summaryrefslogtreecommitdiffstats
path: root/.scripts
diff options
context:
space:
mode:
Diffstat (limited to '.scripts')
-rw-r--r--.scripts/SCRIPTS.md140
-rw-r--r--.scripts/configs21
-rw-r--r--.scripts/folders9
-rwxr-xr-x.scripts/remaps2
-rwxr-xr-x.scripts/shortcuts.sh34
5 files changed, 178 insertions, 28 deletions
diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md
index 42a866e..1a92c81 100644
--- a/.scripts/SCRIPTS.md
+++ b/.scripts/SCRIPTS.md
@@ -1,142 +1,226 @@
# Directory of Scripts
## `audio`
+
The audio recording script run by `dmenurecord` (bound to `mod+Print`).
## `bottomleft`
-Makes the currently selected window float in the bottom left of screen. Bound to `mod+B`.
+
+Makes the currently selected window float in the bottom left of screen. Bound
+to `mod+B`.
## `camtoggle`
+
Starts/kills /dev/video0 webcam. Placed in bottom right by default.
## `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 `<leader>c` in vim.
+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 `<leader>c` in vim.
## `crontog`
+
Turns off/on all user cronjobs.
## `displayselect`
+
Select which displays to use. Bound to `mod+F3`.
## `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.
+
+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.
## `dmenumount`
-Detect available partitions with `lsblk` and offer to mount them. Bound to `mod+F9`. Will do nothing if none are available.
+
+Detect available partitions with `lsblk` and offer to mount them. 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.
+
+Gives a list of recording commands: `audio`, `video` and `screencast` (both) in
+dmenu for selection.
## `dmenuumount`
-Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing if none are mounted.
+
+Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing
+if none are mounted.
## `dropdowncalc`
-The command initially run in the `math` window (toggeable with `mod+a`). Runs `r` if available, else `python`.
+
+The command initially run in the `math` window (toggeable with `mod+a`). Runs
+`r` if available, else `python`.
## `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.
+
+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.
## `i3battery`
-i3blocks module. Shows available power remaining with icon indicating battery status. Colors indicate different levels of charge.
+
+i3blocks module. Shows available power remaining with icon indicating battery
+status. Colors indicate different levels of charge.
## `i3mail`
-i3blocks module for use with mutt-wizard. Shows unread mail and if `mailsync.sh` is running.
+
+i3blocks module for use with mutt-wizard. Shows unread mail and if
+`mailsync.sh` is running.
## `i3mpd`
+
i3blocks module. Shows current song; if paused, name will be grayed and italic.
## `i3mpdupdate`
+
A daemon running by default that will update the i3mpd block on mpd change.
## `i3pacman`
-i3blocks module. Detects new installable upgrades. Only works if you use cronjobs to automatically sync repositories.
+
+i3blocks module. Detects new installable upgrades. Only works if you use
+cronjobs to automatically sync repositories.
## `i3resize`
+
A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`.
## `i3torrent`
-i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or finished (🌱).
+
+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 (☀️).
+
+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.
## `kb-lights.py`
+
A Python 3 script which will increase or decrease keyboard lights when given
either a `+` or `-` argument.
## `killrecording`
+
End a recording started by `dmenurecord` the proper way.
## `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.
+
+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.
+
+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.
## `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.
+be paused and the screen will be distorted and locked and screen will soon time
+out. User must insert password to unlock.
## `musstuff`
+
Some old notes and commands on deleted music shortcuts.
## `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 `<leader>p` in my vim config to reveal typical output.
+`.rmd` file, or if given an `.html` file, will open it in the browser. Bound
+to `<leader>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.
## `polybar_launch`
-For `polybar` users. Launches `polybar` on every screen. Should be run in the i3 config.
+
+For `polybar` users. Launches `polybar` on every screen. Should be run in the
+i3 config.
## `popweather`
+
The script called by clicking on the i3 weather module. Brings up the forecast
from `http://wttr.in` and waits for input to prevent immediate closing of
spawned window.
## `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`.
+
+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`.
## `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.
+
+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.
## `samedir`
-Opens a terminal window in the same directory as the window currently selection. Bound to `mod+shift+enter`.
+
+Opens a terminal window in the same directory as the window currently
+selection. Bound to `mod+shift+enter`.
## `screencast`
+
A script for `dmenurecord`. Records default audio and the screen.
+## `shortcuts.sh`
+
+For updating bash and ranger shortcuts. Reads `~/.scripts/folders` and
+`~/.scripts/configs` for pairs of keypresses and directories and configfiles,
+then autoproduces bash aliases and ranger shortcuts for them. See the
+`README.md` at
+[https://github.com/LukeSmithxyz/shortcu-sync](https://github.com/LukeSmithxyz/shortcu-sync)
+for the specifics.
+
## `texclear`
-Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file.
+
+Remove all `.tex` related build files. This is run by my vim when I stop
+editing any `.tex` file.
## `tmuxinit`
-The startup script for the dropdown terminal (toggleable with `mod+u`). Either attaches to an existing tmux session or begins a new one.
+
+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`.
## `tpb`
+
Search Pirate Bay for the certain search terms given as arguments.
## `tutorialvids`
-A dmenu prompt that gives some options of tutorial videos to watch. Bound to `mod+shift+e`.
+
+A dmenu prompt that gives some options of tutorial videos to watch. Bound to
+`mod+shift+e`.
## `video`
+
A script for `dmenurecord`. Records the screen with no audio.
diff --git a/.scripts/configs b/.scripts/configs
new file mode 100644
index 0000000..51b5027
--- /dev/null
+++ b/.scripts/configs
@@ -0,0 +1,21 @@
+cff ~/.scripts/folders
+cfc ~/.scripts/configs
+cfb ~/.bashrc
+cfz ~/.zshrc
+cfv ~/.vimrc
+cfr ~/.config/ranger/rc.conf
+cfi ~/.config/i3/config
+cfq ~/.config/qutebrowser/config.py
+cfm ~/.config/mutt/muttrc
+cft ~/.config/termite/config
+eb ~/Documents/LaTeX/uni.bib
+cv ~/Documents/LaTeX/cv.tex
+cfp ~/.config/polybar/config
+cfd ~/.Xdefaults
+cfu ~/.config/newsboat/urls
+cfn ~/.config/newsboat/config
+cfA ~/.asoundrc
+cfmb ~/.config/ncmpcpp/bindings
+cfmc ~/.config/ncmpcpp/config
+cfmpd ~/.config/mpd/mpd.conf
+cfM ~/.config/mpd/mpd.conf
diff --git a/.scripts/folders b/.scripts/folders
new file mode 100644
index 0000000..3105b35
--- /dev/null
+++ b/.scripts/folders
@@ -0,0 +1,9 @@
+# You can add comments to these files with #
+h ~/
+d ~/Documents
+D ~/Downloads
+m ~/Music
+pp ~/Pictures
+vv ~/Videos
+s ~/.scripts
+cf ~/.config
diff --git a/.scripts/remaps b/.scripts/remaps
index 755ff5b..32394e4 100755
--- a/.scripts/remaps
+++ b/.scripts/remaps
@@ -2,6 +2,8 @@
# This script is called by i3 on startup.
+# Increase key speed via a rate change
+xset r rate 300 50
# Map the caps lock key to super...
setxkbmap -layout us -variant altgr-intl -option caps:super
# If you don't want a us international keyboard, rather whatever keyboard
diff --git a/.scripts/shortcuts.sh b/.scripts/shortcuts.sh
new file mode 100755
index 0000000..4758787
--- /dev/null
+++ b/.scripts/shortcuts.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Config locations
+folders="$HOME/.scripts/folders"
+configs="$HOME/.scripts/configs"
+
+# Output locations
+shell_shortcuts="$HOME/.shortcuts"
+ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf"
+qute_shortcuts="$HOME/.config/qutebrowser/shortcuts.py"
+
+# Shell rc file (i.e. bash vs. zsh, etc.)
+shellrc="$HOME/.bashrc"
+
+# Download the shorcut files if not present.
+[[ ! -f $folders ]] && curl https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.scripts/folders > "$folders"
+[[ ! -f $configs ]] && curl https://raw.githubusercontent.com/LukeSmithxyz/voidrice/master/.scripts/configs > "$configs"
+
+# Remove
+rm -f $shell_shortcuts $ranger_shortcuts $qute_shortcuts
+
+# Ensuring that output locations are properly sourced
+(grep "source ~/.shortcuts" $shellrc)>/dev/null || echo "source ~/.shortcuts" >> $shellrc
+(grep "source $HOME/.config/ranger/shortcuts.conf" $HOME/.config/ranger/rc.conf)>/dev/null || echo "source $HOME/.config/ranger/shortcuts.conf" >> $HOME/.config/ranger/rc.conf
+(grep "config.source('shortcuts.py')" $HOME/.config/qutebrowser/config.py)>/dev/null || echo "config.source('shortcuts.py')" >> $HOME/.config/qutebrowser/config.py
+
+# directory shortcuts
+sed "/^#/d" $folders | awk '{print "alias "$1"=\"cd "$2" && ls -a\""}' >> $shell_shortcuts
+sed "/^#/d" $folders | 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
+sed "/^#/d" $folders | awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> $qute_shortcuts
+
+# dotfile shortcuts
+sed "/^#/d" $configs | awk '{print "alias "$1"=\"$EDITOR "$2"\""}' >> $shell_shortcuts
+sed "/^#/d" $configs | awk '{print "map "$1" shell $EDITOR "$2}' >> $ranger_shortcuts