commit 980b3c133521a88bae2a9e390303564b9eb34773
parent f4a1da43c3d25a07df8ecc46008d41cc0c77e8fb
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 5 Mar 2019 14:30:50 +0100
Apply colors to dwm settings
Diffstat:
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/links/bin/colortheme b/links/bin/colortheme
@@ -13,8 +13,12 @@ function show_help {
echo "usage: ${0##*/} [OPTION] COMMAND THEMENAME"
echo "where COMMAND is one of the following:"
echo " list: Show all color schemes available in $themedir"
- echo " set: Write colors from THEMENAME to ~/.Xresources"
- echo " and ~/code/st/config.h, if they exist."
+ echo " set: Write colors from THEMENAME to:"
+ echo " ~/.Xresources"
+ echo " ~/code/st/config.h"
+ echo " ~/code/tabbed/config.h"
+ echo " ~/code/dwm/config.h"
+ echo " if they exist."
echo "Valid OPTIONS are:"
echo " -h, --help show this message"
echo " -v, --version show version information"
@@ -157,6 +161,16 @@ function set_colors {
(cd ~/code/tabbed && sudo make install)
fi
+
+ if [ -f ~/code/dwm/config.h ]; then
+ sed -i "s/col_gray4\[\] *= \".*\";/col_gray4\[\] = \"$background\";/;\
+ s/col_cyan\[\] *= \".*\";/col_cyan\[\] = \"$foreground\";/;\
+ s/col_gray3\[\] *= \".*\";/col_gray3\[\] = \"$foreground\";/;\
+ s/col_gray1\[\] *= \".*\";/col_gray1\[\] = \"$background\";/;"\
+ ~/code/dwm/config.h
+ (cd ~/code/dwm && sudo make install)
+ fi
+
}
[[ $# -lt 1 ]] && (show_help && exit 1)