mirror of
https://github.com/notwa/rc
synced 2024-11-05 08:29:02 -08:00
20 lines
516 B
Bash
Executable file
20 lines
516 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
# YES_ZSH
|
|
|
|
screeny() { ### @-
|
|
### handle GNU screens.
|
|
### these days, i typically use tmux instead.
|
|
local user="${1:?needs arg for user name}"
|
|
shift
|
|
home="/home/$user"
|
|
pushd "$home" >/dev/null
|
|
local name="${1:?needs arg for screen name}"
|
|
shift
|
|
~/sh/unscreen "$name" || return 1
|
|
echo screen -S "$name" -dm sudo -Hu "$user" "$@"
|
|
screen -S "$name" -dm sudo -Hu "$user" "$@"
|
|
popd "$home" >/dev/null
|
|
return 0
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || screeny "$@"
|