update menu/sidepanels theme handling

master
Daniel Napora 2020-09-26 18:19:58 +02:00
parent e5c591aa15
commit 538f53d8ef
2 changed files with 13 additions and 6 deletions

View File

@ -27,19 +27,22 @@ jgmenu_theme=${jgmenu_theme:-obtheme}
case $jgmenu_theme in
default)
export color_norm_fg="#FFFFFF "
#export color_norm_fg="#FFFFFF "
;;
obtheme)
export color_title_fg="#FFFFFF "
#export color_title_fg="#FFFFFF "
ob_file=$HOME/.config/openbox/rc.xml
[[ -f $ob_file ]] && wm_theme=$(awk '/<theme>/ {while (getline n) {if (match(n, /<name>/)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file")
if [ ! -f "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc" ]; then
obtheme2jgmenu
fi
while read -r a b c
do
[[ -n "$a" && "$a" != [[:blank:]#]* ]] && export "$a$b$c"
done < $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc
done < "$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc"
;;
*)
export color_norm_fg="#FFFFFF "
#export color_norm_fg="#FFFFFF "
while read -r a b c
do
[[ -n "$a" && "$a" != [[:blank:]#]* ]] && export "$a$b$c"

View File

@ -5,10 +5,14 @@ ob_file=$HOME/.config/openbox/rc.xml
#Run only if theme doesn't exist
CONFFILE="$HOME/.config/mabox/jgobthemes/$wm_theme.colorrc"
CONFFILE="$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc"
if [ ! -f "$CONFFILE" ]; then
jgmenu_run init --apply-obtheme
cp $HOME/.config/jgmenu/jgmenurc $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc
grep -f $HOME/.config/mabox/jgobthemes/example.txt $HOME/.config/jgmenu/jgmenurc | sponge $HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc
echo "color_title_border = #ffffff 50" >> "$CONFFILE"
#cp $HOME/.config/jgmenu/jgmenurc $HOME/.config/mabox/jgobthemes/$wm_theme.colorrc
fi