From e7fef9abe0b931542f5e7dc93e1dda210ef32613 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sat, 6 Oct 2018 23:44:57 +0200 Subject: Fix 'cut' bug with multibyte characters --- i3/.config/i3blocks/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'i3') diff --git a/i3/.config/i3blocks/config b/i3/.config/i3blocks/config index bd9357e..c1a9b1e 100644 --- a/i3/.config/i3blocks/config +++ b/i3/.config/i3blocks/config @@ -31,13 +31,13 @@ signal=1 [primary] label= -command=echo "$(xclip -o | cut -c1-9 | sed -e 's/[^a-zA-Z0-9\-]/_/g')" +command=echo "$(xclip -o | grep -o '^.\{0,9\}' | sed -e 's/[^a-zA-Z0-9\-]/_/g')" min_width=15 interval=5 [clipboard] label= -command=echo "$(xclip -o -selection "clipboard" | cut -c1-9 | sed -e 's/[^a-zA-Z0-9\-]/_/g')" +command=echo "$(xclip -o -selection "clipboard" | grep -o '^.\{0,9\}' | sed -e 's/[^a-zA-Z0-9\-]/_/g')" instance=Master interval=5 -- cgit v1.2.3