This commit is contained in:
GasparVardanyan 2022-02-28 05:02:14 +04:00
parent d6ef43cc7b
commit 3ca4a36cf8
3 changed files with 109 additions and 21 deletions

47
settheme Executable file
View file

@ -0,0 +1,47 @@
#!/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

View file

@ -90,7 +90,7 @@
*color15: S_base3
! gaspar's modifications
// gaspar's modifications
wallpaper: cubes
vim*colorscheme: solarized
@ -108,3 +108,44 @@ dwm*selbackground: #174956 # selenized dark bg1
! dwm*selborder: S_base02
! dwm*selborder: #0a4c5c # custom color
dwm*selborder: #174956 # selenized dark bg1
/*
=== VIM INTEGRATION ===
set background=dark
let themefile = system ("echo\ -n\ \$\(xrdb\ -query\ \|\ grep\ -P\ \'\^vim\\.\?\\\*\?colorscheme:\\s\*\\S+\'\ \|\ sed\ \'s/\\s\\+/\ /\'\ \|\ cut\ -d\ \'\ \'\ -f\ 2\)")
if themefile != ''
execute 'source ~/.local/share/themes/'.themefile.'.vim'
else
color leet2
endif
=== WALLPAPER INTEGRATION ===
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//" \
)*
=== MAN INTEGRATION ===
export PATH="$HOME/.local/share/themes/bin:$HOME/.local/bin:$PATH"
=== DWM, ST INTEGRATION ===
via xtheme patches
*/
// https://ethanschoonover.com/solarized/
// https://observer.com/2015/02/meet-the-man-behind-solarized-the-most-important-color-scheme-in-computer-history/
// https://www.wired.com/story/very-mathematical-history-perfect-color-combination/