dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2f4c2a68a1cbebb0e06a5b3296e4bbb575c5fcb2
parent cd667e6aa111c86b40b9e3104605953e9b341332
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Mon,  5 Nov 2018 17:51:24 -0500

scripts sorted

Diffstat:
M.config/i3/config | 12++++++------
M.config/i3/i3_guide.rmd | 53++++++++++++++++++++++++++---------------------------
M.profile | 2+-
M.scripts/SCRIPTS.md | 340++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
R.scripts/cronbat -> .scripts/cron/cronbat | 0
A.scripts/cron/crontog | 5+++++
A.scripts/cron/newsup | 14++++++++++++++
D.scripts/crontog | 5-----
D.scripts/dmenuarchwiki | 17-----------------
D.scripts/ext | 2--
R.scripts/bottomleft -> .scripts/i3cmds/bottomleft | 0
R.scripts/bottomright -> .scripts/i3cmds/bottomright | 0
R.scripts/camtoggle -> .scripts/i3cmds/camtoggle | 0
R.scripts/ddspawn -> .scripts/i3cmds/ddspawn | 0
R.scripts/displayselect -> .scripts/i3cmds/displayselect | 0
R.scripts/dmenumount -> .scripts/i3cmds/dmenumount | 0
R.scripts/dmenurecord -> .scripts/i3cmds/dmenurecord | 0
R.scripts/dmenuumount -> .scripts/i3cmds/dmenuumount | 0
R.scripts/dmenuunicode -> .scripts/i3cmds/dmenuunicode | 0
R.scripts/dropdowncalc -> .scripts/i3cmds/dropdowncalc | 0
R.scripts/ducksearch -> .scripts/i3cmds/ducksearch | 0
R.scripts/i3resize -> .scripts/i3cmds/i3resize | 0
R.scripts/killrecording -> .scripts/i3cmds/killrecording | 0
A.scripts/i3cmds/lockscreen | 19+++++++++++++++++++
R.scripts/newspod -> .scripts/i3cmds/newspod | 0
R.scripts/prompt -> .scripts/i3cmds/prompt | 0
R.scripts/samedir -> .scripts/i3cmds/samedir | 0
A.scripts/i3cmds/td-toggle | 15+++++++++++++++
R.scripts/tmuxdd -> .scripts/i3cmds/tmuxdd | 0
R.scripts/toggletouchpad -> .scripts/i3cmds/toggletouchpad | 0
R.scripts/tutorialvids -> .scripts/i3cmds/tutorialvids | 0
D.scripts/kb-lights.py | 35-----------------------------------
D.scripts/lockscreen | 19-------------------
D.scripts/musstuff | 49-------------------------------------------------
D.scripts/newsup | 10----------
R.scripts/lock.png -> .scripts/pix/lock.png | 0
D.scripts/polybar_launch | 16----------------
D.scripts/showclip | 6------
R.scripts/i3battery -> .scripts/statusbar/i3battery | 0
R.scripts/i3mail -> .scripts/statusbar/i3mail | 0
R.scripts/i3mpd -> .scripts/statusbar/i3mpd | 0
R.scripts/i3mpdupdate -> .scripts/statusbar/i3mpdupdate | 0
R.scripts/i3pacman -> .scripts/statusbar/i3pacman | 0
R.scripts/i3torrent -> .scripts/statusbar/i3torrent | 0
R.scripts/i3volume -> .scripts/statusbar/i3volume | 0
R.scripts/i3weather -> .scripts/statusbar/i3weather | 0
R.scripts/i3wifi -> .scripts/statusbar/i3wifi | 0
R.scripts/popupgrade -> .scripts/statusbar/popupgrade | 0
R.scripts/popweather -> .scripts/statusbar/popweather | 0
D.scripts/td-toggle | 13-------------
R.scripts/compiler -> .scripts/tools/compiler | 0
R.scripts/dmenuhandler -> .scripts/tools/dmenuhandler | 0
A.scripts/tools/ext | 2++
R.scripts/extract -> .scripts/tools/extract | 0
R.scripts/getbib -> .scripts/tools/getbib | 0
R.scripts/getkeys -> .scripts/tools/getkeys | 0
R.scripts/linkhandler -> .scripts/tools/linkhandler | 0
R.scripts/lmc -> .scripts/tools/lmc | 0
R.scripts/note -> .scripts/tools/note | 0
R.scripts/opout -> .scripts/tools/opout | 0
R.scripts/pauseallmpv -> .scripts/tools/pauseallmpv | 0
R.scripts/remaps -> .scripts/tools/remaps | 0
R.scripts/shortcuts -> .scripts/tools/shortcuts | 0
R.scripts/speedvid.sh -> .scripts/tools/speedvid | 0
R.scripts/texclear -> .scripts/tools/texclear | 0
R.scripts/tpb -> .scripts/tools/tpb | 0
R.scripts/transadd -> .scripts/tools/transadd | 0
M.vimrc | 2+-
68 files changed, 289 insertions(+), 347 deletions(-)

diff --git a/.config/i3/config b/.config/i3/config @@ -56,7 +56,7 @@ exec --no-startup-id dunst # Composite manager: exec --no-startup-id compton # Runs the key remapping scripts -exec --no-startup-id ~/.scripts/remaps +exec --no-startup-id remaps # Unclutter makes the mouse invisible after a brief period exec --no-startup-id unclutter # Run the script to update the mpd i3block on change. @@ -137,7 +137,7 @@ bindsym $mod+Shift+Insert exec --no-startup-id showclip bindsym $mod+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill -bindsym $mod+w exec --no-startup-id $BROWSER +bindsym $mod+w exec $term -e nmtui bindsym $mod+Shift+w exec --no-startup-id $BROWSER bindsym $mod+e exec $term -e neomutt @@ -201,8 +201,8 @@ bindsym $mod+Shift+z gaps outer current minus 5 bindsym $mod+x exec --no-startup-id lockscreen bindsym $mod+Shift+x exec --no-startup-id prompt "Shutdown computer?" "$shutdown" -bindsym $mod+c exec --no-startup-id camtoggle -##bindsym $mod+Shift+c +bindsym $mod+c exec --no-startup-id freealf +bindsym $mod+Shift+c exec --no-startup-id camtoggle bindsym $mod+v exec $term -e ncmpcpp -s visualizer bindsym $mod+Shift+v exec --no-startup-id projectM-pulseaudio @@ -410,8 +410,8 @@ 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 XF86KbdLightOnOff exec -bindsym XF86KbdBrightnessDown exec --no-startup-id python3.6 ~/.scripts/kb-lights.py - -bindsym XF86KbdBrightnessUp exec --no-startup-id python3.6 ~/.scripts/kb-lights.py + +#bindsym XF86KbdBrightnessDown exec +#bindsym XF86KbdBrightnessUp exec ##bindsym XF86Reply exec ##bindsym XF86MailForward exec ##bindsym XF86Save exec diff --git a/.config/i3/i3_guide.rmd b/.config/i3/i3_guide.rmd @@ -114,40 +114,40 @@ system will grow on you quick. ## Basic Programs *Note:* LARBS will install nearly all of these programs by default, but some -only come if you chose an extra option. Naturally, you can use `packer` to look +only come if you chose an extra option. Naturally, you can use `yay` to look for and install any you want to add. + `Mod+r` -- ranger (file browser/manager) + `Mod+e` -- mutt (email) + `Mod+m` -- ncmpcpp (music player) -+ `Mod+a` -- R/Python calculator (be sure to close with Mod+a for reusability) ++ `Mod+w` -- nmtui (for connecting to wireless internet) ++ `Mod+a` -- R/Python calculator (hide with `mod+a`) + `Mod+i` -- htop (system info) + `Mod+n` -- newsboat (RSS feed reader) + `Mod+y` -- calcurse (calendar and schedule) -+ `Mod+u` -- "Dropdown" terminal (close with Mod+u for reusability) ++ `Mod+u` -- "Dropdown" terminal (hide with `mod+u`) + `Mod+A` -- pulsemixer (audio system control) -+ `Mod+w/W` -- Web Browser ++ `Mod+W` -- Web Browser + `Mod+G` -- GIMP (for general image manipulation) ## System + `Mod+R` -- ranger as root user + `Mod+x` -- i3lock (Enter password to return) -+ `Mod+X` -- shutdown (will give a dmenu confirm prompt) -+ `Mod+Shift+Backspace` -- reboot (will give a dmenu confirm prompt) -+ `Mod+Shift+Escape` -- exit i3 (will give a dmenu confirm prompt) ++ `Mod+X` -- shutdown (will ask to confirm) ++ `Mod+Shift+Backspace` -- reboot (will ask to confirm) ++ `Mod+Shift+Escape` -- exit i3 (will ask to confirm) + `Mod+F1` -- Shows this document + `Mod+F2` -- Refresh i3 + `Mod+F3` -- Select screen/display to use -+ `Mod+F4` -- Hibernate ++ `Mod+F4` -- Hibernate (will ask to confirm) + `Mod+F5` -- Reset Network Manager, search for new networks + `Mod+F6` -- transmission torrent client (cli) + `Mod+F7` -- Toggle on/off transmission client via dmenu + `Mod+F8` -- Check mail, if [mutt-wizard](https://github.com/lukesmithxyz/mutt-wizard) is installed -+ `Mod+F9` -- Mount a drive/partition -+ `Mod+F10` -- Unmount a drive/partition (does not umount `/`, `/home` or - `/boot`) ++ `Mod+F9` -- Mount a USB drive/hard drive or Android ++ `Mod+F10` -- Unmount a non-essential drive or Android + `Mod+F11` -- Search term on DuckDuckGo + `Mod+F12` -- Wifi-menu for selecting the wireless internet source. @@ -188,43 +188,42 @@ additions. I use scrot and ffmpeg to make different recordings of the desktop and audio. All of these recording shortcuts will output into `~`, and will not overwrite -previous recordings. +previous recordings as their names are based on their exact times. + `PrintScreen` -- Take a scrot screenshot + `Shift+PrintScreen` -- Take a scrot screenshot of only selected window + `Mod+PrintScreen` -- Opens dmenu menu to select kind of audio/video recording ++ `Mod+Delete` -- Kills any recording started in the above way. + `Mod+ScrollLock` -- Turn on and off screenkey (if installed) for visual typing display -+ `Mod+Delete` -- kills ffmpeg, thus ending recordings - -Each of the recording scripts are located in `~/.scripts`. You can check them -out or modify them if needed. ++ `Mod+Shift+c` -- Toggles a webcam in the bottom right for screencasting. ## Other buttons I've mapped those extra buttons that some keyboards have (play and pause -buttons, email, webbrowsing buttons, etc.) to what you would expect. - +buttons, screen brightness, email, web browsing buttons, etc.) to what you +would expect. # Special traits of this system ## Easy config access -Open a terminal and type `cfc`. This will open a file where you will see -customizable pairs of key shortcuts and config files. Enter any of these -shortcuts in bash or ranger to immediately open the file in vim. +Open a terminal and type `bf`. This will open a file where you will see +customizable pairs of key shortcuts and config files and other important text +files. Enter any of these shortcuts in bash or ranger to immediately open the +file in vim. You may add new entries here and they will be refreshed when you save the file in vim. This will take effect immediately once you start a new instance of bash -or ranger. +or ranger or reload your previous sessions. ## Folder and config shortcuts -Open a terminal and type `cff`. This opens a file when you can keep and create -folder shortcuts. There are only a few here now, because I don't know what your -folder structure is going to look like, but on my machine, I have 109 and -growing. +Open a terminal and type `bd`. This opens a file when you can keep and create +directory/folder shortcuts. There are only a few here now, because I don't know +what your folder structure is going to look like, but on my machine, I have 109 +and growing. -Each line has a shortcut key/keys and its target. These can be used in serveral +Each line has a shortcut key/keys and its target. These can be used in several applications. In bash, simply press `d`, the shortcut for `~/Documents` and you will cd there (and automatically `ls -a`). diff --git a/.profile b/.profile @@ -2,7 +2,7 @@ # Profile file. Runs on login. -export PATH="$PATH:$HOME/.scripts" +export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" export EDITOR="vim" export TERMINAL="st" export BROWSER="linkhandler" diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md @@ -1,146 +1,136 @@ # Directory of Scripts -## `audio` +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`: -The audio recording script run by `dmenurecord` (bound to `mod+Print`). +``` +export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" +``` -## `bottomleft` +## `statusbar/` -Makes the currently selected window float in the bottom left of screen. Bound -to `mod+B`. +For modules used in i3blocks. -## `camtoggle` +### `i3battery` -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. - -## `crontog` - -Turns off/on all user cronjobs. - -## `displayselect` - -Select which displays to use. Bound to `mod+F3`. +i3blocks module. Shows available power remaining with icon indicating battery +status. Colors indicate different levels of charge. -## `dmenuarchwiki` +### `i3mail` -Bind this script to a key and it will give you a prompt to search for a term in -the Arch Wiki. Used to be binded to `mod+F11`, but has been replaced by -`ducksearch` there. +i3blocks module for use with mutt-wizard. Shows unread mail and if +`mailsync.sh` is running. -## `dmenuhandler` +### `i3mpd` -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. +i3blocks module. Shows current song; if paused, name will be grayed and italic. -## `dmenumount` +### `i3mpdupdate` -Detect available partitions with `lsblk` and offer to mount them. Bound to -`mod+F9`. Will do nothing if none are available. +A daemon running by default that will update the i3mpd block on mpd change. -## `dmenurecord` +### `i3pacman` -Gives a list of recording commands: `audio`, `video` and `screencast` (both) in -dmenu for selection. +i3blocks module. Detects new installable upgrades. Only works if you use +cronjobs to automatically sync repositories. -## `dmenuumount` +### `i3torrent` -Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing -if none are mounted. +i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or +finished (🌱). -## `dropdowncalc` +### `i3volume` -The command initially run in the `math` window (toggeable with `mod+a`). Runs -`r` if available, else `python`. +i3blocks module. Shows volume percentage or mute notification. -## `ducksearch` +### `i3weather` -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. +i3blocks module. Gets weather forcast from wttr.in and returns today's +precipitation chance (☔), daily low (❄️) and daily high (☀️). -## `extract` +### `i3wifi` -Will detect file type of archive and run appropriate extraction command. +A modified version of the i3blocks wifi module. Clicked, it brings up wifi-menu +and also appears when there is no wifi connection. -## `getbib` +### `popupdate` -Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to -search for the .pdf's DOI. Returns nothing if none detected. +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. -## `getkeys` +### `popweather` -Get the LARBS documentation on what bindings exist for main programs. +The script called by clicking on the i3 weather module. Brings up the forecast +from `http://wttr.in` and will close on <Enter>. -## `i3battery` -i3blocks module. Shows available power remaining with icon indicating battery -status. Colors indicate different levels of charge. +## `cron/` -## `i3mail` +For scripts meant to be cronjobs. None are active by default on LARBS. -i3blocks module for use with mutt-wizard. Shows unread mail and if -`mailsync.sh` is running. +### `checkup` -## `i3mpd` +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. -i3blocks module. Shows current song; if paused, name will be grayed and italic. +You may need to grant your user the ability to run `pacman -Syyuw --noconfirm` +without a password (done in `/etc/sudoers`). -## `i3mpdupdate` +### `cronbat` -A daemon running by default that will update the i3mpd block on mpd change. +Gives a dunst notification if the battery is less than 25%. -## `i3pacman` +### `crontog` -i3blocks module. Detects new installable upgrades. Only works if you use -cronjobs to automatically sync repositories. +Not actually a cronjob, but just turns off/on all user cronjobs. -## `i3resize` +### `newsup` -A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`. +Updates newsboat RSS feeds if connected to internet. Will also display a +newspaper update icon on i3blocks if it has not be user disabled. -## `i3torrent` +## `tools/` -i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or -finished (🌱). +Scripts intended to be run either manually by the user or linked to a shortcut +in vim or another program. -## `i3volume` +### `compiler` -i3blocks module. Shows volume percentage or mute notification. +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. -## `i3weather` +### `dmenuhandler` -i3blocks module. Gets weather forcast from wttr.in and returns today's -precipitation chance (☔), daily low (❄️) and daily high (☀️). +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. -## `i3wifi` +### `extract` -A modified version of the i3blocks wifi module. Clicked, it brings up wifi-menu -and also appears when there is no wifi connection. +Will detect file type of archive and run appropriate extraction command. -## `kb-lights.py` +### `getbib` -A Python 3 script which will increase or decrease keyboard lights when given -either a `+` or `-` argument. +Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to +search for the .pdf's DOI. Returns nothing if none detected. -## `killrecording` +### `getkeys` -End a recording started by `dmenurecord` the proper way. +Get the LARBS documentation on what bindings exist for main programs. -## `linkhandler` +### `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` +### `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 @@ -148,96 +138,166 @@ 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. - -## `musstuff` - -Some old notes and commands on deleted music shortcuts. - -## `note` +### `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` +### `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. -## `pauseallmpv` +### `pauseallmpv` Pauses all mpv instances by sending the `,` key to each. Used by several -scripts, but can be used alone as well. +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. -## `polybar_launch` +### `remaps` -For `polybar` users. Launches `polybar` on every screen. Should be run in the -i3 config. +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. -## `popweather` +### `shortcuts` -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. +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. -## `prompt` +### `speedvid` -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`. +Speed up a given video file (`$1`) by a given ammount (`$2`). -## `remaps` +### `tpb` -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. +Search Pirate Bay for the certain search terms given as arguments. -## `samedir` +### `texclear` -Opens a terminal window in the same directory as the window currently -selection. Bound to `mod+shift+enter`. +Remove all `.tex` related build files. This is run by my vim when I stop +editing any `.tex` file. -## `screencast` +### `transadd` -A script for `dmenurecord`. Records default audio and the screen. +The mimeapp default script for handling torrent magnet links. Starts +`transmission-daemon` if not running and adds the link. -## `shortcuts.sh` +## `i3cmds` -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. +These are scripts linked to bindings in i3. They typically perform +user-interface actions or involve dmenu. -## `texclear` +### `bottomleft` and `bottomright` -Remove all `.tex` related build files. This is run by my vim when I stop -editing any `.tex` file. +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. -## `tmuxinit` +### `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` +### `toggletouchpad` As the name suggests, turns off TouchPad if on, and turns it on if off. -Requires `xf86-input-synaptics`. - -## `tpb` +Requires `xf86-input-synaptics`. If your laptop has a special button for this, +it will be mapped by default. -Search Pirate Bay for the certain search terms given as arguments. - -## `tutorialvids` +### `tutorialvids` 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/cronbat b/.scripts/cron/cronbat diff --git a/.scripts/cron/crontog b/.scripts/cron/crontog @@ -0,0 +1,5 @@ +#!/bin/sh +# Toggles all cronjobs off/on. +# Stores disabled crontabs in ~/.consaved until restored. + +([ -f ~/.cronsaved ] && crontab - < ~/.cronsaved && rm ~/.cronsaved && notify-send "Cronjobs have been re-enabled." && echo cronjobs re-enabled.) || ( crontab -l > ~/.cronsaved && crontab -r && echo cronjobs saved and disabled.;notify-send "Cronjobs have been saved and disabled.") diff --git a/.scripts/cron/newsup b/.scripts/cron/newsup @@ -0,0 +1,14 @@ +#!/bin/sh + +# Set as a cron job to check for new RSS entries for newsboat. +# Note that newsbot cannot be opened during the sync and this +# sync cannot run while another instance of newsboat is open. + +ping -q -t 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit +echo "📰 🔃" > ~/.newsup +pkill -RTMIN+6 i3blocks +printf "Loading new RSS entries for newsboat...\\n" +/usr/bin/newsboat -x reload && + printf "Done.\\n" +echo "" > ~/.newsup +pkill -RTMIN+6 i3blocks diff --git a/.scripts/crontog b/.scripts/crontog @@ -1,5 +0,0 @@ -#!/bin/bash -# Toggles all cronjobs off/on. -# Stores disabled crontabs in ~/.consaved until restored. - -([[ -f ~/.cronsaved ]] && cat ~/.cronsaved | crontab - && rm ~/.cronsaved && notify-send "Cronjobs have been re-enabled." && echo cronjobs re-enabled.) || ( crontab -l > ~/.cronsaved && crontab -r && echo cronjobs saved and disabled.;notify-send "Cronjobs have been saved and disabled.") diff --git a/.scripts/dmenuarchwiki b/.scripts/dmenuarchwiki @@ -1,17 +0,0 @@ -#!/bin/sh - -# Gives a dmenu prompt to search the Arch Wiki in your preferred web browser -# Home goes to the home page of the Arch Wiki -# Anything else, it search it - -# Original idea/script by Github user @Caedis. Minor changes by Luke. - -pgrep -x dmenu && exit - -choice=$(echo "📖" | dmenu -i -p "Type ArchWiki page or search term:") || exit 1 - -if [ "$choice" = "📖" ]; then - $BROWSER "https://wiki.archlinux.org" -else - $BROWSER "https://wiki.archlinux.org/index.php?search=$choice" -fi diff --git a/.scripts/ext b/.scripts/ext @@ -1 +0,0 @@ -extract- \ No newline at end of file diff --git a/.scripts/bottomleft b/.scripts/i3cmds/bottomleft diff --git a/.scripts/bottomright b/.scripts/i3cmds/bottomright diff --git a/.scripts/camtoggle b/.scripts/i3cmds/camtoggle diff --git a/.scripts/ddspawn b/.scripts/i3cmds/ddspawn diff --git a/.scripts/displayselect b/.scripts/i3cmds/displayselect diff --git a/.scripts/dmenumount b/.scripts/i3cmds/dmenumount diff --git a/.scripts/dmenurecord b/.scripts/i3cmds/dmenurecord diff --git a/.scripts/dmenuumount b/.scripts/i3cmds/dmenuumount diff --git a/.scripts/dmenuunicode b/.scripts/i3cmds/dmenuunicode diff --git a/.scripts/dropdowncalc b/.scripts/i3cmds/dropdowncalc diff --git a/.scripts/ducksearch b/.scripts/i3cmds/ducksearch diff --git a/.scripts/i3resize b/.scripts/i3cmds/i3resize diff --git a/.scripts/killrecording b/.scripts/i3cmds/killrecording diff --git a/.scripts/i3cmds/lockscreen b/.scripts/i3cmds/lockscreen @@ -0,0 +1,19 @@ +#!/bin/sh + +rm -f /tmp/locked.png + +# If `imagemagick` is not installed, use a blank screen. +[ -f /usr/bin/convert ] && +scrot -m -z /tmp/base.png && +pgrep -x dunst && notify-send -i ~/.scripts/pix/lock.png "Locking computer..." && +convert /tmp/base.png -blur 0x8 /tmp/locked.png + +# Pause music (mocp, mpd and send the pause key to all mpv videos): +mocp -P >/dev/null 2>&1 +mpc pause >/dev/null 2>&1 +pauseallmpv >/dev/null 2>&1 + +i3lock -e -f -c 000000 -i /tmp/locked.png + +# In five seconds, turn off display unless key press in last 4 seconds. +sleep 5 && [ 4000 -lt "$(xssstate -i)" ] && pgrep -x i3lock && xset dpms force off diff --git a/.scripts/newspod b/.scripts/i3cmds/newspod diff --git a/.scripts/prompt b/.scripts/i3cmds/prompt diff --git a/.scripts/samedir b/.scripts/i3cmds/samedir diff --git a/.scripts/i3cmds/td-toggle b/.scripts/i3cmds/td-toggle @@ -0,0 +1,15 @@ +#!/bin/sh + +# If transmission-daemon is running, will ask to kill, else will ask to start. + +[ ! -f /usr/bin/transmission-daemon ] && echo "Transmission not installed." && exit + +if pgrep -x transmission-da >/dev/null ; +then + yn=$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?") + [ "$yn" = "Yes" ] && killall transmission-da +else + yn=$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?") + [ "$yn" = "Yes" ] && transmission-daemon +fi +sleep 3 && pkill -RTMIN+7 i3blocks diff --git a/.scripts/tmuxdd b/.scripts/i3cmds/tmuxdd diff --git a/.scripts/toggletouchpad b/.scripts/i3cmds/toggletouchpad diff --git a/.scripts/tutorialvids b/.scripts/i3cmds/tutorialvids diff --git a/.scripts/kb-lights.py b/.scripts/kb-lights.py @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -# coding: utf-8 - -from sys import argv -import dbus - - -def kb_light_set(delta): - bus = dbus.SystemBus() - kbd_backlight_proxy = bus.get_object('org.freedesktop.UPower', '/org/freedesktop/UPower/KbdBacklight') - kbd_backlight = dbus.Interface(kbd_backlight_proxy, 'org.freedesktop.UPower.KbdBacklight') - - current = kbd_backlight.GetBrightness() - maximum = kbd_backlight.GetMaxBrightness() - new = max(0, current + delta) - - if 0 <= new <= maximum: - current = new - kbd_backlight.SetBrightness(current) - - # Return current backlight level percentage - return 100 * current / maximum - -if __name__ == '__main__': - if len(argv[1:]) == 1: - if argv[1] == "--up" or argv[1] == "+": - # ./kb-light.py (+|--up) to increment - print(kb_light_set(1)) - elif argv[1] == "--down" or argv[1] == "-": - # ./kb-light.py (-|--down) to decrement - print(kb_light_set(-1)) - else: - print("Unknown argument:", argv[1]) - else: - print("Script takes exactly one argument.", len(argv[1:]), "arguments provided.") diff --git a/.scripts/lockscreen b/.scripts/lockscreen @@ -1,19 +0,0 @@ -#!/bin/sh - -rm -f /tmp/locked.png - -# If `imagemagick` is not installed, use a blank screen. -[ -f /usr/bin/convert ] && -scrot -m -z /tmp/base.png && -pgrep -x dunst && notify-send -i ~/.scripts/lock.png "Locking computer..." && -convert /tmp/base.png -blur 0x8 /tmp/locked.png - -# Pause music (mocp, mpd and send the pause key to all mpv videos): -mocp -P >/dev/null 2>&1 -mpc pause >/dev/null 2>&1 -pauseallmpv >/dev/null 2>&1 - -i3lock -e -f -c 000000 -i /tmp/locked.png - -# In five seconds, turn off display unless key press in last 4 seconds. -sleep 5 && [ 4000 -lt "$(xssstate -i)" ] && pgrep -x i3lock && xset dpms force off diff --git a/.scripts/musstuff b/.scripts/musstuff @@ -1,49 +0,0 @@ -These are some old lines from the i3 config. - -I now use the lmc script to change volume and music tracks, which makes i3blocks integration better. - -I deleted the alternative lines for audio commands from the i3 config. -Still, since they're a good reference for people who use ALSA, or people who use music players besides mpd, I've kept them in this file. - -You can replace the commands in the lmc script to get the setup you want. I might have the script autodecide the command later on. - -#FOR ALSA/AMIXER -#set $inc --no-startup-id amixer sset Master 2%+ -#set $biginc --no-startup-id amixer sset Master 5%+ -#set $dec --no-startup-id amixer sset Master 2%- -#set $bigdec --no-startup-id amixer sset Master 5%- -#set $mute --no-startup-id amixer sset Master toggle -#set $truemute --no-startup-id amixer sset Master mute - -##For spotify -#set $music spotify -#set $pause dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause -#set $trupause dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause -#set $play dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play -#set $next dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next -#set $prev dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous -#set $lilfor dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek -#set $bigfor dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek( - -# For moc: -#set $music --no-startup-id st -e mocp -#set $pause --no-startup-id mocp -G -#set $truepause --no-startup-id mocp -P -#set $next --no-startup-id mocp -f -#set $prev --no-startup-id mocp -r -#set $lilfor --no-startup-id mocp -k 10 -#set $bigfor --no-startup-id mocp -k 120 -#set $lilbak --no-startup-id mocp -k -10 -#set $bigbak --no-startup-id mocp -k -120 -#set $beg --no-startup-id mocp -j 0% - -# For cmus: -#set $music --no-startup-id st -e cmus -#set $pause --no-startup-id cmus-remote -u -#set $next --no-startup-id cmus-remote -n -#set $prev --no-startup-id cmus-remote -r -#set $lilfor --no-startup-id cmus-remote -k +10 -#set $bigfor --no-startup-id cmus-remote -k +120 -#set $lilbak --no-startup-id cmus-remote -k -10 -#set $bigbak --no-startup-id cmus-remote -k -120 -#set $beg --no-startup-id cmus-remote -k 00:00:00 diff --git a/.scripts/newsup b/.scripts/newsup @@ -1,10 +0,0 @@ -#!/bin/sh - -ping -q -t 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit -echo "📰 🔃" > ~/.newsup -pkill -RTMIN+6 i3blocks -printf "Loading new RSS entries for newsboat...\\n" -/usr/bin/newsboat -x reload && - printf "Done.\\n" -echo "" > ~/.newsup -pkill -RTMIN+6 i3blocks diff --git a/.scripts/lock.png b/.scripts/pix/lock.png Binary files differ. diff --git a/.scripts/polybar_launch b/.scripts/polybar_launch @@ -1,16 +0,0 @@ -#!/bin/sh -#!/usr/bin/env sh - -# Terminate already running bar instances -killall -q polybar - -# Wait until the processes have been shut down -while pgrep -x polybar >/dev/null; do sleep 1; done - -# Launch bar1 and bar2 -#polybar example & - -for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar example -c ~/.config/polybar/config & done -feh --bg-scale ~/.config/wall.png - -echo "Bars launched..." diff --git a/.scripts/showclip b/.scripts/showclip @@ -1,6 +0,0 @@ -#!/bin/sh - -# Display contents of selection via dunst if running. -# Separate script for i3. - -pgrep -x dunst >/dev/null && notify-send "$(xclip -o -selection clipboard)" diff --git a/.scripts/i3battery b/.scripts/statusbar/i3battery diff --git a/.scripts/i3mail b/.scripts/statusbar/i3mail diff --git a/.scripts/i3mpd b/.scripts/statusbar/i3mpd diff --git a/.scripts/i3mpdupdate b/.scripts/statusbar/i3mpdupdate diff --git a/.scripts/i3pacman b/.scripts/statusbar/i3pacman diff --git a/.scripts/i3torrent b/.scripts/statusbar/i3torrent diff --git a/.scripts/i3volume b/.scripts/statusbar/i3volume diff --git a/.scripts/i3weather b/.scripts/statusbar/i3weather diff --git a/.scripts/i3wifi b/.scripts/statusbar/i3wifi diff --git a/.scripts/popupgrade b/.scripts/statusbar/popupgrade diff --git a/.scripts/popweather b/.scripts/statusbar/popweather diff --git a/.scripts/td-toggle b/.scripts/td-toggle @@ -1,13 +0,0 @@ -#!/bin/sh - -# If transmission-daemon is running, will ask to kill, else will ask to start. - -if pgrep -x transmission-da ; -then - yn=$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?") - [ "$yn" = "Yes" ] && killall transmission-daemon -else - yn=$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?") - [ "$yn" = "Yes" ] && transmission-daemon -fi -sleep 3 && pkill -RTMIN+7 i3blocks diff --git a/.scripts/compiler b/.scripts/tools/compiler diff --git a/.scripts/dmenuhandler b/.scripts/tools/dmenuhandler diff --git a/.scripts/tools/ext b/.scripts/tools/ext @@ -0,0 +1 @@ +extract+ \ No newline at end of file diff --git a/.scripts/extract b/.scripts/tools/extract diff --git a/.scripts/getbib b/.scripts/tools/getbib diff --git a/.scripts/getkeys b/.scripts/tools/getkeys diff --git a/.scripts/linkhandler b/.scripts/tools/linkhandler diff --git a/.scripts/lmc b/.scripts/tools/lmc diff --git a/.scripts/note b/.scripts/tools/note diff --git a/.scripts/opout b/.scripts/tools/opout diff --git a/.scripts/pauseallmpv b/.scripts/tools/pauseallmpv diff --git a/.scripts/remaps b/.scripts/tools/remaps diff --git a/.scripts/shortcuts b/.scripts/tools/shortcuts diff --git a/.scripts/speedvid.sh b/.scripts/tools/speedvid diff --git a/.scripts/texclear b/.scripts/tools/texclear diff --git a/.scripts/tpb b/.scripts/tools/tpb diff --git a/.scripts/transadd b/.scripts/tools/transadd diff --git a/.vimrc b/.vimrc @@ -110,7 +110,7 @@ let mapleader =" " autocmd BufWritePre * %s/\s\+$//e " When shortcut files are updated, renew bash and ranger configs with new material: - autocmd BufWritePost ~/.scripts/folders,~/.scripts/configs !bash ~/.scripts/shortcuts.sh + autocmd BufWritePost ~/.key_directories,~/.key_files !bash ~/.scripts/tools/shortcuts " Runs a script that cleans out tex build files whenever I close out of a .tex file. autocmd VimLeave *.tex !texclear %