diff --git a/.bashrc b/.bashrc index 85698659..ec8e599a 100644 --- a/.bashrc +++ b/.bashrc @@ -4,5 +4,5 @@ shopt -s autocd #Allows you to cd into directory merely by typing the directory HISTSIZE= HISTFILESIZE= # Infinite history. export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" -[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases -[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" +[ -f "$HOME/.config/larbs/shortcuts" ] && source "$HOME/.config/larbs/shortcuts" # Load shortcut aliases +[ -f "$HOME/.config/larbs/aliasrc" ] && source "$HOME/.config/larbs/aliasrc" diff --git a/.config/i3/config b/.config/i3/config index 7b4bcf35..4d4d496c 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -280,7 +280,7 @@ for_window [title="mpvfloat"] border pixel 0 no_focus [title="mpvfloat"] # #---Function Buttons---# # -bindsym $mod+F1 exec --no-startup-id groff -kejpt -mom ~/.readme.mom -Tpdf | zathura - +bindsym $mod+F1 exec --no-startup-id groff -kejpt -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - bindsym $mod+F2 restart bindsym $mod+F3 exec --no-startup-id displayselect bindsym $mod+F4 exec --no-startup-id prompt "Hibernate computer?" "$hibernate" diff --git a/.aliasrc b/.config/larbs/.aliasrc similarity index 94% rename from .aliasrc rename to .config/larbs/.aliasrc index 1fb1c8d1..737db129 100644 --- a/.aliasrc +++ b/.config/larbs/.aliasrc @@ -19,7 +19,7 @@ alias ka="killall" \ yt="youtube-dl --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'" \ yta="yt -x -f bestaudio/best" \ YT="youtube-viewer" \ - ref="shortcuts >/dev/null; source ~/.shortcuts" \ + ref="shortcuts >/dev/null; source ~/.config/larbs/shortcuts" \ upc="sudo pacman -Syu; pkill -RTMIN+8 i3blocks" \ lsp="pacman -Qett --color=always | less" diff --git a/.bmdirs b/.config/larbs/bmdirs similarity index 100% rename from .bmdirs rename to .config/larbs/bmdirs diff --git a/.bmfiles b/.config/larbs/bmfiles similarity index 80% rename from .bmfiles rename to .config/larbs/bmfiles index d657c833..f3d37694 100644 --- a/.bmfiles +++ b/.config/larbs/bmfiles @@ -1,7 +1,7 @@ -bf ~/.bmfiles -bd ~/.bmdirs +bf ~/.config/larbs/bmfiles +bd ~/.config/larbs/bmdirs cfb ~/.bashrc -cfa ~/.aliasrc +cfa ~/.config/larbs/aliasrc cfz ~/.zshrc cfv ~/.config/nvim/init.vim cfr ~/.config/ranger/rc.conf diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 28339844..4638e9e7 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -92,7 +92,7 @@ set clipboard=unnamedplus autocmd BufWritePre * %s/\s\+$//e " When shortcut files are updated, renew bash and ranger configs with new material: - autocmd BufWritePost ~/.bmdirs,~/.bmfiles !shortcuts + autocmd BufWritePost ~/.config/larbs/bmdirs,~/.config/larbs/bmfiles !shortcuts " Run xrdb whenever Xdefaults or Xresources are updated. autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb % diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/luke_ranger_readme.md index 51c5dd10..79195374 100644 --- a/.config/ranger/luke_ranger_readme.md +++ b/.config/ranger/luke_ranger_readme.md @@ -33,7 +33,7 @@ These "verbs" take "nouns" or "arguments," like these: + d -- "~/Documents" + D -- "~/Downloads" + cf -- "~/.config" -+ And many others, including those you add to `~/.bmdirs`. ++ And many others, including those you add to `~/.config/larbs/bmdirs`. Press any "verb" followed by any "argument" to perform a folder operation. "gd" will cd to ~/Documents, for example. "mD" will move the selected file(s) to ~/Downloads. "tcf" will create a new tab in ~/.config, etc. etc. diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 71aab4b6..f9a7d0ee 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -4,12 +4,12 @@ do case "$1" in "w") setbg "$file" & ;; "c") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/larbs/bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." & ;; "m") - [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" + [ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.config/larbs/bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")" [ -z "$destdir" ] && exit mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." & ;; diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 59ec1a99..55262287 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -1,5 +1,5 @@ " vim: filetype=vim -source ~/.vifmshortcuts +source ~/.config/larbs/vifmshortcuts map h map j diff --git a/.emoji b/.local/share/larbs/emoji similarity index 100% rename from .emoji rename to .local/share/larbs/emoji diff --git a/.readme.mom b/.local/share/larbs/readme.mom similarity index 98% rename from .readme.mom rename to .local/share/larbs/readme.mom index 7844860b..ae17d214 100644 --- a/.readme.mom +++ b/.local/share/larbs/readme.mom @@ -306,7 +306,7 @@ buttons, screen brightness, email, web browsing buttons, etc.) to what you would expect. .HEADING 1 "Bookmarking Files and Directories" .PP -Note the files \f(CW~/.bmdirs\fP and \f(CW~/.bmfiles\fP. +Note the files \f(CW~/.config/larbs/bmdirs\fP and \f(CW~/.config/larbs/bmfiles\fP. These files hold bookmarked directories and files respectively, along with shortcut keys to their left. LARBS, specfically the \f(CWshortcuts\fP script, will automatically read these files and autogenerate aliases and shortcuts for bash/zsh and ranger from them. .PP @@ -327,8 +327,8 @@ Create a new tab in \f(CW~/Documents\fP \f(CWYd\fP \(en Copy/yank (cp) a copy of the selected file(s) to \f(CWDocuments\fP .LIST OFF -Shortcuts like these are generated for all key sequence/directory pairs in \f(CW~/.bmdirs\fP. -Additionally, you may also add editable files to \f(CW~/.bmfiles\fP. +Shortcuts like these are generated for all key sequence/directory pairs in \f(CW~/.config/larbs/bmdirs\fP. +Additionally, you may also add editable files to \f(CW~/.config/larbs/bmfiles\fP. Each key sequence you pair with a file will become an alias to edit it in either bash or ranger. .PP Whenever you edit and save one of the bookmark files, vim will automatically rerun the shortcut script, thus uupdating the shortcuts that will be used in new instances of bash and ranger. diff --git a/.profile b/.profile index 838c9f08..4c09fbd3 100644 --- a/.profile +++ b/.profile @@ -23,7 +23,7 @@ export LESS_TERMCAP_se=$'\E[0m' # reset reverse video export LESS_TERMCAP_us=$'\E[1;32m' # begin underline export LESS_TERMCAP_ue=$'\E[0m' # reset underline -[ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1 +[ ! -f ~/.config/larbs/shortcuts ] && shortcuts >/dev/null 2>&1 echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "$HOME/.bashrc" diff --git a/.scripts/SCRIPTS.md b/.scripts/SCRIPTS.md index 34bb01bb..5ba27e7f 100644 --- a/.scripts/SCRIPTS.md +++ b/.scripts/SCRIPTS.md @@ -54,7 +54,7 @@ in vim or another program. - `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `p` in my vim config to reveal typical output. - `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition. - `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine. -- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files. +- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.config/larbs/shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files. - `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`). - `tpb` -- Search Pirate Bay for the certain search terms given as arguments. - `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file. diff --git a/.scripts/i3cmds/dmenuunicode b/.scripts/i3cmds/dmenuunicode index e9efa0cb..e0d26375 100755 --- a/.scripts/i3cmds/dmenuunicode +++ b/.scripts/i3cmds/dmenuunicode @@ -5,7 +5,7 @@ # Must have xclip installed to even show menu. xclip -h >/dev/null || exit -chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 20 -fn Monospace-18) +chosen=$(grep -v "#" $HOME/.local/share/larbs/emoji | dmenu -i -l 20 -fn Monospace-18) [ "$chosen" != "" ] || exit diff --git a/.scripts/statusbar/help b/.scripts/statusbar/help index eacb15be..6a72354b 100755 --- a/.scripts/statusbar/help +++ b/.scripts/statusbar/help @@ -1,7 +1,7 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) groff -mom ~/.readme.mom -Tpdf | zathura - ;; + 1) groff -mom ~/.local/share/larbs/readme.mom -Tpdf | zathura - ;; 3) pgrep -x dunst >/dev/null && notify-send "❓ Help module: - Left click to open LARBS guide.";; esac diff --git a/.scripts/tools/shortcuts b/.scripts/tools/shortcuts index cb4cc6ed..7d50584a 100755 --- a/.scripts/tools/shortcuts +++ b/.scripts/tools/shortcuts @@ -1,10 +1,10 @@ #!/bin/bash # Output locations. Unactivated progs should go to /dev/null. -shell_shortcuts="$HOME/.shortcuts" +shell_shortcuts="$HOME/.config/larbs/shortcuts" ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" qute_shortcuts="/dev/null" fish_shortcuts="$HOME/.config/fish/shortcuts.fish" -vifm_shortcuts="$HOME/.vifmshortcuts" +vifm_shortcuts="$HOME/.config/larbs/vifmshortcuts" # Remove, prepare files rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null @@ -13,14 +13,14 @@ 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/.bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/larbs/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 "\nmap t" $1, ":cd", $2 "\nmap M" $1, ":cd", $2 ":mo\nmap Y" $1, ":cd", $2 ":co" }' >> "$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/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ +sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.config/larbs/bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ >(awk '{print "abbr", $1, "\"$EDITOR "$2"\""}' >> "$fish_shortcuts") \ >(awk '{print "map", $1, ":e", $2 "" }' >> "$vifm_shortcuts") \ | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/README.md b/README.md index bea59a84..088338da 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ The command `getkeys` will also show basic key binds for different programs. ## Dynamic Configuration Files -Store your favorite or high-traffic directories in `~/.bmdirs` or your most -important config files in `~/.bmfiles` with keyboard shortcuts. When you add +Store your favorite or high-traffic directories in `~/.config/larbs/bmdirs` or your most +important config files in `~/.config/larbs/bmfiles` with keyboard shortcuts. When you add things to theses files my vimrc will automatically run `shortcuts` which will dynamically generate shortcuts for these in bash, ranger and optionally qutebrowser and fish.