@@ -11,11 +11,12 @@ launch() {
Open
Open
Pick
Pick
Choose
Choose
Tasks
Terminal
Terminal
Multiplexer
Multiplexer
LBRY
Chat
Chat
Music
Music
Bookmarks
Equalizer
Equalizer
Browser
Browser
Hidden browser
Hidden browser
@@ -27,8 +28,9 @@ launch() {
Games
Games
Play clipboard
Play clipboard
Play downloads
Play downloads
Processes" | tr -d '\t' |
dmenu -i -p "Launcher")
Processes
Mixer" | tr -d '\t' |
dmenu -i -c -l 20 -p "Launcher")
case $app in
case $app in
Notes) st -t "Notes" -e vim "+cd ~/notes/text" "+CtrlP";;
Notes) st -t "Notes" -e vim "+cd ~/notes/text" "+CtrlP";;
@@ -38,22 +40,24 @@ launch() {
Open) opener;;
Open) opener;;
Pick) pick;;
Pick) pick;;
Choose) choose;;
Choose) choose;;
Bookmarks) st -t "Bookmarks" -e sh -lc buku;;
Terminal) st -t "Terminal";;
Terminal) st -t "Terminal";;
Tasks) st -t "Tasks" -e sh -lc taskwarrior-tui;;
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";;
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";;
Games) games;;
Games) games;;
Multiplexer) st -t "Multiplexer" -e tmux attach-session -t 0 || st -t "Multiplexer" -e tmux new-session -s 0;;
Multiplexer) st -t "Multiplexer" -e tmux attach-session -t 0 || st -t "Multiplexer" -e tmux new-session -s 0;;
LBRY) lbry;;
'Go page') num=$(go_page); pages pager $num;;
'Go page') num=$(go_page); pages pager $num;;
Chat) element-desktop;;
Chat) element-desktop;;
Music) st -t "Music" -e ncmpcpp;;
Music) st -t "Music" -e ncmpcpp;;
Browser) $browser_cmd;;
Browser) $browser_cmd;;
'Hidden browser') $browser_cmd --incognito;;
'Hidden browser') $browser_cmd --incognito;;
Email) st -t 'Email' -e neomutt;;
Email) st -t 'Email' -e sh -lc neomutt;;
Images) view_images;;
Images) view_images;;
'Play clipboard') mpv "$(xclip -o -selection clipboard)";;
'Play clipboard') mpv "$(xclip -o -selection clipboard)";;
'Play downloads') mpv "$HOME/downloads/tmp/$(ls ~/downloads/tmp/ | dmenu -i -l 10 -p 'play')";;
'Play downloads') mpv "$HOME/downloads/tmp/$(ls ~/downloads/tmp/ | dmenu -i -l 10 -p 'play')";;
'Mixer') st -t "Mixer" -e pulsemixer;;
'Equalizer') qpaeq;;
'Equalizer') qpaeq;;
Processes) st -t "Processes" -e h top;;
Processes) st -t "Processes" -e top;;
esac
esac
}
}
@@ -62,6 +66,7 @@ action() {
Pause Music
Pause Music
Play Music
Play Music
Single on
Single on
Bookmarks
Command
Command
Command to clipboard
Command to clipboard
Select VPN
Select VPN
@@ -80,7 +85,7 @@ action() {
Update cache
Update cache
Enable Bar
Enable Bar
Exit" | tr -d '\t' |
Exit" | tr -d '\t' |
dmenu -i -p "Actions")
dmenu -i -c -l 20 - p "Actions")
case $action in
case $action in
'Play Music') mpc play ;;
'Play Music') mpc play ;;
@@ -90,6 +95,7 @@ action() {
'Rebind Keys') setup-xbindkeys;;
'Rebind Keys') setup-xbindkeys;;
'Disable Bar') tmux set -g status off;;
'Disable Bar') tmux set -g status off;;
'Enable Bar') tmux set -g status on;;
'Enable Bar') tmux set -g status on;;
'Bookmarks') bookmarks;;
'Command') cmd;;
'Command') cmd;;
'Command to clipboard') cmd_clip;;
'Command to clipboard') cmd_clip;;
'Username') username;;
'Username') username;;
@@ -111,7 +117,7 @@ login() {
Password
Password
Alternate
Alternate
Show
Show
Edit" | tr -d '\t' | dmenu -i -p "login")
Edit" | tr -d '\t' | dmenu -i -c - p "login")
case $choice in
case $choice in
Username) username;;
Username) username;;
@@ -128,10 +134,10 @@ do_search() {
Godocs
Godocs
Mojeek
Mojeek
Package
Package
Github" | tr -d '\t' | dmenu -i -p "Search")
Github" | tr -d '\t' | dmenu -i -c - p "Search")
case "$type" in
case "$type" in
Manual) p=$(man -k '' | dmenu -l 20 -p 'Manual' | cut -d' ' -f1); if [ -z $p ]; then exit; fi; st -t "Manual - $p" -e man "$p";;
Manual) p=$(man -k '' | dmenu -i -c - l 20 -p 'Manual' | cut -d' ' -f1); if [ -z $p ]; then exit; fi; st -t "Manual - $p" -e man "$p";;
Github) github;;
Github) github;;
Godocs) godoc;;
Godocs) godoc;;
DDG) ddg;;
DDG) ddg;;
@@ -141,42 +147,48 @@ do_search() {
}
}
download() {
download() {
youtube-dl --add-metadata --no-progress -o "$HOME/downloads/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)"
notify-send -u low -t 3000 "Download complete"
youtube-dl --add-metadata --no-progress -o "$HOME/downloads/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)"
notify-send -u low -t 3000 "Download complete"
}
}
download_music() {
download_music() {
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
"$HOME/music/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
"$HOME/music/new/ %(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
if [ ! $? ]; then
if [ ! $? ]; then
youtube-dl -x --no-progress --audio-format mp3 -o \
"$HOME/music/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
"$HOME/music/new/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
fi
if [ -e "$HOME/music/new/NA - NA"* ]; then
rm "$HOME/music/new/NA - NA"*
youtube-dl -x --add-metadata --no-progress --audio-format mp3 -o \
"$HOME/music/new/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)"
fi
fi
notify-send -u low -t 3000 "Download complete"
notify-send -u low -t 3000 "Download complete"
}
}
view_images() {
view_images() {
d=$(mru listdirs | dmenu -l 20 -i -p 'where?')
d=$(mru listdirs | dmenu -c - l 20 -i -p 'where?')
if [ -z "$d" ]; then exit; fi
if [ -z "$d" ]; then exit; fi
sxiv -r "$d"
sxiv -r "$d"
}
}
package() {
package() {
type=$(printf "search\ninfo" | dmenu -p 'package')
type=$(printf "search\ninfo" | dmenu -c - p 'package')
if [ -z "$type" ]; then
if [ -z "$type" ]; then
exit
exit
elif [ "$type" = "info" ]; then
elif [ "$type" = "info" ]; then
s=$(dmenu_path | dmenu -i -p 'package info')
s=$(dmenu_path | dmenu -i -c - p 'package info')
st -e sh -lc "apt-cache show $s"
st -e sh -lc "apt-cache show $s"
else
else
s=$(dmenu -i -p 'package search')
s=$(dmenu -i -c - p 'package search')
st -e sh -lc "apt search \"$s\""
st -e sh -lc "apt search \"$s\""
fi
fi
}
}
editor() {
editor() {
#handle spacing in filenames bug
#handle spacing in filenames bug
file=$(mru list | dmenu -i -l 1 0 -p 'edit file')
file=$(mru list | dmenu -i -c -l 2 0 -p 'edit file')
if [ -z "$file" ]; then exit; fi
if [ -z "$file" ]; then exit; fi
first=$(printf "$file" | head -n1 -)
first=$(printf "$file" | head -n1 -)
d=$(dirname "$first")
d=$(dirname "$first")
@@ -186,7 +198,7 @@ editor() {
}
}
opener() {
opener() {
mru list | dmenu -i -l 20 -p 'open' | while read f; do xdg-open "$f"; done
mru list | dmenu -i -c - l 20 -p 'open' | while read f; do xdg-open "$f"; done
}
}
screenshot() {
screenshot() {
@@ -214,11 +226,11 @@ both" |
}
}
search_type() {
search_type() {
search_string="$(printf "New window\nBookmarks\nHistory" | dmenu -p "$1")"
search_string="$(printf "New window\nBookmarks\nHistory" | dmenu -c - p "$1")"
search_mode='tab'
search_mode='tab'
case "$search_string" in
case "$search_string" in
'New window') search_mode='window'; search_string=$(printf '' | dmenu -p "new $1");;
'New window') search_mode='window'; search_string=$(printf '' | dmenu -c - p "new $1");;
'Bookmarks');;
'Bookmarks');;
'History') ;;
'History') ;;
# *) printf "Invalid argument";;
# *) printf "Invalid argument";;
@@ -316,7 +328,7 @@ sel_account() {
account=$(
account=$(
find ~/.password-store/[!\.]* -type f |
find ~/.password-store/[!\.]* -type f |
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" |
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" |
dmenu -p 'account'
dmenu -c -i -l 20 - p 'account'
)
)
if [ -z "$account" ]; then exit; fi
if [ -z "$account" ]; then exit; fi
printf "$account"
printf "$account"
@@ -326,7 +338,7 @@ username() {
account=$(sel_account)
account=$(sel_account)
if [ -z "$account" ]; then exit; fi
if [ -z "$account" ]; then exit; fi
name=$(pass show "$account" | sed -n -e "s/^username: //p" |
name=$(pass show "$account" | sed -n -e "s/^username: //p" |
dmenu -p 'which username' | xclip -f -selection clipboard)
dmenu -c -i -l 20 - p 'which username' | xclip -f -selection clipboard)
if [ -z "$name" ]; then exit; fi
if [ -z "$name" ]; then exit; fi
notify-send -u low -t 2000 "username copied" "$account: $name"
notify-send -u low -t 2000 "username copied" "$account: $name"
}
}
@@ -336,7 +348,7 @@ password() {
touch /tmp/prompt-login-$$
touch /tmp/prompt-login-$$
account=$(find ~/.password-store/[!\.]* -type f |
account=$(find ~/.password-store/[!\.]* -type f |
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" |
sed -e "s:$HOME/.password-store/::" -e "s:\.gpg::" |
dmenu -p 'which service')
dmenu -i -c -l 20 - p 'which service')
pass -c $account
pass -c $account
notify-send -u low -t 1000 'password copied' "Copied $account"
notify-send -u low -t 1000 'password copied' "Copied $account"
@@ -348,7 +360,7 @@ password() {
other_password() {
other_password() {
account=$(sel_account)
account=$(sel_account)
name=$(pass show "$account" | sed -n -e "s/^username: //p" |
name=$(pass show "$account" | sed -n -e "s/^username: //p" |
dmenu -i -p 'which user password')
dmenu -i -c -l 20 - p 'which user password')
if [ -z "$name" ]; then exit; fi
if [ -z "$name" ]; then exit; fi
copy=$(pass show $account | grep -B 1 "^username: $name" | head -n1 | tr -d '\n')
copy=$(pass show $account | grep -B 1 "^username: $name" | head -n1 | tr -d '\n')
printf "$copy" | xclip -selection clipboard
printf "$copy" | xclip -selection clipboard
@@ -375,15 +387,15 @@ edit_password() {
# Execute a command with the specified file or directory as it's argument
# Execute a command with the specified file or directory as it's argument
choose() {
choose() {
d=$(mru listdirs | dmenu -i -l 20 -p 'from')
d=$(mru listdirs | dmenu -i -c - l 20 -p 'from')
if [ -z "$d" ]; then exit; fi
if [ -z "$d" ]; then exit; fi
f=$(
f=$(
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path '*node_modules/*' -o -ipath '*backups/my-plugins*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) |
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path '*node_modules/*' -o -ipath '*backups/my-plugins*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) |
dmenu -i -l 20 -p 'choose file'
dmenu -i -c - l 20 -p 'choose file'
)
)
if [ -z "$f" ]; then exit; fi
if [ -z "$f" ]; then exit; fi
c=$(dmenu_path | dmenu -i -p 'operation')
c=$(dmenu_path | dmenu -i -c - p 'operation')
if [ -z $c ]; then exit; fi
if [ -z $c ]; then exit; fi
$c "$f"
$c "$f"
}
}
@@ -395,11 +407,11 @@ vpn() {
# It finds all the current files in a known directory without needing to update the mru list of files
# It finds all the current files in a known directory without needing to update the mru list of files
# If the directory is chosen instead of the file within it, it opens the directory with nnn
# If the directory is chosen instead of the file within it, it opens the directory with nnn
pick() {
pick() {
d=$(mru listdirs | dmenu -i -l 20 -p 'from')
d=$(mru listdirs | dmenu -i -c - l 20 -p 'from')
if [ -z "$d" ]; then exit; fi
if [ -z "$d" ]; then exit; fi
f=$(
f=$(
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path '*node_modules/*' -o -ipath '*backups/my-plugins*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) |
(printf "$d\n"; find "$d" -type f -not \( -path '*/.*/*' -o -path '*node_modules/*' -o -ipath '*backups/my-plugins*' -o -ipath '*/.uuid' -ipath '*.swp*' \)) |
dmenu -i -l 20 -p 'pick file'
dmenu -i -c - l 20 -p 'pick file'
)
)
if [ -z "$f" ]; then exit; fi
if [ -z "$f" ]; then exit; fi
if [ "$d" = "$f" ]; then st -t 'Files' -e sh -lc "nnn '$f'"; exit; fi
if [ "$d" = "$f" ]; then st -t 'Files' -e sh -lc "nnn '$f'"; exit; fi
@@ -408,7 +420,7 @@ pick() {
do_exit() {
do_exit() {
choice=$(printf "Shutdown
choice=$(printf "Shutdown
Reboot"| dmenu -i -p 'Exit')
Reboot"| dmenu -i -c - p 'Exit')
case $choice in
case $choice in
Shutdown) ls;;
Shutdown) ls;;
@@ -417,7 +429,7 @@ do_exit() {
}
}
select_song() {
select_song() {
song=$(mpc playlist | dmenu -i -l 20 -p 'song')
song=$(mpc playlist | dmenu -i -c - l 20 -p 'song')
num=$(mpc playlist | sed -n "/$song/=")
num=$(mpc playlist | sed -n "/$song/=")
mpc play $num
mpc play $num
}
}
@@ -428,7 +440,7 @@ games() {
Divinity
Divinity
Rise to Ruins
Rise to Ruins
Witcher 3
Witcher 3
POE" | dmenu -i -p 'Games')
POE" | dmenu -i -c - p 'Games')
case "$sel" in
case "$sel" in
Albion);;
Albion);;
@@ -439,6 +451,21 @@ games() {
esac
esac
}
}
bookmarks() {
sel=$(printf "Open
Select by tag
Modify
Delete
Edit" | tr -d "\t" | dmenu -i -c -p 'Bookmarks')
case "$sel" in
'Open') m=$(buku --nc -p | dmenu -i -c -l 30 -p "open bookmark");;
'Select by tag');;
'Modify');;
'Delete');;
esac
}
case $1 in
case $1 in
launch ) launch;;
launch ) launch;;
action) action;;
action) action;;