commit 71c9602699d7b55cf94ef30c7ebcb3fc61b2a973
parent f8f3874317057d51b5fc9c1f2ae4febfdf739306
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 19 Dec 2018 17:38:39 +0100
Use emoji for denoting keyboard layout and disable dunst notification
Diffstat:
4 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/links/.config/i3/config b/links/.config/i3/config
@@ -69,7 +69,7 @@ bindsym $mod+comma exec signal-desktop
bindsym $mod+w exec firefox
bindsym $mod+Shift+w exec tor-browser
bindsym $mod+p exec zathura
-bindsym Mod1+Mod4+l exec --no-startup-id ~/bin/keyboard-layout-switch.sh && notify-send `cat ~/.kbd-layout` && pkill -RTMIN+3 i3blocks
+bindsym Mod1+Mod4+l exec --no-startup-id ~/bin/keyboard-layout-switch.sh && pkill -RTMIN+3 i3blocks
bindsym $mod+n exec $term -e ranger
# volume control with alsamixer
diff --git a/links/.config/i3/i3blocks b/links/.config/i3/i3blocks
@@ -41,8 +41,8 @@ label=
interval=20
signal=2
-[layout]
-command=cat $HOME/.kbd-layout
+[i3layout]
+#command=cat $HOME/.kbd-layout
interval=once
signal=3
diff --git a/links/.config/i3/i3scripts/i3layout b/links/.config/i3/i3scripts/i3layout
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+case $BLOCK_BUTTON in
+ 1) ~/bin/keyboard-layout-switch.sh && pkill -RTMIN+3 i3blocks;;
+ #3) pgrep -x dunst >/dev/null && notify-send "<b>π Battery module:</b>
+#π: discharging
+#β»: stagnant charge
+#π: charging
+#β‘: charged
+#β: battery very low!
+#- Text color reflects charge left" ;;
+esac
+
+lang=$(cat ~/.kbd-layout) || exit
+
+[ "$lang" = "dk" ] && lang=π©π°
+[ "$lang" = "us" ] && lang=πΊπΈ
+
+printf "%s" "$lang"
diff --git a/links/bin/keyboard-layout-switch.sh b/links/bin/keyboard-layout-switch.sh
@@ -17,7 +17,7 @@ if [ ! -f $LAYOUTFILE ]; then
echo "us" > $LAYOUTFILE
setxkbmap $LANG1 $OPTS
xmodmap ~/.Xmodmap
- notify-send $LANG1
+ #notify-send $LANG1
exit
fi