master
Daniel Napora 2022-12-11 18:26:22 +01:00
parent 23ad1ea97c
commit 3edb5dd7bf
2 changed files with 35 additions and 7 deletions

View File

@ -18,6 +18,8 @@ if [ ! -f "$FILE" ]; then
8|9|10|14):;; 8|9|10|14):;;
*) *)
mb-setvar Hidden=true "$HOME"/.config/autostart/xfce4-power-manager.desktop mb-setvar Hidden=true "$HOME"/.config/autostart/xfce4-power-manager.desktop
# fix tint2 battery indicator bug spawning notifications even if there is no battery
sd "battery_low_cmd =.*$" "battery_low_cmd =" "$HOME"/.config/tint2/*.tint2rc
;; ;;
esac esac

View File

@ -1,7 +1,29 @@
#!/bin/bash #!/bin/bash
# mb-setfont # mb-setfont
getfont () { get_obfont () {
nspace="http://openbox.org/3.4/rc"
cfg="$HOME/.config/openbox/rc.xml"
NAME=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:name' "$cfg")
SIZE=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:size' "$cfg")
WEIGHT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:weight' "$cfg")
SLANT=$(xmlstarlet sel -N a="$nspace" -t -v '/a:openbox_config/a:theme/a:font[@place="ActiveWindow"]/a:slant' "$cfg")
notify-send.sh "OB ActiveWindow Font" "$NAME $WEIGHT $SLANT $SIZE"
CURRENT_FONT="$NAME $WEIGHT $SLANT $SIZE"
}
get_menu_item_font () {
. ~/.config/mabox/mabox.conf
CURRENT_FONT="${menu_font_family} ${menu_font_size}"
}
get_menu_sep_font () {
. ~/.config/mabox/mabox.conf
CURRENT_FONT="${menu_sep_font_family:-Ubuntu} ${menu_sep_font_size:-10}"
}
selectfont () {
case "$LANG" in case "$LANG" in
pl*) pl*)
SELECTFONT="Wybierz czcionkę i jej rozmiar" SELECTFONT="Wybierz czcionkę i jej rozmiar"
@ -15,7 +37,7 @@ getfont () {
;; ;;
esac esac
FONT=$(yad --title="${SELECTFONT}" --font --separate-output --button="$CANCEL:1" --button="$SELECT:0") FONT=$(yad --title="${SELECTFONT}" --font --fontname="${CURRENT_FONT}" --separate-output --button="$CANCEL:1" --button="$SELECT:0")
FONTNAME=$(echo $FONT | cut -d'|' -f1) FONTNAME=$(echo $FONT | cut -d'|' -f1)
FONTSTYLE=$(echo $FONT | cut -d'|' -f2) FONTSTYLE=$(echo $FONT | cut -d'|' -f2)
FONTSIZE=$(echo $FONT | cut -d'|' -f3) FONTSIZE=$(echo $FONT | cut -d'|' -f3)
@ -79,24 +101,28 @@ font_conky_all () {
} }
case "$1" in case "$1" in
obtitle) obtitle)
getfont get_obfont
selectfont
font_obtitle font_obtitle
;; ;;
menu_item) menu_item)
getfont get_menu_item_font
selectfont
font_menu_item font_menu_item
;; ;;
menu_sep) menu_sep)
getfont get_menu_sep_font
selectfont
font_menu_sep font_menu_sep
;; ;;
conky_single) conky_single)
getfont selectfont
font_conky_single "${2}" font_conky_single "${2}"
;; ;;
conky_all) conky_all)
getfont selectfont
font_conky_all font_conky_all
;; ;;
*) *)