mb-jgtools/bin/obtheme2jgmenu

19 lines
659 B
Plaintext
Raw Normal View History

2020-03-03 16:14:43 +01:00
#!/bin/bash
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")
2020-03-03 18:37:32 +01:00
#Run only if theme doesn't exist
2020-09-26 18:19:58 +02:00
CONFFILE="$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc"
2020-03-03 18:37:32 +01:00
if [ ! -f "$CONFFILE" ]; then
2020-03-03 16:14:43 +01:00
jgmenu_run init --apply-obtheme
2020-09-26 18:19:58 +02:00
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
2020-03-03 18:37:32 +01:00
fi
2020-09-26 18:19:58 +02:00