From ad02cc8b0068cba198d1f1002f49fb065f6bf64a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Feb 2014 05:31:19 +0100 Subject: add makefile and autocompletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/completion | 16 ++++++++++ 2 files changed, 113 insertions(+) create mode 100644 Makefile create mode 100644 src/completion diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..15bbe3e --- /dev/null +++ b/Makefile @@ -0,0 +1,97 @@ +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + + +PREFIX ?= /usr +BIN ?= /bin +DATA ?= /share +BINDIR ?= $(PREFIX)$(BIN) +DATADIR ?= $(PREFIX)$(DATA) +LICENSEDIR ?= $(DATADIR)/licenses +LOCALEDIR ?= $(DATADIR)/locale + +SHEBANG ?= /usr/bin/python2 +COMMAND ?= blueshift-tray +PKGNAME ?= blueshift-tray + + +.PHONY: all +all: bin/blueshift-tray + + +bin/blueshift-tray: src/blueshift-tray + @mkdir -p bin + cp $< $@ + sed -i '' $@ + +bin/blueshift-tray.bash: src/completion + @mkdir -p bin + auto-auto-complete bash --output $@ --source $< + +bin/blueshift-tray.zsh: src/completion + @mkdir -p bin + auto-auto-complete zsh --output $@ --source $< + +bin/blueshift-tray.fish: src/completion + @mkdir -p bin + auto-auto-complete fish --output $@ --source $< + + +.PHONY: install +install: install-base install-shell + +.PHONY: install-base +install-base: install-command install-license + +.PHONY: install-command +install-command: bin/blueshift-tray + install -dm755 -- "$(DESTDIR)$(BINDIR)" + install -m755 $< -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + +.PHONY: install-license +install-license: + install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + +.PHONY: install-shell +install-shell: install-bash install-zsh install-fish + +.PHONY: install-bash +install-bash: bin/blueshift.bash + install -dm755 -- "$(DESTDIR)$(DATADIR)/bash-completion/completions" + install -m644 $< -- "$(DESTDIR)$(DATADIR)/bash-completion/completions/$(COMMAND)" + +.PHONY: install-zsh +install-zsh: bin/blueshift.zsh + install -dm755 -- "$(DESTDIR)$(DATADIR)/zsh/site-functions" + install -m644 $< -- "$(DESTDIR)$(DATADIR)/zsh/site-functions/_$(COMMAND)" + +.PHONY: install-fish +install-fish: bin/blueshift.fish + install -dm755 -- "$(DESTDIR)$(DATADIR)/fish/completions" + install -m644 $< -- "$(DESTDIR)$(DATADIR)/fish/completions/$(COMMAND).fish" + + +.PHONY: uninstall +uninstall: + -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING" + -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" + -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" + -rm -- "$(DESTDIR)$(DATADIR)/fish/completions/$(COMMAND).fish" + -rmdir -- "$(DESTDIR)$(DATADIR)/fish/completions" + -rmdir -- "$(DESTDIR)$(DATADIR)/fish" + -rm -- "$(DESTDIR)$(DATADIR)/zsh/site-functions/_$(COMMAND)" + -rmdir -- "$(DESTDIR)$(DATADIR)/zsh/site-functions" + -rmdir -- "$(DESTDIR)$(DATADIR)/zsh" + -rm -- "$(DESTDIR)$(DATADIR)/bash-completion/completions/$(COMMAND)" + -rmdir -- "$(DESTDIR)$(DATADIR)/bash-completion/completions" + -rmdir -- "$(DESTDIR)$(DATADIR)/bash-completion" + + +.PHONY: all +clean: + -rm -r bin + diff --git a/src/completion b/src/completion new file mode 100644 index 0000000..e1b6ade --- /dev/null +++ b/src/completion @@ -0,0 +1,16 @@ +(blueshift-tray + (multiple unargumented + ((options -p --panic-gate --panicgate) (complete --panicgate) (desc 'Applies the settings directly instead of transitioning into the initial settings')) + ((options -r --reset) (complete --reset) (desc 'Transition from the specified settings to clean settings')) + ) + (multiple argumented + ((options -c --configurations) (complete --configurations) (arg SCRIPT) (files -f) (desc 'Select configuration script')) + ((options -g --gamma) (complete --gamma) (arg RGB|R:G:B) (files -0) (desc 'Apply gamma correction to the colour curves')) + ((options -b --brightness) (complete --brightness) (arg RGB|R:G:B) (files -0) (desc 'Change brightness using sRGB')) + ((options +b ++brightness) (complete ++brightness) (arg Y) (files -0) (desc 'Change brightness using CIE xyY')) + ((options -t --temperature) (complete --temperature) (arg KELVIN) (files -0) (desc 'Change colour temperature')) + ((options -l --location) (complete --location) (arg LAT:LON) (files -0) (desc 'Specify your geographical location')) + ((options -o --output --crtc) (complete --output) (arg CRTC) (files -0) (desc 'Select CRTC to apply changes to')) + ) +) + -- cgit v1.2.3-70-g09d2