add user@host to i3blocks

This commit is contained in:
thek4n 2026-02-08 15:39:48 +03:00
parent c5cd1726dd
commit 6ed951778b
2 changed files with 9 additions and 0 deletions

View File

@ -55,6 +55,10 @@ signal=2
command=i3blocks_helper language
signal=1
[userhost]
command=i3blocks_helper userhost
signal=1
[time]
command=i3blocks_helper time
interval=30

View File

@ -107,6 +107,10 @@ cmd_language() {
esac
}
cmd_userhost() {
printf "%s@%s\n" "${USER}" "${HOST:-${HOSTNAME:-}}"
}
case "${1}" in
wireless) shift; cmd_wireless "$@" ;;
ethernet) shift; cmd_ethernet "$@" ;;
@ -121,6 +125,7 @@ case "${1}" in
pomodoro) shift; cmd_pomodoro "$@" ;;
bluetooth_battery) shift; cmd_bluetooth_battery "$@" ;;
language) shift; cmd_language "$@" ;;
userhost) shift; cmd_userhost "$@" ;;
*) exit "${EXIT_FAILURE}" ;;
esac