From 22074a2a82b6ce69215b3d62274320ae1df64443 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 27 Apr 2018 12:29:28 +0100 Subject: [PATCH 1/5] Add zip-recent to bin folder --- bin/zip-recent | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 bin/zip-recent diff --git a/bin/zip-recent b/bin/zip-recent new file mode 100755 index 00000000..cf5e7dd0 --- /dev/null +++ b/bin/zip-recent @@ -0,0 +1,45 @@ +#!/usr/bin/sh + +# A script to create a zip archive of any recentally modified files + + +# Set the defaults +mtime="7" +filename="" + +while [ $1 ]; do + case $1 in + -h|--help) + echo "Zips recentally modified files" + echo "" + echo -e "Use this to create a zip archive of recentally modified files" + echo -e "Usage: zip-recent [options] filename" + echo "" + echo -e "Options" + echo -e "\t-mtime\t\tThe number of days that should be considered recent [default=$mtime]" + exit 0 + ;; + -mtime) + shift + mtime="$1" + shift + ;; + *) + filename="$1" + shift + ;; + esac +done + +if [ "$filename" = "" ]; then + echo "You need to enter a filename" + exit 1 +fi + +# Make sure the filename ends with .zip +filename="${filename%\.zip}.zip" + + +find . -type f -mtime -$mtime -exec zip $filename {} \; + + From 7a96f6718acd29cdbd755f8b2d143ece67edb107 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 27 Apr 2018 12:30:37 +0100 Subject: [PATCH 2/5] Make caps-lock on prompt update when toggled --- i3/configWork | 15 ++++++++------- shells/zsh/zshrc | 4 ++++ x/xbindkeysrc | 2 ++ x/xinitrc | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 x/xbindkeysrc diff --git a/i3/configWork b/i3/configWork index 4b406949..82e8c43b 100644 --- a/i3/configWork +++ b/i3/configWork @@ -69,12 +69,13 @@ bindsym $mod+u exec ~/.dotfiles/rofi/scripts/rofi-emoji bindsym $mod+Shift+x exec killall i3 -bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks -bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks - - -for_window [class="xfce4-appfinder"] floating enable +# Send signals to i3 blocks and zsh to tell them that capslock has been pushed +# The message to zsh is technically a "window change" which causes zsh to re-draw the prompt +# https://unix.stackexchange.com/questions/440184/update-zsh-ps1-propt-on-keypress +bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks && pkill -SIGWINCH zsh +#Send a message to i3blocks to say that numlock has been pushed +bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks # There also is the (new) i3-dmenu-desktop which only displays applications @@ -263,8 +264,8 @@ bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% & bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% && pkill -SIGRTMIN+10 i3blocks #decrease sound volume bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle && pkill -SIGRTMIN+10 i3blocks # mute sound -bindsym --whole-window $alt+button4 exec --no-startup-id pactl set-sink-volume 0 +5% && pkill -SIGRTMIN+10 i3blocks #increase sound volume -bindsym --whole-window $alt+button5 exec --no-startup-id pactl set-sink-volume 0 -5% && pkill -SIGRTMIN+10 i3blocks #decrease sound volume +bindsym --whole-window $alt+button4 exec --no-startup-id pactl set-sink-volume 0 -5% && pkill -SIGRTMIN+10 i3blocks #decrease sound volume +bindsym --whole-window $alt+button5 exec --no-startup-id pactl set-sink-volume 0 +5% && pkill -SIGRTMIN+10 i3blocks #increase sound volume # Sreen brightness controls #bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness diff --git a/shells/zsh/zshrc b/shells/zsh/zshrc index 9f5a43fb..6ed75ea4 100644 --- a/shells/zsh/zshrc +++ b/shells/zsh/zshrc @@ -87,6 +87,10 @@ source $ZSH/oh-my-zsh.sh source ~/.dotfiles/shells/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +TRAPWINCH(){ + zle && {zle reset-prompt; zle -R} +} + if [ -f ~/.current-folder ] && [ ! $TMUX ]; then cd "$(cat ~/.current-folder)" clear diff --git a/x/xbindkeysrc b/x/xbindkeysrc new file mode 100644 index 00000000..e9613d9e --- /dev/null +++ b/x/xbindkeysrc @@ -0,0 +1,2 @@ +#"pkill -u $USER -SIGWINCH zsh" +# Caps_Lock diff --git a/x/xinitrc b/x/xinitrc index b38092b5..2ce935d7 100644 --- a/x/xinitrc +++ b/x/xinitrc @@ -4,5 +4,6 @@ eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh export $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg) dbus-update-activation-environment --systemd DISPLAY #exec xrdb .Xresources +xbindkeys exec i3 -V >> ~/i3log-$(date + '%F-%k-%M-%S') 2>&1 exec sh /home/jonathan/.conky/conky-startup.sh From 1c6b24d79f1ffc5fbdb2a37aada52c5388906f5e Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 27 Apr 2018 12:31:44 +0100 Subject: [PATCH 3/5] Update vim config --- vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim b/vim index 3158f314..702903b5 160000 --- a/vim +++ b/vim @@ -1 +1 @@ -Subproject commit 3158f31419852bf8c413eef06ba7ebc83e5982f9 +Subproject commit 702903b58931978c03e3a6f078058fa1284ae8fe From 9ea399a138fda1ae7494f7f16cfb5eab89edc972 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 27 Apr 2018 12:58:27 +0100 Subject: [PATCH 4/5] Link to original repo for dvdrip --- bin/dvdrip | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/dvdrip b/bin/dvdrip index 36679b51..f84c3d2d 100755 --- a/bin/dvdrip +++ b/bin/dvdrip @@ -2,6 +2,9 @@ # coding=utf-8 """ + +based on this: https://github.com/xenomachina/dvdrip + Rip DVDs quickly and easily from the commandline. Features: From 9c12f43f98a627f00dbe40ba949fb812f10865b6 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 27 Apr 2018 14:38:44 +0100 Subject: [PATCH 5/5] Make zshrc use build in cd rather than alias when opening new terminal --- shells/zsh/zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shells/zsh/zshrc b/shells/zsh/zshrc index 6ed75ea4..beb694f4 100644 --- a/shells/zsh/zshrc +++ b/shells/zsh/zshrc @@ -92,6 +92,5 @@ TRAPWINCH(){ } if [ -f ~/.current-folder ] && [ ! $TMUX ]; then - cd "$(cat ~/.current-folder)" - clear + \cd "$(cat ~/.current-folder)" fi