sx: remove case check on tty

Substring removal using the '#' form will already try to match from the
beginning of the string.

If the output from ps does not start with "tty" then nothing will be
removed.
This commit is contained in:
Earnestly 2018-12-14 14:47:57 +00:00
parent d2919f5b62
commit 956be33728
1 changed files with 1 additions and 4 deletions

5
sx
View File

@ -20,10 +20,7 @@ cleanup() {
stty=$(stty -g) stty=$(stty -g)
tty=$(ps -o tty= $$) tty=$(ps -o tty= $$)
tty=${tty#tty}
case $tty in
tty*) tty=${tty#tty}
esac
cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx
datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx