Compare commits
3 Commits
95a5f21abd
...
1505382d97
Author | SHA1 | Date |
---|---|---|
David Kebler | 1505382d97 | |
David Kebler | 3be1dc8325 | |
David Kebler | 9a90125ac5 |
|
@ -4,3 +4,4 @@
|
||||||
base.code-workspace
|
base.code-workspace
|
||||||
/module.lib
|
/module.lib
|
||||||
load/ucishellgiturl
|
load/ucishellgiturl
|
||||||
|
btpl.run
|
|
@ -11,3 +11,6 @@ alias sdle="systemctl list-unit-files | grep enabled"
|
||||||
alias sdpidu="systemctl show --property MainPID --value"
|
alias sdpidu="systemctl show --property MainPID --value"
|
||||||
alias sdmt="sudo systemctl list-units -t mount --all"
|
alias sdmt="sudo systemctl list-units -t mount --all"
|
||||||
alias sded="sudo systemctl edit"
|
alias sded="sudo systemctl edit"
|
||||||
|
alias sdcat="sudo systemctl cat"
|
||||||
|
alias sdsh="sudo systemctl show --all"
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
lastversion --assets --output /shell/base/modules/scripting/btpl.lib download bash-tpl
|
|
File diff suppressed because it is too large
Load Diff
|
@ -50,3 +50,19 @@ loginctl disable-linger
|
||||||
function sdstub {
|
function sdstub {
|
||||||
[[ $(loginctl show-user "$USER" --property=Linger | cut -d= -f2) == 'yes' ]] && echo enabled || echo disabled
|
[[ $(loginctl show-user "$USER" --property=Linger | cut -d= -f2) == 'yes' ]] && echo enabled || echo disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sdcatg(){
|
||||||
|
systemctl cat "$1" | grep "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
function sdshg(){
|
||||||
|
systemctl show "$1" | grep "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
function sdcatug(){
|
||||||
|
systemctl cat --user "$1" | grep "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
function sdshug(){
|
||||||
|
systemctl show --user "$1" | grep "$2"
|
||||||
|
}
|
|
@ -28,7 +28,7 @@ mounted () {
|
||||||
|
|
||||||
dir_bind_unmount () {
|
dir_bind_unmount () {
|
||||||
local usesudo
|
local usesudo
|
||||||
local mp=$1
|
local mp=${1:-$PWD}
|
||||||
[[ ! $(mounted $mp) ]] && echo no mountpoint at $mp && mp=$BFS_MOUNT_DIR/$(basename $mp)
|
[[ ! $(mounted $mp) ]] && echo no mountpoint at $mp && mp=$BFS_MOUNT_DIR/$(basename $mp)
|
||||||
[[ ! $(mounted $mp) ]] && echo no mountpoint at $mp either, aborting && return 1
|
[[ ! $(mounted $mp) ]] && echo no mountpoint at $mp either, aborting && return 1
|
||||||
[[ $EUID -ne 0 ]] && usesudo=sudo
|
[[ $EUID -ne 0 ]] && usesudo=sudo
|
||||||
|
@ -73,10 +73,14 @@ if [[ $(mounted $mp) ]]; then
|
||||||
}
|
}
|
||||||
|
|
||||||
dir_bind () {
|
dir_bind () {
|
||||||
mp=${2:-$BFS_MOUNT_DIR/$(basename $1)}
|
dir=${1:-$PWD}
|
||||||
dir_bind_user $USER $1 $mp
|
mp=${2:-$BFS_MOUNT_DIR/$(basename "$dir")}
|
||||||
|
dir_bind_user $USER $dir $mp
|
||||||
if [ -v PS1 ]; then
|
if [ -v PS1 ]; then
|
||||||
echo enter \"u\" when you ready to unmount, otherwise any other key will leave mounted
|
if [[ $BFSEDIT ]]; then /opt/bin/vscode $mp 1>/dev/null ; else xdg-open $mp; fi
|
||||||
|
echo $BFSEDIT
|
||||||
|
echo enter \"u\" to unmount, otherwise any other key will leave mounted
|
||||||
|
unset BFSEDIT
|
||||||
read -n1 ans
|
read -n1 ans
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
[[ $ans == "u" ]] && dir_bind_unmount $mp
|
[[ $ans == "u" ]] && dir_bind_unmount $mp
|
||||||
|
@ -92,18 +96,10 @@ dir_bind_user $1 $2 $2
|
||||||
}
|
}
|
||||||
|
|
||||||
bfs_vscode () {
|
bfs_vscode () {
|
||||||
mp=${2:-$BFS_MOUNT_DIR/$(basename $1)}
|
BFSEDIT="When done editing FIRST close your vscode window then"
|
||||||
dir_bind_user $USER $1 $mp
|
dir_bind "$@"
|
||||||
/opt/bin/vscode $mp
|
|
||||||
if [ -v PS1 ]; then
|
|
||||||
echo when you ready to unmount FIRST close your vscode window then enter \"u\"
|
|
||||||
echo otherwise any other key will leave mounted
|
|
||||||
read -n1 ans
|
|
||||||
echo -e "\n"
|
|
||||||
[[ $ans == "u" ]] && dir_bind_unmount $mp
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
(return 0 2>/dev/null) || dir_bind_user $@
|
(return 0 2>/dev/null) || dir_bind_user $@
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue