From 06bbae9998ad0dc8bd146ca04d82b6e9a04f23e8 Mon Sep 17 00:00:00 2001 From: LORDBABUINO Date: Tue, 18 Dec 2018 21:09:48 +0000 Subject: [PATCH 01/39] Fix style when showing full weather report --- .scripts/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather index a6c8d751..4b7bbb6e 100755 --- a/.scripts/statusbar/weather +++ b/.scripts/statusbar/weather @@ -3,7 +3,7 @@ location="" case $BLOCK_BUTTON in - 1) $TERMINAL -e less -S ~/.weatherreport ;; + 1) $TERMINAL -e less -Srf ~/.weatherreport ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module: - Click for wttr.in forecast. ☔: Chance of rain/snow From 441cef8ada8841500983210fafd43ab69de09914 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 22 Dec 2018 19:26:02 -0500 Subject: [PATCH 02/39] shortcut sourcing now non-automatic --- .bashrc | 8 +++----- .config/ranger/rc.conf | 3 +++ .config/ranger/shortcuts.conf | 0 .scripts/tools/shortcuts | 22 +++------------------- 4 files changed, 9 insertions(+), 24 deletions(-) create mode 100644 .config/ranger/shortcuts.conf diff --git a/.bashrc b/.bashrc index 2040b2ee..1bf2cb97 100644 --- a/.bashrc +++ b/.bashrc @@ -9,11 +9,9 @@ stty -ixon # Disable ctrl-s and ctrl-q. shopt -s autocd #Allows you to cd into directory merely by typing the directory name. HISTSIZE= HISTFILESIZE= # Infinite history. -# Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file). -if [ "$EUID" -ne 0 ] - then export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" - else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" -fi +export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" + +[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases export GPG_TTY=$(tty) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf index 9e67b37b..ecd73731 100644 --- a/.config/ranger/rc.conf +++ b/.config/ranger/rc.conf @@ -515,3 +515,6 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po #Downloading map ytv console shell youtube-dl -ic%space map yta console shell youtube-dl -xic%space + +# Source shortcuts +source ~/.config/ranger/shortcuts.conf diff --git a/.config/ranger/shortcuts.conf b/.config/ranger/shortcuts.conf new file mode 100644 index 00000000..e69de29b diff --git a/.scripts/tools/shortcuts b/.scripts/tools/shortcuts index 5ccb114b..9a4ded2c 100755 --- a/.scripts/tools/shortcuts +++ b/.scripts/tools/shortcuts @@ -1,12 +1,4 @@ #!/bin/bash - -# Shell rc file (i.e. bash vs. zsh, etc.) -shellrc="$HOME/.bashrc" - -# Bookmark file locations -bmdirs="$HOME/.bmdirs" -bmfiles="$HOME/.bmfiles" - # Output locations. Unactivated progs should go to /dev/null. shell_shortcuts="$HOME/.shortcuts" ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" @@ -15,24 +7,16 @@ fish_shortcuts="/dev/null" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null -#echo "abbr \\" > "$fish_shortcuts" +echo "abbr \\" > "$fish_shortcuts" echo "alias \\" > "$shell_shortcuts" -# Ensure text of argument 1 exists in the file argument 2 -ensure() { (grep "$1" "$2")>/dev/null 2>&1 || echo "$1" >> "$2" ;} - -ensure "source $shell_shortcuts" "$shellrc" -ensure "source $HOME/.config/ranger/shortcuts.conf" "$HOME/.config/ranger/rc.conf" -#ensure "config.source('shortcuts.py')" "$HOME/.config/qutebrowser/config.py" -#ensure "source $HOME/.config/fish/shortcuts.fish" "$HOME/.config/fish/config.fish" - # Format the `bmdirs` file in the correct syntax and sent it to all three configs. -sed "s/#.*$//;/^$/d" "$bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ >(awk '{print $1, "\"cd " $2 "; and ls -a\" \\"}' >> "$fish_shortcuts") \ >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `configs` file in the correct syntax and sent it to both configs. -sed "s/#.*$//;/^$/d" "$bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^$\s*/d" "$HOME/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print $1, "\"$EDITOR "$2"\" \\"}' >> "$fish_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" From 9b353a51481a87b53376b78d47a0110bcb7facc7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 22 Dec 2018 19:39:14 -0500 Subject: [PATCH 03/39] brainlethood fixed --- .scripts/tools/shortcuts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/tools/shortcuts b/.scripts/tools/shortcuts index 9a4ded2c..0ec0463e 100755 --- a/.scripts/tools/shortcuts +++ b/.scripts/tools/shortcuts @@ -17,6 +17,6 @@ sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmdirs" | tee >(awk '{print $1"=\"cd "$2" && | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" # Format the `configs` file in the correct syntax and sent it to both configs. -sed "s/\s*#.*$//;/^$\s*/d" "$HOME/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print $1, "\"$EDITOR "$2"\" \\"}' >> "$fish_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" From 6dc4bec778148cf4a53939dfdf4fea91c476febd Mon Sep 17 00:00:00 2001 From: Anders Damsgaard Date: Sun, 23 Dec 2018 17:30:42 +0100 Subject: [PATCH 04/39] Add option to mirror displays with external resolution priority --- .scripts/i3cmds/displayselect | 37 ++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect index c5f751a2..3ffc4f38 100755 --- a/.scripts/i3cmds/displayselect +++ b/.scripts/i3cmds/displayselect @@ -6,11 +6,38 @@ # I plan on adding a routine from multi-monitor setups later. twoscreen() { # If multi-monitor is selected and there are two screens. - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary") - direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto - } + + mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") + # Mirror displays using native resolution of external display and a scaled + # version for the internal display + if [ "$mirror" = "yes" ]; then + external=$(echo "$screens" | dmenu -i -p "Select external display:") + internal=$(echo "$screens" | grep -v "$external") + + res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \ + tail -n 1 | awk '{print $1}') + res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \ + tail -n 1 | awk '{print $1}') + + res_ext_x=$(echo $res_external | sed 's/x.*//') + res_ext_y=$(echo $res_external | sed 's/.*x//') + res_int_x=$(echo $res_internal | sed 's/x.*//') + res_int_y=$(echo $res_internal | sed 's/.*x//') + + scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) + scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) + + xrandr --output "$external" --auto \ + --output "$internal" --auto --same-as "$external" \ + --scale "$scale_x"x"$scale_y" + else + + primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + secondary=$(echo "$screens" | grep -v "$primary") + direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") + xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto + fi + } morescreen() { # If multi-monitor is selected and there are more than two screens. primary=$(echo "$screens" | dmenu -i -p "Select primary display:") From d1aea08dd62b46786f132f98e1398a40e0d1b6b5 Mon Sep 17 00:00:00 2001 From: Anders Damsgaard Date: Sun, 23 Dec 2018 17:51:28 +0100 Subject: [PATCH 05/39] Make sure native scaling is restored when selecting single display --- .scripts/i3cmds/displayselect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect index 3ffc4f38..9822b12e 100755 --- a/.scripts/i3cmds/displayselect +++ b/.scripts/i3cmds/displayselect @@ -65,7 +65,7 @@ chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p case "$chosen" in "manual selection") arandr ; exit ;; "multi-monitor") multimon ;; - *) xrandr --output "$chosen" --auto $(echo "$screens" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; + *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$screens" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; esac # Fix feh background if screen size/arangement has changed. From 8891e7d099f299fe47f4c19d340a9e0751d57077 Mon Sep 17 00:00:00 2001 From: Tom Jansen Date: Sun, 23 Dec 2018 18:07:16 +0100 Subject: [PATCH 06/39] add vfat support to dmenumount --- .scripts/i3cmds/dmenumount | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.scripts/i3cmds/dmenumount b/.scripts/i3cmds/dmenumount index 431141ff..661a5245 100755 --- a/.scripts/i3cmds/dmenumount +++ b/.scripts/i3cmds/dmenumount @@ -19,7 +19,12 @@ mountusb() { \ chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0 getmount "/mnt /media /mount /home -maxdepth 5 -type d" - sudo -A mount "$chosen" "$mp" && notify-send "$chosen mounted to $mp." + partitiontype="$(lsblk -no "fstype" "$chosen")" + case "$partitiontype" in + "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;; + *) sudo -A mount "$chosen" "$mp";; + esac + notify-send "$chosen mounted to $mp." } mountandroid() { \ From 4dcd3d8de61c99d6db8ff6c73d1297fd1a0d894a Mon Sep 17 00:00:00 2001 From: Anders Damsgaard Date: Sun, 23 Dec 2018 19:11:22 +0100 Subject: [PATCH 07/39] Enforce native scale for xrandr commands --- .scripts/i3cmds/displayselect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect index 9822b12e..0bd612ec 100755 --- a/.scripts/i3cmds/displayselect +++ b/.scripts/i3cmds/displayselect @@ -11,7 +11,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. # Mirror displays using native resolution of external display and a scaled # version for the internal display if [ "$mirror" = "yes" ]; then - external=$(echo "$screens" | dmenu -i -p "Select external display:") + external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:") internal=$(echo "$screens" | grep -v "$external") res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \ @@ -27,7 +27,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) - xrandr --output "$external" --auto \ + xrandr --output "$external" --auto --scale 1.0x1.0 \ --output "$internal" --auto --same-as "$external" \ --scale "$scale_x"x"$scale_y" else @@ -35,7 +35,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. primary=$(echo "$screens" | dmenu -i -p "Select primary display:") secondary=$(echo "$screens" | grep -v "$primary") direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto + xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 fi } From 7bcac0476ab50d719c0b2e2469871a85760ab08f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Dec 2018 18:29:48 -0500 Subject: [PATCH 08/39] browser fix --- .scripts/tools/dmenuhandler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/tools/dmenuhandler b/.scripts/tools/dmenuhandler index f00178b7..9da9d57e 100755 --- a/.scripts/tools/dmenuhandler +++ b/.scripts/tools/dmenuhandler @@ -8,7 +8,7 @@ case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube- "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;; "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; - browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;; + browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;; feh) setsid feh "$1" >/dev/null 2>&1 & ;; w3m) w3m "$1" >/dev/null 2>&1 ;; "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; From a9b704812763fdc536de9a3fcc624c6fa893d9a5 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Dec 2018 18:30:45 -0500 Subject: [PATCH 09/39] tutorials if null --- .scripts/i3cmds/tutorialvids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/i3cmds/tutorialvids b/.scripts/i3cmds/tutorialvids index 2743bfc4..1449cbe7 100755 --- a/.scripts/i3cmds/tutorialvids +++ b/.scripts/i3cmds/tutorialvids @@ -15,4 +15,4 @@ 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 | awk '{print $1}')\s" | sed 's/.*\t//')" +echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 20 | awk '{print $1}')\s" | sed 's/.*\t//' | xargs -r mpv From 9386a5bf600e4a1b193facd619302615d80a97d5 Mon Sep 17 00:00:00 2001 From: MateuszOkulus Date: Fri, 28 Dec 2018 18:05:28 +0100 Subject: [PATCH 10/39] fix showclip --- .scripts/i3cmds/showclip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/i3cmds/showclip b/.scripts/i3cmds/showclip index 57644870..9f8a6b9c 100755 --- a/.scripts/i3cmds/showclip +++ b/.scripts/i3cmds/showclip @@ -9,7 +9,7 @@ clip=$(xclip -o -selection clipboard) prim=$(xclip -o -selection primary) -[ "$prim" != "" ] && notify-send "Clipboard: +[ "$clip" != "" ] && notify-send "Clipboard: $clip" -[ "$clip" != "" ] && notify-send "Primary: +[ "$prim" != "" ] && notify-send "Primary: $prim" From e6f6a83082551692770f6c83c2112fb2a2f961ea Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 30 Dec 2018 18:40:57 -0500 Subject: [PATCH 11/39] own mounted drives --- .scripts/i3cmds/dmenumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/i3cmds/dmenumount b/.scripts/i3cmds/dmenumount index 661a5245..4de7438f 100755 --- a/.scripts/i3cmds/dmenumount +++ b/.scripts/i3cmds/dmenumount @@ -22,7 +22,7 @@ mountusb() { \ partitiontype="$(lsblk -no "fstype" "$chosen")" case "$partitiontype" in "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;; - *) sudo -A mount "$chosen" "$mp";; + *) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";; esac notify-send "$chosen mounted to $mp." } From 2e8fa83f194855e000acac051fdaba9fa5cbd857 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 30 Dec 2018 18:41:34 -0500 Subject: [PATCH 12/39] bash only run bashrc --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index a26b4cea..0fbcc8e5 100644 --- a/.profile +++ b/.profile @@ -25,10 +25,10 @@ export LESS_TERMCAP_ue=$'\E[0m' # reset underline [ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1 -[ -f ~/.bashrc ] && source "$HOME/.bashrc" +echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "$HOME/.bashrc" # Start graphical server if i3 not already running. [ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && exec startx -# Switch escape and caps and use wal colors if tty: +# Switch escape and caps if tty: sudo -n loadkeys ~/.scripts/ttymaps.kmap 2>/dev/null From 690cad2bfaa36e2eaa213be1ede89c25ef9daa44 Mon Sep 17 00:00:00 2001 From: Laith Date: Tue, 1 Jan 2019 23:07:33 +0100 Subject: [PATCH 13/39] fixing typos --- .scripts/i3cmds/dmenurecord | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.scripts/i3cmds/dmenurecord b/.scripts/i3cmds/dmenurecord index d5ed889f..7f0ea72a 100755 --- a/.scripts/i3cmds/dmenurecord +++ b/.scripts/i3cmds/dmenurecord @@ -52,7 +52,7 @@ video() { ffmpeg \ } webcamhidef() { ffmpeg \ - -f v412 \ + -f v4l2 \ -i /dev/video0 \ -video_size 1920x1080 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & @@ -61,7 +61,7 @@ webcamhidef() { ffmpeg \ } webcam() { ffmpeg \ - -f v412 \ + -f v4l2 \ -i /dev/video0 \ -video_size 640x480 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & @@ -85,8 +85,8 @@ askrecording() { \ screencast) screencast;; audio) audio;; video) video;; - webcam) webcamrecord;; - "webcam (hi-def)") webcamrecord;; + webcam) webcam;; + "webcam (hi-def)") webcamhidef;; esac } From c347e748c98d6a7161d176aa11297f9280d86de3 Mon Sep 17 00:00:00 2001 From: Laith Date: Wed, 2 Jan 2019 02:54:34 +0100 Subject: [PATCH 14/39] Change TRUEBROWSER to BROWSER --- .scripts/tools/linkhandler | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/tools/linkhandler b/.scripts/tools/linkhandler index 4f364fcb..abd6f0a8 100755 --- a/.scripts/tools/linkhandler +++ b/.scripts/tools/linkhandler @@ -10,7 +10,7 @@ scihub="http://sci-hub.tw/" # If no url given. Opens browser. For using script as $BROWSER. -[ -z "$1" ] && { "$TRUEBROWSER"; exit; } +[ -z "$1" ] && { "$BROWSER"; exit; } case "$1" in *mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) @@ -23,5 +23,5 @@ case "$1" in setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;; *) if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" - else setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & fi ;; + else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;; esac From 6f87d56cd8079d08aa2ab9496084e5c30978f955 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 10:47:27 -0500 Subject: [PATCH 15/39] profile changes --- .profile | 5 ++-- .vim/autoload/plug.vim | 61 ------------------------------------------ 2 files changed, 2 insertions(+), 64 deletions(-) diff --git a/.profile b/.profile index 0fbcc8e5..0a2c6fd1 100644 --- a/.profile +++ b/.profile @@ -2,16 +2,15 @@ # Profile file. Runs on login. # Adds `~/.scripts` and all subdirectories to $PATH -export PATH="$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')$PATH" +export PATH="$PATH:$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')" export EDITOR="vim" export TERMINAL="st" export BROWSER="firefox" export READER="zathura" export BIB="$HOME/Documents/LaTeX/uni.bib" export REFER="$HOME/.referbib" -# PIX is here I have LARBS keep icons. Subject to change, hence a variable. -export PIX="$HOME/.scripts/pix" export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass" +export PIX="$HOME/.pix/" # less/man colors export LESS=-R diff --git a/.vim/autoload/plug.vim b/.vim/autoload/plug.vim index 4e056308..ace33a88 100644 --- a/.vim/autoload/plug.vim +++ b/.vim/autoload/plug.vim @@ -1,66 +1,5 @@ -" vim-plug: Vim plugin manager -" ============================ -" -" Download plug.vim and put it in ~/.vim/autoload -" -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" -" Edit your .vimrc -" -" call plug#begin('~/.vim/plugged') -" -" " Make sure you use single quotes -" -" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align -" Plug 'junegunn/vim-easy-align' -" -" " Any valid git URL is allowed -" Plug 'https://github.com/junegunn/vim-github-dashboard.git' -" -" " Multiple Plug commands can be written in a single line using | separators -" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' -" -" " On-demand loading -" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } -" -" " Using a non-master branch -" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } -" -" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) -" Plug 'fatih/vim-go', { 'tag': '*' } -" -" " Plugin options -" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } -" -" " Plugin outside ~/.vim/plugged with post-update hook -" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -" -" " Unmanaged plugin (manually installed and updated) -" Plug '~/my-prototype-plugin' -" -" " Initialize plugin system -" call plug#end() -" -" Then reload .vimrc and :PlugInstall to install plugins. -" -" Plug options: -" -"| Option | Description | -"| ----------------------- | ------------------------------------------------ | -"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | -"| `rtp` | Subdirectory that contains Vim plugin | -"| `dir` | Custom directory for the plugin | -"| `as` | Use different name for the plugin | -"| `do` | Post-update hook (string or funcref) | -"| `on` | On-demand loading: Commands or ``-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" " More information: https://github.com/junegunn/vim-plug " -" " Copyright (c) 2017 Junegunn Choi " " MIT License From a35d089ec6c92dc4d5d0563f3fc0e144380045dc Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:04:07 -0500 Subject: [PATCH 16/39] weather signal fix --- .config/i3blocks/config | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index fbfb938f..89e3c1b7 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -28,6 +28,7 @@ signal=7 [weather] interval=3600 +signal=5 [mailbox] label=📬 From 07364aeaca6fae238d0569932829247388d5102b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:06:15 -0500 Subject: [PATCH 17/39] recording files moved to /tmp/ for cleanliness --- .config/i3blocks/config | 2 +- .scripts/i3cmds/dmenurecord | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 89e3c1b7..980d7910 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -3,7 +3,7 @@ separator_block_width=15 markup=pango [record] -command=cat ~/.recordingicon +command=cat /tmp/recordingicon interval=once signal=9 diff --git a/.scripts/i3cmds/dmenurecord b/.scripts/i3cmds/dmenurecord index 7f0ea72a..0047e7a0 100755 --- a/.scripts/i3cmds/dmenurecord +++ b/.scripts/i3cmds/dmenurecord @@ -10,15 +10,15 @@ # If there is already a running instance, user will be prompted to end it. updateicon() { \ - echo "$1" > ~/.recordingicon + echo "$1" > /tmp/recordingicon pkill -RTMIN+9 i3blocks } killrecording() { - recpid="$(cat ~/.recordingpid)" + recpid="$(cat /tmp/recordingpid)" # kill with SIGTERM, allowing finishing touches. kill -15 "$recpid" - rm -f ~/.recordingpid + rm -f /tmp/recordingpid updateicon "" pkill -RTMIN+9 i3blocks # even after SIGTERM, ffmpeg may still run, so SIGKILL it. @@ -37,7 +37,7 @@ screencast() { \ -r 30 \ -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "⏺️🎙️" } @@ -47,7 +47,7 @@ video() { ffmpeg \ -i :0.0 \ -c:v libx264 -qp 0 -r 30 \ "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "⏺️" } @@ -56,7 +56,7 @@ webcamhidef() { ffmpeg \ -i /dev/video0 \ -video_size 1920x1080 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎥" } @@ -65,7 +65,7 @@ webcam() { ffmpeg \ -i /dev/video0 \ -video_size 640x480 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎥" } @@ -75,7 +75,7 @@ audio() { \ -f alsa -i default \ -c:a flac \ "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & - echo $! > ~/.recordingpid + echo $! > /tmp/recordingpid updateicon "🎙️" } @@ -101,5 +101,5 @@ case "$1" in audio) audio;; video) video;; kill) killrecording;; - *) ([ -f ~/.recordingpid ] && asktoend && exit) || askrecording;; + *) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;; esac From 4bab39ad70cb5f5cabad3ee647c4072d0129b7a7 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:09:31 -0500 Subject: [PATCH 18/39] weather report also moved to /tmp/ --- .scripts/cron/getforecast | 2 +- .scripts/statusbar/weather | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.scripts/cron/getforecast b/.scripts/cron/getforecast index 2760c893..25386d45 100755 --- a/.scripts/cron/getforecast +++ b/.scripts/cron/getforecast @@ -2,5 +2,5 @@ # Updates weather forecast ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit location="$1"; [ -z "$location" ] || location="$location+" -curl -s "wttr.in/$location" > ~/.weatherreport +curl -s "wttr.in/$location" > /tmp/weatherreport pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated." diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather index 00abda23..5024681b 100755 --- a/.scripts/statusbar/weather +++ b/.scripts/statusbar/weather @@ -2,7 +2,7 @@ [ "$(stat -c %y .weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast case $BLOCK_BUTTON in - 1) $TERMINAL -e less -Srf ~/.weatherreport ;; + 1) $TERMINAL -e less -S /tmp/weatherreport ;; 3) pgrep -x dunst >/dev/null && notify-send "🌈 Weather module: - Click for wttr.in forecast. ☔: Chance of rain/snow @@ -10,6 +10,6 @@ case $BLOCK_BUTTON in 🌞: Daily high" ;; esac -printf "%s" "$(sed '16q;d' ~/.weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" +printf "%s" "$(sed '16q;d' /tmp/weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')" -sed '13q;d' ~/.weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' +sed '13q;d' /tmp/weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' From bf3c631cec86921ee0d9d7049d5f1c7daf3d0ab2 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:11:38 -0500 Subject: [PATCH 19/39] weather report update fix --- .scripts/statusbar/weather | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather index 5024681b..f3699ee0 100755 --- a/.scripts/statusbar/weather +++ b/.scripts/statusbar/weather @@ -1,5 +1,5 @@ #!/bin/sh -[ "$(stat -c %y .weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast +[ "$(stat -c %y /tmp/weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast case $BLOCK_BUTTON in 1) $TERMINAL -e less -S /tmp/weatherreport ;; From f031a2d502964b9171f87a79afbecea712e1b362 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:26:53 -0500 Subject: [PATCH 20/39] SCRIPTS readme updates for renames etc. --- .scripts/SCRIPTS.md | 75 +++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md index 6756039d..b6eef4ff 100644 --- a/.scripts/SCRIPTS.md +++ b/.scripts/SCRIPTS.md @@ -12,59 +12,72 @@ export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" For modules used in i3blocks. -### `i3battery` +### `battery` i3blocks module. Shows available power remaining with icon indicating battery status. Colors indicate different levels of charge. -### `i3mail` +### `clock` + +Shows time and date. If clicked, brings up calender or coming calcuse events. + +### `cpu` + +Shows CPU temperature. If clicked, shows most processor-intensive processes. + +### `help` + +Module which appears as a question mark. Brings up readme if clicked. + +### `internet` + +Shows whether machine is connected to wifi and ethernet. If clicked, brings up `nmtui`. + +### `mailbox` i3blocks module for use with mutt-wizard. Shows unread mail and if `mailsync.sh` is running. -### `i3mpd` +### `mem` + +Shows memory usage. If clicked, shows most memory-intensive processes. + +### `music` i3blocks module. Shows current song; if paused, name will be grayed and italic. -### `i3mpdupdate` +### `mpdupdate` A daemon running by default that will update the i3mpd block on mpd change. -### `i3pacman` +### `news` + +Shows unread newsboat articles. Brings up newsboat or refreshes RSS feeds. + +### `pacpackages` i3blocks module. Detects new installable upgrades. Only works if you use cronjobs to automatically sync repositories. -### `i3torrent` - -i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or -finished (🌱). - -### `i3volume` - -i3blocks module. Shows volume percentage or mute notification. - -### `i3weather` - -i3blocks module. Gets weather forcast from wttr.in and returns today's -precipitation chance (☔), daily low (❄️) and daily high (☀️). - -### `i3wifi` - -A modified version of the i3blocks wifi module. Clicked, it brings up wifi-menu -and also appears when there is no wifi connection. - -### `popupdate` +### `popupgrade` Called by clicking on the update icon if there are new packages. Spawns a `yay` upgrade of the main Arch repos and AUR packages, updates the i3blocks module once complete. -### `popweather` +### `torrent` -The script called by clicking on the i3 weather module. Brings up the forecast -from `http://wttr.in` and will close on . +i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or +finished (🌱). +### `volume` + +i3blocks module. Shows volume percentage or mute notification. + +### `weather` + +i3blocks module. Gets weather forcast from wttr.in and returns today's +precipitation chance (☔), daily low (❄️) and daily high (☀️). ## `cron/` @@ -88,6 +101,10 @@ Gives a dunst notification if the battery is less than 25%. Not actually a cronjob, but just turns off/on all user cronjobs. +### `getforecast` + +Updates the weather forecast. This is automatically run by `weather` if there hasn't been a new forecast today. + ### `newsup` Updates newsboat RSS feeds if connected to internet. Will also display a @@ -224,7 +241,7 @@ Gives a dmenu prompt for mounting USB drives or Android devices. Bound to ### `dmenurecord` Gives a list of recording commands: `audio`, `video` and `screencast` (both) in -dmenu for selection. Bound to `mod+Print Screen` by default. Should be kill by +dmenu for selection. Bound to `mod+PrintScreen` by default. Should be killed by `killrecording`. ### `dmenuumount` From f79911f67c5151c05c480dd05707ea9856f7ac08 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 2 Jan 2019 11:33:45 -0500 Subject: [PATCH 21/39] SCRIPTs file now with lists, not subheadings --- .scripts/SCRIPTS.md | 345 +++++++------------------------------------- 1 file changed, 56 insertions(+), 289 deletions(-) diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md index b6eef4ff..34bb01bb 100644 --- a/.scripts/SCRIPTS.md +++ b/.scripts/SCRIPTS.md @@ -12,309 +12,76 @@ export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" For modules used in i3blocks. -### `battery` - -i3blocks module. Shows available power remaining with icon indicating battery -status. Colors indicate different levels of charge. - -### `clock` - -Shows time and date. If clicked, brings up calender or coming calcuse events. - -### `cpu` - -Shows CPU temperature. If clicked, shows most processor-intensive processes. - -### `help` - -Module which appears as a question mark. Brings up readme if clicked. - -### `internet` - -Shows whether machine is connected to wifi and ethernet. If clicked, brings up `nmtui`. - -### `mailbox` - -i3blocks module for use with mutt-wizard. Shows unread mail and if -`mailsync.sh` is running. - -### `mem` - -Shows memory usage. If clicked, shows most memory-intensive processes. - -### `music` - -i3blocks module. Shows current song; if paused, name will be grayed and italic. - -### `mpdupdate` - -A daemon running by default that will update the i3mpd block on mpd change. - -### `news` - -Shows unread newsboat articles. Brings up newsboat or refreshes RSS feeds. - -### `pacpackages` - -i3blocks module. Detects new installable upgrades. Only works if you use -cronjobs to automatically sync repositories. - -### `popupgrade` - -Called by clicking on the update icon if there are new packages. Spawns a `yay` -upgrade of the main Arch repos and AUR packages, updates the i3blocks module -once complete. - -### `torrent` - -i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or -finished (🌱). - -### `volume` - -i3blocks module. Shows volume percentage or mute notification. - -### `weather` - -i3blocks module. Gets weather forcast from wttr.in and returns today's -precipitation chance (☔), daily low (❄️) and daily high (☀️). +- `battery` -- i3blocks module. Shows available power remaining with icon indicating battery status. Colors indicate different levels of charge. +- `clock` -- Shows time and date. If clicked, brings up calender or coming calcuse events. +- `cpu` -- Shows CPU temperature. If clicked, shows most processor-intensive processes. +- `help` -- Module which appears as a question mark. Brings up readme if clicked. +- `internet` -- Shows whether machine is connected to wifi and ethernet. If clicked, brings up `nmtui`. +- `mailbox` -- i3blocks module for use with mutt-wizard. Shows unread mail and if `mailsync.sh` is running. +- `mem` -- Shows memory usage. If clicked, shows most memory-intensive processes. +- `music` -- i3blocks module. Shows current song; if paused, name will be grayed and italic. +- `mpdupdate` -- A daemon running by default that will update the i3mpd block on mpd change. +- `news` -- Shows unread newsboat articles. Brings up newsboat or refreshes RSS feeds. +- `pacpackages` -- i3blocks module. Detects new installable upgrades. Only works if you use cronjobs to automatically sync repositories. +- `popupgrade` -- Called by clicking on the update icon if there are new packages. Spawns a `yay` upgrade of the main Arch repos and AUR packages, updates the i3blocks module once complete. +- `torrent` -- i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or finished (🌱). +- `volume` -- i3blocks module. Shows volume percentage or mute notification. +- `weather` -- i3blocks module. Gets weather forcast from wttr.in and returns today's precipitation chance (☔), daily low (❄️) and daily high (☀️). ## `cron/` For scripts meant to be cronjobs. None are active by default on LARBS. -### `checkup` - -If connected to internet, syncs package repositories and downloads (but does -not install) any potential updates. Gives `notify-send` notifications of when -it is active since other `pacman` install commands cannot be run -simultaneously. - -You may need to grant your user the ability to run `pacman -Syyuw --noconfirm` -without a password (done in `/etc/sudoers`). - -### `cronbat` - -Gives a dunst notification if the battery is less than 25%. - -### `crontog` - -Not actually a cronjob, but just turns off/on all user cronjobs. - -### `getforecast` - -Updates the weather forecast. This is automatically run by `weather` if there hasn't been a new forecast today. - -### `newsup` - -Updates newsboat RSS feeds if connected to internet. Will also display a -newspaper update icon on i3blocks if it has not be user disabled. +- `checkup` -- If connected to internet, syncs package repositories and downloads (but does not install) any potential updates. Gives `notify-send` notifications of when it is active since other `pacman` install commands cannot be run simultaneously. You may need to grant your user the ability to run `pacman -Syyuw --noconfirm` without a password (done in `/etc/sudoers`). +- `cronbat` -- Gives a dunst notification if the battery is less than 25%. +- `crontog` -- Not actually a cronjob, but just turns off/on all user cronjobs. +- `getforecast` -- Updates the weather forecast. This is automatically run by `weather` if there hasn't been a new forecast today. +- `newsup` -- Updates newsboat RSS feeds if connected to internet. Will also display a newspaper update icon on i3blocks if it has not be user disabled. ## `tools/` Scripts intended to be run either manually by the user or linked to a shortcut in vim or another program. -### `compiler` - -Compiles a markdown, R markdown or LaTeX document with the approriate command. -Will also run `make && sudo make install` if in a `config.h` file. Otherwise -it will create a sent presentation. This can be thought of a general output -handler. I have it bound to `c` in vim. - -### `dmenuhandler` - -Give this script a url and it will offer dmenu options for opening it. Used by -`newsboat` and some other programs as a link handler. - -### `extract` - -Will detect file type of archive and run appropriate extraction command. - -### `getbib` - -Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to -search for the .pdf's DOI. Returns nothing if none detected. - -### `getkeys` - -Get the LARBS documentation on what bindings exist for main programs. - -### `linkhandler` - -The automatic link handler used by `newsboat` and other programs. Urls of video -sites or of video files are opened in `mpv`, images are downloaded/opened in -`feh`, music files are downloaded with `wget` and all other urls are opened in -the default browser. - -### `lmc` - -A music controller that simplifies music/audio management and improves the -interface with i3blocks. Check inside to see what it does. This is what i3 -audio/music commands run by default. If you use a difference music system or -ALSA, you can change this script rather than changing all the shortcuts in -different places. - -### `note` - -Give this script some text/a message as an argument. It will print it to the -terminal, and if `dunst` is running, display a notification. - -### `opout` - -"Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or -`.rmd` file, or if given an `.html` file, will open it in the browser. Bound -to `p` in my vim config to reveal typical output. - -### `pauseallmpv` - -Pauses all mpv instances by sending the `,` key to each. Used by several -scripts, but can be used alone as well. It will not pause an audio only mpv -instance. If you know how to add a hack to do this, feel free to PR it or email -me an addition. - -### `remaps` - -Remaps capslock to escape when pressed and super/mod when held. Maps the menu -key to super as well. Runs the US international keyboard setup. If you want -another keyboard setup, edit this fine. - -### `shortcuts` - -For updating bash and ranger shortcuts. Reads `~/.key_directories` and -`~/.key_files` for pairs of keypresses and directories and files, then -autoproduces bash aliases and ranger shortcuts for them which output to -`~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are -read automatically by my bash and ranger configs. You don't have to run this -script manually though, as it's run by vim whenever you edit one of the -`~/.key_*` files. - -### `speedvid` - -Speed up a given video file (`$1`) by a given ammount (`$2`). - -### `tpb` - -Search Pirate Bay for the certain search terms given as arguments. - -### `texclear` - -Remove all `.tex` related build files. This is run by my vim when I stop -editing any `.tex` file. - -### `transadd` - -The mimeapp default script for handling torrent magnet links. Starts -`transmission-daemon` if not running and adds the link. +- `compiler` -- Compiles a markdown, R markdown or LaTeX document with the approriate command. Will also run `make && sudo make install` if in a `config.h` file. Otherwise it will create a sent presentation. This can be thought of a general output handler. I have it bound to `c` in vim. +- `dmenuhandler` -- Give this script a url and it will offer dmenu options for opening it. Used by `newsboat` and some other programs as a link handler. +- `extract` -- Will detect file type of archive and run appropriate extraction command. +- `getbib` -- Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to search for the .pdf's DOI. Returns nothing if none detected. +- `getkeys` -- Get the LARBS documentation on what bindings exist for main programs. +- `linkhandler` -- The automatic link handler used by `newsboat` and other programs. Urls of video sites or of video files are opened in `mpv`, images are downloaded/opened in `feh`, music files are downloaded with `wget` and all other urls are opened in the default browser. +- `lmc` -- A music controller that simplifies music/audio management and improves the interface with i3blocks. Check inside to see what it does. This is what i3 audio/music commands run by default. If you use a difference music system or ALSA, you can change this script rather than changing all the shortcuts in different places. +- `note` -- Give this script some text/a message as an argument. It will print it to the terminal, and if `dunst` is running, display a notification. +- `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `p` in my vim config to reveal typical output. +- `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition. +- `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine. +- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files. +- `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`). +- `tpb` -- Search Pirate Bay for the certain search terms given as arguments. +- `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file. +- `transadd` -- The mimeapp default script for handling torrent magnet links. Starts `transmission-daemon` if not running and adds the link. ## `i3cmds` These are scripts linked to bindings in i3. They typically perform user-interface actions or involve dmenu. -### `bottomleft` and `bottomright` - -Makes the currently selected window float in one of the bottom corners of the -screen. `bottomleft` is bound to `mod+B` by default. - -### `camtoggle` - -Starts/kills /dev/video0 webcam. Placed in bottom right by default. - -### `ddspawn` - -This is the script called to create, show and hide the dropdown tmux terminal -mapped to `mod+u`, but also the dropdown calculator mapped to `mod+a`. Give the -script an argument that is a script the window will run. If a window does not -already exist, `ddspawn` creates it, if it does, `ddspawn` will toggle its -visibility. The the script itself for usage. - -### `displayselect` - -Select which displays to use. Bound to `mod+F3`. - -### `dmenumount` - -Gives a dmenu prompt for mounting USB drives or Android devices. Bound to -`mod+F9`. Will do nothing if none are available. - -### `dmenurecord` - -Gives a list of recording commands: `audio`, `video` and `screencast` (both) in -dmenu for selection. Bound to `mod+PrintScreen` by default. Should be killed by -`killrecording`. - -### `dmenuumount` - -Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing -if none are mounted. It will not try to unmount essential system partitions. - -### `dmenuunicode` - -Shows a searchable dmenu prompt of emoji characters. The selected emoji is -copied to the system clipboard, while its character code is copied to primary -selection (middle mouse button). - -### `dropdowncalc` - -The dropdown calculator script called by `ddspawn` and bound to `mod+a` by -default. Will run an R calculator if installed, otherwise python. - -### `ducksearch` - -Show a dmenu prompt and search for the inputed text in DuckDuckGo. Can take -bangtags as expected, i.e. typing in `!aw Arch Linux` will search the Arch Wiki -for "Arch Linux" or `!yt Luke Smith` will search YouTube for "Luke Smith", etc. - -### `i3resize` - -A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`. - -### `killrecording` - -End a recording started by `dmenurecord` the proper way without file trucation -or lingering background processes, mapped to `mod+Delete` by default. - -### `lockscreen` - -The screen locker. Gives a confirm prompt and if user says yes, all audio will -be paused and the screen will be distorted and locked and screen will soon time -out. User must insert password to unlock. Mapped to `mod+x` by default. - -### `newspod` - -A silly line that has a script all to itself due to i3's idiosyncracies. Starts -`newsboat`, if `newsboat` cannot open because of another instance being open, -opens `podboat`. - -### `prompt` - -Gives a Yes/No prompt to a question given as an argument. Used by numerous -bindings like `mod+shift+x`, `mod+shift+backspace` and `mod+shift+escape`. - -### `samedir` - -Opens a terminal window in the same directory as the window currently -selection. Bound to `mod+shift+enter`. - -### `td-toggle` - -Gives a dmenu prompt to start `transmission-daemon` if not running, or the kill -it if it is. Obviously you need `transmission-cli` installed for this to work. -Mapped to `mod+F7` by default. - -### `tmuxdd` - -The startup script for the dropdown terminal (toggleable with `mod+u`). Either -attaches to an existing tmux session or begins a new one. - -### `toggletouchpad` - -As the name suggests, turns off TouchPad if on, and turns it on if off. -Requires `xf86-input-synaptics`. If your laptop has a special button for this, -it will be mapped by default. - -### `tutorialvids` - -A dmenu prompt that gives some options of tutorial videos to watch. Bound to -`mod+shift+e`. +- `bottomleft` and `bottomright` -- Makes the currently selected window float in one of the bottom corners of the screen. `bottomleft` is bound to `mod+B` by default. +- `camtoggle` -- Starts/kills /dev/video0 webcam. Placed in bottom right by default. +- `ddspawn` -- This is the script called to create, show and hide the dropdown tmux terminal mapped to `mod+u`, but also the dropdown calculator mapped to `mod+a`. Give the script an argument that is a script the window will run. If a window does not already exist, `ddspawn` creates it, if it does, `ddspawn` will toggle its visibility. The the script itself for usage. +- `displayselect` -- Select which displays to use. Bound to `mod+F3`. +- `dmenumount` -- Gives a dmenu prompt for mounting USB drives or Android devices. Bound to `mod+F9`. Will do nothing if none are available. +- `dmenurecord` -- Gives a list of recording commands: `audio`, `video` and `screencast` (both) in dmenu for selection. Bound to `mod+PrintScreen` by default. Should be killed by `killrecording`. +- `dmenuumount` -- Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing if none are mounted. It will not try to unmount essential system partitions. +- `dmenuunicode` -- Shows a searchable dmenu prompt of emoji characters. The selected emoji is copied to the system clipboard, while its character code is copied to primary selection (middle mouse button). +- `dropdowncalc` -- The dropdown calculator script called by `ddspawn` and bound to `mod+a` by default. Will run an R calculator if installed, otherwise python. +- `ducksearch` -- Show a dmenu prompt and search for the inputed text in DuckDuckGo. Can take bangtags as expected, i.e. typing in `!aw Arch Linux` will search the Arch Wiki for "Arch Linux" or `!yt Luke Smith` will search YouTube for "Luke Smith", etc. +- `i3resize` -- A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`. +- `killrecording` -- End a recording started by `dmenurecord` the proper way without file trucation or lingering background processes, mapped to `mod+Delete` by default. +- `lockscreen` -- The screen locker. Gives a confirm prompt and if user says yes, all audio will be paused and the screen will be distorted and locked and screen will soon time out. User must insert password to unlock. Mapped to `mod+x` by default. +- `newspod` -- A silly line that has a script all to itself due to i3's idiosyncracies. Starts `newsboat`, if `newsboat` cannot open because of another instance being open, opens `podboat`. +- `prompt` -- Gives a Yes/No prompt to a question given as an argument. Used by numerous bindings like `mod+shift+x`, `mod+shift+backspace` and `mod+shift+escape`. +- `samedir` -- Opens a terminal window in the same directory as the window currently selection. Bound to `mod+shift+enter`. +- `td-toggle` -- Gives a dmenu prompt to start `transmission-daemon` if not running, or the kill it if it is. Obviously you need `transmission-cli` installed for this to work. Mapped to `mod+F7` by default. +- `tmuxdd` -- The startup script for the dropdown terminal (toggleable with `mod+u`). Either attaches to an existing tmux session or begins a new one. +- `toggletouchpad` -- As the name suggests, turns off TouchPad if on, and turns it on if off. Requires `xf86-input-synaptics`. If your laptop has a special button for this, it will be mapped by default. +- `tutorialvids` -- A dmenu prompt that gives some options of tutorial videos to watch. Bound to `mod+shift+e`. From 4dded8fa4642166b9a1caf2af15f1e41dccbb6a6 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 3 Jan 2019 11:49:14 -0500 Subject: [PATCH 22/39] ignore ignored packages for update icon --- .scripts/statusbar/pacpackages | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/statusbar/pacpackages b/.scripts/statusbar/pacpackages index 9e1ef22c..91648309 100755 --- a/.scripts/statusbar/pacpackages +++ b/.scripts/statusbar/pacpackages @@ -16,4 +16,4 @@ case $BLOCK_BUTTON in esac -pacman -Qu | wc -l | sed -e "s/^0$//g" +pacman -Qu | grep -v "[ignored]" | wc -l | sed -e "s/^0$//g" From 60dc1da4fd1f5c5ff2c7657244d7f39cec572361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Horv=C3=A1th?= Date: Thu, 3 Jan 2019 19:51:38 +0100 Subject: [PATCH 23/39] Simplified ddspawn, no need for pause --- .config/i3/config | 4 ++++ .scripts/i3cmds/ddspawn | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index e63e4c62..b7c5d7d7 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -39,6 +39,8 @@ for_window [instance="tmuxdd"] resize set 625 450 for_window [instance="tmuxdd"] move scratchpad for_window [instance="tmuxdd"] border pixel 3 for_window [instance="tmuxdd"] sticky enable +for_window [instance="tmuxdd"] scratchpad show +for_window [instance="tmuxdd"] move position center # Then I have a window running R I use for basic arithmetic # I'll later bind this to mod+a. @@ -47,6 +49,8 @@ for_window [instance="dropdowncalc"] resize set 800 300 for_window [instance="dropdowncalc"] move scratchpad for_window [instance="dropdowncalc"] border pixel 2 for_window [instance="dropdowncalc"] sticky enable +for_window [instance="dropdowncalc"] scratchpad show +for_window [instance="dropdowncalc"] move position center # #---Starting External Scripts---# # # Setting the background: diff --git a/.scripts/i3cmds/ddspawn b/.scripts/i3cmds/ddspawn index 0871a59f..123cecbe 100755 --- a/.scripts/i3cmds/ddspawn +++ b/.scripts/i3cmds/ddspawn @@ -6,7 +6,7 @@ # argument 1: script to run in dropdown window # all other args are interpreted as options for your terminal # My usage: -# ddpawn +# ddspawn # bindsym $mod+u exec --no-startup-id ddspawn tmuxdd # Will hide/show window running the `tmuxdd` script when I press mod+u in i3 # bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 @@ -17,9 +17,8 @@ if xwininfo -tree -root | grep "(\"$1\" "; then echo "Window detected." + i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" else echo "Window not detected... spawning." - i3 "exec --no-startup-id $TERMINAL -n $1 $(echo "$@" | cut -d ' ' -f2-) -e $1" && i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" - sleep .25 # This sleep is my laziness, will fix later (needed for immediate appearance after spawn). + i3 "exec --no-startup-id $1" fi -i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" From 56b81e956a0c9b8f52297438cea9372b43b9f830 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 3 Jan 2019 14:03:09 -0500 Subject: [PATCH 24/39] sxiv key handler added --- .config/sxiv/exec/key-handler | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 .config/sxiv/exec/key-handler diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler new file mode 100755 index 00000000..e0303f94 --- /dev/null +++ b/.config/sxiv/exec/key-handler @@ -0,0 +1,37 @@ +#!/bin/sh +while read file +do + fullpath="$(pwd)/$file" + case "$1" in + "w") + cp "$file" ~/.config/wall.png && + feh --bg-scale "$HOME/.config/wall.png" + notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." ;; + "c") + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && exit + cp "$file" "$destdir" && notify-send -i "$fullpath" "$file copied to $destdir." & + ;; + "m") + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && exit + cp "$file" "$destdir" && notify-send -i "$fullpath" "$file moved to $destdir." & + ;; + "r") + convert -rotate 90 "$file" "$file" ;; + "R") + convert -rotate -90 "$file" "$file" ;; + "f") + convert -flop "$file" "$file" ;; + "y") + echo -n "$file" | xclip -selection clipboard && + notify-send "$file copied to clipboard" & ;; + "Y") + echo -n "$fullpath" | xclip -selection clipboard && + notify-send "$fullpath copied to clipboard" & ;; + "d") + [ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;; + "G") + gimp "$file" & ;; + esac +done From 9a13230d95af8d99e18ad7e9c19e6219f004ed2c Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 3 Jan 2019 14:13:46 -0500 Subject: [PATCH 25/39] sxiv now default image viewer --- .config/mimeapps.list | 6 +++--- .config/ranger/rifle.conf | 3 +-- .local/share/applications/sxiv.desktop | 4 ++++ .scripts/i3cmds/tutorialvids | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .local/share/applications/sxiv.desktop diff --git a/.config/mimeapps.list b/.config/mimeapps.list index fa9bdb1b..85224313 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -3,6 +3,6 @@ x-scheme-handler/magnet=transmission-remote.desktop; x-scheme-handler/mailto=mutt.desktop; text/plain=vim.desktop; application/pdf=zathura.desktop; -image/png=feh.desktop; -image/jpeg=feh.desktop; -image/gif=gif.desktop; +image/png=sxiv.desktop; +image/jpeg=sxiv.desktop; +image/gif=sxiv.desktop; diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index c7836788..c6b85d0d 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -184,14 +184,13 @@ ext djvu, has atril, X, flag f = atril -- "$@" #------------------------------------------- mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" mime ^image/svg, has display, X, flag f = display -- "$@" -mime ^image/gif, has mpv, X, flag f = mpv --loop -- "$@" mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@" mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@" ext xcf, X, flag f = gimp -- "$@" +mime ^image, has sxiv, X, flag f = sxiv -a -- "$@" mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@" mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@" -mime ^image, has sxiv, X, flag f = sxiv -- "$@" mime ^image, has mirage, X, flag f = mirage -- "$@" mime ^image, has ristretto, X, flag f = ristretto "$@" mime ^image, has eog, X, flag f = eog -- "$@" diff --git a/.local/share/applications/sxiv.desktop b/.local/share/applications/sxiv.desktop new file mode 100644 index 00000000..fa810f22 --- /dev/null +++ b/.local/share/applications/sxiv.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=feh image viewer +Exec=/usr/bin/sxiv -a %u diff --git a/.scripts/i3cmds/tutorialvids b/.scripts/i3cmds/tutorialvids index 1449cbe7..5a3aa2bf 100755 --- a/.scripts/i3cmds/tutorialvids +++ b/.scripts/i3cmds/tutorialvids @@ -1,7 +1,7 @@ #!/bin/sh vidlist=" status bar https://www.youtube.com/watch?v=gKumet6b-WY -feh +sxiv (image viewer) https://www.youtube.com/watch?v=GYW9i_u5PYs 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 From 13e2d589d1a593a500bbcd0eb77b3359d479c410 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 3 Jan 2019 14:52:36 -0500 Subject: [PATCH 26/39] ddspawn fix --- .scripts/i3cmds/ddspawn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/i3cmds/ddspawn b/.scripts/i3cmds/ddspawn index 123cecbe..2c23fd6a 100755 --- a/.scripts/i3cmds/ddspawn +++ b/.scripts/i3cmds/ddspawn @@ -20,5 +20,5 @@ then i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" else echo "Window not detected... spawning." - i3 "exec --no-startup-id $1" + i3 "exec --no-startup-id $TERMINAL -n $1 $(echo "$@" | cut -d ' ' -f2-) -e $1" fi From b958aa01c58bb5a448bcb8afc24c68844a8b9a06 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 3 Jan 2019 19:06:34 -0500 Subject: [PATCH 27/39] oh god luke, wh what r u doing --- .config/nvim/init.vim | 216 +++++++++++++++++++++++++++++++++++++++++ .vimrc | 217 +----------------------------------------- 2 files changed, 217 insertions(+), 216 deletions(-) create mode 100644 .config/nvim/init.vim mode change 100644 => 120000 .vimrc diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 00000000..b462bbd3 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,216 @@ +" _ +" __ _(_)_ __ ___ _ __ ___ +" \ \ / / | '_ ` _ \| '__/ __| +" \ V /| | | | | | | | | (__ +" \_/ |_|_| |_| |_|_| \___| + +let mapleader =" " + +call plug#begin('~/.vim/plugged') +Plug 'junegunn/goyo.vim' +Plug 'PotatoesMaster/i3-vim-syntax' +Plug 'jreybert/vimagit' +Plug 'LukeSmithxyz/vimling' +Plug 'vimwiki/vimwiki' +call plug#end() + +" Some basics: + set nocompatible + filetype plugin on + syntax on + set encoding=utf-8 + set number relativenumber +" Enable autocompletion: + set wildmode=longest,list,full +" Disables automatic commenting on newline: + autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + +" Goyo plugin makes text more readable when writing prose: + map f :Goyo \| set linebreak + +" Spell-check set to o, 'o' for 'orthography': + map o :setlocal spell! spelllang=en_us + +" Splits open at the bottom and right, which is non-retarded, unlike vim defaults. + set splitbelow splitright + +" Shortcutting split navigation, saving a keypress: + map h + map j + map k + map l + +" Check file in shellcheck: + map s :!clear && shellcheck % + +" Open my bibliography file in split + map b :vsp$BIB + map r :vsp$REFER + +" Replace all is aliased to S. + nnoremap S :%s//g + +" Compile document, be it groff/LaTeX/markdown/etc. + map c :w! \| !compiler % + +" Open corresponding .pdf/.html or preview + map p :!opout % + +" Runs a script that cleans out tex build files whenever I close out of a .tex file. + autocmd VimLeave *.tex !texclear % + +" Ensure files are read as what I want: + let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} + autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown + autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff + autocmd BufRead,BufNewFile *.tex set filetype=tex + +" Readmes autowrap text: + autocmd BufRead,BufNewFile *.md set tw=79 + +" Use urlscan to choose and open a url: + :noremap u :w !urlscan -r 'linkhandler {}' + :noremap ,, !urlscan -r 'linkhandler {}' + +" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed): + vnoremap "+y + map "+P + +" Enable Goyo by default for mutt writting + " Goyo's width will be the line limit in mutt. + autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 + autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo + +" Automatically deletes all trailing whitespace on save. + autocmd BufWritePre * %s/\s\+$//e + +" When shortcut files are updated, renew bash and ranger configs with new material: + autocmd BufWritePost ~/.bm* !shortcuts + +" Run xrdb whenever Xdefaults or Xresources are updated. + autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb % + +" Navigating with guides + inoremap /<++>"_c4l + vnoremap /<++>"_c4l + map /<++>"_c4l + + "____ _ _ +"/ ___| _ __ (_)_ __ _ __ ___| |_ ___ +"\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __| + "___) | | | | | |_) | |_) | __/ |_\__ \ +"|____/|_| |_|_| .__/| .__/ \___|\__|___/ + "|_| |_| + +"""LATEX + " Word count: + autocmd FileType tex map o :w !detex \| wc -w + " Code snippets + autocmd FileType tex inoremap ,fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i + autocmd FileType tex inoremap ,fi \begin{fitch}\end{fitch}<++>3kA + autocmd FileType tex inoremap ,exe \begin{exe}\ex\end{exe}<++>3kA + autocmd FileType tex inoremap ,em \emph{}<++>T{i + autocmd FileType tex inoremap ,bf \textbf{}<++>T{i + autocmd FileType tex vnoremap , ``>2la}?\\{a + autocmd FileType tex inoremap ,it \textit{}<++>T{i + autocmd FileType tex inoremap ,ct \textcite{}<++>T{i + autocmd FileType tex inoremap ,cp \parencite{}<++>T{i + autocmd FileType tex inoremap ,glos {\gll<++>\\<++>\\\trans{``<++>''}}2k2bcw + autocmd FileType tex inoremap ,x \begin{xlist}\ex\end{xlist}kA + autocmd FileType tex inoremap ,ol \begin{enumerate}\end{enumerate}<++>3kA\item + autocmd FileType tex inoremap ,ul \begin{itemize}\end{itemize}<++>3kA\item + autocmd FileType tex inoremap ,li \item + autocmd FileType tex inoremap ,ref \ref{}<++>T{i + autocmd FileType tex inoremap ,tab \begin{tabular}<++>\end{tabular}<++>4kA{}i + autocmd FileType tex inoremap ,ot \begin{tableau}\inp{<++>}\const{<++>}<++><++>\end{tableau}<++>5kA{}i + autocmd FileType tex inoremap ,can \cand{}<++>T{i + autocmd FileType tex inoremap ,con \const{}<++>T{i + autocmd FileType tex inoremap ,v \vio{}<++>T{i + autocmd FileType tex inoremap ,a \href{}{<++>}<++>2T{i + autocmd FileType tex inoremap ,sc \textsc{}<++>T{i + autocmd FileType tex inoremap ,chap \chapter{}<++>2kf}i + autocmd FileType tex inoremap ,sec \section{}<++>2kf}i + autocmd FileType tex inoremap ,ssec \subsection{}<++>2kf}i + autocmd FileType tex inoremap ,sssec \subsubsection{}<++>2kf}i + autocmd FileType tex inoremap ,st F{i*f}i + autocmd FileType tex inoremap ,beg \begin{DELRN}<++>\end{DELRN}<++>4k0fR:MultipleCursorsFindDELRNc + autocmd FileType tex inoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex nnoremap ,up /usepackageo\usepackage{}i + autocmd FileType tex inoremap ,tt \texttt{}<++>T{i + autocmd FileType tex inoremap ,bt {\blindtext} + autocmd FileType tex inoremap ,nu $\varnothing$ + autocmd FileType tex inoremap ,col \begin{columns}[T]\begin{column}{.5\textwidth}\end{column}\begin{column}{.5\textwidth}<++>\end{column}\end{columns}5kA + autocmd FileType tex inoremap ,rn (\ref{})<++>F}i + +"""HTML + autocmd FileType html inoremap ,b <++>FbT>i + autocmd FileType html inoremap ,it <++>FeT>i + autocmd FileType html inoremap ,1

<++>2kf<++>2kf<++>2kf

<++>02kf>a + autocmd FileType html inoremap ,a href=""><++><++>14hi + autocmd FileType html inoremap ,e target="_blank"href=""><++><++>14hi + autocmd FileType html inoremap ,ul
<++>03kfo
  • F>a + autocmd FileType html inoremap ,ol
    <++>03kf<++>Fcf"a + autocmd FileType html inoremap ,td <++>Fdcit + autocmd FileType html inoremap ,tr <++>kf<++>Fhcit + autocmd FileType html inoremap ,tab
    O + autocmd FileType html inoremap ,gr F>a + autocmd FileType html inoremap ,rd F>a + autocmd FileType html inoremap ,yl F>a + autocmd FileType html inoremap ,dt
    <++>
    <++>2kcit + autocmd FileType html inoremap ,dl
    <++>3kcc + autocmd FileType html inoremap & & + autocmd FileType html inoremap á á + autocmd FileType html inoremap é é + autocmd FileType html inoremap í í + autocmd FileType html inoremap ó ó + autocmd FileType html inoremap ú ú + autocmd FileType html inoremap ä ä + autocmd FileType html inoremap ë ë + autocmd FileType html inoremap ï ï + autocmd FileType html inoremap ö ö + autocmd FileType html inoremap ü ü + autocmd FileType html inoremap ã ã + autocmd FileType html inoremap ẽ &etilde; + autocmd FileType html inoremap ĩ ĩ + autocmd FileType html inoremap õ õ + autocmd FileType html inoremap ũ ũ + autocmd FileType html inoremap ñ ñ + autocmd FileType html inoremap à à + autocmd FileType html inoremap è è + autocmd FileType html inoremap ì ì + autocmd FileType html inoremap ò ò + autocmd FileType html inoremap ù ù + + +""".bib + autocmd FileType bib inoremap ,a @article{author={<++>},year={<++>},title={<++>},journal={<++>},volume={<++>},pages={<++>},}<++>8kA,i + autocmd FileType bib inoremap ,b @book{author={<++>},year={<++>},title={<++>},publisher={<++>},}<++>6kA,i + autocmd FileType bib inoremap ,c @incollection{author={<++>},title={<++>},booktitle={<++>},editor={<++>},year={<++>},publisher={<++>},}<++>8kA,i + +"MARKDOWN + autocmd Filetype markdown,rmd map w yiWi[Ea](pa) + autocmd Filetype markdown,rmd inoremap ,n --- + autocmd Filetype markdown,rmd inoremap ,b ****<++>F*hi + autocmd Filetype markdown,rmd inoremap ,s ~~~~<++>F~hi + autocmd Filetype markdown,rmd inoremap ,e **<++>F*i + autocmd Filetype markdown,rmd inoremap ,h ====<++>F=hi + autocmd Filetype markdown,rmd inoremap ,i ![](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++>F[a + autocmd Filetype markdown,rmd inoremap ,1 #<++>kA + autocmd Filetype markdown,rmd inoremap ,2 ##<++>kA + autocmd Filetype markdown,rmd inoremap ,3 ###<++>kA + autocmd Filetype markdown,rmd inoremap ,l -------- + autocmd Filetype rmd inoremap ,r ```{r}```2kO + autocmd Filetype rmd inoremap ,p ```{python}```2kO + autocmd Filetype rmd inoremap ,c ``````2kO + +""".xml + autocmd FileType xml inoremap ,e <++>isPermaLink="false"><++>:put=strftime('%a, %d %b %Y %H:%M:%S %z')kJA<++>]]>?<enter>cit + autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci" + diff --git a/.vimrc b/.vimrc deleted file mode 100644 index b462bbd3..00000000 --- a/.vimrc +++ /dev/null @@ -1,216 +0,0 @@ -" _ -" __ _(_)_ __ ___ _ __ ___ -" \ \ / / | '_ ` _ \| '__/ __| -" \ V /| | | | | | | | | (__ -" \_/ |_|_| |_| |_|_| \___| - -let mapleader =" " - -call plug#begin('~/.vim/plugged') -Plug 'junegunn/goyo.vim' -Plug 'PotatoesMaster/i3-vim-syntax' -Plug 'jreybert/vimagit' -Plug 'LukeSmithxyz/vimling' -Plug 'vimwiki/vimwiki' -call plug#end() - -" Some basics: - set nocompatible - filetype plugin on - syntax on - set encoding=utf-8 - set number relativenumber -" Enable autocompletion: - set wildmode=longest,list,full -" Disables automatic commenting on newline: - autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - -" Goyo plugin makes text more readable when writing prose: - map <leader>f :Goyo \| set linebreak<CR> - -" Spell-check set to <leader>o, 'o' for 'orthography': - map <leader>o :setlocal spell! spelllang=en_us<CR> - -" Splits open at the bottom and right, which is non-retarded, unlike vim defaults. - set splitbelow splitright - -" Shortcutting split navigation, saving a keypress: - map <C-h> <C-w>h - map <C-j> <C-w>j - map <C-k> <C-w>k - map <C-l> <C-w>l - -" Check file in shellcheck: - map <leader>s :!clear && shellcheck %<CR> - -" Open my bibliography file in split - map <leader>b :vsp<space>$BIB<CR> - map <leader>r :vsp<space>$REFER<CR> - -" Replace all is aliased to S. - nnoremap S :%s//g<Left><Left> - -" Compile document, be it groff/LaTeX/markdown/etc. - map <leader>c :w! \| !compiler <c-r>%<CR><CR> - -" Open corresponding .pdf/.html or preview - map <leader>p :!opout <c-r>%<CR><CR> - -" Runs a script that cleans out tex build files whenever I close out of a .tex file. - autocmd VimLeave *.tex !texclear % - -" Ensure files are read as what I want: - let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} - autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown - autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff - autocmd BufRead,BufNewFile *.tex set filetype=tex - -" Readmes autowrap text: - autocmd BufRead,BufNewFile *.md set tw=79 - -" Use urlscan to choose and open a url: - :noremap <leader>u :w<Home> !urlscan -r 'linkhandler {}'<CR> - :noremap ,, !urlscan -r 'linkhandler {}'<CR> - -" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed): - vnoremap <C-c> "+y - map <C-p> "+P - -" Enable Goyo by default for mutt writting - " Goyo's width will be the line limit in mutt. - autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 - autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo - -" Automatically deletes all trailing whitespace on save. - autocmd BufWritePre * %s/\s\+$//e - -" When shortcut files are updated, renew bash and ranger configs with new material: - autocmd BufWritePost ~/.bm* !shortcuts - -" Run xrdb whenever Xdefaults or Xresources are updated. - autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb % - -" Navigating with guides - inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l - vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l - map <Space><Tab> <Esc>/<++><Enter>"_c4l - - "____ _ _ -"/ ___| _ __ (_)_ __ _ __ ___| |_ ___ -"\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __| - "___) | | | | | |_) | |_) | __/ |_\__ \ -"|____/|_| |_|_| .__/| .__/ \___|\__|___/ - "|_| |_| - -"""LATEX - " Word count: - autocmd FileType tex map <leader><leader>o :w !detex \| wc -w<CR> - " Code snippets - autocmd FileType tex inoremap ,fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i - autocmd FileType tex inoremap ,fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA - autocmd FileType tex inoremap ,exe \begin{exe}<Enter>\ex<Space><Enter>\end{exe}<Enter><Enter><++><Esc>3kA - autocmd FileType tex inoremap ,em \emph{}<++><Esc>T{i - autocmd FileType tex inoremap ,bf \textbf{}<++><Esc>T{i - autocmd FileType tex vnoremap , <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a - autocmd FileType tex inoremap ,it \textit{}<++><Esc>T{i - autocmd FileType tex inoremap ,ct \textcite{}<++><Esc>T{i - autocmd FileType tex inoremap ,cp \parencite{}<++><Esc>T{i - autocmd FileType tex inoremap ,glos {\gll<Space><++><Space>\\<Enter><++><Space>\\<Enter>\trans{``<++>''}}<Esc>2k2bcw - autocmd FileType tex inoremap ,x \begin{xlist}<Enter>\ex<Space><Enter>\end{xlist}<Esc>kA<Space> - autocmd FileType tex inoremap ,ol \begin{enumerate}<Enter><Enter>\end{enumerate}<Enter><Enter><++><Esc>3kA\item<Space> - autocmd FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space> - autocmd FileType tex inoremap ,li <Enter>\item<Space> - autocmd FileType tex inoremap ,ref \ref{}<Space><++><Esc>T{i - autocmd FileType tex inoremap ,tab \begin{tabular}<Enter><++><Enter>\end{tabular}<Enter><Enter><++><Esc>4kA{}<Esc>i - autocmd FileType tex inoremap ,ot \begin{tableau}<Enter>\inp{<++>}<Tab>\const{<++>}<Tab><++><Enter><++><Enter>\end{tableau}<Enter><Enter><++><Esc>5kA{}<Esc>i - autocmd FileType tex inoremap ,can \cand{}<Tab><++><Esc>T{i - autocmd FileType tex inoremap ,con \const{}<Tab><++><Esc>T{i - autocmd FileType tex inoremap ,v \vio{}<Tab><++><Esc>T{i - autocmd FileType tex inoremap ,a \href{}{<++>}<Space><++><Esc>2T{i - autocmd FileType tex inoremap ,sc \textsc{}<Space><++><Esc>T{i - autocmd FileType tex inoremap ,chap \chapter{}<Enter><Enter><++><Esc>2kf}i - autocmd FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i - autocmd FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i - autocmd FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i - autocmd FileType tex inoremap ,st <Esc>F{i*<Esc>f}i - autocmd FileType tex inoremap ,beg \begin{DELRN}<Enter><++><Enter>\end{DELRN}<Enter><Enter><++><Esc>4k0fR:MultipleCursorsFind<Space>DELRN<Enter>c - autocmd FileType tex inoremap ,up <Esc>/usepackage<Enter>o\usepackage{}<Esc>i - autocmd FileType tex nnoremap ,up /usepackage<Enter>o\usepackage{}<Esc>i - autocmd FileType tex inoremap ,tt \texttt{}<Space><++><Esc>T{i - autocmd FileType tex inoremap ,bt {\blindtext} - autocmd FileType tex inoremap ,nu $\varnothing$ - autocmd FileType tex inoremap ,col \begin{columns}[T]<Enter>\begin{column}{.5\textwidth}<Enter><Enter>\end{column}<Enter>\begin{column}{.5\textwidth}<Enter><++><Enter>\end{column}<Enter>\end{columns}<Esc>5kA - autocmd FileType tex inoremap ,rn (\ref{})<++><Esc>F}i - -"""HTML - autocmd FileType html inoremap ,b <b></b><Space><++><Esc>FbT>i - autocmd FileType html inoremap ,it <em></em><Space><++><Esc>FeT>i - autocmd FileType html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i - autocmd FileType html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i - autocmd FileType html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i - autocmd FileType html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a - autocmd FileType html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi - autocmd FileType html inoremap ,e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi - autocmd FileType html inoremap ,ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i - autocmd FileType html inoremap ,li <Esc>o<li></li><Esc>F>a - autocmd FileType html inoremap ,ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i - autocmd FileType html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a - autocmd FileType html inoremap ,td <td></td><++><Esc>Fdcit - autocmd FileType html inoremap ,tr <tr></tr><Enter><++><Esc>kf<i - autocmd FileType html inoremap ,th <th></th><++><Esc>Fhcit - autocmd FileType html inoremap ,tab <table><Enter></table><Esc>O - autocmd FileType html inoremap ,gr <font color="green"></font><Esc>F>a - autocmd FileType html inoremap ,rd <font color="red"></font><Esc>F>a - autocmd FileType html inoremap ,yl <font color="yellow"></font><Esc>F>a - autocmd FileType html inoremap ,dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit - autocmd FileType html inoremap ,dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc - autocmd FileType html inoremap &<space> &<space> - autocmd FileType html inoremap á á - autocmd FileType html inoremap é é - autocmd FileType html inoremap í í - autocmd FileType html inoremap ó ó - autocmd FileType html inoremap ú ú - autocmd FileType html inoremap ä ä - autocmd FileType html inoremap ë ë - autocmd FileType html inoremap ï ï - autocmd FileType html inoremap ö ö - autocmd FileType html inoremap ü ü - autocmd FileType html inoremap ã ã - autocmd FileType html inoremap ẽ &etilde; - autocmd FileType html inoremap ĩ ĩ - autocmd FileType html inoremap õ õ - autocmd FileType html inoremap ũ ũ - autocmd FileType html inoremap ñ ñ - autocmd FileType html inoremap à à - autocmd FileType html inoremap è è - autocmd FileType html inoremap ì ì - autocmd FileType html inoremap ò ò - autocmd FileType html inoremap ù ù - - -""".bib - autocmd FileType bib inoremap ,a @article{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>journal<Space>=<Space>{<++>},<Enter>volume<Space>=<Space>{<++>},<Enter>pages<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i - autocmd FileType bib inoremap ,b @book{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>6kA,<Esc>i - autocmd FileType bib inoremap ,c @incollection{<Enter>author<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>booktitle<Space>=<Space>{<++>},<Enter>editor<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i - -"MARKDOWN - autocmd Filetype markdown,rmd map <leader>w yiWi[<esc>Ea](<esc>pa) - autocmd Filetype markdown,rmd inoremap ,n ---<Enter><Enter> - autocmd Filetype markdown,rmd inoremap ,b ****<++><Esc>F*hi - autocmd Filetype markdown,rmd inoremap ,s ~~~~<++><Esc>F~hi - autocmd Filetype markdown,rmd inoremap ,e **<++><Esc>F*i - autocmd Filetype markdown,rmd inoremap ,h ====<Space><++><Esc>F=hi - autocmd Filetype markdown,rmd inoremap ,i ![](<++>)<++><Esc>F[a - autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++><Esc>F[a - autocmd Filetype markdown,rmd inoremap ,1 #<Space><Enter><++><Esc>kA - autocmd Filetype markdown,rmd inoremap ,2 ##<Space><Enter><++><Esc>kA - autocmd Filetype markdown,rmd inoremap ,3 ###<Space><Enter><++><Esc>kA - autocmd Filetype markdown,rmd inoremap ,l --------<Enter> - autocmd Filetype rmd inoremap ,r ```{r}<CR>```<CR><CR><esc>2kO - autocmd Filetype rmd inoremap ,p ```{python}<CR>```<CR><CR><esc>2kO - autocmd Filetype rmd inoremap ,c ```<cr>```<cr><cr><esc>2kO - -""".xml - autocmd FileType xml inoremap ,e <item><Enter><title><++>isPermaLink="false"><++>:put=strftime('%a, %d %b %Y %H:%M:%S %z')kJA<++>]]>?<enter>cit - autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci" - diff --git a/.vimrc b/.vimrc new file mode 120000 index 00000000..25b6a3be --- /dev/null +++ b/.vimrc @@ -0,0 +1 @@ +.config/nvim/init.vim \ No newline at end of file From dc00b95f69d615cfc7678d18081abe47cf9d8c32 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Thu, 3 Jan 2019 19:11:39 -0500 Subject: [PATCH 28/39] ddspawn simplification --- .config/i3/config | 33 ++++++++++++--------------------- .scripts/i3cmds/ddspawn | 21 +++++++-------------- 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index b7c5d7d7..cf4e4afa 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -32,25 +32,16 @@ set $hibernate sudo -A systemctl suspend # #---Dropdown Windows---# # -# First I have a tmux window used for background scripts. -# I'll later bind this to mod+u. -for_window [instance="tmuxdd"] floating enable -for_window [instance="tmuxdd"] resize set 625 450 -for_window [instance="tmuxdd"] move scratchpad -for_window [instance="tmuxdd"] border pixel 3 -for_window [instance="tmuxdd"] sticky enable -for_window [instance="tmuxdd"] scratchpad show -for_window [instance="tmuxdd"] move position center - -# Then I have a window running R I use for basic arithmetic -# I'll later bind this to mod+a. -for_window [instance="dropdowncalc"] floating enable -for_window [instance="dropdowncalc"] resize set 800 300 -for_window [instance="dropdowncalc"] move scratchpad -for_window [instance="dropdowncalc"] border pixel 2 -for_window [instance="dropdowncalc"] sticky enable -for_window [instance="dropdowncalc"] scratchpad show -for_window [instance="dropdowncalc"] move position center +# General dropdown window traits. The order can matter. +for_window [instance="dropdown_*"] floating enable +for_window [instance="dropdown_*"] move scratchpad +for_window [instance="dropdown_*"] sticky enable +for_window [instance="dropdown_*"] scratchpad show +for_window [instance="dropdown_tmuxdd"] resize set 625 450 +for_window [instance="dropdown_dropdowncalc"] resize set 800 300 +for_window [instance="dropdown_tmuxdd"] border pixel 3 +for_window [instance="dropdown_dropdowncalc"] border pixel 2 +for_window [instance="dropdown_*"] move position center # #---Starting External Scripts---# # # Setting the background: @@ -137,8 +128,8 @@ bindsym $mod+Insert exec --no-startup-id showclip bindsym $mod+Pause exec --no-startup-id xcqr # #---Letter Key Bindings---# # -bindsym $mod+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill -bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill +bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill +bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill bindsym $mod+w exec $term -e nmtui bindsym $mod+Shift+w exec --no-startup-id $BROWSER diff --git a/.scripts/i3cmds/ddspawn b/.scripts/i3cmds/ddspawn index 2c23fd6a..ef86abf6 100755 --- a/.scripts/i3cmds/ddspawn +++ b/.scripts/i3cmds/ddspawn @@ -1,24 +1,17 @@ #!/bin/sh -# This script simplifies dropdown windows in i3. -# Shows/hides a scratchpad of a given name, if it doesn't exist, creates it. -# Usage: -# argument 1: script to run in dropdown window -# all other args are interpreted as options for your terminal -# My usage: -# ddspawn -# bindsym $mod+u exec --no-startup-id ddspawn tmuxdd -# Will hide/show window running the `tmuxdd` script when I press mod+u in i3 -# bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 -# Similar to above but with `dropdowncalc` and the other args are interpretated as for my terminal emulator (to increase font) +# Toggle floating dropdown terminal in i3, or start if non-existing. +# $1 is the script run in the terminal. +# All other args are terminal settings. +# Terminal names are in dropdown_* to allow easily setting i3 settings. [ -z "$1" ] && exit -if xwininfo -tree -root | grep "(\"$1\" "; +if xwininfo -tree -root | grep "(\"dropdown_$1\" "; then echo "Window detected." - i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" + i3 "[instance=\"dropdown_$1\"] scratchpad show; [instance=\"dropdown_$1\"] move position center" else echo "Window not detected... spawning." - i3 "exec --no-startup-id $TERMINAL -n $1 $(echo "$@" | cut -d ' ' -f2-) -e $1" + i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 $(echo "$@" | cut -d ' ' -f2-) -e $1" fi From cc57ff0e2695cf85d871fb41ff7cf2a5732dfec5 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Thu, 3 Jan 2019 20:39:10 -0500 Subject: [PATCH 29/39] checkup noteless and ignores ignored --- .scripts/cron/checkup | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.scripts/cron/checkup b/.scripts/cron/checkup index 4838948e..016ee90e 100755 --- a/.scripts/cron/checkup +++ b/.scripts/cron/checkup @@ -3,16 +3,16 @@ ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit -note "Checking for pacakge updates..." "$PIX/larbs.gif" +notify-send -i "$PIX/larbs.gif" "Checking for pacakge updates..." -sudo pacman -Syyuw --noconfirm || note "Error downloading updates. +sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates. Check your internet connection, if pacman is already running, or run update manually to see errors." pkill -RTMIN+8 i3blocks -if pacman -Qul +if pacman -Qu | grep -v "[ignored]" then - note "Package updates available. Click statusbar icon for update." "$PIX/larbs.gif" + notify-send -i "$PIX/larbs.gif" "Package updates available. Click statusbar icon (📦) for update." else - note "Repository sync complete. No new packages for update." "$PIX/larbs.gif" + notify-send -i "$PIX/larbs.gif" "Repository sync complete. No new packages for update." fi From 83dc47d52f1f32d637152a63dd27353f83f00b91 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 10:57:19 -0500 Subject: [PATCH 30/39] switch to maim --- .config/i3/config | 4 ++-- .scripts/i3cmds/maimpick | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 .scripts/i3cmds/maimpick diff --git a/.config/i3/config b/.config/i3/config index cf4e4afa..14cdb77b 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -323,8 +323,8 @@ bindsym $mod+bracketright exec --no-startup-id lmc forward 10 bindsym $mod+Shift+bracketright exec --no-startup-id lmc forward 120 # For screenshots and recording -bindsym Print exec --no-startup-id scrot -bindsym Shift+Print exec --no-startup-id scrot -u +bindsym Print exec --no-startup-id maim +bindsym Shift+Print exec --no-startup-id maimpick bindsym $mod+Print exec --no-startup-id dmenurecord bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey" bindsym $mod+Delete exec $stoprec diff --git a/.scripts/i3cmds/maimpick b/.scripts/i3cmds/maimpick new file mode 100755 index 00000000..f3f72fe7 --- /dev/null +++ b/.scripts/i3cmds/maimpick @@ -0,0 +1,9 @@ +#!/bin/sh +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfullscreen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in + "a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;; + "current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;; + "full screen") maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;; + "a selected area (copy)") maim -s | xclip -selection clipboard -t image/png ;; + "current window (copy)") maim -i | xclip -selection clipboard -t image/png ;; + "full screen (copy)") maim | xclip -selection clipboard -t image/png ;; +esac From be62eb5c82937dced3585ee03c3f8b0375745bb2 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 14:21:17 -0500 Subject: [PATCH 31/39] maim fix --- .config/i3/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/i3/config b/.config/i3/config index 14cdb77b..82550fa6 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -323,7 +323,7 @@ bindsym $mod+bracketright exec --no-startup-id lmc forward 10 bindsym $mod+Shift+bracketright exec --no-startup-id lmc forward 120 # For screenshots and recording -bindsym Print exec --no-startup-id maim +bindsym Print exec --no-startup-id maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" bindsym Shift+Print exec --no-startup-id maimpick bindsym $mod+Print exec --no-startup-id dmenurecord bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey" From f2d056cb85b0a8e2038468e690232c63d87f797e Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:08:12 -0500 Subject: [PATCH 32/39] mpv pause system changed (socat required) --- .bashrc | 19 ++++++------------- .config/ranger/rifle.conf | 14 ++++++++------ .scripts/tools/dmenuhandler | 4 ++-- .scripts/tools/linkhandler | 10 +++++----- .scripts/tools/pauseallmpv | 6 +++--- 5 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.bashrc b/.bashrc index 1bf2cb97..30a6a9dd 100644 --- a/.bashrc +++ b/.bashrc @@ -1,40 +1,33 @@ #!/bin/bash -# _ _ -# | |__ __ _ ___| |__ _ __ ___ -# | '_ \ / _` / __| '_ \| '__/ __| -# | |_) | (_| \__ \ | | | | | (__ -# |_.__/ \__,_|___/_| |_|_| \___| - stty -ixon # Disable ctrl-s and ctrl-q. shopt -s autocd #Allows you to cd into directory merely by typing the directory name. HISTSIZE= HISTFILESIZE= # Infinite history. - export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" [ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases -export GPG_TTY=$(tty) - # System Maintainence alias mw="~/.config/mutt/mutt-wizard.sh" -alias muttwizard="~/.config/mutt/mutt-wizard.sh" alias sdn="sudo shutdown now" alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg +alias gua="git remote | xargs -L1 git push --all" # Some aliases alias e="$EDITOR" alias p="sudo pacman" alias SS="sudo systemctl" alias v="vim" -alias sv="sudo vim" +alias f="vifm" alias r="ranger" alias sr="sudo ranger" alias ka="killall" alias g="git" alias trem="transmission-remote" alias mkd="mkdir -pv" -alias ref="shortcuts && source ~/.bashrc" # Refresh shortcuts manually and reload bashrc -alias bw="wal -i ~/.config/wall.png" # Rerun pywal +alias ref="shortcuts >/dev/null ; source ~/.bashrc" # Refresh shortcuts manually and reload bashrc +alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" +alias x="sxiv -ft *" +alias lp="pacman -Qett --color=always | less" # Adding color alias ls='ls -hN --color=auto --group-directories-first' diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index c6b85d0d..512327f0 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -117,9 +117,11 @@ ext php = php -- "$1" #------------------------------------------- mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" mime ^video|audio, has smplayer, X, flag f = smplayer "$@" -mime ^video, has mpv, X, flag f = mpv -- "$@" -mime ^video, has mpv, X, flag f = mpv --fs -- "$@" -mime ^video, has mpv, X, flag f = mpv --loop -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-video -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --fs -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --loop -- "$@" +mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --title="obs" --autofit=1050x700 -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" mime ^video, has mplayer, X, flag f = mplayer -- "$@" @@ -132,16 +134,16 @@ mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@" #------------------------------------------- mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" -mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-audio-display -- "$@" mime ^audio|ogg$ = tag "$@" -mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" ext midi?, terminal, has wildmidi = wildmidi -- "$@" #-------------------------------------------- # Video without X: #------------------------------------------- -mime ^video, terminal, !X, has mpv = mpv -- "$@" +mime ^video, terminal, !X, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" mime ^video, terminal, !X, has mplayer = mplayer -- "$@" diff --git a/.scripts/tools/dmenuhandler b/.scripts/tools/dmenuhandler index 9da9d57e..391bdc19 100755 --- a/.scripts/tools/dmenuhandler +++ b/.scripts/tools/dmenuhandler @@ -5,11 +5,11 @@ case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in "copy url") echo "$1" | xclip -selection clipboard ;; mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; - "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;; + "mpv (loop)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet --loop "$1" >/dev/null 2>&1 & ;; "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;; feh) setsid feh "$1" >/dev/null 2>&1 & ;; w3m) w3m "$1" >/dev/null 2>&1 ;; - "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; + "mpv (float)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; esac diff --git a/.scripts/tools/linkhandler b/.scripts/tools/linkhandler index abd6f0a8..07196605 100755 --- a/.scripts/tools/linkhandler +++ b/.scripts/tools/linkhandler @@ -13,11 +13,11 @@ scihub="http://sci-hub.tw/" [ -z "$1" ] && { "$BROWSER"; exit; } case "$1" in - *mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) - setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; - *png|*jpg|*jpe|*jpeg) - setsid feh "$1" >/dev/null 2>&1 & ;; - *mp3|*flac|*opus|*mp3?source) + *mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) + setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; + *png|*jpg|*jpe|*jpeg|*gif) + setsid sxiv -a "$1" >/dev/null 2>&1 & ;; + *mp3|*flac|*opus|*mp3?source*) setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; *springer.com*) setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;; diff --git a/.scripts/tools/pauseallmpv b/.scripts/tools/pauseallmpv index 08241b57..c5da2206 100755 --- a/.scripts/tools/pauseallmpv +++ b/.scripts/tools/pauseallmpv @@ -1,4 +1,4 @@ #!/bin/sh -# Sends a , key to all mpv instances, pausing them at the last frame. - -xdotool search --class mpv | xargs -I % xdotool key --window % comma +for i in $(ls /tmp/mpvsoc*); do + echo '{ "command": ["set_property", "pause", true] }' | socat - $i; +done From 954d110d25eba2309ef4948d853b7b637758a709 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:08:49 -0500 Subject: [PATCH 33/39] lol babby's first regex error --- .scripts/cron/checkup | 2 +- .scripts/statusbar/pacpackages | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.scripts/cron/checkup b/.scripts/cron/checkup index 016ee90e..770c3490 100755 --- a/.scripts/cron/checkup +++ b/.scripts/cron/checkup @@ -10,7 +10,7 @@ sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates. Check your internet connection, if pacman is already running, or run update manually to see errors." pkill -RTMIN+8 i3blocks -if pacman -Qu | grep -v "[ignored]" +if pacman -Qu | grep -v "\[ignored\]" then notify-send -i "$PIX/larbs.gif" "Package updates available. Click statusbar icon (📦) for update." else diff --git a/.scripts/statusbar/pacpackages b/.scripts/statusbar/pacpackages index 91648309..9ec679e7 100755 --- a/.scripts/statusbar/pacpackages +++ b/.scripts/statusbar/pacpackages @@ -16,4 +16,4 @@ case $BLOCK_BUTTON in esac -pacman -Qu | grep -v "[ignored]" | wc -l | sed -e "s/^0$//g" +pacman -Qu | grep -v "\[ignored\]" | wc -l | sed -e "s/^0$//g" From 9cb4d09d6537c45f7826daa367bde4a57275a9e7 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:09:26 -0500 Subject: [PATCH 34/39] nifty alias examples --- .bashrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 30a6a9dd..9a37ddc8 100644 --- a/.bashrc +++ b/.bashrc @@ -36,9 +36,11 @@ alias diff="diff --color=auto" alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting. # Internet -alias yt="youtube-dl --add-metadata -ic" # Download video link +alias yt="youtube-dl --add-metadata -i" # Download video link alias yta="yt -x -f bestaudio/best" # Download only audio alias YT="youtube-viewer" shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;} -vf() { $EDITOR $(fzf) ;} +se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;} +sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;} +vf() { fzf | xargs -r -I % $EDITOR % ;} From 1507b00e421a58ef2f53f24e43906e9017234755 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:10:10 -0500 Subject: [PATCH 35/39] ms (groff_ms) files handled in ranger --- .config/ranger/rifle.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index 512327f0..0854afdf 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -226,8 +226,9 @@ label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" # Define the editor for non-text files + pager as last action - !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask -label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" -label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" + !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = ask +label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = $EDITOR -- "$@" +label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = "$PAGER" -- "$@" ext blend, has blender, X, flag f = blender -- "$@" +ext ms = $EDITOR -- "$@" From 6cba95b3d4e123cfa6305325cd69ed42fa07372f Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:10:29 -0500 Subject: [PATCH 36/39] zathura reads postscript from ranger --- .config/ranger/rifle.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index 0854afdf..f9f03e8f 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -166,6 +166,7 @@ ext pdf, has qpdfview, X, flag f = qpdfview "$@" ext epub, has zathura, X, flag f = zathura -- "$@" ext epub, has mupdf, X, flag f = mupdf "$@" +ext ps, has zathura, X, flag f = zathura -- "$@" ext docx, has abiword, X, flag f = abiword "$@" From 658206dac26dbf88b86e22e1d5127490bfae0606 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:10:49 -0500 Subject: [PATCH 37/39] ask by mpv in ranger --- .config/ranger/rifle.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf index f9f03e8f..97410d99 100644 --- a/.config/ranger/rifle.conf +++ b/.config/ranger/rifle.conf @@ -101,6 +101,7 @@ ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1" ext nes, has fceux, X = fceux "$1" ext exe = wine "$1" name ^[mM]akefile$ = make +ext asf, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@" #-------------------------------------------- # Code From 9597b54ffc4a43343d017d4972b72508e3b47f01 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Fri, 4 Jan 2019 23:14:03 -0500 Subject: [PATCH 38/39] ranger trains its own replacement --- .config/i3/config | 14 ++++++++------ .profile | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.config/i3/config b/.config/i3/config index 82550fa6..c6fdf32c 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -14,7 +14,7 @@ # This config file will use environmental variables such as $BROWSER and $TERMINAL. # You can set these variables in ~/.profile or ~/.bash_profile if you have it as below: # -# export BROWSER="firefox" +# export FILE="ranger" # export TERMINAL="st" # #---Basic Definitions---# # @@ -121,7 +121,7 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode ##bindsym $mod+asciitilde #STOP/HIDE EVERYTHING: -bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger +bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e $FILE # Show selection: bindsym $mod+Insert exec --no-startup-id showclip @@ -348,7 +348,7 @@ bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdow bindsym XF86Calculator exec $term -e R -q --no-save ##bindsym XF86Sleep This binding is typically mapped by systemd automatically. ##bindsym XF86WakeUp exec -bindsym XF86Explorer exec $term -e ranger +bindsym XF86Explorer exec $term -e $FILE ##bindsym XF86Send exec ##bindsym XF86Xfer exec bindsym XF86WWW exec --no-startup-id $BROWSER @@ -357,7 +357,7 @@ bindsym XF86ScreenSaver exec exec --no-startup-id lockscreen ##bindsym XF86RotateWindows exec ##bindsym XF86TaskPane exec ##bindsym XF86Favorites exec -bindsym XF86MyComputer exec $term -e ranger +bindsym XF86MyComputer exec $term -e $FILE ##bindsym XF86Back exec ##bindsym XF86Forward exec bindsym XF86Eject exec --no-startup-id dmenuumount @@ -402,14 +402,16 @@ bindsym XF86Shop exec $BROWSER https://ebay.com bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15 bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15 bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp -bindsym XF86Display exec --no-startup-id arandr +bindsym XF86Display exec --no-startup-id displayselect #bindsym XF86KbdLightOnOff exec #bindsym XF86KbdBrightnessDown exec #bindsym XF86KbdBrightnessUp exec ##bindsym XF86Reply exec ##bindsym XF86MailForward exec ##bindsym XF86Save exec -bindsym XF86Documents exec $term -e ranger ~/Documents +bindsym XF86Documents exec $term -e $FILE ~/Documents ##bindsym XF86Battery exec ##bindsym XF86Bluetooth exec bindsym XF86WLAN exec $netrefresh + +exec --no-startup-id lukescripts diff --git a/.profile b/.profile index 0a2c6fd1..e10d661a 100644 --- a/.profile +++ b/.profile @@ -7,6 +7,7 @@ export EDITOR="vim" export TERMINAL="st" export BROWSER="firefox" export READER="zathura" +export FILE="ranger" export BIB="$HOME/Documents/LaTeX/uni.bib" export REFER="$HOME/.referbib" export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass" From 94854171f0d4e42ac267a62310d08be2091dfcc0 Mon Sep 17 00:00:00 2001 From: Luke Smith <luke@lukesmith.xyz> Date: Sat, 5 Jan 2019 12:02:55 -0500 Subject: [PATCH 39/39] bottom right/left location calculation fixes --- .scripts/i3cmds/bottomleft | 4 ++-- .scripts/i3cmds/bottomright | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.scripts/i3cmds/bottomleft b/.scripts/i3cmds/bottomleft index be12b633..c73a59af 100755 --- a/.scripts/i3cmds/bottomleft +++ b/.scripts/i3cmds/bottomleft @@ -8,9 +8,9 @@ current=$(xdotool getwindowfocus) newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3)) -xdotool windowsize "$(xdotool getwindowfocus)" $newheight $newwidth +xdotool windowsize "$current" $newheight $newwidth -newsize=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') +newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) xdotool windowmove "$current" 0 $height diff --git a/.scripts/i3cmds/bottomright b/.scripts/i3cmds/bottomright index 7ddc253b..45e46bf0 100755 --- a/.scripts/i3cmds/bottomright +++ b/.scripts/i3cmds/bottomright @@ -8,10 +8,10 @@ current=$(xdotool getwindowfocus) newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3)) -xdotool windowsize "$(xdotool getwindowfocus)" $newheight $newwidth +xdotool windowsize "$current" $newheight $newwidth -newsize=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') -newwidth=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | grep -o " [0-9]*") +newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') +newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*") vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth))