瀏覽代碼

Move launcher and actions to prompt script

laptop
= 3 年之前
父節點
當前提交
a7e57659ba
共有 9 個文件被更改,包括 87 次插入43 次删除
  1. +0
    -16
      app-launch
  2. +0
    -3
      app-nnn
  3. +0
    -2
      app-notes
  4. +0
    -2
      app-tmux
  5. +0
    -2
      app-vim
  6. +0
    -11
      do-action
  7. +2
    -6
      dwm-start
  8. +2
    -1
      ewrap
  9. +83
    -0
      prompt

+ 0
- 16
app-launch 查看文件

@@ -1,16 +0,0 @@
#!/bin/sh

app=$(printf "Notes\nFiles\nEditor\nTerminal\nMultiplexer\nLBRY\nChat\nMusic\nProcesses" | dmenu -i -p "Launcher")

case $app in
Notes) app-notes;;
Files) app-nnn;;
Editor) st -e vim;;
Terminal) st;;
Multiplexer) app-tmux;;
LBRY) lbry;;
Chat) element-desktop;;
Music) st -e ncmpcpp;;
Browser) brave-browser;;
Processes) st -e htop;;
esac

+ 0
- 3
app-nnn 查看文件

@@ -1,3 +0,0 @@
#!/bin/sh

st -e nnn

+ 0
- 2
app-notes 查看文件

@@ -1,2 +0,0 @@
#!/bin/sh
st -e vim "+cd ~/Notes/text" "+CtrlP"

+ 0
- 2
app-tmux 查看文件

@@ -1,2 +0,0 @@
#!/bin/sh
st -e tmux $*

+ 0
- 2
app-vim 查看文件

@@ -1,2 +0,0 @@
#!/bin/sh
st -e vim "$*"

+ 0
- 11
do-action 查看文件

@@ -1,11 +0,0 @@
#!/bin/sh

action=$(printf "Play Music\nPause Music\nToggle Music\nSelect VPN\nDisable VPN\nRebind keys" |
dmenu -i -p "Actions")

case $action in
'Play Music') mpc play ;;
'Pause Music') mpc pause ;;
'Toggle Music') mpc toggle ;;
'Rebind keys') setup-xbindkeys;;
esac

+ 2
- 6
dwm-start 查看文件

@@ -2,6 +2,7 @@
setxkbmap -option caps:swapescape
picom -b
~/.fehbg
xbindkeys -f $HOME/Backups/configs/xbindkeysrc

# relaunch DWM if the binary changes, otherwise bail
csum=$(sha1sum $(which dwm.winkey))
@@ -12,12 +13,7 @@ do
then
csum=$new_csum
dwm-statusbar &
pid=$!
pulseaudio -k
dwm.winkey &
pid="$pid $!"
xbindkeys -f $HOME/Backups/configs/xbindkeysrc
wait $pid
dwm.winkey
else
exit 0
fi


+ 2
- 1
ewrap 查看文件

@@ -1,8 +1,9 @@
#!/bin/sh
#This is a wrapper script for editing files from nnn. It checks if it nnn is running in tmux then calls the appropriate editor.

if ! { [ "$TERM" = "tmux-256color" ] && [ -n "$TMUX" ]; } then
# Remove option --tab for new window
app-vim $*
st -e vim $*
else
# tmux session running
vim $* #tmux -u split-window "vim \"$*\""


+ 83
- 0
prompt 查看文件

@@ -0,0 +1,83 @@
#!/bin/sh

#Finish vpn and networking stuff after ini script is finished, then make sure printf in case goes to stderror which is shown in bar

launch() {
app=$(printf "Notes
Files
Editor
Terminal
Multiplexer
LBRY
Chat
Music
Browser
Email
Processes" |
dmenu -i -p "Launcher")

case $app in
Notes) st -e vim "+cd ~/Notes/text" "+CtrlP";;
Files) st -e nnn;;
Editor) st -e vim;;
Terminal) st;;
Multiplexer) st -e tmux $*;;
LBRY) lbry;;
Chat) element-desktop;;
Music) st -e ncmpcpp;;
Browser) brave-browser;;
Email) brave-browser mail.protonmail.com/login;;
Processes) st -e htop;;
esac
}

action() {
action=$(printf "Play Music
Pause Music
Toggle Music
Select VPN
Disable VPN
Enable VPN
VPN Status
Rebind Keys
Disable Bar
Enable Bar" |
dmenu -i -p "Actions")

case $action in
'Play Music') mpc play ;;
'Pause Music') mpc pause ;;
'Toggle Music') mpc toggle ;;
'Rebind Keys') setup-xbindkeys;;
'Disable Bar') tmux set -g status off;;
'Enable Bar') tmux set -g status on;;
esac
}

screenshot() {
method=$(printf "clipboard
file
both" |
dmenu -i -p "Screenshot")

if test $method = "file"; then
scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
-s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png
fi
}
if test $method = "clipboard"; then
scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
-s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png\
-e "xclip $f; rm $f"
fi

if test $method = "both"; then
scrot --note "-f 'LiterationSans Nerd Font Book/11' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"\
-s ~/Pictures/screenshots/screenshot-%Y-%m-%d_$wx$h.png\
-e "xclip $f;"
fi
case $1 in
launch) launch;;
action) action;;
*) printf "Invalid argument";;
esac

Loading…
取消
儲存