From 24905884eea0293e9ab8bb8a349a9f9bed6177f4 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sun, 31 Jan 2021 12:41:53 +0100 Subject: [PATCH] Removed explicit font from most dmenu calls, dmenu font is read from Xresources now and kept as uniform as possible --- configs/appcfg/xresources_dmenu.xr | 3 +++ scripts/appscripts/sxmo_files.sh | 2 +- scripts/appscripts/sxmo_record.sh | 6 +++--- scripts/appscripts/sxmo_reddit.sh | 2 +- scripts/appscripts/sxmo_rss.sh | 2 +- scripts/appscripts/sxmo_timer.sh | 2 +- scripts/appscripts/sxmo_weather.sh | 2 +- scripts/appscripts/sxmo_websearch.sh | 2 +- scripts/appscripts/sxmo_youtube.sh | 4 ++-- scripts/core/sxmo_appmenu.sh | 2 +- scripts/core/sxmo_gpsutil.sh | 6 +++--- scripts/core/sxmo_networks.sh | 12 ++++++------ scripts/core/sxmo_pipecomplete.sh | 2 +- scripts/core/sxmo_timezonechange.sh | 2 +- scripts/core/sxmo_xinit.sh | 1 + scripts/modem/sxmo_modemcall.sh | 4 ++-- scripts/modem/sxmo_modemdial.sh | 4 ++-- scripts/modem/sxmo_modeminfo.sh | 2 +- scripts/modem/sxmo_modemtext.sh | 10 +++++----- scripts/notifications/sxmo_notificationsmenu.sh | 2 +- 20 files changed, 38 insertions(+), 34 deletions(-) create mode 100644 configs/appcfg/xresources_dmenu.xr diff --git a/configs/appcfg/xresources_dmenu.xr b/configs/appcfg/xresources_dmenu.xr new file mode 100644 index 0000000..1f4d7a0 --- /dev/null +++ b/configs/appcfg/xresources_dmenu.xr @@ -0,0 +1,3 @@ +dmenu.font: Terminus-30 + + diff --git a/scripts/appscripts/sxmo_files.sh b/scripts/appscripts/sxmo_files.sh index 70df743..fcd5378 100755 --- a/scripts/appscripts/sxmo_files.sh +++ b/scripts/appscripts/sxmo_files.sh @@ -14,7 +14,7 @@ while true; do PICKED="$( echo "$CHOICES" | - dmenu -fn Terminus-18 -c -p "$DIR" -l 20 -i + dmenu -c -p "$DIR" -l 20 -i )" echo "$PICKED" | grep "Close Menu" && exit 0 diff --git a/scripts/appscripts/sxmo_record.sh b/scripts/appscripts/sxmo_record.sh index 1afabba..ead4eb2 100755 --- a/scripts/appscripts/sxmo_record.sh +++ b/scripts/appscripts/sxmo_record.sh @@ -38,13 +38,13 @@ recordconfirm() { Delete Recording " | xargs -0 echo | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - dmenu -p "$DUR" -fn Terminus-18 -c -l 10 + dmenu -p "$DUR" -c -l 10 )" if echo "$PICK" | grep "Playback"; then st -e mpv -ao=alsa -v "$FILE" elif echo "$PICK" | grep "Delete Recording"; then rm "$FILE" - echo "File deleted." | dmenu -fn Terminus-18 -c -l 10 + echo "File deleted." | dmenu -c -l 10 return else return @@ -67,7 +67,7 @@ recordmenu() { xargs -0 echo | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - dmenu -fn Terminus-30 -c -p "Record" -l 20 + dmenu -c -p "Record" -l 20 )" if [ "$OPTION" = "Line Jack" ]; then diff --git a/scripts/appscripts/sxmo_reddit.sh b/scripts/appscripts/sxmo_reddit.sh index 2a1a047..6fc4132 100755 --- a/scripts/appscripts/sxmo_reddit.sh +++ b/scripts/appscripts/sxmo_reddit.sh @@ -5,7 +5,7 @@ menu() { pidof "$KEYBOARD" || "$KEYBOARD" & SUBREDDIT="$( printf %b "Close Menu\n$(echo "$SXMO_SUBREDDITS" | tr " " '\n')" | - dmenu -p "Subreddit:" -c -l 10 -fn Terminus-20 + dmenu -p "Subreddit:" -c -l 10 )" pkill "$KEYBOARD" [ "Close Menu" = "$SUBREDDIT" ] && exit 0 diff --git a/scripts/appscripts/sxmo_rss.sh b/scripts/appscripts/sxmo_rss.sh index 2b50862..afa7f27 100755 --- a/scripts/appscripts/sxmo_rss.sh +++ b/scripts/appscripts/sxmo_rss.sh @@ -61,7 +61,7 @@ rsstimespanmenu() { echo "$CHOICES" | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - dmenu -p "RSS Timespan" -c -l 10 -fn Terminus-20 + dmenu -p "RSS Timespan" -c -l 10 )" if echo "$CHOICE" | grep "Fetch"; then diff --git a/scripts/appscripts/sxmo_timer.sh b/scripts/appscripts/sxmo_timer.sh index c2580d6..ffac5cf 100755 --- a/scripts/appscripts/sxmo_timer.sh +++ b/scripts/appscripts/sxmo_timer.sh @@ -40,7 +40,7 @@ menu() { 1m 30s Close Menu - " | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -fn "Terminus-30" -l 20 + " | awk 'NF' | awk '{$1=$1};1' | dmenu -p Timer -c -l 20 )" pkill "$KEYBOARD" [ "Close Menu" = "$TIMEINPUT" ] && exit 0 diff --git a/scripts/appscripts/sxmo_weather.sh b/scripts/appscripts/sxmo_weather.sh index f49daa2..57ff607 100755 --- a/scripts/appscripts/sxmo_weather.sh +++ b/scripts/appscripts/sxmo_weather.sh @@ -130,7 +130,7 @@ weathermenu() { )" | grep -vE '^#' | sed "s/\t/: /g" | - sxmo_dmenu_with_kb.sh -i -c -l 10 -fn Terminus-18 -p "Locations" + sxmo_dmenu_with_kb.sh -i -c -l 10 -p "Locations" )" if [ "$CHOICE" = "Close Menu" ]; then exit 0 diff --git a/scripts/appscripts/sxmo_websearch.sh b/scripts/appscripts/sxmo_websearch.sh index 505eaef..7778306 100755 --- a/scripts/appscripts/sxmo_websearch.sh +++ b/scripts/appscripts/sxmo_websearch.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh pidof "$KEYBOARD" || "$KEYBOARD" & SEARCHQUERY="$( - echo "Close Menu" | dmenu -t -p "Search Query:" -c -fn "Terminus-20" -l 20 + echo "Close Menu" | dmenu -t -p "Search:" -c -l 20 )" pkill "$KEYBOARD" [ "Close Menu" = "$SEARCHQUERY" ] && exit 0 diff --git a/scripts/appscripts/sxmo_youtube.sh b/scripts/appscripts/sxmo_youtube.sh index aec8fbf..896e6df 100755 --- a/scripts/appscripts/sxmo_youtube.sh +++ b/scripts/appscripts/sxmo_youtube.sh @@ -31,7 +31,7 @@ searchmenu() { xargs -0 echo | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - sxmo_dmenu_with_kb.sh -p "Yt Search" -c -l 10 -fn Terminus-20 + sxmo_dmenu_with_kb.sh -p "Yt Search" -c -l 10 )" if [ "Close Menu" = "$ENTRY" ]; then @@ -59,7 +59,7 @@ resultsmenu() { xargs -0 echo | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - dmenu -c -l 10 -p "Yt Results" -fn Terminus-20 + dmenu -c -l 10 -p "Results" -fn Terminus-20 )" if [ "Change Search" = "$PICKED" ]; then diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index 9342197..30fd3b1 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -440,7 +440,7 @@ mainloop() { getprogchoices "$ARGS" echo "$PROGCHOICES" | cut -d'^' -f1 | - dmenu -idx "$DMENUIDX" -l 16 -c -fn "Terminus-30" -p "$WINNAME" | ( + dmenu -idx "$DMENUIDX" -l 16 -c -p "$WINNAME" | ( PICKED="$(cat)" echo "$PICKED" | grep . || quit LOOP="$(echo "$PROGCHOICES" | grep -m1 -F "$PICKED" | cut -d '^' -f2)" diff --git a/scripts/core/sxmo_gpsutil.sh b/scripts/core/sxmo_gpsutil.sh index 55523de..b87fdd4 100755 --- a/scripts/core/sxmo_gpsutil.sh +++ b/scripts/core/sxmo_gpsutil.sh @@ -166,7 +166,7 @@ menuregionsearch() { printf %b "$POIS" | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | - sxmo_dmenu_with_kb.sh -i -c -l 10 -fn Terminus-18 -p Search + sxmo_dmenu_with_kb.sh -i -c -l 10 -p Search )" if [ "$QUERY" = "Close Menu" ]; then @@ -192,7 +192,7 @@ menulocations() { )" | grep -vE '^#' | sed "s/\t/: /g" | - sxmo_dmenu_with_kb.sh -i -c -l 10 -fn Terminus-18 -p "Locations" + sxmo_dmenu_with_kb.sh -i -c -l 10 -p "Locations" )" ZOOM=14 if [ "$CHOICE" = "Close Menu" ]; then @@ -218,7 +218,7 @@ menumaptype() { CHOICE="$( echo "$CHOICES" | awk -F^ '{ print $1 }' | - dmenu -idx "$IDX" -c -l 10 -fn Terminus-18 -p "Map Type" | + dmenu -idx "$IDX" -c -l 10 -p "Map Type" | awk '{$1=$1};1' )" echo "$CHOICE" | grep "Close Menu" && exit 0 diff --git a/scripts/core/sxmo_networks.sh b/scripts/core/sxmo_networks.sh index 1e97d5a..5043419 100755 --- a/scripts/core/sxmo_networks.sh +++ b/scripts/core/sxmo_networks.sh @@ -20,7 +20,7 @@ toggleconnection() { deletenetworkmenu() { CHOICE="$( printf %b "Close Menu\n$(connections)" | - dmenu -c -p "Delete Network" -l 14 -fn "Terminus-20" + dmenu -c -p "Delete Network" -l 14 )" if [ "$CHOICE" = "Close Menu" ]; then return @@ -34,13 +34,13 @@ deletenetworkmenu() { addnetworkgsmmenu() { CONNNAME="$( echo "Close Menu" | - sxmo_dmenu_with_kb.sh -c -p "Add GSM: Alias" -fn "Terminus-20" -l 20 + sxmo_dmenu_with_kb.sh -c -p "Add GSM: Alias" -l 20 )" [ "$CONNNAME" = "Close Menu" ] && return APN="$( echo "Close Menu" | - sxmo_dmenu_with_kb.sh -c -p "Add GSM: APN" -fn "Terminus-20" -l 20 + sxmo_dmenu_with_kb.sh -c -p "Add GSM: APN" -l 20 )" [ "$APN" = "Close Menu" ] && return @@ -56,13 +56,13 @@ addnetworkwpamenu() { SSID="$( nmcli d wifi list | tail -n +2 | grep -v '^\*' | awk -F' ' '{ print $6 }' | grep -v '\-\-' | xargs -0 printf 'Close Menu\n%s' | - sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20 + sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -l 20 )" [ "$SSID" = "Close Menu" ] && return PASSPHRASE="$( echo "Close Menu" | - sxmo_dmenu_with_kb.sh -c -p "Add WPA: Passpharse" -fn "Terminus-20" -l 20 + sxmo_dmenu_with_kb.sh -c -p "Add WPA: Passphrase" -l 20 )" [ "$PASSPHRASE" = "Close Menu" ] && return @@ -89,7 +89,7 @@ networksmenu() { Scan Wifi Networks Close Menu " | - awk '{$1=$1};1' | grep '\w' | dmenu -c -p 'Networks' -l 14 -fn 'Terminus-20' + awk '{$1=$1};1' | grep '\w' | dmenu -c -p 'Networks' -l 14 )" if [ "$CHOICE" = "Close Menu" ]; then exit diff --git a/scripts/core/sxmo_pipecomplete.sh b/scripts/core/sxmo_pipecomplete.sh index 1dc2866..06562be 100755 --- a/scripts/core/sxmo_pipecomplete.sh +++ b/scripts/core/sxmo_pipecomplete.sh @@ -8,7 +8,7 @@ menu() { printf %b "$( echo "Close Menu"; echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' | sort | uniq - )" | dmenu -p "$PROMPT" -l 10 -i -c -fn Terminus-20 + )" | dmenu -p "$PROMPT" -l 10 -i -c )" pkill "$KEYBOARD" } diff --git a/scripts/core/sxmo_timezonechange.sh b/scripts/core/sxmo_timezonechange.sh index d7230cd..e7fc41c 100755 --- a/scripts/core/sxmo_timezonechange.sh +++ b/scripts/core/sxmo_timezonechange.sh @@ -13,7 +13,7 @@ menu() { find /usr/share/zoneinfo -type f | sed 's#^/usr/share/zoneinfo/##g' | sort | - sxmo_dmenu_with_kb.sh -p Timezone -c -l 10 -fn Terminus-20 -i + sxmo_dmenu_with_kb.sh -p Timezone -c -l 10 -i )" st -e "$0" change "$T" } diff --git a/scripts/core/sxmo_xinit.sh b/scripts/core/sxmo_xinit.sh index 845ee87..f09cb0d 100755 --- a/scripts/core/sxmo_xinit.sh +++ b/scripts/core/sxmo_xinit.sh @@ -35,6 +35,7 @@ xdefaults() { xsetroot -mod 29 29 -fg '#0b3a4c' -bg '#082430' xset s off -dpms xrdb /usr/share/sxmo/appcfg/xresources_xcalc.xr + xrdb /usr/share/sxmo/appcfg/xresources_dmenu.xr synclient TapButton1=1 TapButton2=3 TapButton3=2 MinSpeed=0.25 } diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index b4c6c7b..7480828 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -192,7 +192,7 @@ incallmenuloop() { cut -d'^' -f1 | sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | #this cryptic statement trims leading/trailing whitespace from a string - dmenu -idx $DMENUIDX -l 14 "$([ "$WINDOWIFIED" = 0 ] && echo "-c" || echo "-wm")" -fn "Terminus-30" -p "$NUMBER" | + dmenu -idx $DMENUIDX -l 14 "$([ "$WINDOWIFIED" = 0 ] && echo "-c" || echo "-wm")" -p "$NUMBER" | ( PICKED="$(cat)"; echo "sxmo_modemcall: Picked is $PICKED">&2 @@ -213,7 +213,7 @@ dtmfmenu() { while true; do PICKED="$( echo "$NUMS" | grep -o . | sed '1 iReturn to Call Menu' | - dmenu "$([ "$WINDOWIFIED" = 0 ] && echo "-c" || echo "-wm")" -l 20 -fn Terminus-20 -c -idx $DTMFINDEX -p "DTMF Tone" + dmenu "$([ "$WINDOWIFIED" = 0 ] && echo "-c" || echo "-wm")" -l 20 -c -idx $DTMFINDEX -p "DTMF Tone" )" echo "$PICKED" | grep "Return to Call Menu" && return DTMFINDEX=$(echo "$NUMS" | grep -bo "$PICKED" | cut -d: -f1 | xargs -IN echo 2+N | bc) diff --git a/scripts/modem/sxmo_modemdial.sh b/scripts/modem/sxmo_modemdial.sh index 4ac5444..83b213b 100755 --- a/scripts/modem/sxmo_modemdial.sh +++ b/scripts/modem/sxmo_modemdial.sh @@ -21,14 +21,14 @@ dialmenu() { NUMBER="$( printf %b "Close Menu\nMore contacts\n$CONTACTS" | grep . | - sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i + sxmo_dmenu_with_kb.sh -l 10 -p Number -c -i )" echo "$NUMBER" | grep "Close Menu" && kill -9 0 echo "$NUMBER" | grep -q "More contacts" && NUMBER="$( printf %b "Close Menu\n$(sxmo_contacts.sh --all)" | grep . | - sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i + sxmo_dmenu_with_kb.sh -l 10 -p Number -c -i )" NUMBER="$(echo "$NUMBER" | cut -d: -f1 | tr -d -- '- ')" if [ -z "$NUMBER" ] || [ "$NUMBER" = "CloseMenu" ]; then diff --git a/scripts/modem/sxmo_modeminfo.sh b/scripts/modem/sxmo_modeminfo.sh index a2bd5a3..4fbcd54 100755 --- a/scripts/modem/sxmo_modeminfo.sh +++ b/scripts/modem/sxmo_modeminfo.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh err() { - printf %b "$1" | dmenu -fn Terminus-20 -c -l 10 + printf %b "$1" | dmenu -c -l 10 exit } diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index bccefb8..bc70180 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -41,14 +41,14 @@ choosenumbermenu() { NUMBER="$( printf %b "\nCancel\nMore contacts\n$(sxmo_contacts.sh | grep -E "^\+?[0-9]+:")" | awk NF | - menu sxmo_dmenu_with_kb.sh -p "Number" -fn "Terminus-20" -l 10 -c -i | + menu sxmo_dmenu_with_kb.sh -p "Number" -l 10 -c -i | cut -d: -f1 | tr -d -- '- ' )" echo "$NUMBER" | grep -qE "^Morecontacts$" && NUMBER="$( #joined words without space is not a bug printf %b "\nCancel\n$(sxmo_contacts.sh --all)" | grep . | - menu sxmo_dmenu_with_kb.sh -l 10 -p "Number" -c -fn Terminus-20 -i | + menu sxmo_dmenu_with_kb.sh -l 10 -p "Number" -c -i | cut -d: -f1 | tr -d -- '- ' )" @@ -71,7 +71,7 @@ sendtextmenu() { do CONFIRM="$( printf %b "Edit Message ($(echo "$TEXT" | head -n1))\nSend to → $NUMBER\nSave as Draft\nCancel" | - menu dmenu -c -idx 1 -p "Confirm" -fn "Terminus-20" -l 10 + menu dmenu -c -idx 1 -p "Confirm" -l 10 )" echo "$CONFIRM" | grep -E "^Send" && (echo "$TEXT" | sxmo_modemsendsms.sh "$NUMBER" -) && echo "Sent text to $NUMBER">&2 && exit 0 echo "$CONFIRM" | grep -E "^Cancel$" && exit 1 @@ -92,7 +92,7 @@ draft() { senddrafttextmenu() { CONFIRM="$( printf %b "Cancel\n$(ls "$DRAFT_DIR")" | - menu sxmo_dmenu_with_kb.sh -p "Draft Message" -fn "Terminus-20" -l 10 -c -i + menu sxmo_dmenu_with_kb.sh -p "Draft Message" -l 10 -c -i )" echo "$CONFIRM" | grep -E "^Cancel$" && exit 1 FILE="$DRAFT_DIR/$CONFIRM" @@ -120,7 +120,7 @@ main() { printf %b "$CONTACT" | xargs -IL echo "L logfile" done )" - CONTACTIDANDNUM="$(printf %b "$ENTRIES" | menu dmenu -p Texts -c -fn Terminus-20 -l 10 -i)" + CONTACTIDANDNUM="$(printf %b "$ENTRIES" | menu dmenu -p Texts -c -l 10 -i)" echo "$CONTACTIDANDNUM" | grep "Close Menu" && exit 1 echo "$CONTACTIDANDNUM" | grep "Send a Text" && sendnewtextmenu && exit 1 echo "$CONTACTIDANDNUM" | grep "Send a Draft Text" && senddrafttextmenu && exit 1 diff --git a/scripts/notifications/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh index 92fcdbc..06fb4ac 100755 --- a/scripts/notifications/sxmo_notificationsmenu.sh +++ b/scripts/notifications/sxmo_notificationsmenu.sh @@ -19,7 +19,7 @@ notificationmenu() { sed '/^[[:space:]]*$/d' | awk '{$1=$1};1' | cut -d^ -f1 | - dmenu -c -i -fn "Terminus-18" -p "Notifs" -l 10 + dmenu -c -i -p "Notifs" -l 20 )" [ "$PICKEDCONTENT" = "Close Menu" ] && exit 1