diff options
author | tdro <tdro@users.noreply.github.com> | 2020-08-26 00:49:55 -0400 |
---|---|---|
committer | tdro <tdro@users.noreply.github.com> | 2020-08-26 00:49:55 -0400 |
commit | c3d2b57e84c58fbb10d1ce28960af8689d01b389 (patch) | |
tree | 34043548c41f19ad1c4d2516b3f3d600dfeb1a93 /.local | |
parent | 0b60a87f7aa5e0130a0a83cd1995ede451fe5e11 (diff) | |
download | dotfiles-c3d2b57e84c58fbb10d1ce28960af8689d01b389.tar.gz dotfiles-c3d2b57e84c58fbb10d1ce28960af8689d01b389.tar.bz2 dotfiles-c3d2b57e84c58fbb10d1ce28960af8689d01b389.zip |
.local/bin/dmenu_run_history: Add terminal and sudo mode
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/dmenu_run_history | 7 | ||||
-rwxr-xr-x | .local/bin/scripts/app-launcher-priv | 7 | ||||
-rwxr-xr-x | .local/bin/scripts/app-launcher-terminal | 3 |
3 files changed, 12 insertions, 5 deletions
diff --git a/.local/bin/dmenu_run_history b/.local/bin/dmenu_run_history index 22c03cf..ab1cb73 100755 --- a/.local/bin/dmenu_run_history +++ b/.local/bin/dmenu_run_history @@ -1,5 +1,8 @@ #!/bin/sh +[ "$1" = "sudo" ] && export cmd_prefix='sudo -A ' && export dmenu_args='-sb red' && shift 1; +[ "$1" = "terminal" ] && export cmd_prefix='urxvt -hold -e ' && export dmenu_args='-sb gray' && shift 1; + # https://tools.suckless.org/dmenu/scripts/ cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} @@ -25,7 +28,7 @@ awk -v histfile="$historyfile" ' x[$0]=1 } } !x[$0]++ ' "$cache" \ - | dmenu -b "$@" \ + | dmenu -b $dmenu_args "$@" \ | awk -v histfile="$historyfile" ' BEGIN { FS=OFS="\t" @@ -49,4 +52,4 @@ awk -v histfile="$historyfile" ' print history[f],f | "sort -t '\t' -k1rn >" histfile } ' \ - | while read -r cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done + | while read -r cmd; do ${SHELL:-"/bin/sh"} -c "$cmd_prefix $cmd" & done diff --git a/.local/bin/scripts/app-launcher-priv b/.local/bin/scripts/app-launcher-priv index f8f741f..09d279f 100755 --- a/.local/bin/scripts/app-launcher-priv +++ b/.local/bin/scripts/app-launcher-priv @@ -1,4 +1,5 @@ #!/bin/sh -xset r rate 200 25; -rofi -cache-dir "$HOME/.local/share" -fullscreen -show run -display-run '#' -run-command 'sudo -A {cmd}' -font 'ubuntu 12' -padding 250; -xset r rate 200 60; + +# rofi -cache-dir "$HOME/.local/share" -fullscreen -show run -display-run '#' -run-command 'sudo -A {cmd}' -font 'ubuntu 12' -padding 250; + +dmenu_run_history sudo; diff --git a/.local/bin/scripts/app-launcher-terminal b/.local/bin/scripts/app-launcher-terminal new file mode 100755 index 0000000..97d5f0f --- /dev/null +++ b/.local/bin/scripts/app-launcher-terminal @@ -0,0 +1,3 @@ +#!/bin/sh + +dmenu_run_history terminal; |