dotfiles: leviathan: arch-openbox-20231010
This commit is contained in:
39
.config/tint2/executor/network
Executable file
39
.config/tint2/executor/network
Executable file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
export LC_ALL=POSIX LANG=POSIX; . "${HOME}/.owl4ce_var"
|
||||
|
||||
type -p ip iwgetid &>/dev/null || exec echo 'Install iproute2/wireless-tools!'
|
||||
|
||||
if iwgetid "$INT_WIFI" &>/dev/null; then
|
||||
if [ -n "$(iwgetid "$INT_WIFI" | grep -oP '"\K[^"]+')" ]; then
|
||||
if ip addr show "$INT_WIFI" | grep -Fqo 'inet'; then
|
||||
status="$(iwgetid "$INT_WIFI" --raw)"
|
||||
icon=''
|
||||
else
|
||||
status="No IP address (${INT_WIFI})"
|
||||
icon=''
|
||||
fi
|
||||
else
|
||||
status="Disconnected"
|
||||
icon=''
|
||||
fi
|
||||
elif ip link show "$INT_ETH" &>/dev/null; then
|
||||
if ip addr show "$INT_ETH" | grep -Fqo 'inet'; then
|
||||
status="$(ip addr show "$INT_ETH" | grep -oP 'inet \K[^/]+' | sed 1q) (${INT_ETH})"
|
||||
icon=''
|
||||
else
|
||||
status="No IP address (${INT_ETH})"
|
||||
icon=''
|
||||
fi
|
||||
else
|
||||
status="Network interface not found (${INT_ETH}/${INT_WIFI})"
|
||||
icon=''
|
||||
fi
|
||||
|
||||
case ${1} in
|
||||
status) exec echo "$status"
|
||||
;;
|
||||
icon) exec echo "$icon"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit ${?}
|
14
.config/tint2/executor/temp
Executable file
14
.config/tint2/executor/temp
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
export LC_ALL=POSIX LANG=POSIX; . "${HOME}/.owl4ce_var"
|
||||
|
||||
LINUX_SYS='/sys/devices/virtual/thermal'
|
||||
|
||||
if [ -d "${LINUX_SYS}/${TEMP_DEV}" ]; then
|
||||
exec echo "$(expr $(<"${LINUX_SYS}/${TEMP_DEV}/temp") / 1000)"$'\xc2\xb0C'
|
||||
elif [ ! -d "$LINUX_SYS" ]; then
|
||||
exec echo "${LINUX_SYS} is an invalid path!"
|
||||
else
|
||||
exec echo "${TEMP_DEV} not found!"
|
||||
fi
|
||||
|
||||
exit ${?}
|
45
.config/tint2/executor/volume
Executable file
45
.config/tint2/executor/volume
Executable file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
export LC_ALL=POSIX LANG=POSIX; . "${HOME}/.owl4ce_var"
|
||||
|
||||
type -p amixer &>/dev/null || exec echo 'Install alsa-utils!'
|
||||
|
||||
VOLUME="$(amixer get Master | grep -oP '\[\K[^%\]]+' | sed 1q)"
|
||||
|
||||
icon()
|
||||
{
|
||||
if [ "$VOLUME" -eq 0 ]; then
|
||||
icon=''
|
||||
elif [ "$VOLUME" -lt 30 ]; then
|
||||
icon=''
|
||||
elif [ "$VOLUME" -lt 70 ]; then
|
||||
icon=''
|
||||
else
|
||||
icon=''
|
||||
fi
|
||||
exec echo "$icon"
|
||||
}
|
||||
|
||||
case ${1} in
|
||||
percent) if amixer get Master | grep -Fqo 'off'; then
|
||||
exec echo 'Muted'
|
||||
else
|
||||
exec echo "${VOLUME}%"
|
||||
fi
|
||||
;;
|
||||
icon) if amixer get Master | grep -Fqo 'off'; then
|
||||
exec echo ""
|
||||
else
|
||||
icon
|
||||
fi
|
||||
;;
|
||||
up) amixer set Master on -q
|
||||
exec amixer sset Master "${AUDIO_STEPS:-5}%+" -q
|
||||
;;
|
||||
down) amixer set Master on -q
|
||||
exec amixer sset Master "${AUDIO_STEPS:-5}%-" -q
|
||||
;;
|
||||
mute) exec amixer set Master 1+ toggle -q
|
||||
;;
|
||||
esac
|
||||
|
||||
exit ${?}
|
Reference in New Issue
Block a user