aboutsummaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2022-03-17 23:10:42 -0400
committertdro <tdro@users.noreply.github.com>2022-03-17 23:14:01 -0400
commit07224674954a8740322206a8d30981dd017ae3e3 (patch)
tree5feb1ea5a6510f7c4ba0e346ab0e91bfe3c100a9 /.local
parent4b01f405f38a83e0e3e8c036c19c6ad2e2e7907a (diff)
downloaddotfiles-07224674954a8740322206a8d30981dd017ae3e3.tar.gz
dotfiles-07224674954a8740322206a8d30981dd017ae3e3.tar.bz2
dotfiles-07224674954a8740322206a8d30981dd017ae3e3.zip
.config/nixpkgs/packages/dmenu: Use my source and patches
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/dmenu_run_history13
-rwxr-xr-x.local/bin/internet-search2
-rwxr-xr-x.local/bin/manpdf9
-rwxr-xr-x.local/bin/pass-menu2
-rwxr-xr-x.local/bin/plumber18
-rwxr-xr-x.local/bin/plumber-dmenu20
-rwxr-xr-x.local/bin/window-switcher26
7 files changed, 61 insertions, 29 deletions
diff --git a/.local/bin/dmenu_run_history b/.local/bin/dmenu_run_history
index 72127fe..ba9b2af 100755
--- a/.local/bin/dmenu_run_history
+++ b/.local/bin/dmenu_run_history
@@ -2,8 +2,15 @@
# https://tools.suckless.org/dmenu/scripts/
-[ "$1" = "privilege" ] && export cmd_prefix='rofi-askpass ' && export dmenu_args='-p Privilege -sb red' && shift 1;
-[ "$1" = "terminal" ] && export cmd_prefix='urxvt -hold -e ' && export dmenu_args='-p Terminal -sb gray' && shift 1;
+[ "$1" = "privilege" ] &&
+ export cmd_prefix='rofi-askpass ' &&
+ export dmenu_args='-nhf #ff7070 -sf #ff7070 -p ⠀:::⠀privilege⠀:::' &&
+ shift 1
+
+[ "$1" = "terminal" ] &&
+ export cmd_prefix='urxvt -hold -e ' &&
+ export dmenu_args='-nhf #9e9e9e -sf #9e9e9e -p ⠀:::⠀terminal⠀:::' &&
+ shift 1
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
cache=$cachedir/dmenu_run
@@ -26,7 +33,7 @@ awk -v histfile="$historyfile" '
x[$0]=1
}
} !x[$0]++ ' "$cache" \
- | dmenu -i -b ${dmenu_args:--p Launch} "$@" \
+ | dmenu -i -b ${dmenu_args:--p ⠀:::⠀execute⠀:::} "$@" \
| awk -v histfile="$historyfile" '
BEGIN {
FS=OFS="\t"
diff --git a/.local/bin/internet-search b/.local/bin/internet-search
index 096c4ee..0a3d0cd 100755
--- a/.local/bin/internet-search
+++ b/.local/bin/internet-search
@@ -1,2 +1,2 @@
#!/bin/sh -eu
-rofi -dmenu -show run -font "ubuntu 16" -padding 10 -lines 0 -p " " | xargs -r surfraw duckduckgo
+rofi -dmenu -i -font "ubuntu 16" -theme-str 'listview { lines: 0; }' -p " " | xargs -r surfraw duckduckgo
diff --git a/.local/bin/manpdf b/.local/bin/manpdf
index 349f9b4..6fefd44 100755
--- a/.local/bin/manpdf
+++ b/.local/bin/manpdf
@@ -1,2 +1,7 @@
-#!/bin/sh
-man -k . | dmenu -b | awk '{ print $1 }' | xargs -r man -Tpdf | zathura -
+#!/bin/sh -eu
+
+man -k . |
+ rofi -font "ubuntu 12" -matching regex -padding 20 -dmenu -i -p 'Manuals' |
+ awk '{ print $1 }' |
+ xargs -r man -Tpdf |
+ zathura -
diff --git a/.local/bin/pass-menu b/.local/bin/pass-menu
index 3d49d2f..7f0a306 100755
--- a/.local/bin/pass-menu
+++ b/.local/bin/pass-menu
@@ -8,7 +8,7 @@ shopt -s nullglob globstar
printf "\n" | $copy
copy='xsel --input --primary'
-menu='dmenu -f -i -b -p Password'
+menu='dmenu -f -i -b -nhf #ffeb3b -sf #ffeb3b -p ⠀:::⠀passwords⠀:::'
_paste () { xdotool type "$(xsel --output --primary)"; }
prefix=${PASSWORD_STORE_DIR-~/.password-store}
diff --git a/.local/bin/plumber b/.local/bin/plumber
index b129563..3d4ebdc 100755
--- a/.local/bin/plumber
+++ b/.local/bin/plumber
@@ -13,15 +13,15 @@ defmodule ArgParser do
|> OptionParser.parse!(strict: [option: :string, text: :string])
options = [
- first_letter: "First Letter Word",
- single_line: "Single Line",
- slug_text: "Slug",
- title_case: "Title Case",
- lower_case: "Lower Case",
- lorem_title: "Lorem Title",
- lorem_paragraph: "Lorem Paragraph",
- thesaurus: "Thesaurus",
- kjv_lookup: "KJV Verse Lookup"
+ first_letter: "first letter word",
+ single_line: "single line",
+ slug_text: "slug",
+ title_case: "title case",
+ lower_case: "lower case",
+ lorem_title: "lorem title",
+ lorem_paragraph: "lorem paragraph",
+ thesaurus: "thesaurus",
+ kjv_lookup: "kjv verse lookup"
]
cond do
diff --git a/.local/bin/plumber-dmenu b/.local/bin/plumber-dmenu
index 31e200d..9779223 100755
--- a/.local/bin/plumber-dmenu
+++ b/.local/bin/plumber-dmenu
@@ -1,17 +1,17 @@
#!/bin/sh -eu
options="\
-First Letter Word
-Single Line
-Slug
-Title Case
-Lower Case
-Lorem Title
-Lorem Paragraph
-Thesaurus
-KJV Verse Lookup
+first letter word
+single line
+slug
+title case
+lower case
+lorem title
+lorem paragraph
+thesaurus
+kjv verse lookup
"
printf "%s" "$options" \
- | dmenu -i -b -p Plumb \
+ | dmenu -i -b -p ⠀:::⠀plumber⠀::: \
| while read -r option
do
text=$(plumber --option "$option" --text "$(xsel -o)")
diff --git a/.local/bin/window-switcher b/.local/bin/window-switcher
index b19de68..9daf156 100755
--- a/.local/bin/window-switcher
+++ b/.local/bin/window-switcher
@@ -1,3 +1,23 @@
-#!/bin/sh -eu
-wmctrl -l | dmenu -f -i -b -p 'Switch' | awk '{ print $1 }' | xargs wmctrl -ia
-#rofi -no-disable-history -show window -theme-str '#prompt { enabled: false; }' -window-format {t} -font "ubuntu 12" -padding 15 -lines 1
+#!/bin/sh -u
+# https://git.suckless.org/sites/file/tools.suckless.org/dmenu/scripts/switch.html
+
+windows=$(wmctrl -xl |
+ tr --squeeze-repeats '[:blank:]' |
+ tr '[:upper:]' '[:lower:]' |
+ cut --delimiter ' ' --fields 3-3,5- |
+ sed 's/^[a-zA-Z0-9-]*\.//' |
+ sort |
+ uniq)
+
+windows=$(printf "%s" "$windows" |
+ awk --assign list="$windows" \
+ '{cur=length($1); printf $1; for(i=0; i < list - cur + 1; i++) printf " "; $1 = ""; printf "%s\n", $0}' 2> /dev/null)
+
+selection=$(
+ printf "%s" "$windows" | dmenu -nhf '#e68a00' -sf '#e68a00' -f -i -b -p ⠀:::⠀windows⠀:::
+ [ "$?" = 127 ] && kill -15 "$$" && "$0"
+)
+
+target=$(printf "%s" "$selection" | tr --squeeze-repeats '[:blank:]' | cut --delimiter ' ' --fields 2-)
+
+[ -n "$target" ] && wmctrl -a "$target"