diff options
author | Urbain Vaes <urbain@vaes.uk> | 2018-10-06 23:44:57 +0200 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2018-10-06 23:44:57 +0200 |
commit | e7fef9abe0b931542f5e7dc93e1dda210ef32613 (patch) | |
tree | f32ac1099115fa959257eb29c4b80274495a617b | |
parent | 09c060d9bdfd2a71c0b874cb72cae9e859c36adb (diff) |
Fix 'cut' bug with multibyte characters
-rw-r--r-- | i3/.config/i3blocks/config | 4 |
1 files changed, 2 insertions, 2 deletions
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=<span color='gray'></span> -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=<span color='gray'></span> -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 |