diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-05-18 00:07:32 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-05-18 00:07:32 -0400 |
| commit | 54920103c2843f5a3620effbccaceaee7f6885c1 (patch) | |
| tree | 222aa8e75573364cd043382996f4798d94104f65 /.scripts | |
| parent | 18e001db07d7105ab4dc4f4f836ca0d3a516a791 (diff) | |
| download | eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.tar.gz eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.tar.zst eibhear-54920103c2843f5a3620effbccaceaee7f6885c1.zip | |
scripts moved to ~/.local/bin
Diffstat (limited to '.scripts')
73 files changed, 0 insertions, 1264 deletions
diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md deleted file mode 100644 index a99e35e..0000000 --- a/.scripts/SCRIPTS.md +++ /dev/null @@ -1,87 +0,0 @@ -# Directory of Scripts - -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`: - -``` -export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH" -``` - -## `statusbar/` - -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 (βοΈ). - -## `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. - -## `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 `<leader>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 `<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. 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 `~/.config/bmdirs` and `~/.config/bmfiles` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.config/shortcutrc` 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 `~/.bm*` 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`. diff --git a/.scripts/cron/IMPORTANT_NOTE.md b/.scripts/cron/IMPORTANT_NOTE.md deleted file mode 100644 index 4568a77..0000000 --- a/.scripts/cron/IMPORTANT_NOTE.md +++ /dev/null @@ -1,11 +0,0 @@ -# Important Note - -These cronjobs have components that require information about your current display to display notifications correctly. - -When you add them as cronjobs, I recommend you precede the command with commands as those below: - -``` -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus; export DISPLAY=:0; . $HOME/.profile; then_command_goes_here -``` - -This ensures that notifications will display, xdotool commands will function and environmental varialbes will work as well. diff --git a/.scripts/cron/checkup b/.scripts/cron/checkup deleted file mode 100755 index 0bda098..0000000 --- a/.scripts/cron/checkup +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Syncs repositories and downloads updates, meant to be run as a cronjob. - -ping -q -c 1 1.1.1.1 > /dev/null || exit - -notify-send "π¦ Repository Sync" "Checking for package 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 -Qu | grep -v "\[ignored\]" -then - notify-send "π Repository Sync" "Updates available. Click statusbar icon (π¦) for update." -else - notify-send "π¦ Repository Sync" "Sync complete. No new packages for update." -fi diff --git a/.scripts/cron/cronbat b/.scripts/cron/cronbat deleted file mode 100755 index c09ff42..0000000 --- a/.scripts/cron/cronbat +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Notify me with notify-send if my battery is below 25%. -# You can set this to run via cron. - -[ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && exit -[ "$(cat /sys/class/power_supply/BAT0/capacity)" -lt 25 ] && -export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus && -notify-send -u critical "Battery critically low." diff --git a/.scripts/cron/crontog b/.scripts/cron/crontog deleted file mode 100755 index 93c2d30..0000000 --- a/.scripts/cron/crontog +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# Toggles all cronjobs off/on. -# Stores disabled crontabs in ~/.consaved until restored. - -([ -f ~/.config/cronsaved ] && crontab - < ~/.config/cronsaved && rm ~/.config/cronsaved && notify-send "π Cronjobs re-enabled.") || ( crontab -l > ~/.config/cronsaved && crontab -r && notify-send "π Cronjobs saved and disabled.") diff --git a/.scripts/cron/newsup b/.scripts/cron/newsup deleted file mode 100755 index f894927..0000000 --- a/.scripts/cron/newsup +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Set as a cron job to check for new RSS entries for newsboat. -# If newsboat is open, sends it an "R" key to refresh. - -ping -q -c 1 1.1.1.1 > /dev/null || exit - -/usr/bin/notify-send "π° Updating RSS feeds..." - -pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit - -echo π > /tmp/newsupdate -pkill -RTMIN+6 i3blocks -/usr/bin/newsboat -x reload -rm -f /tmp/newsupdate -pkill -RTMIN+6 i3blocks -/usr/bin/notify-send "π° RSS feed update complete." diff --git a/.scripts/i3cmds/cabl b/.scripts/i3cmds/cabl deleted file mode 100755 index b5b1b3f..0000000 --- a/.scripts/i3cmds/cabl +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Dependencies are xclip and xorg-xprop. -# qrencode required for qrcode generation. -# groff/zathura required for man pages. -prim="$(xclip -o)"; [ -z "$prim" ] && exit - -PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) -PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') -cd "$(readlink /proc/"$PID"/cwd)" -[ -f "$prim" ] && xdg-open "$prim" && exit -[ -d "$prim" ] && "$TERMINAL" "$prim" && exit - -websearch() { "$BROWSER" "https://duckduckgo.com/?q=$@" ;} -wikipedia() { "$BROWSER" "https://en.wikipedia.org/wiki/$@" ;} -wiktionary() { "$BROWSER" "https://en.wiktionary.org/wiki/$@" ;} -maps() { "$BROWSER" "https://www.openstreetmap.org/search?query=$@" ;} -ebay() { "$BROWSER" "https://www.ebay.com/sch/$@" ;} - -echo "$prim" | grep "^.*\.[A-Za-z]\+.*" >/dev/null && gotourl() { "$BROWSER" "$@" ;} -echo "$prim" | grep "^.*@.*\.[A-Za-z]\+$" >/dev/null && email() { xdg-email "$@" ;} -command -v qrencode >/dev/null && qrcode() { qrencode "$@" -s 10 -o /tmp/qr.png && xdg-open /tmp/qr.png ;} -man -k "^$prim$" >/dev/null && manual() { man -Tpdf "$prim" | zathura - ;} - -func="$(declare -F | awk '{print $3}' | dmenu -p "Plumb \"$(echo "$prim" | cut -c -30)\" to?" -i -l 15)" - -[ -z "$func" ] || "$func" "$prim" diff --git a/.scripts/i3cmds/camtoggle b/.scripts/i3cmds/camtoggle deleted file mode 100755 index 05679c0..0000000 --- a/.scripts/i3cmds/camtoggle +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" /dev/video0 diff --git a/.scripts/i3cmds/ddspawn b/.scripts/i3cmds/ddspawn deleted file mode 100755 index d4a4034..0000000 --- a/.scripts/i3cmds/ddspawn +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# 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 - -script=$1 -shift -if xwininfo -tree -root | grep "(\"dropdown_$script\" "; -then - echo "Window detected." - i3 "[instance=\"dropdown_$script\"] scratchpad show; [instance=\"dropdown_$script\"] move position center" -else - echo "Window not detected... spawning." - i3 "exec --no-startup-id $TERMINAL -n dropdown_$script $@ -e $script" -fi diff --git a/.scripts/i3cmds/displayselect b/.scripts/i3cmds/displayselect deleted file mode 100755 index e526014..0000000 --- a/.scripts/i3cmds/displayselect +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -# A UI for detecting and selecting all displays. -# Probes xrandr for connected displays and lets user select one to use. -# User may also select "manual selection" which opens arandr. -# I plan on adding a routine from multi-monitor setups later. - -twoscreen() { # If multi-monitor is selected and there are two screens. - - 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 "Optimize resolution for:") - 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 --scale 1.0x1.0 \ - --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 --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 - fi - } - -morescreen() { # If multi-monitor is selected and there are more than two screens. - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:") - direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:") - xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto - } - -multimon() { # Multi-monitor handler. - case "$(echo "$screens" | wc -l)" in - 1) xrandr $(echo "$allposs" | grep -v "$screens" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; - 2) twoscreen ;; - *) morescreen ;; - esac ;} - -# Get all possible displays -allposs=$(xrandr -q | grep "connected") - -# Get all connected screens. -screens=$(echo "$allposs" | grep " connected" | awk '{print $1}') - -# Get user choice including multi-monitor and manual selection: -chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && -case "$chosen" in - "manual selection") arandr ; exit ;; - "multi-monitor") multimon ;; - *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;; -esac - -setbg # Fix background if screen size/arangement has changed. -remaps # Re-remap keys if keyboard added (for laptop bases) -pgrep -x dunst >/dev/null && killall dunst && setsid dunst & # Restart dunst to ensure proper location on screen diff --git a/.scripts/i3cmds/dmenumount b/.scripts/i3cmds/dmenumount deleted file mode 100755 index 9129643..0000000 --- a/.scripts/i3cmds/dmenumount +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh -# Gives a dmenu prompt to mount unmounted drives. -# If they're in /etc/fstab, they'll be mounted automatically. -# Otherwise, you'll be prompted to give a mountpoint from already existsing directories. -# If you input a novel directory, it will prompt you to create that directory. - -getmount() { \ - [ -z "$chosen" ] && exit 1 - mp="$(find $1 | dmenu -i -p "Type in mount point.")" - [ "$mp" = "" ] && exit 1 - if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") - [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") - fi - } - -mountusb() { \ - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')" - sudo -A mount "$chosen" && notify-send "π» USB mounting" "$chosen mounted." && exit 0 - alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$2=="part"&&$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not \( -path *%s -prune \) \ \n",$3}') - getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" - 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"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";; - esac - notify-send "π» USB mounting" "$chosen mounted to $mp." - } - -mountandroid() { \ - chosen=$(echo "$anddrives" | dmenu -i -p "Which Android device?" | cut -d : -f 1) - getmount "$HOME -maxdepth 3 -type d" - simple-mtpfs --device "$chosen" "$mp" - notify-send "π€ Android Mounting" "Android device mounted to $mp." - } - -asktype() { \ - case $(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?") in - USB) mountusb ;; - Android) mountandroid ;; - esac - } - -anddrives=$(simple-mtpfs -l 2>/dev/null) -usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$2=="part"&&$4==""{printf "%s (%s)\n",$1,$3}')" - -if [ -z "$usbdrives" ]; then - [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit - echo "Android device(s) detected." - mountandroid -else - if [ -z "$anddrives" ]; then - echo "USB drive(s) detected." - mountusb - else - echo "Mountable USB drive(s) and Android device(s) detected." - asktype - fi -fi diff --git a/.scripts/i3cmds/dmenurecord b/.scripts/i3cmds/dmenurecord deleted file mode 100755 index 0047e7a..0000000 --- a/.scripts/i3cmds/dmenurecord +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh - -# Usage: -# `record`: Ask for recording type via dmenu -# `record screencast`: Record both audio and screen -# `record video`: Record only screen -# `record audio`: Record only audio -# `record kill`: Kill existing recording -# -# If there is already a running instance, user will be prompted to end it. - -updateicon() { \ - echo "$1" > /tmp/recordingicon - pkill -RTMIN+9 i3blocks - } - -killrecording() { - recpid="$(cat /tmp/recordingpid)" - # kill with SIGTERM, allowing finishing touches. - kill -15 "$recpid" - rm -f /tmp/recordingpid - updateicon "" - pkill -RTMIN+9 i3blocks - # even after SIGTERM, ffmpeg may still run, so SIGKILL it. - sleep 3 - kill -9 "$recpid" - exit - } - -screencast() { \ - ffmpeg -y \ - -f x11grab \ - -framerate 60 \ - -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ - -i :0.0 \ - -f alsa -i default \ - -r 30 \ - -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \ - "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > /tmp/recordingpid - updateicon "βΊοΈποΈ" - } - -video() { ffmpeg \ - -f x11grab \ - -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ - -i :0.0 \ - -c:v libx264 -qp 0 -r 30 \ - "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > /tmp/recordingpid - updateicon "βΊοΈ" - } - -webcamhidef() { ffmpeg \ - -f v4l2 \ - -i /dev/video0 \ - -video_size 1920x1080 \ - "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > /tmp/recordingpid - updateicon "π₯" - } - -webcam() { ffmpeg \ - -f v4l2 \ - -i /dev/video0 \ - -video_size 640x480 \ - "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > /tmp/recordingpid - updateicon "π₯" - } - - -audio() { \ - ffmpeg \ - -f alsa -i default \ - -c:a flac \ - "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & - echo $! > /tmp/recordingpid - updateicon "ποΈ" - } - -askrecording() { \ - choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:") - case "$choice" in - screencast) screencast;; - audio) audio;; - video) video;; - webcam) webcam;; - "webcam (hi-def)") webcamhidef;; - esac - } - -asktoend() { \ - response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") && - [ "$response" = "Yes" ] && killrecording - } - - -case "$1" in - screencast) screencast;; - audio) audio;; - video) video;; - kill) killrecording;; - *) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;; -esac diff --git a/.scripts/i3cmds/dmenuumount b/.scripts/i3cmds/dmenuumount deleted file mode 100755 index dee53e7..0000000 --- a/.scripts/i3cmds/dmenuumount +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# A dmenu prompt to unmount drives. -# Provides you with mounted partitions, select one to unmount. -# Drives mounted at /, /boot and /home will not be options to unmount. - -unmountusb() { - [ -z "$drives" ] && exit - chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') - [ -z "$chosen" ] && exit - sudo -A umount "$chosen" && notify-send "π» USB unmounting" "$chosen unmounted." - } - -unmountandroid() { \ - chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?") - [ -z "$chosen" ] && exit - sudo -A umount -l "$chosen" && notify-send "π€ Android unmounting" "$chosen unmounted." - } - -asktype() { \ - case "$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" in - USB) unmountusb ;; - Android) unmountandroid ;; - esac - } - -drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$2=="part"&&$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') - -if ! grep simple-mtpfs /etc/mtab; then - [ -z "$drives" ] && echo "No drives to unmount." && exit - echo "Unmountable USB drive detected." - unmountusb -else - if [ -z "$drives" ] - then - echo "Unmountable Android device detected." - unmountandroid - else - echo "Unmountable USB drive(s) and Android device(s) detected." - asktype - fi -fi diff --git a/.scripts/i3cmds/dmenuunicode b/.scripts/i3cmds/dmenuunicode deleted file mode 100755 index 4abf202..0000000 --- a/.scripts/i3cmds/dmenuunicode +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Give dmenu list of all unicode characters to copy. -# Shows the selected character in dunst if running. - -# Must have xclip installed to even show menu. -xclip -h >/dev/null || exit - -chosen=$(grep -v "#" ~/.config/emoji | dmenu -i -l 20 -fn Monospace-18) - -[ "$chosen" != "" ] || exit - -c=$(echo "$chosen" | sed "s/ .*//") -echo "$c" | tr -d '\n' | xclip -selection clipboard -notify-send "'$c' copied to clipboard." & - -s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}') -echo "$s" | tr -d '\n' | xclip -notify-send "'$s' copied to primary." & diff --git a/.scripts/i3cmds/dropdowncalc b/.scripts/i3cmds/dropdowncalc deleted file mode 100755 index 4d41f88..0000000 --- a/.scripts/i3cmds/dropdowncalc +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ifinstalled bc && echo "Welcome to the Calculator." && bc -lq diff --git a/.scripts/i3cmds/ducksearch b/.scripts/i3cmds/ducksearch deleted file mode 100755 index 7b5bca6..0000000 --- a/.scripts/i3cmds/ducksearch +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# Gives a dmenu prompt to search DuckDuckGo. -# Without input, will open DuckDuckGo.com. -# URLs will be directly handed to the browser. -# Anything else, it search it. -browser=${BROWSER:-firefox} - -pgrep -x dmenu && exit - -choice=$(echo "π¦" | dmenu -i -p "Search DuckDuckGo:") || exit 1 - -if [ "$choice" = "π¦" ]; then - $browser "https://duckduckgo.com" -else - if echo "$choice" | grep "^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$"; then - $browser "$choice" - else - $browser "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1" - fi -fi diff --git a/.scripts/i3cmds/hover b/.scripts/i3cmds/hover deleted file mode 100755 index 8d03a99..0000000 --- a/.scripts/i3cmds/hover +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right -current=$(xdotool getwindowfocus) -newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) -newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3)) -xdotool windowsize "$current" $newheight $newwidth -newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') -newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*") - -case "$1" in - left) horizontal=0; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;; - right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) ; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;; -esac -xdotool windowmove "$current" $horizontal $vertical diff --git a/.scripts/i3cmds/i3resize b/.scripts/i3cmds/i3resize deleted file mode 100755 index 11b0992..0000000 --- a/.scripts/i3cmds/i3resize +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# This script was made by `goferito` on Github. -# Some cleanup by Luke. - -[ -z "$1" ] && echo "No direction provided" && exit 1 -distanceStr="2 px or 2 ppt" - -moveChoice() { - i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \ - i3-msg resize "$3" "$4" "$distanceStr" -} - -case $1 in - up) - moveChoice grow up shrink down - ;; - down) - moveChoice shrink up grow down - ;; - left) - moveChoice shrink right grow left - ;; - right) - moveChoice grow right shrink left - ;; -esac - diff --git a/.scripts/i3cmds/killrecording b/.scripts/i3cmds/killrecording deleted file mode 100755 index ec9a698..0000000 --- a/.scripts/i3cmds/killrecording +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -kill -9 "$(cat ~/.recordingpid)" - -# Update i3bar. -echo "" > ~/.recordingicon -pkill -RTMIN+9 i3blocks diff --git a/.scripts/i3cmds/maimpick b/.scripts/i3cmds/maimpick deleted file mode 100755 index 07d032f..0000000 --- a/.scripts/i3cmds/maimpick +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (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 "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;; - "full screen (copy)") maim | xclip -selection clipboard -t image/png ;; -esac diff --git a/.scripts/i3cmds/prompt b/.scripts/i3cmds/prompt deleted file mode 100755 index 56de2f8..0000000 --- a/.scripts/i3cmds/prompt +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -# A dmenu binary prompt script. -# Gives a dmenu prompt labeled with $1 to perform command $2. -# For example: -# `./prompt "Do you want to shutdown?" "shutdown -h now"` - -[ "$(printf "No\\nYes" | dmenu -i -p "$1" -nb darkred -sb red -sf white -nf gray )" = "Yes" ] && $2 diff --git a/.scripts/i3cmds/samedir b/.scripts/i3cmds/samedir deleted file mode 100755 index 88845fc..0000000 --- a/.scripts/i3cmds/samedir +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -PID=$(xprop -id "$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')" | grep -m 1 PID | cut -d " " -f 3) -PID=$(echo "$(pstree -lpA "$PID" | tail -n 1)" | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') -cd "$(readlink /proc/"$PID"/cwd)" -"$TERMINAL" diff --git a/.scripts/i3cmds/showclip b/.scripts/i3cmds/showclip deleted file mode 100755 index d2faff8..0000000 --- a/.scripts/i3cmds/showclip +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Display contents of selection via dunst if running. -# Separate script for i3. - -clip=$(xclip -o -selection clipboard) -prim=$(xclip -o -selection primary) - -[ -n "$clip" ] && notify-send "Clipboard:" "$clip" -[ -n "$prim" ] && notify-send "Primary:" "$prim" diff --git a/.scripts/i3cmds/td-toggle b/.scripts/i3cmds/td-toggle deleted file mode 100755 index dc727b9..0000000 --- a/.scripts/i3cmds/td-toggle +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# If transmission-daemon is running, will ask to kill, else will ask to start. -if pgrep -x transmission-da >/dev/null ; -then - [ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed." -else - ifinstalled transmission-cli || exit - [ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started." -fi -sleep 3 && pkill -RTMIN+7 i3blocks diff --git a/.scripts/i3cmds/tmuxdd b/.scripts/i3cmds/tmuxdd deleted file mode 100755 index c194ff1..0000000 --- a/.scripts/i3cmds/tmuxdd +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# This is the script that i3 runs to either start tmux in -# the dropdown terminal or log into a previous session. -tmux a || tmux diff --git a/.scripts/i3cmds/toggletouchpad b/.scripts/i3cmds/toggletouchpad deleted file mode 100755 index 6d8c9c8..0000000 --- a/.scripts/i3cmds/toggletouchpad +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Toggle touchpad. Requires xf86-input-synaptics. -(synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && echo "TouchPad reactivated." && exit -synclient TouchpadOff=1 && echo "TouchPad deactivated." diff --git a/.scripts/i3cmds/torwrap b/.scripts/i3cmds/torwrap deleted file mode 100755 index 04e7a51..0000000 --- a/.scripts/i3cmds/torwrap +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -ifinstalled transmission-remote-cli transmission-cli || exit - -! pgrep -x transmission-da >/dev/null && transmission-daemon && notify-send "Starting torrent daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks - -$TERMINAL -e transmission-remote-cli diff --git a/.scripts/i3cmds/tutorialvids b/.scripts/i3cmds/tutorialvids deleted file mode 100755 index f1357eb..0000000 --- a/.scripts/i3cmds/tutorialvids +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -vidlist=" -status bar https://www.youtube.com/watch?v=gKumet6b-WY -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 -pacman (installing/managing programs) https://www.youtube.com/watch?v=-dEuXTMzRKs -mutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A -ncmpcpp (music player) https://www.youtube.com/watch?v=sZIEdI9TS2U -newsboat (RSS reader) https://www.youtube.com/watch?v=dUFCRqs822w -zathura (pdf viewer) https://www.youtube.com/watch?v=V_Iz4zdyRM4 -gpg keys https://www.youtube.com/watch?v=DMGIlj7u7Eo -calcurse (calendar) https://www.youtube.com/watch?v=hvc-pHjbhdE -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 -" -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 diff --git a/.scripts/i3cmds/winresize b/.scripts/i3cmds/winresize deleted file mode 100755 index 090bbf3..0000000 --- a/.scripts/i3cmds/winresize +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "π" | dmenu -p "Give width and height:" | xargs xdotool windowsize "$(xdotool getwindowfocus)" diff --git a/.scripts/larbs.png b/.scripts/larbs.png Binary files differdeleted file mode 100644 index 0dbc687..0000000 --- a/.scripts/larbs.png +++ /dev/null diff --git a/.scripts/statusbar/battery b/.scripts/statusbar/battery deleted file mode 100755 index 25c9269..0000000 --- a/.scripts/statusbar/battery +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# Give a battery name (e.g. BAT0) as an argument. - -case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "π Battery module" "π: discharging -π: not charging -β»: stagnant charge -π: charging -β‘: charged -β: battery very low! -- Text color reflects charge left" ;; -esac - -capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit -status=$(cat /sys/class/power_supply/"$1"/status) - -if [ "$capacity" -ge 75 ]; then - color="#00ff00" -elif [ "$capacity" -ge 50 ]; then - color="#ffffff" -elif [ "$capacity" -ge 25 ]; then - color="#ffff00" -else - color="#ff0000" - warn="β" -fi - -[ -z $warn ] && warn=" " - -[ "$status" = "Charging" ] && color="#ffffff" - -printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//;s/Discharging/π/;s/Not Charging/π/;s/Charging/π/;s/Unknown/β»οΈ/;s/Full/β‘/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')" diff --git a/.scripts/statusbar/clock b/.scripts/statusbar/clock deleted file mode 100755 index d6d54ef..0000000 --- a/.scripts/statusbar/clock +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -date '+%Y %b %d (%a) %I:%M%p' - -case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; - 2) "$TERMINAL" -e calcurse -D ~/.config/calcurse ;; - 3) pgrep -x dunst >/dev/null && notify-send "π
Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` -- Middle click opens calcurse if installed" ;; -esac diff --git a/.scripts/statusbar/cpu b/.scripts/statusbar/cpu deleted file mode 100755 index 3b1394a..0000000 --- a/.scripts/statusbar/cpu +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "π₯ CPU hogs" "$(ps axch -o cmd:15,%cpu --sort=-%cpu | head)" ;; - 3) notify-send "π₯ CPU module " "\- Shows CPU temperature. -- Click to show intensive processes. -- % is of single core." ;; -esac - -sensors | awk '/Core 0/ {print $3}' diff --git a/.scripts/statusbar/disk b/.scripts/statusbar/disk deleted file mode 100755 index d3dd07d..0000000 --- a/.scripts/statusbar/disk +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Status bar module for disk space -# $1 should be drive mountpoint -# $2 is optional icon, otherwise mountpoint will displayed - -[ -z "$1" ] && exit - -icon="$2" -[ -z "$2" ] && icon="$1" - -case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "π½ Disk space" "$(df -h --output=target,used,size)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "π½ Disk module" "\- Shows used hard drive space. -- Click to show all disk info." ;; -esac - -printf "%s: %s" "$icon" "$(df -h "$1" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.scripts/statusbar/help b/.scripts/statusbar/help deleted file mode 100755 index 1374769..0000000 --- a/.scripts/statusbar/help +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -case $BLOCK_BUTTON in - 1) groff -mom ~/.readme.mom -Tpdf | zathura - ;; - 2) i3 restart ;; - 3) pgrep -x dunst >/dev/null && notify-send "β Help module" "\- Left click to open LARBS guide. -- Middle click to refresh i3.";; -esac; echo "β" diff --git a/.scripts/statusbar/internet b/.scripts/statusbar/internet deleted file mode 100755 index 1d2f2e8..0000000 --- a/.scripts/statusbar/internet +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) $TERMINAL -e nmtui ;; - 3) pgrep -x dunst >/dev/null && notify-send "π Internet module" "\- Click to connect -π‘: no wifi connection -πΆ: wifi connection with quality -β: no ethernet -π: ethernet working -" ;; -esac - -[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="π‘" - -[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "πΆ", int($3 * 100 / 70) "%" }') - -printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/β/;s/up/π/")" diff --git a/.scripts/statusbar/iplocate b/.scripts/statusbar/iplocate deleted file mode 100755 index 4ca4f10..0000000 --- a/.scripts/statusbar/iplocate +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Gets your public ip address checks which country you are in and -# displays that information in the statusbar -# -# https://www.maketecheasier.com/ip-address-geolocation-lookups-linux/ -ifinstalled "geoiplookup" || exit -addr="$(curl ifconfig.me 2>/dev/null)" || exit -grep "flag: " ~/.config/emoji | grep "$(geoiplookup $addr | sed 's/.*, //')" | sed "s/flag: //;s/;.*//" diff --git a/.scripts/statusbar/mailbox b/.scripts/statusbar/mailbox deleted file mode 100755 index 21c85ab..0000000 --- a/.scripts/statusbar/mailbox +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# i3blocks mail module. -# Displays number of unread mail and an loading icon if updating. -# When clicked, brings up `neomutt`. - -case $BLOCK_BUTTON in - 1) "$TERMINAL" -e neomutt ;; - 2) setsid mailsync >/dev/null & ;; - 3) pgrep -x dunst >/dev/null && notify-send "π¬ Mail module" "\- Shows unread mail -- Shows π if syncing mail -- Left click opens neomutt -- Middle click syncs mail" ;; -esac - -echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)" diff --git a/.scripts/statusbar/memory b/.scripts/statusbar/memory deleted file mode 100755 index dfd3d7b..0000000 --- a/.scripts/statusbar/memory +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) notify-send "π§ Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; - 3) notify-send "π§ Memory module" "\- Shows Memory Used/Total. -- Click to show memory hogs." ;; -esac - -free -h | awk '/^Mem:/ {print $3 "/" $2}' diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate deleted file mode 100755 index afe11bb..0000000 --- a/.scripts/statusbar/mpdupdate +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# Whenever the mpd state changes, update the mpd i3 module. -kill -0 "$(cat /tmp/mpdupdate)" 2>/dev/null && exit || echo $$ > /tmp/mpdupdate - -sleep 5 && while : ; do - pkill -RTMIN+11 i3blocks - mpc idle >/dev/null || exit -done diff --git a/.scripts/statusbar/music b/.scripts/statusbar/music deleted file mode 100755 index 93c2c9c..0000000 --- a/.scripts/statusbar/music +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -filter() { - sed "/^volume:/d" | tac | sed -e "s/\\&/&/g;s/\\[paused\\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\\[playing\\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\\/span>/g" - } - -case $BLOCK_BUTTON in - 1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause - 2) mpc toggle | filter ;; # right click, pause/unpause - 3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "π΅ Music module" "\- Shows mpd song playing. -- Italic when paused. -- Left click opens ncmpcpp. -- Middle click pauses. -- Scroll changes track.";; # right click, pause/unpause - 4) mpc prev | filter ;; # scroll up, previous - 5) mpc next | filter ;; # scroll down, next - *) mpc status | filter ;; -esac; exit diff --git a/.scripts/statusbar/news b/.scripts/statusbar/news deleted file mode 100755 index b7ca1a7..0000000 --- a/.scripts/statusbar/news +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# i3blocks newsboat module. -# Displays number of unread news items and an loading icon if updating. -# When clicked, brings up `newsboat`. - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e newsboat ;; - 2) setsid newsup >/dev/null & exit ;; - 3) pgrep -x dunst >/dev/null && notify-send "π° News module" "\- Shows unread news items -- Shows π if updating with \`newsup\` -- Left click opens newsboat -- Middle click syncs RSS feeds -<b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; -esac - - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" diff --git a/.scripts/statusbar/pacpackages b/.scripts/statusbar/pacpackages deleted file mode 100755 index 418bc2d..0000000 --- a/.scripts/statusbar/pacpackages +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# i3blocks module for pacman upgrades. -# Displays number of upgradeable packages. -# For this to work, have a `pacman -Sy` command run in the background as a -# cronjob every so often as root. This script will then read those packages. -# When clicked, it will run an upgrade via pacman. - -case $BLOCK_BUTTON in - 1) $TERMINAL -e popupgrade ;; - 2) notify-send "$(/usr/bin/pacman -Qu)" ;; - 3) pgrep -x dunst >/dev/null && notify-send "Upgrade module" "π¦: number of upgradable packages -- Left click to upgrade packages -- Middle click to show upgradable packages" ;; -esac - - -pacman -Qu | grep -v "\[ignored\]" | wc -l | sed -e "s/^0$//g" diff --git a/.scripts/statusbar/popupgrade b/.scripts/statusbar/popupgrade deleted file mode 100755 index 83035c3..0000000 --- a/.scripts/statusbar/popupgrade +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -printf "Beginning upgrade.\\n" - -yay -Syu -pkill -RTMIN+8 i3blocks - -printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" -read -r diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent deleted file mode 100755 index 0ab811c..0000000 --- a/.scripts/statusbar/torrent +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -transmission-remote -l | grep % | - sed " # This first sed command is to ensure a desirable order with sort - s/.*Stopped.*/A/g; - s/.*Seeding.*/Z/g; - s/.*100%.*/N/g; - s/.*Idle.*/B/g; - s/.*Uploading.*/L/g; - s/.*%.*/M/g" | - sort -h | uniq -c | sed " # Now we replace the standin letters with icons. - s/A/π/g; - s/B/βοΈ/g; - s/L/πΌ/g; - s/M/π½/g; - s/N/β
/g; - s/Z/π±/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" - -case $BLOCK_BUTTON in - 1) $TERMINAL -e transmission-remote-cli ;; - 3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "π: paused -β³: idle (seeds needed) -πΌ: uploading (unfinished) -π½: downloading -β
: done -π±: done and seeding" ;; -esac - diff --git a/.scripts/statusbar/volume b/.scripts/statusbar/volume deleted file mode 100755 index 3bbb32b..0000000 --- a/.scripts/statusbar/volume +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e pulsemixer & ;; - 2) pulsemixer --toggle-mute ;; - 4) pulsemixer --change-volume +5 ;; - 5) pulsemixer --change-volume -5 ;; - 3) pgrep -x dunst >/dev/null && notify-send "π’ Volume module" "\- Shows volume π, π if muted. -- Middle click to mute. -- Scroll to change." -esac - -[ "$(pulsemixer --get-mute)" = "1" ] && printf "π\\n" && exit - -vol=$(pulsemixer --get-volume | awk '{print $1}') - -if [ "$vol" -gt "70" ]; then - icon="π" -elif [ "$vol" -lt "30" ]; then - icon="π" -else - icon="π" -fi - -printf "%s %s%%\\n" "$icon" "$vol" diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather deleted file mode 100755 index e4de680..0000000 --- a/.scripts/statusbar/weather +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -location="$1"; [ -z "$location" ] || { location="$location+" && rm -f "$HOME/.local/share/weatherreport" ;} - -getforecast() { ping -q -c 1 1.1.1.1 >/dev/null || exit 1 -curl -s "wttr.in/$location" > "$HOME/.local/share/weatherreport" || exit 1 ;} - -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/β /g" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/weatherreport" | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " βοΈ",$1 "Β°","π",$2 "Β°"}' ;} - -case $BLOCK_BUTTON in - 1) $TERMINAL -e less -S "$HOME/.local/share/weatherreport" ;; - 2) getforecast && showweather ;; - 3) pgrep -x dunst >/dev/null && notify-send "π Weather module" "\- Left click for full forecast. -- Middle click to update forecast. -β: Chance of rain/snow -β: Daily low -π: Daily high" ;; -esac - -if [ "$(stat -c %y "$HOME/.local/share/weatherreport" >/dev/null 2>&1 | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] - then getforecast && showweather - else showweather -fi diff --git a/.scripts/tools/compiler b/.scripts/tools/compiler deleted file mode 100755 index 7d3bf1d..0000000 --- a/.scripts/tools/compiler +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# This script will compile or run another finishing operation on a document. I -# have this script run via vim. -# -# Compiles .tex. groff (.mom, .ms), .rmd, .md. -# Opens .sent files as sent presentations. -# Runs scripts based on extention or shebang - -file=$(readlink -f "$1") -dir=$(dirname "$file") -base="${file%.*}" - -cd "$dir" || exit - -textype() { \ - command="pdflatex" - ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" - $command --output-directory="$dir" "$base" && - grep -i addbibresource "$file" >/dev/null && - biber --input-directory "$dir" "$base" && - $command --output-directory="$dir" "$base" && - $command --output-directory="$dir" "$base" - } - -case "$file" in - *\.ms) refer -PS -e "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - *\.mom) refer -PS -e "$file" | groff -mom -kejpt -T pdf > "$base".pdf ;; - *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; - *\.tex) textype "$file" ;; - *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; - *config.h) sudo make install ;; - *\.c) cc "$file" -o "$base" && "$base" ;; - *\.py) python "$file" ;; - *\.go) go run "$file" ;; - *\.sent) setsid sent "$file" 2>/dev/null & ;; - *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; -esac diff --git a/.scripts/tools/dmenuhandler b/.scripts/tools/dmenuhandler deleted file mode 100755 index 391bdc1..0000000 --- a/.scripts/tools/dmenuhandler +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# Feed this script a link and it will give dmenu -# some choice programs to use to open it. - -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 --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 --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/dmenupass b/.scripts/tools/dmenupass deleted file mode 100755 index 4fc464f..0000000 --- a/.scripts/tools/dmenupass +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -dmenu -fn Monospace-18 -sb "#d79921" -sf "#1d2021" -nf "#000000" -nb "#000000" -p "$1" <&- && echo diff --git a/.scripts/tools/ext b/.scripts/tools/ext deleted file mode 120000 index 562d2b3..0000000 --- a/.scripts/tools/ext +++ /dev/null @@ -1 +0,0 @@ -extract
\ No newline at end of file diff --git a/.scripts/tools/extract b/.scripts/tools/extract deleted file mode 100755 index a63ab10..0000000 --- a/.scripts/tools/extract +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# A general, all-purpose extraction script. -# -# Default behavior: Extract archive into new directory -# Behavior with `-c` option: Extract contents into current directory - -while getopts "hc" o; do case "${o}" in - c) extracthere="True" ;; - *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;; -esac done - -if [ -z "$extracthere" ]; then - archive="$(readlink -f "$*")" && - directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" && - mkdir -p "$directory" && - cd "$directory" || exit -else - archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")" -fi - -[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit - -if [ -f "$archive" ] ; then - case "$archive" in - *.tar.bz2|*.tar.xz|*.tbz2) tar xvjf "$archive" ;; - *.tar.gz|*.tgz) tar xvzf "$archive" ;; - *.lzma) unlzma "$archive" ;; - *.bz2) bunzip2 "$archive" ;; - *.rar) unrar x -ad "$archive" ;; - *.gz) gunzip "$archive" ;; - *.tar) tar xvf "$archive" ;; - *.zip) unzip "$archive" ;; - *.Z) uncompress "$archive" ;; - *.7z) 7z x "$archive" ;; - *.xz) unxz "$archive" ;; - *.exe) cabextract "$archive" ;; - *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; - esac -else - printf "File \"%s\" not found.\\n" "$archive" -fi diff --git a/.scripts/tools/getbib b/.scripts/tools/getbib deleted file mode 100755 index ed441c5..0000000 --- a/.scripts/tools/getbib +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit - -if [ -f "$1" ]; then - # Try to get DOI from pdfinfo or pdftotext output. - doi=$(pdfinfo "$1" | grep -io "doi:.*") || - doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1) || - exit 1 -else - doi="$1" -fi - -# Check crossref.org for the bib citation. -curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" diff --git a/.scripts/tools/getkeys b/.scripts/tools/getkeys deleted file mode 100755 index 444f4c0..0000000 --- a/.scripts/tools/getkeys +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -cat ~/.config/getkeys/"$1" 2>/dev/null && exit -echo "Run command with one of the following arguments for info about that program:" -ls ~/.config/getkeys diff --git a/.scripts/tools/ifinstalled b/.scripts/tools/ifinstalled deleted file mode 100755 index b0d23e5..0000000 --- a/.scripts/tools/ifinstalled +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# If $1 command is not available, error code and notify. -command -v "$1" >/dev/null || { notify-send "π¦ $1" "must be installed for this function." && exit 1 ;} diff --git a/.scripts/tools/linkhandler b/.scripts/tools/linkhandler deleted file mode 100755 index c616d04..0000000 --- a/.scripts/tools/linkhandler +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Feed script a url or file location. -# If an image, it will view in sxiv, -# if a video or gif, it will view in mpv -# if a music file or pdf, it will download, -# otherwise it opens link in browser. - -# If no url given. Opens browser. For using script as $BROWSER. -[ -z "$1" ] && { "$BROWSER"; exit; } - -case "$1" in - *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) - curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;; - *mp3|*flac|*opus|*mp3?source*) - setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; - *) - if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" - else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;; -esac diff --git a/.scripts/tools/lmc b/.scripts/tools/lmc deleted file mode 100755 index 18cf2c2..0000000 --- a/.scripts/tools/lmc +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# A general audio interface for LARBS. - -[ -z "$2" ] && num="2" || num="$2" - -case "$1" in - u*) pulsemixer --change-volume +"$num" ;; - d*) pulsemixer --change-volume -"$num" ;; - m*) pulsemixer --toggle-mute ;; - truemute) pulsemixer --mute ;; - play) mpc play ;; - n*) mpc next ;; - prev) mpc prev ;; - t*) mpc toggle ;; - p*) mpc pause ; pauseallmpv ;; - f*) mpc seek +"$num" ;; - b*) mpc seek -"$num" ;; - r*) mpc seek 0% ;; - *) cat << EOF -lmc: cli music interface for mpd and pulse for those with divine intellect too -grand to remember the mpc/pamixer commands. - -Allowed options: - up NUM Increase volume (2 secs default) - down NUM Decrease volume (2 secs default) - mute Toggle mute - truemute Mute - next Next track - prev Previous track - toggle Toggle pause - truepause Pause - foward NUM Seek foward in song (2 secs default) - back NUM Seek back in song (2 secs default) - restart Restart current song - all else Print this message - -All of these commands, except for \`truemute\`, \`prev\` and \`play\` can be truncated, -i.e. \`lmc r\` for \`lmc restart\`. -EOF -esac - -pkill -RTMIN+10 i3blocks diff --git a/.scripts/tools/opout b/.scripts/tools/opout deleted file mode 100755 index c742aa9..0000000 --- a/.scripts/tools/opout +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# opout: "open output": A general handler for opening a file's intended output. -# I find this useful especially running from vim. - -basename="$(echo "$1" | sed 's/\.[^\/.]*$//')" - -case "$1" in - *.tex|*.md|*.rmd|*.ms|*.me|*.mom) setsid "$READER" "$basename".pdf >/dev/null 2>&1 & ;; - *.html) setsid "$BROWSER" --new-window "$basename".html >/dev/null 2>&1 & ;; - *.sent) setsid sent "$1" >/dev/null 2>&1 & ;; -esac diff --git a/.scripts/tools/pauseallmpv b/.scripts/tools/pauseallmpv deleted file mode 100755 index c5da220..0000000 --- a/.scripts/tools/pauseallmpv +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -for i in $(ls /tmp/mpvsoc*); do - echo '{ "command": ["set_property", "pause", true] }' | socat - $i; -done diff --git a/.scripts/tools/podentr b/.scripts/tools/podentr deleted file mode 100755 index 13ab4a8..0000000 --- a/.scripts/tools/podentr +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# entr command to run `queueandnotify` when newsboat queue is changed - -[ "$(pgrep -x $(basename $0) | wc -l)" -gt 2 ] && exit - -echo ~/.local/share/newsboat/queue | entr -p queueandnotify 2>/dev/null diff --git a/.scripts/tools/qndl b/.scripts/tools/qndl deleted file mode 100755 index a99d37e..0000000 --- a/.scripts/tools/qndl +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# $1 is a url; $2 is a command -[ -z "$1" ] && exit -base="$(basename "$1")" -notify-send "β³ Queuing $base..." -cmd="$2" -[ -z "$cmd" ] && cmd="youtube-dl --add-metadata" -idnum="$(tsp $cmd "$1")" -realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")" -tsp -D "$idnum" mv "$base" "$realname" -tsp -D "$idnum" notify-send "π $realname done." diff --git a/.scripts/tools/queueandnotify b/.scripts/tools/queueandnotify deleted file mode 100755 index a1417ec..0000000 --- a/.scripts/tools/queueandnotify +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Podboat sucks. This script replaces it. -# It reads the newsboat queue, queuing downloads with taskspooler. -# It also removes the junk from extentions. -queuefile="$HOME/.local/share/newsboat/queue" - -while read -r line; do - [ -z "$line" ] && continue - url="$(echo "$line" | awk '{print $1}')" - qndl "$url" "curl -LO" -done < "$queuefile" - -echo > "$queuefile" diff --git a/.scripts/tools/remaps b/.scripts/tools/remaps deleted file mode 100755 index df7d6c9..0000000 --- a/.scripts/tools/remaps +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# This script is called by i3 on startup to remap keys. -# Increase key speed via a rate change -xset r rate 300 50 -# Map the caps lock key to super... -setxkbmap -option caps:super -# But when it is pressed only once, treat it as escape. -killall xcape 2>/dev/null ; xcape -e 'Super_L=Escape' -# Map the menu button to right super as well. -xmodmap -e 'keycode 135 = Super_R' diff --git a/.scripts/tools/rotdir b/.scripts/tools/rotdir deleted file mode 100755 index e7103db..0000000 --- a/.scripts/tools/rotdir +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 -base="$(basename $1)" - ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" diff --git a/.scripts/tools/rssadd b/.scripts/tools/rssadd deleted file mode 100755 index 8822fc5..0000000 --- a/.scripts/tools/rssadd +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -! echo "$1" | grep "https*://\S\+\.[A-Za-z]\+\S*" >/dev/null && - notify-send "That doesn't look like a full URL." && exit -RSSFILE="$HOME/.config/newsboat/urls" -if awk '{print $1}' "$RSSFILE" | grep "^$1$" >/dev/null; then - notify-send "You already have this RSS feed." -else - echo "$1" >> "$RSSFILE" && notify-send "RSS feed added." -fi diff --git a/.scripts/tools/setbg b/.scripts/tools/setbg deleted file mode 100755 index 950ae7c..0000000 --- a/.scripts/tools/setbg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Sets the background. If given an argument, will set file as background. -[ ! -z "$1" ] && cp "$1" ~/.config/wall.png && notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." -xwallpaper --zoom ~/.config/wall.png diff --git a/.scripts/tools/shortcuts b/.scripts/tools/shortcuts deleted file mode 100755 index 1c4f278..0000000 --- a/.scripts/tools/shortcuts +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="$HOME/.config/shortcutrc" -ranger_shortcuts="/dev/null" -qute_shortcuts="/dev/null" -fish_shortcuts="/dev/null" -vifm_shortcuts="$HOME/.config/vifm/vifmshortcuts" - -# Remove, prepare files -rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null -printf "# vim: filetype=sh\\n" > "$fish_shortcuts" -printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts" -printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts" - -# Format the `bmdirs` file in the correct syntax and sent it to all three configs. -sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ - >(awk '{print "abbr", $1, "\"cd " $2 "; and ls -a\""}' >> "$fish_shortcuts") \ - >(awk '{print "map g" $1, ":cd", $2 "<CR>\nmap t" $1, "<tab>:cd", $2 "<CR><tab>\nmap M" $1, "<tab>:cd", $2 "<CR><tab>:mo<CR>\nmap Y" $1, "<tab>:cd", $2 "<CR><tab>:co<CR>" }' >> "$vifm_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/\s*#.*$//;/^\s*$/d" "$HOME/.config/bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ - >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ - >(awk '{print "map", $1, ":e", $2 "<CR>" }' >> "$vifm_shortcuts") \ - | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/.scripts/tools/texclear b/.scripts/tools/texclear deleted file mode 100755 index f6a5062..0000000 --- a/.scripts/tools/texclear +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Clears the build files of a LaTeX/XeLaTeX build. -# I have vim run this file whenever I exit a .tex file. - -case "$1" in - *.tex) - file=$(readlink -f "$1") - dir=$(dirname "$file") - base="${file%.*}" - find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;; - *) printf "Give .tex file as argument.\\n" ;; -esac - diff --git a/.scripts/tools/transadd b/.scripts/tools/transadd deleted file mode 100755 index ad2ee7f..0000000 --- a/.scripts/tools/transadd +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# Mimeapp script for adding torrent to transmission-daemon, but will also start the daemon first if not running. - -# transmission-daemon sometimes fails to take remote requests in its first moments. - -pgrep -x transmission-da || (transmission-daemon && notify-send "Starting transmission daemon..." && sleep 3 && pkill -RTMIN+7 i3blocks) - -transmission-remote -a "$@" && notify-send "π½ Torrent added." diff --git a/.scripts/tools/vifmimg b/.scripts/tools/vifmimg deleted file mode 100755 index 1569962..0000000 --- a/.scripts/tools/vifmimg +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -[ -z "$FIFO_UEBERZUG" ] && exit - -readonly ID_PREVIEW="preview" - -if [ "$1" = "draw" ]; then - declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="${PWD}/$6") > "$FIFO_UEBERZUG" -elif [ "$1" = "videopreview" ]; then - [ ! -f "/tmp/$6.png" ] && ffmpegthumbnailer -i "${PWD}/$6" -o "/tmp/$6.png" -s 0 -q 10 && - declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" [x]="$2" [y]="$3" [max_width]="$4" [max_height]="$5" [path]="/tmp/$6.png") > "$FIFO_UEBERZUG" -else - declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") > "$FIFO_UEBERZUG" -fi diff --git a/.scripts/tools/vu b/.scripts/tools/vu deleted file mode 100755 index 778835a..0000000 --- a/.scripts/tools/vu +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env sh -export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}" - -cleanup() { - rm "$FIFO_UEBERZUG" 2>/dev/null - pkill -P $$ 2>/dev/null -} - -rm "$FIFO_UEBERZUG" 2>/dev/null -mkfifo "$FIFO_UEBERZUG" -trap cleanup EXIT -tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash & - -vifm -cleanup diff --git a/.scripts/ttymaps.kmap b/.scripts/ttymaps.kmap deleted file mode 100644 index 51a7042..0000000 --- a/.scripts/ttymaps.kmap +++ /dev/null @@ -1,2 +0,0 @@ -keycode 1 = Caps_Lock -keycode 58 = Escape diff --git a/.scripts/unix b/.scripts/unix deleted file mode 100755 index 14d7ef0..0000000 --- a/.scripts/unix +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes -#converted to shell by #nixers @ irc.unix.chat - -cat << 'eof' - [38;5;255m,_ ,_==ββ[0m - [38;5;255m, βββββ
β
[48;5;240mβ
[48;5;20mβ[48;5;240mβ
ΒΎ[0m. [38;5;199m/ [38;5;20m/[0m - [38;5;255m[48;5;20mβ[0m[38;5;255m[48;5;199mβ[38;5;16m[48;5;255m<Β΄ [38;5;32m"[38;5;34mΒ»[38;5;255mββ[48;5;32mβ[48;5;240m%[0m\ [38;5;199m/ [38;5;20m/ [38;5;45m/ [38;5;118m/[0m - [38;5;255m,[38;5;255m[48;5;240mβ
[38;5;16m[48;5;255m7" [38;5;160mΒ΄[38;5;34m>[38;5;255m[48;5;39mββ[38;5;199m[48;5;255mβ[0m[38;5;255m% [38;5;20m/ [38;5;118m/ [38;5;199m> [38;5;118m/ [38;5;199m>[38;5;255m/[38;5;45m%[0m - [38;5;255mβ[48;5;240m[38;5;255mΒΆ[48;5;240m[38;5;255mβ[48;5;255m [38;5;196m,[38;5;34mΒ»[48;5;201m[38;5;255mββ[0m[38;5;255mΒΎΒ΄[0m [38;5;199m/[38;5;255m> %[38;5;199m/[38;5;118m%[38;5;255m/[38;5;199m/ [38;5;45m/ [38;5;199m/[0m - [38;5;255m[48;5;240mβ[48;5;255m[38;5;16mβ[48;5;16m[38;5;255mβ
β
[38;5;16m[48;5;255mβ
β,,[38;5;32mβ[38;5;16mβ
[38;5;255m[48;5;16mβ
β
[38;5;255m[48;5;20mΓ[0m[38;5;255m\[0m[38;5;20m/[38;5;118m/[38;5;255m /[38;5;118m/[38;5;199m/[38;5;255m>[38;5;45m// [38;5;255m/[38;5;118m>[38;5;199m/ [38;5;20m/[0m - [48;5;20m[38;5;255mV[48;5;255m[38;5;16mβ[48;5;20m[38;5;255mΒ«[0m[38;5;255mΒΌ.;[48;5;240m[38;5;255mβ[48;5;255m[38;5;16m β[0m[38;5;255m<Β«.,[48;5;25m[38;5;255m`[48;5;240m=[0m[38;5;20m/[38;5;199m/ [38;5;255m/>[38;5;45m/[38;5;118m/[38;5;255m%/[38;5;199m% / [38;5;20m/[0m - [38;5;20m//[48;5;255m[38;5;16mβ <Β΄ -Β²,)[48;5;16m[38;5;255m(β[48;5;255m[38;5;16m~"-[38;5;199mβ/[0m[38;5;255mΒΎ[0m[38;5;199m/ [38;5;118m%[38;5;255m/[38;5;118m>[38;5;45m/ [38;5;118m/[38;5;199m>[0m - [38;5;20m/ / [38;5;118m/ [48;5;20m[38;5;255mβ[48;5;240m[38;5;16m%[48;5;255m -./βββ[48;5;16m[38;5;255mβ
[48;5;255m[38;5;16mβ[48;5;255m[38;5;16m, [38;5;199m/[48;5;199m[38;5;255m7[0m[38;5;20m/[38;5;199m/[38;5;255m;/[38;5;199m/[38;5;118m% [38;5;20m/ /[0m - [38;5;20m/ [38;5;199m/[38;5;255m/[38;5;45m/[38;5;118m/[38;5;255m[48;5;240m`[48;5;20m[38;5;255mβ[48;5;20m[38;5;255mβ[48;5;255m[38;5;16m %z[0m[38;5;255mWv xX[48;5;20m[38;5;255mβ[48;5;34m[38;5;255mβ[48;5;199m[38;255mβ[0m[38;5;20m/[38;5;199m/[38;5;255m&;[38;5;20m% [38;5;199m/ [38;5;20m/[0m - [38;5;20m/ / [38;5;255m/ [38;5;118m%[38;5;199m/[38;5;255m/%/[48;5;240m[38;5;255mΒΎ[48;5;255m[38;5;16mΒ½Β΄[38;5;255m[48;5;16mβ[0m[38;5;246mββ[38;5;255mββ[38;5;246mβββ[0m[48;5;16m[38;5;255mβ[38;5;255m[48;5;199mΒΆ[48;5;20m[38;5;255m\[0m[38;5;20m/[0m[48;5;255m[38;5;240m&[0m [38;5;20m/[0m - [38;5;199m<[38;5;118m/ [38;5;45m/[38;5;255m</[38;5;118m%[38;5;255m/[38;5;45m/[38;5;255m`[48;5;16mβ[48;5;255m[38;5;16m