aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-04-03 02:16:35 +0300
committerYaroslav <contact@yaroslavps.com>2020-04-03 02:16:35 +0300
commitd001819487e0545ecc0c5b40b70793b8d5828a70 (patch)
tree424c1c17901219babb4d3824bd411d7ea3d0ab76 /dotfiles
parentafb5f74cccf20d38a7170349e173d658178b51ad (diff)
downloadswayrice-d001819487e0545ecc0c5b40b70793b8d5828a70.tar.gz
swayrice-d001819487e0545ecc0c5b40b70793b8d5828a70.zip
even better kbd layout script
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/.config/waybar/config2
-rwxr-xr-xdotfiles/.local/bin/barvpnstatus2
-rwxr-xr-xdotfiles/.local/bin/swaykbd11
-rwxr-xr-xdotfiles/.local/bin/togglevpn6
4 files changed, 11 insertions, 10 deletions
diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config
index 8596154..6d5903b 100644
--- a/dotfiles/.config/waybar/config
+++ b/dotfiles/.config/waybar/config
@@ -180,7 +180,7 @@
"exec": "barweather"
},
"custom/swaykbd": {
- "format": "<span color=\"#5b8277\">⌨</span> {}",
+ "format": "{}",
"exec": "swaykbd",
"tooltip": false
},
diff --git a/dotfiles/.local/bin/barvpnstatus b/dotfiles/.local/bin/barvpnstatus
index 1af57c4..7850d94 100755
--- a/dotfiles/.local/bin/barvpnstatus
+++ b/dotfiles/.local/bin/barvpnstatus
@@ -1,7 +1,7 @@
#!/bin/sh
if [ -f "$HOME/.cache/openvpnpid" ]; then
- printf "🔐 vpn"
+ printf " vpn"
exit
fi
diff --git a/dotfiles/.local/bin/swaykbd b/dotfiles/.local/bin/swaykbd
index b0fc34a..d90f78c 100755
--- a/dotfiles/.local/bin/swaykbd
+++ b/dotfiles/.local/bin/swaykbd
@@ -1,6 +1,9 @@
#!/bin/sh
-swaymsg -r -t get_inputs | grep "xkb_active_layout_name" | awk -F '"' '{print $4}' | sed 's/ (US)//g'
+swaymsg -r -t get_inputs | \
+ grep "xkb_active_layout_name" | \
+ awk -F '"' '{print $4}' | \
+ sed 's/English (US)/🇺🇸 English/g;s/Spanish/🇲🇽 Español/g;s/Russian/🇷🇺 Русский/g' | head -1
swaymsg \
--type subscribe \
@@ -13,8 +16,6 @@ swaymsg \
select(.change == "xkb_layout") |
.input.xkb_active_layout_name |
sub(" \\(US\\)"; "")
- '
+ ' | \
+ sed --unbuffered 's/English/🇺🇸 English/g;s/Spanish/🇲🇽 Español/g;s/Russian/🇷🇺 Русский/g'
-case $BLOCK_BUTTON in
- 1) echo "TO-DO" ;;
-esac;
diff --git a/dotfiles/.local/bin/togglevpn b/dotfiles/.local/bin/togglevpn
index 88add47..f4dc1f1 100755
--- a/dotfiles/.local/bin/togglevpn
+++ b/dotfiles/.local/bin/togglevpn
@@ -7,16 +7,16 @@ if [ -f "$HOME/.cache/openvpnpid" ]; then
fi
if [ ! -f "$HOME/.config/ovpn/conf.ovpn" ]; then
- notify-send "🔐 OpenVPN" "Can't start VPN. Configuration file is missing"
+ notify-send " OpenVPN" "Can't start VPN. Configuration file is missing"
exit
fi
sudo openvpn "$HOME/.config/ovpn/conf.ovpn" &
PID=$!
-notify-send "🔐 OpenVPN" "VPN is being initialized"
+notify-send " OpenVPN" "VPN is being initialized"
echo $PID > ~/.cache/openvpnpid
killall -40 waybar
wait $PID
-notify-send "🔐 OpenVPN" "VPN service has stopped with exit code $?"
+notify-send " OpenVPN" "VPN service has stopped with exit code $?"
rm -f ~/.cache/openvpnpid
killall -40 waybar