|
@@ -9,6 +9,8 @@ launch() { |
|
|
Edit |
|
|
Edit |
|
|
Editor |
|
|
Editor |
|
|
Open |
|
|
Open |
|
|
|
|
|
Pick |
|
|
|
|
|
Choose |
|
|
Terminal |
|
|
Terminal |
|
|
Multiplexer |
|
|
Multiplexer |
|
|
LBRY |
|
|
LBRY |
|
@@ -26,11 +28,13 @@ launch() { |
|
|
dmenu -i -p "Launcher") |
|
|
dmenu -i -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";; |
|
|
Files) st -t "Files" -e sh -lc nnn;; |
|
|
Files) st -t "Files" -e sh -lc nnn;; |
|
|
Edit) editor;; |
|
|
Edit) editor;; |
|
|
Editor) st -t "Editor" -e vim "+CtrlPMRUFiles";; |
|
|
Editor) st -t "Editor" -e vim "+CtrlPMRUFiles";; |
|
|
Open) opener;; |
|
|
Open) opener;; |
|
|
|
|
|
Pick) pick;; |
|
|
|
|
|
Choose) choose;; |
|
|
Terminal) st -t "Terminal";; |
|
|
Terminal) st -t "Terminal";; |
|
|
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";; |
|
|
Page) pages pager "$(printf "1\n2\n3\n" | dmenu -p 'page')";; |
|
|
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;; |
|
@@ -42,7 +46,7 @@ launch() { |
|
|
'Hidden browser') $browser_cmd --incognito;; |
|
|
'Hidden browser') $browser_cmd --incognito;; |
|
|
Email) $browser_cmd mail.protonmail.com/login;; |
|
|
Email) $browser_cmd mail.protonmail.com/login;; |
|
|
'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')";; |
|
|
Processes) st -t "Processes" -e htop;; |
|
|
Processes) st -t "Processes" -e htop;; |
|
|
esac |
|
|
esac |
|
|
} |
|
|
} |
|
@@ -53,8 +57,6 @@ action() { |
|
|
Play Music |
|
|
Play Music |
|
|
Command |
|
|
Command |
|
|
Command to clipboard |
|
|
Command to clipboard |
|
|
Choose |
|
|
|
|
|
Choosedir |
|
|
|
|
|
Select VPN |
|
|
Select VPN |
|
|
Disable VPN |
|
|
Disable VPN |
|
|
Enable VPN |
|
|
Enable VPN |
|
@@ -66,6 +68,8 @@ action() { |
|
|
Username |
|
|
Username |
|
|
Alternate password |
|
|
Alternate password |
|
|
Download |
|
|
Download |
|
|
|
|
|
Download music |
|
|
|
|
|
Update cache |
|
|
Enable Bar" | tr -d '\t' | |
|
|
Enable Bar" | tr -d '\t' | |
|
|
dmenu -i -p "Actions") |
|
|
dmenu -i -p "Actions") |
|
|
|
|
|
|
|
@@ -77,15 +81,15 @@ action() { |
|
|
'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;; |
|
|
'Command') cmd;; |
|
|
'Command') cmd;; |
|
|
'Choose') chooser;; |
|
|
|
|
|
'Choosedir') choosedir;; |
|
|
|
|
|
'Command to clipboard') cmd_clip;; |
|
|
'Command to clipboard') cmd_clip;; |
|
|
'Username') username;; |
|
|
'Username') username;; |
|
|
'Password') password;; |
|
|
'Password') password;; |
|
|
'Alternate password') other_password;; |
|
|
'Alternate password') other_password;; |
|
|
'Show calender') notify-send 'Calender' "\n\n$(cal)";; |
|
|
'Show calender') notify-send 'Calender' "\n\n$(cal)";; |
|
|
|
|
|
'Update cache') { mru update; mru updatedirs; };; |
|
|
#This should check for an error code and confirm that download has started |
|
|
#This should check for an error code and confirm that download has started |
|
|
'Download') youtube-dl --no-progress -o "$HOME/Downloads/tmp/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)"; notify-send -u low -t 3000 "Download complete";; |
|
|
|
|
|
|
|
|
'Download') download;; |
|
|
|
|
|
'Download music') download_music;; |
|
|
esac |
|
|
esac |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -104,6 +108,7 @@ login() { |
|
|
Show) show_password;; |
|
|
Show) show_password;; |
|
|
esac |
|
|
esac |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
do_search() { |
|
|
do_search() { |
|
|
type=$(printf "Manual |
|
|
type=$(printf "Manual |
|
|
DDG |
|
|
DDG |
|
@@ -114,7 +119,7 @@ do_search() { |
|
|
Github" | tr -d '\t' | dmenu -i -p "Search") |
|
|
Github" | tr -d '\t' | dmenu -i -p "Search") |
|
|
|
|
|
|
|
|
case "$type" in |
|
|
case "$type" in |
|
|
Manual) p=$(printf '' | dmenu -p 'man'); if [ -z $p ]; then exit; fi; st -t "Manual $p" -e man "$p";; |
|
|
|
|
|
|
|
|
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";; |
|
|
Github) github;; |
|
|
Github) github;; |
|
|
Godocs) godoc;; |
|
|
Godocs) godoc;; |
|
|
DDG) ddg;; |
|
|
DDG) ddg;; |
|
@@ -123,6 +128,20 @@ do_search() { |
|
|
esac |
|
|
esac |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
download() { |
|
|
|
|
|
youtube-dl --no-progress -o "$HOME/downloads/%(title)s.%(ext)s" "$(xclip -selection clipboard -o)" |
|
|
|
|
|
notify-send -u low -t 3000 "Download complete" |
|
|
|
|
|
} |
|
|
|
|
|
download_music() { |
|
|
|
|
|
youtube-dl --no-progress -f bestaudio -o \ |
|
|
|
|
|
"$HOME/downloads/music/%(track)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" |
|
|
|
|
|
if [ $? ]; then |
|
|
|
|
|
youtube-dl --no-progress -f bestaudio -o \ |
|
|
|
|
|
"$HOME/downloads/music/%(title)s - %(artist)s.%(ext)s" "$(xclip -selection clipboard -o)" |
|
|
|
|
|
fi |
|
|
|
|
|
notify-send -u low -t 3000 "Download complete" |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
package() { |
|
|
package() { |
|
|
type=$(printf "search\ninfo" | dmenu -p 'package') |
|
|
type=$(printf "search\ninfo" | dmenu -p 'package') |
|
|
if [ -z "$type" ]; then |
|
|
if [ -z "$type" ]; then |
|
@@ -326,35 +345,51 @@ edit_password() { |
|
|
if [ -n "$error" ]; then notify-send -u low -t 3000 "password edit error" "$error"; fi |
|
|
if [ -n "$error" ]; then notify-send -u low -t 3000 "password edit error" "$error"; fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
chooser() { |
|
|
|
|
|
f=$(mru list | dmenu -i -l 20 -p 'choose file') |
|
|
|
|
|
|
|
|
# Execute a command with the specified file or directory as it's argument |
|
|
|
|
|
choose() { |
|
|
|
|
|
d=$(mru listdirs | dmenu -i -l 20 -p 'from') |
|
|
|
|
|
if [ -z "$d" ]; then exit; fi |
|
|
|
|
|
f=$( |
|
|
|
|
|
(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' |
|
|
|
|
|
) |
|
|
if [ -z "$f" ]; then exit; fi |
|
|
if [ -z "$f" ]; then exit; fi |
|
|
c=$(dmenu_path | dmenu -i -p 'operation') |
|
|
|
|
|
if [ -z $c ]; then exit; fi |
|
|
|
|
|
$c "$f" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
choosedir(){ |
|
|
|
|
|
f=$(mru listdirs | dmenu -i -l 20 -p 'choose dir') |
|
|
|
|
|
if [ -z "$f" ]; then exit; fi |
|
|
|
|
|
c=$(dmenu_path | dmenu -i -p 'operation') |
|
|
c=$(dmenu_path | dmenu -i -p 'operation') |
|
|
if [ -z $c ]; then exit; fi |
|
|
if [ -z $c ]; then exit; fi |
|
|
$c "$f" |
|
|
$c "$f" |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
vpn() { |
|
|
vpn() { |
|
|
ls |
|
|
ls |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# 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 |
|
|
|
|
|
pick() { |
|
|
|
|
|
d=$(mru listdirs | dmenu -i -l 20 -p 'from') |
|
|
|
|
|
if [ -z "$d" ]; then exit; fi |
|
|
|
|
|
f=$( |
|
|
|
|
|
(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' |
|
|
|
|
|
) |
|
|
|
|
|
if [ -z "$f" ]; then exit; fi |
|
|
|
|
|
if [ "$d" = "$f" ]; then st -t 'Files' -e sh -lc "nnn '$f'"; exit; fi |
|
|
|
|
|
xdg-open "$f" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
case $1 in |
|
|
case $1 in |
|
|
launch ) launch;; |
|
|
launch ) launch;; |
|
|
action) action;; |
|
|
action) action;; |
|
|
|
|
|
pick) pick;; |
|
|
cmd) cmd;; |
|
|
cmd) cmd;; |
|
|
cmd_clip) cmd_clip;; |
|
|
cmd_clip) cmd_clip;; |
|
|
login) login;; |
|
|
login) login;; |
|
|
search) do_search;; |
|
|
search) do_search;; |
|
|
open) opener;; |
|
|
open) opener;; |
|
|
choose) chooser;; |
|
|
|
|
|
|
|
|
choose) choose;; |
|
|
vpn) vpn;; |
|
|
vpn) vpn;; |
|
|
|
|
|
download) download;; |
|
|
|
|
|
download_music) download_music;; |
|
|
*) printf "Invalid argument";; |
|
|
*) printf "Invalid argument";; |
|
|
esac |
|
|
esac |