47 lines
1.1 KiB
Bash
Executable file
47 lines
1.1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
# Themes work with:
|
|
# dwm, st, dmenu, tabbed,
|
|
# xresources, wallpapers, vim,
|
|
# dunst, zsh (experimental), ls
|
|
|
|
[ -f ~/.local/share/themes/"$1".xdefaults ] || exit -1
|
|
|
|
cp ~/.local/share/themes/"$1".xdefaults ~/.local/etc/theme
|
|
|
|
if [ -f ~/.local/share/themes/"$1".dir_colors ]
|
|
then
|
|
cp ~/.local/share/themes/"$1".dir_colors ~/.local/etc/dir_colors
|
|
else
|
|
rm ~/.local/etc/dir_colors
|
|
fi
|
|
|
|
rm -rf ~/.local/share/themes/bin
|
|
|
|
[ -d ~/.local/share/themes/"$1"-bin ] && cp -r ~/.local/share/themes/{"$1"-,}bin
|
|
|
|
xrdb ~/.Xresources
|
|
|
|
echo -e "dwm\nst\ndmenu\ntabbed" |
|
|
while read t
|
|
do
|
|
(cd ~/.local/src/$t && make clean && ./xtheme && make PREFIX=$HOME/.local install ; make clean ; cd -)
|
|
done
|
|
|
|
cat ~/.local/share/themes/"$1".xdefaults | grep -P "^\wallpaper:\s*\S*$" -m 1 &&
|
|
feh --bg-fill ~/.local/share/themes/"$1"-wallpapers/$( \
|
|
cat ~/.local/share/themes/"$1".xdefaults \
|
|
| grep -P "^wallpaper:\s*\S*$" \
|
|
| sed "s/^.*:\s//" \
|
|
)*
|
|
|
|
(
|
|
killall dunst
|
|
cd ~/.config/dunst
|
|
./xtheme
|
|
cat theme.h dunstrc.template | cpp > dunstrc
|
|
cd -
|
|
)
|
|
|
|
dunstify "Theme Changed
|
|
restart dwm" -t 3000
|