mb-jgtools/bin/obtheme2jgmenu

18 lines
591 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
2022-04-28 02:09:28 +02:00
echo "menu_gradient_pos = none" >> "$CONFFILE"
2022-05-15 11:48:20 +02:00
sd '^#' '' "$CONFFILE"
2020-03-03 18:37:32 +01:00
fi
2020-09-26 18:19:58 +02:00