From 3edb5dd7bf148c8a1f219c70c7075bc454af4fde Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sun, 11 Dec 2022 18:26:22 +0100 Subject: [PATCH] upd --- bin/mabox-langfiles | 2 ++ bin/mb-setfont | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/bin/mabox-langfiles b/bin/mabox-langfiles index 844b90c..3d1ebb8 100755 --- a/bin/mabox-langfiles +++ b/bin/mabox-langfiles @@ -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 diff --git a/bin/mb-setfont b/bin/mb-setfont index df6c92b..2555779 100755 --- a/bin/mb-setfont +++ b/bin/mb-setfont @@ -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 ;; *)