diff --git a/files/.config/polybar/bluetooth.bash b/files/.config/polybar/bluetooth.bash index eb68933..4c8c52c 100755 --- a/files/.config/polybar/bluetooth.bash +++ b/files/.config/polybar/bluetooth.bash @@ -1,14 +1,16 @@ #!/bin/bash -if rfkill list bluetooth | grep "yes" >/dev/null; then - if [[ "$1" == "toggle" ]]; then - rfkill unblock bluetooth - fi - echo "$ICO_BLU_OFF" -else - if [[ "$1" == "toggle" ]]; then - rfkill block bluetooth - fi - echo "$ICO_BLU_ON" +if which rfkill >/dev/null && [[ -f /dev/rfkill ]]; then + if rfkill list bluetooth | grep "yes" >/dev/null; then + if [[ "$1" == "toggle" ]]; then + rfkill unblock bluetooth + fi + echo "$ICO_BLU_OFF" + else + if [[ "$1" == "toggle" ]]; then + rfkill block bluetooth + fi + echo "$ICO_BLU_ON" + fi fi diff --git a/files/.config/polybar/openvpn.bash b/files/.config/polybar/openvpn.bash index 2e1a779..30bb29c 100755 --- a/files/.config/polybar/openvpn.bash +++ b/files/.config/polybar/openvpn.bash @@ -1,7 +1,10 @@ #!/bin/bash -if ! pgrep "openvpn" &>/dev/null || ! ip link | grep -q tun; then - echo "$ICO_VPN_OFF " -else - echo "$ICO_VPN_ON " +if which openvpn >/dev/null; then + if ! pgrep "openvpn" &>/dev/null || ! ip link | grep -q tun; then + echo "$ICO_VPN_OFF " + else + echo "$ICO_VPN_ON " + fi fi + diff --git a/files/.config/polybar/wifi_toggle.bash b/files/.config/polybar/wifi_toggle.bash index 499d792..089a172 100755 --- a/files/.config/polybar/wifi_toggle.bash +++ b/files/.config/polybar/wifi_toggle.bash @@ -1,8 +1,10 @@ #!/bin/bash -if rfkill list wifi | grep "yes" >/dev/null; then - rfkill unblock wifi -else - rfkill block wifi +if which rfkill >/dev/null && [[ -f /dev/rfkill ]]; then + if rfkill list wifi | grep "yes" >/dev/null; then + rfkill unblock wifi + else + rfkill block wifi + fi fi diff --git a/files/.profile b/files/.profile index d7ab6eb..cafefdb 100644 --- a/files/.profile +++ b/files/.profile @@ -9,7 +9,7 @@ export EDITOR=nvim export PAGER=less # motd -export MOTD_SERVICES="$MOTD_SERVICES docker.socket libvirtd" +export MOTD_SERVICES="$MOTD_SERVICES docker.socket" # firefox export MOZ_USE_XINPUT2=1