Several fixes, patched dwmblocks so it shows spaces around the bar
This commit is contained in:
6
dwmblocks_scripts/battery_notify
Executable file
6
dwmblocks_scripts/battery_notify
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
PRCT=$(acpi | awk -F, '{ print $2 }' | sed 's/%//g' | xargs)
|
||||
if [[ $PRCT -lt 20 ]]; then
|
||||
notify-send -u critical "Battery level is CRITICAL!" "$PRCT"
|
||||
fi
|
@@ -1,7 +1,13 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
prct=$(acpi | grep 'Discharging' | awk '{print $4}' | sed 's/,//')
|
||||
batid=$(acpi | grep 'Discharging' | awk '{print $2}' | sed 's/://')
|
||||
prct=$(acpi 2>/dev/null | grep 'Discharging' | awk '{print $4}' | sed 's/,//')
|
||||
batid=$(acpi 2>/dev/null | grep 'Discharging' | awk '{print $2}' | sed 's/://')
|
||||
|
||||
# If not supported
|
||||
if [[ $(acpi 2>&1 | grep 'No support') ]]; then
|
||||
echo "No battery" >&2;
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If charged
|
||||
if [[ $(acpi | grep 'Discharging' | wc -c) -eq $(acpi | grep 'Charging' | wc -c) ]]; then
|
||||
|
4
dwmblocks_scripts/dwm_date
Executable file
4
dwmblocks_scripts/dwm_date
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DATE=$(date '+%b %d (%a) %I:%M:%S %p')
|
||||
echo "$DATE"
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
eth="$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
|
||||
wlp="$(ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
|
||||
eth="$(ip -4 addr show eth0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
|
||||
wlp="$(ip -4 addr show wlan0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}')"
|
||||
|
||||
if [[ $(echo $eth | wc -c) -gt 1 ]]
|
||||
then
|
||||
|
@@ -1,12 +1,14 @@
|
||||
#!/bin/bash
|
||||
# This works just with wpa_supplicant
|
||||
|
||||
ssid="$(wpa_cli status | grep ssid | sed -n '2p' | awk -F '=' '{print $2}')"
|
||||
ssid="$(wpa_cli status 2>/dev/null | grep ssid | sed -n '2p' | awk -F '=' '{print $2}')"
|
||||
|
||||
if [[ $(echo $ssid | wc -c) -gt 1 ]]
|
||||
then
|
||||
echo "$ssid"
|
||||
exit;
|
||||
echo "SSID $ssid"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "No SSID available" >&2
|
||||
exit 1
|
||||
|
||||
|
Reference in New Issue
Block a user