voidrice/.scripts/SCRIPTS.md

304 lines
9.2 KiB
Markdown
Raw Normal View History

2018-07-18 23:13:10 +00:00
# Directory of Scripts
2018-11-05 22:51:24 +00:00
I keep all my user-created scripts here in `~/.scripts/`. Scripts are sorted
into sub-directories for easy management, and all are seamlessly added to
`$PATH` with the command below in `~/.profile`:
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
```
export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH"
```
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
## `statusbar/`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
For modules used in i3blocks.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3battery`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
i3blocks module. Shows available power remaining with icon indicating battery
status. Colors indicate different levels of charge.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3mail`
2018-11-05 22:51:24 +00:00
i3blocks module for use with mutt-wizard. Shows unread mail and if
`mailsync.sh` is running.
2018-11-05 22:51:24 +00:00
### `i3mpd`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
i3blocks module. Shows current song; if paused, name will be grayed and italic.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3mpdupdate`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
A daemon running by default that will update the i3mpd block on mpd change.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3pacman`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
i3blocks module. Detects new installable upgrades. Only works if you use
cronjobs to automatically sync repositories.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3torrent`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or
finished (🌱).
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3volume`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
i3blocks module. Shows volume percentage or mute notification.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `i3weather`
2018-11-05 22:51:24 +00:00
i3blocks module. Gets weather forcast from wttr.in and returns today's
precipitation chance (☔), daily low (❄️) and daily high (☀️).
2018-11-05 22:51:24 +00:00
### `i3wifi`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
A modified version of the i3blocks wifi module. Clicked, it brings up wifi-menu
and also appears when there is no wifi connection.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `popupdate`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `popweather`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
The script called by clicking on the i3 weather module. Brings up the forecast
from `http://wttr.in` and will close on <Enter>.
2018-07-18 23:13:10 +00:00
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
## `cron/`
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
For scripts meant to be cronjobs. None are active by default on LARBS.
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
### `checkup`
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
You may need to grant your user the ability to run `pacman -Syyuw --noconfirm`
without a password (done in `/etc/sudoers`).
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `cronbat`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Gives a dunst notification if the battery is less than 25%.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `crontog`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Not actually a cronjob, but just turns off/on all user cronjobs.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `newsup`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Updates newsboat RSS feeds if connected to internet. Will also display a
newspaper update icon on i3blocks if it has not be user disabled.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
## `tools/`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Scripts intended to be run either manually by the user or linked to a shortcut
in vim or another program.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `compiler`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `dmenuhandler`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
### `extract`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Will detect file type of archive and run appropriate extraction command.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `getbib`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to
search for the .pdf's DOI. Returns nothing if none detected.
2018-07-29 18:04:49 +00:00
2018-11-05 22:51:24 +00:00
### `getkeys`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Get the LARBS documentation on what bindings exist for main programs.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `linkhandler`
2018-08-02 14:57:56 +00:00
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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `lmc`
2018-08-02 14:57:56 +00:00
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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `note`
2018-09-04 18:48:40 +00:00
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.
2018-11-05 22:51:24 +00:00
### `opout`
2018-08-02 14:57:56 +00:00
"Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or
2018-08-02 14:57:56 +00:00
`.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.
2018-11-05 22:51:24 +00:00
### `pauseallmpv`
2018-08-02 14:57:56 +00:00
2018-07-29 18:04:49 +00:00
Pauses all mpv instances by sending the `,` key to each. Used by several
2018-11-05 22:51:24 +00:00
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.
2018-07-29 18:04:49 +00:00
2018-11-05 22:51:24 +00:00
### `remaps`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `shortcuts`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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.
2018-07-29 18:04:49 +00:00
2018-11-05 22:51:24 +00:00
### `speedvid`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Speed up a given video file (`$1`) by a given ammount (`$2`).
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `tpb`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Search Pirate Bay for the certain search terms given as arguments.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `texclear`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
Remove all `.tex` related build files. This is run by my vim when I stop
editing any `.tex` file.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `transadd`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
The mimeapp default script for handling torrent magnet links. Starts
`transmission-daemon` if not running and adds the link.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
## `i3cmds`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
These are scripts linked to bindings in i3. They typically perform
user-interface actions or involve dmenu.
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
### `bottomleft` and `bottomright`
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
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+Print Screen` by default. Should be kill 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.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `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`
2018-08-02 14:57:56 +00:00
The startup script for the dropdown terminal (toggleable with `mod+u`). Either
attaches to an existing tmux session or begins a new one.
2018-07-18 23:13:10 +00:00
2018-11-05 22:51:24 +00:00
### `toggletouchpad`
2018-08-02 14:57:56 +00:00
2018-07-29 18:04:49 +00:00
As the name suggests, turns off TouchPad if on, and turns it on if off.
2018-11-05 22:51:24 +00:00
Requires `xf86-input-synaptics`. If your laptop has a special button for this,
it will be mapped by default.
2018-08-02 14:57:56 +00:00
2018-11-05 22:51:24 +00:00
### `tutorialvids`
2018-08-02 14:57:56 +00:00
A dmenu prompt that gives some options of tutorial videos to watch. Bound to
`mod+shift+e`.