From 0e5c2471400eb5284c30b217fed6ac9481b9a118 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Sat, 12 Apr 2014 18:02:00 +0200 Subject: [PATCH] added switch-theme for #36; readme updated --- README.rst | 4 +++- rc.lua.blackburn | 2 +- rc.lua.copland | 0 rc.lua.dremora | 2 +- rc.lua.holo | 2 +- rc.lua.multicolor | 0 rc.lua.powerarrow-darker | 0 rc.lua.rainbow | 2 +- rc.lua.steamburn | 0 switch-theme.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 10 files changed, 48 insertions(+), 5 deletions(-) mode change 100755 => 100644 rc.lua.blackburn mode change 100755 => 100644 rc.lua.copland mode change 100755 => 100644 rc.lua.dremora mode change 100755 => 100644 rc.lua.holo mode change 100755 => 100644 rc.lua.multicolor mode change 100755 => 100644 rc.lua.powerarrow-darker mode change 100755 => 100644 rc.lua.rainbow mode change 100755 => 100644 rc.lua.steamburn create mode 100755 switch-theme.sh diff --git a/README.rst b/README.rst index 8caee8d..f9e66bc 100644 --- a/README.rst +++ b/README.rst @@ -83,7 +83,7 @@ Installation Using git you can have the full master branch: :: git clone https://github.com/copycat-killer/awesome-copycats.git - mv -u awesome-copycats ~/.config/awesome + mv awesome-copycats/* ~/.config/awesome; rmdir awesome-copycats cd ~/.config/awesome git submodule init git submodule update @@ -102,6 +102,8 @@ Switch a theme this way: :: then customize your ``rc.lua`` and restart Awesome (``Mod4 + ctrl + r``). +Alternatively, you can use [`switch-theme.sh`](https://github.com/copycat-killer/awesome-copycats/issues/36), which will also update to the latest commit. + Notes ===== diff --git a/rc.lua.blackburn b/rc.lua.blackburn old mode 100755 new mode 100644 index 446f915..f3d5fa7 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -126,7 +126,7 @@ mailwidget = lain.widgets.imap({ count = "" if mailcount > 0 then - mail = "Arch " + mail = "Mail " count = mailcount .. " " end diff --git a/rc.lua.copland b/rc.lua.copland old mode 100755 new mode 100644 diff --git a/rc.lua.dremora b/rc.lua.dremora old mode 100755 new mode 100644 index 6598d41..27c190f --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -129,7 +129,7 @@ mailwidget = lain.widgets.imap({ count = "" if mailcount > 0 then - mail = "Arch " + mail = "Mail " count = mailcount .. " " end diff --git a/rc.lua.holo b/rc.lua.holo old mode 100755 new mode 100644 index f0febce..8d9455e --- a/rc.lua.holo +++ b/rc.lua.holo @@ -146,7 +146,7 @@ mailwidget = lain.widgets.imap({ count = "" if mailcount > 0 then - mail = "Arch " + mail = "Mail " count = mailcount .. " " end diff --git a/rc.lua.multicolor b/rc.lua.multicolor old mode 100755 new mode 100644 diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker old mode 100755 new mode 100644 diff --git a/rc.lua.rainbow b/rc.lua.rainbow old mode 100755 new mode 100644 index 0cb2c80..cd69ec0 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -137,7 +137,7 @@ mailwidget = lain.widgets.imap({ count = "" if mailcount > 0 then - mail = "Arch " + mail = "Mail " count = mailcount .. " " end diff --git a/rc.lua.steamburn b/rc.lua.steamburn old mode 100755 new mode 100644 diff --git a/switch-theme.sh b/switch-theme.sh new file mode 100755 index 0000000..dcd2163 --- /dev/null +++ b/switch-theme.sh @@ -0,0 +1,41 @@ +#! /usr/bin/make -f + +# Awesome Copycats switch theme script +# It also updates to latest commit. +# Dependencies: make, git + + +DESTDIR=~/.config/awesome +PROJECT=copycat-killer/awesome-copycats + +# $(swap_dialog) +define swap_dialog + echo ; \ + echo "see https://github.com/$(PROJECT)" ; \ + echo ; $(themes) | cat -n ; echo ; \ + typeset -i num; \ + read -p "Switch to theme: " num ; \ + if [ ! -z $${num} -a $${num} -ge 1 -a -le $${n_themes} ] ; then \ + NEW_THEME=$$($(themes) | head -n$${num} | tail -n1 ) ; \ + cp $${NEW_THEME} rc.lua ; \ + echo "Theme is now $${NEW_THEME}"; \ + else echo " !! Aborted. " ; fi +endef + +# $(themes) +themes=find rc.lua* -not -name rc.lua + +# number of current themes +n_themes=$(themes) | wc -l + +.SILENT : all + +all: $(DESTDIR) + cd $(DESTDIR) && \ + echo -n $(git pull)#"Already up-to-date."; \ + git submodule init ; \ + git submodule update; \ + $(swap_dialog) + +$(DESTDIR): + git clone https://github.com/${PROJECT}.git $@