From 29cbb903a5c2bf074b26e3c87c4cbb69793b3e19 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 3 Sep 2021 18:22:36 +0200 Subject: Fix i3 bugs --- i3/.config/i3/config | 2 ++ i3/.config/i3blocks/bin/wifi | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/i3/.config/i3/config b/i3/.config/i3/config index e51e8ac..c55e14c 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -192,6 +192,8 @@ bindsym XF86MonBrightnessUp exec light -A 10 bindsym XF86MonBrightnessDown exec light -U 10 bindsym Prior exec light -A 10 bindsym Next exec light -U 10 +bindsym Shift+Prior exec amixer -D pulse sset Master 5%+ +bindsym Shift+Next exec amixer -D pulse sset Master 5%- bindsym Shift+XF86AudioRaiseVolume exec light -A 10 bindsym Shift+XF86AudioLowerVolume exec light -U 10 diff --git a/i3/.config/i3blocks/bin/wifi b/i3/.config/i3blocks/bin/wifi index bc24672..b545c24 100755 --- a/i3/.config/i3blocks/bin/wifi +++ b/i3/.config/i3blocks/bin/wifi @@ -1,15 +1,16 @@ #!/usr/bin/env bash -quality=$(iwconfig wlp2s0 2>/dev/null | grep -oP 'Link Quality=\K[0-9]*/[0-9]*' | awk -F'/' '{print int(100*$1/$2)}') -ssid=$(iwconfig wlp2s0 2>/dev/null | grep -oP '(?<=ESSID:").*(?=")') -wifi_address=$(ip addr show wlp2s0 2>/dev/null | grep -oP -m1 "(?<=inet ).*(?=/)") +wireless=$(ip link | grep -oP -m1 "(wlp[^:]*)") +quality=$(iwconfig $wireless 2>/dev/null | grep -oP 'Link Quality=\K[0-9]*/[0-9]*' | awk -F'/' '{print int(100*$1/$2)}') +ssid=$(iwconfig $wireless 2>/dev/null | grep -oP '(?<=ESSID:")[^\"]*') +wifi_address=$(ip addr show $wireless 2>/dev/null | grep -oP -m1 "(?<=inet ).*(?=/)") eth_address=$(ip addr show eno1 2>/dev/null | grep -oP -m1 "(?<=inet ).*(?=/)") if [[ -n $eth_address ]]; then full_text="eno1: $eth_address" ip_addr="$eth_address" elif [[ -n $wifi_address ]]; then - full_text="wlp2s0: (${quality}% at ${ssid}) ${wifi_address}" + full_text="${wifi_address} (${quality}% at ${ssid})" ip_addr="$wifi_address" else echo "No connection" -- cgit v1.2.3