From a07285687e379b11e0eb823f1140084bc73d27d2 Mon Sep 17 00:00:00 2001
From: = <=>
Date: Sat, 28 Nov 2020 17:34:13 -0500
Subject: [PATCH] Make app launchers

---
 app-launch      | 16 ++++++++++++++++
 app-notes       |  2 ++
 app-tmux        |  2 ++
 app-vim         |  2 ++
 do-action       | 11 +++++++++++
 dwm-start       |  8 ++++++--
 ewrap           |  4 ++--
 setup-xbindkeys |  4 ++++
 8 files changed, 45 insertions(+), 4 deletions(-)
 create mode 100755 app-launch
 create mode 100755 app-notes
 create mode 100755 app-tmux
 create mode 100755 app-vim
 create mode 100755 do-action
 create mode 100755 setup-xbindkeys

diff --git a/app-launch b/app-launch
new file mode 100755
index 0000000..d534677
--- /dev/null
+++ b/app-launch
@@ -0,0 +1,16 @@
+#!/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
diff --git a/app-notes b/app-notes
new file mode 100755
index 0000000..44eaf3b
--- /dev/null
+++ b/app-notes
@@ -0,0 +1,2 @@
+#!/bin/sh
+st -e vim "+cd ~/Notes/text" "+CtrlP"
diff --git a/app-tmux b/app-tmux
new file mode 100755
index 0000000..c0d93b9
--- /dev/null
+++ b/app-tmux
@@ -0,0 +1,2 @@
+#!/bin/sh
+st -e tmux $*
diff --git a/app-vim b/app-vim
new file mode 100755
index 0000000..06e1e15
--- /dev/null
+++ b/app-vim
@@ -0,0 +1,2 @@
+#!/bin/sh
+st -e vim "$*"
diff --git a/do-action b/do-action
new file mode 100755
index 0000000..ea5f815
--- /dev/null
+++ b/do-action
@@ -0,0 +1,11 @@
+#!/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
diff --git a/dwm-start b/dwm-start
index 0ce6ea4..a1136b0 100755
--- a/dwm-start
+++ b/dwm-start
@@ -12,8 +12,12 @@ do
 	then
 		csum=$new_csum
 		dwm-statusbar &
-		#xbindkeys -f "$XDG_CONFIG_HOME"/xbindkeys/config
-		dwm.winkey
+		pid=$!
+		pulseaudio -k
+		dwm.winkey &
+		pid="$pid $!"
+		xbindkeys -f $HOME/Backups/configs/xbindkeysrc
+		wait $pid
 	else
 		exit 0
 	fi
diff --git a/ewrap b/ewrap
index 0e446b8..f694ff7 100755
--- a/ewrap
+++ b/ewrap
@@ -2,9 +2,9 @@
 
 if ! { [ "$TERM" = "tmux-256color"  ] && [ -n "$TMUX"  ];  } then
 # Remove option --tab for new window
-	st -e vim "$*"
+	app-vim $*
 else
 	# tmux session running
-	tmux -u split-window "vim \"$*\""
+	vim $* #tmux -u split-window "vim \"$*\""
 fi
 
diff --git a/setup-xbindkeys b/setup-xbindkeys
new file mode 100755
index 0000000..65e2980
--- /dev/null
+++ b/setup-xbindkeys
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+killall xbindkeys
+xbindkeys -f $BACKUPS_PATH/configs/xbindkeysrc