2015-12-06 12:35:57 -08:00
|
|
|
#!/usr/bin/env zsh
|
2021-07-29 00:37:35 -07:00
|
|
|
# YES_ZSH
|
2021-09-23 06:48:05 -07:00
|
|
|
# YES_BASH
|
|
|
|
# NO_DASH
|
|
|
|
# NO_ASH
|
2015-12-06 12:35:57 -08:00
|
|
|
|
2021-07-30 17:57:08 -07:00
|
|
|
screeny() { ### @-
|
2021-08-02 06:06:13 -07:00
|
|
|
### handle GNU screens.
|
|
|
|
### these days, i typically use tmux instead.
|
2015-12-06 12:35:57 -08:00
|
|
|
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
|
2016-01-05 05:38:34 -08:00
|
|
|
~/sh/unscreen "$name" || return 1
|
|
|
|
echo screen -S "$name" -dm sudo -Hu "$user" "$@"
|
2015-12-06 12:35:57 -08:00
|
|
|
screen -S "$name" -dm sudo -Hu "$user" "$@"
|
|
|
|
popd "$home" >/dev/null
|
2016-01-05 05:38:34 -08:00
|
|
|
return 0
|
2015-12-06 12:35:57 -08:00
|
|
|
}
|
|
|
|
|
2021-08-02 13:48:46 -07:00
|
|
|
[ -n "${preload+-}" ] || screeny "$@"
|