mb-jgtools/bin/obtheme2jgmenu

19 lines
659 B
Bash
Executable File

#!/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")
#Run only if theme doesn't exist
CONFFILE="$HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc"
if [ ! -f "$CONFFILE" ]; then
jgmenu_run init --apply-obtheme
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