From 6ed951778bea8c74786283336de4dfa95122bcdc Mon Sep 17 00:00:00 2001 From: thek4n Date: Sun, 8 Feb 2026 15:39:48 +0300 Subject: [PATCH] add user@host to i3blocks --- home/user/.config/i3blocks/config | 4 ++++ home/user/.local/bin/i3blocks_helper | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/home/user/.config/i3blocks/config b/home/user/.config/i3blocks/config index e173df4..c2cc14f 100644 --- a/home/user/.config/i3blocks/config +++ b/home/user/.config/i3blocks/config @@ -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 diff --git a/home/user/.local/bin/i3blocks_helper b/home/user/.local/bin/i3blocks_helper index 842b0a1..414f862 100755 --- a/home/user/.local/bin/i3blocks_helper +++ b/home/user/.local/bin/i3blocks_helper @@ -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