summaryrefslogtreecommitdiffstats
path: root/.scripts/i3cmds
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/i3cmds')
-rwxr-xr-x.scripts/i3cmds/displayselect2
-rwxr-xr-x.scripts/i3cmds/samedir30
-rwxr-xr-x.scripts/i3cmds/showclip4
-rwxr-xr-x.scripts/i3cmds/td-toggle2
-rwxr-xr-x.scripts/i3cmds/tutorialvids18
5 files changed, 18 insertions, 38 deletions
diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect
index a8cf2f5..c9a2bd9 100755
--- a/.scripts/i3cmds/displayselect
+++ b/.scripts/i3cmds/displayselect
@@ -45,3 +45,5 @@ esac
feh --bg-scale "$HOME/.config/wall.png"
# Re-remap keys if keyboard added (for laptop bases)
remaps
+# Restart dunst to ensure proper location on screen
+pgrep -x dunst >/dev/null && killall dunst && setsid dunst &
diff --git a/.scripts/i3cmds/samedir b/.scripts/i3cmds/samedir
index 7d65838..88845fc 100755
--- a/.scripts/i3cmds/samedir
+++ b/.scripts/i3cmds/samedir
@@ -1,27 +1,5 @@
#!/bin/sh
-# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
-
-CMD=$TERMINAL
-CWD=''
-
-# Get window ID
-ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
-
-# Get PID of process whose window this is
-PID=$(xprop -id "$ID" | grep -m 1 PID | cut -d " " -f 3)
-
-# Get last child process (shell, vim, etc)
-if [ -n "$PID" ]; then
- TREE=$(pstree -lpA "$PID" | tail -n 1)
- PID=$(echo "$TREE" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
-
- # If we find the working directory, run the command in that directory
- if [ -e "/proc/$PID/cwd" ]; then
- CWD=$(readlink /proc/"$PID"/cwd)
- fi
-fi
-if [ -n "$CWD" ]; then
- cd "$CWD" && "$CMD"
-else
- "$CMD"
-fi
+PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3)
+PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
+cd "$(readlink /proc/"$PID"/cwd)"
+"$TERMINAL"
diff --git a/.scripts/i3cmds/showclip b/.scripts/i3cmds/showclip
index 7b3aeee..5764487 100755
--- a/.scripts/i3cmds/showclip
+++ b/.scripts/i3cmds/showclip
@@ -10,6 +10,6 @@ clip=$(xclip -o -selection clipboard)
prim=$(xclip -o -selection primary)
[ "$prim" != "" ] && notify-send "<b>Clipboard:</b>
-$prim"
-[ "$clip" != "" ] && notify-send "<b>Primary:</b>
$clip"
+[ "$clip" != "" ] && notify-send "<b>Primary:</b>
+$prim"
diff --git a/.scripts/i3cmds/td-toggle b/.scripts/i3cmds/td-toggle
index 4eb6652..6489626 100755
--- a/.scripts/i3cmds/td-toggle
+++ b/.scripts/i3cmds/td-toggle
@@ -2,7 +2,7 @@
# If transmission-daemon is running, will ask to kill, else will ask to start.
-[ ! -f /usr/bin/transmission-daemon ] && echo "Transmission not installed." && exit
+[ ! -f /usr/bin/transmission-daemon ] && notify-send "Transmission daemon not installed." && exit
if pgrep -x transmission-da >/dev/null ;
then
diff --git a/.scripts/i3cmds/tutorialvids b/.scripts/i3cmds/tutorialvids
index d5fee01..2743bfc 100755
--- a/.scripts/i3cmds/tutorialvids
+++ b/.scripts/i3cmds/tutorialvids
@@ -2,17 +2,17 @@
vidlist="
status bar https://www.youtube.com/watch?v=gKumet6b-WY
feh
-i3
-mutt https://www.youtube.com/watch?v=2U3vRbF7v5A
-ncmpcpp https://www.youtube.com/watch?v=sZIEdI9TS2U
-newsboat https://www.youtube.com/watch?v=dUFCRqs822w
-ranger https://www.youtube.com/watch?v=L6Vu7WPkoJo
-zathura https://www.youtube.com/watch?v=V_Iz4zdyRM4
+st (terminal) https://www.youtube.com/watch?v=9H75enWM22k
+i3 (window manager) https://www.youtube.com/watch?v=GKviflL9XeI
+mutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A
+ncmpcpp (music player) https://www.youtube.com/watch?v=sZIEdI9TS2U
+newsboat (RSS reader) https://www.youtube.com/watch?v=dUFCRqs822w
+ranger (file manager) https://www.youtube.com/watch?v=L6Vu7WPkoJo
+zathura (pdf viewer) https://www.youtube.com/watch?v=V_Iz4zdyRM4
gpg keys https://www.youtube.com/watch?v=DMGIlj7u7Eo
-calcurse https://www.youtube.com/watch?v=hvc-pHjbhdE
+calcurse (calendar) https://www.youtube.com/watch?v=hvc-pHjbhdE
urlview https://www.youtube.com/watch?v=IgzpAjFgbCw
colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE
vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E
"
-
-mpv "$(echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 5)\\t" | sed 's/.*\t//')"
+mpv "$(echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 5 | awk '{print $1}')\s" | sed 's/.*\t//')"