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):;;
*)
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

View File

@ -1,7 +1,29 @@
#!/bin/bash
# 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
pl*)
SELECTFONT="Wybierz czcionkę i jej rozmiar"
@ -15,7 +37,7 @@ getfont () {
;;
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)
FONTSTYLE=$(echo $FONT | cut -d'|' -f2)
FONTSIZE=$(echo $FONT | cut -d'|' -f3)
@ -79,24 +101,28 @@ font_conky_all () {
}
case "$1" in
obtitle)
getfont
get_obfont
selectfont
font_obtitle
;;
menu_item)
getfont
get_menu_item_font
selectfont
font_menu_item
;;
menu_sep)
getfont
get_menu_sep_font
selectfont
font_menu_sep
;;
conky_single)
getfont
selectfont
font_conky_single "${2}"
;;
conky_all)
getfont
selectfont
font_conky_all
;;
*)