Configure dwm bar
This commit is contained in:
parent
f7f052dd87
commit
4b69ad7dd4
15
.local/bin/scripts/dbar
Executable file
15
.local/bin/scripts/dbar
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sym="|"
|
||||||
|
|
||||||
|
cd "$HOME/.local/bin/scripts/dwmbar/" || exit 1
|
||||||
|
|
||||||
|
status() {
|
||||||
|
echo "$(./internet) $sym $(./lamp) $sym $(./music) $sym $(./alsa) $sym $(./packages) $sym $(./date) $sym $(./clock)"
|
||||||
|
}
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
xsetroot -name " $(status | tr '\n' ' ')"
|
||||||
|
|
||||||
|
sleep 1m
|
||||||
|
done
|
@ -1,6 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
xsetroot -name " $(awk -F"[][]" '/dB/ { print $2 }' <(amixer sget Master)) | $(date "+%H:%M:%S %p") | $(pacman -Qu | wc -l) "
|
|
||||||
sleep 1
|
|
||||||
done
|
|
23
.local/bin/scripts/dwmbar/alsa
Executable file
23
.local/bin/scripts/dwmbar/alsa
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ "$(amixer sget Master | awk 'NR==5 { print $6 }')" = "[off]" ] && {
|
||||||
|
echo " mut" && exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
level=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 }')
|
||||||
|
revel="${level%?}"
|
||||||
|
|
||||||
|
v1=""
|
||||||
|
v2=""
|
||||||
|
v3=""
|
||||||
|
|
||||||
|
if [ "$revel" -lt 20 ]; then
|
||||||
|
echo "$v1"
|
||||||
|
elif [ "$revel" -lt 50 ]; then
|
||||||
|
echo "$v2"
|
||||||
|
elif [ "$revel" -lt 75 ]; then
|
||||||
|
echo "$v3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$level"
|
4
.local/bin/scripts/dwmbar/clock
Executable file
4
.local/bin/scripts/dwmbar/clock
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
date "+%H:%M"
|
4
.local/bin/scripts/dwmbar/date
Executable file
4
.local/bin/scripts/dwmbar/date
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
date "+%a, %d-%m"
|
13
.local/bin/scripts/dwmbar/internet
Executable file
13
.local/bin/scripts/dwmbar/internet
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$(cat /etc/hostname)" = "pc" ]; then
|
||||||
|
ip="$(eth-ip)"
|
||||||
|
echo ""
|
||||||
|
elif [ "$(cat /etc/hostname)" = "laptop" ]; then
|
||||||
|
ip="$(wifi-ip)"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
ping -q -c 1 1.1.1.1 >/dev/null || { echo "dis" && exit 1; }
|
||||||
|
|
||||||
|
echo "$ip"
|
6
.local/bin/scripts/dwmbar/lamp
Executable file
6
.local/bin/scripts/dwmbar/lamp
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
status=$(curl -s 192.168.1.201/status.php)
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
[ "$status" = 1 ] && echo "on" || echo "off"
|
11
.local/bin/scripts/dwmbar/music
Executable file
11
.local/bin/scripts/dwmbar/music
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
if mpc status | grep -q "playing"; then
|
||||||
|
mpc | sed "/^volume:/d;s/\\&/&/g;s/\\[playing\\].*//g"
|
||||||
|
elif mpc status | grep -q "paused"; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
3
.local/bin/scripts/dwmbar/packages
Executable file
3
.local/bin/scripts/dwmbar/packages
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo " $(pacman -Qu | wc -l)"
|
3
.local/bin/scripts/eth-ip
Executable file
3
.local/bin/scripts/eth-ip
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ip a show enp3s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255'
|
@ -1 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
ip a show wlp8s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255'
|
ip a show wlp8s0 | grep -Eo '(inet)?*([0-9]*\.){3}[0-9]*' | grep -v '**\.255'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user