dotfiles

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

commit 50adee4e79febf6f74594604e9f7083461b04227
parent 68bd2acdc8f8040deab188c748d207d93ba923ca
Author: Luke <luke@lukesmith.xyz>
Date:   Sun, 21 Jan 2018 18:29:48 -0700

"first" commit, preparing for LARBS 2.0

Diffstat:
A.Renviron | 2++
A.Rprofile | 1+
A.Xdefaults | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.bash_profile | 10++++++++++
A.bashrc | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.calcurse/conf | 25+++++++++++++++++++++++++
A.calcurse/keys | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/Scripts/audio_alsa.sh | 18++++++++++++++++++
A.config/Scripts/audio_pulse.sh | 18++++++++++++++++++
A.config/Scripts/clear.sh | 1+
A.config/Scripts/configs | 17+++++++++++++++++
A.config/Scripts/extract | 30++++++++++++++++++++++++++++++
A.config/Scripts/flash_win.sh | 13+++++++++++++
A.config/Scripts/folders | 10++++++++++
A.config/Scripts/offlineimap-daemon.py | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/Scripts/offlineimap-daemonctl.sh | 41+++++++++++++++++++++++++++++++++++++++++
A.config/Scripts/remaps | 1+
A.config/Scripts/resize-font | 169+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/Scripts/screen.sh | 24++++++++++++++++++++++++
A.config/Scripts/screencast_alsa.sh | 22++++++++++++++++++++++
A.config/Scripts/screencast_pulse.sh | 22++++++++++++++++++++++
A.config/Scripts/shortcuts.sh | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/Scripts/speedvid.sh | 7+++++++
A.config/Scripts/transmission.sh | 7+++++++
A.config/Scripts/video.sh | 21+++++++++++++++++++++
A.config/Scripts/webview | 23+++++++++++++++++++++++
A.config/Scripts/welcome | 4++++
A.config/compton.conf | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/feh/keys | 12++++++++++++
A.config/fontconfig/fonts.conf | 24++++++++++++++++++++++++
A.config/i3/config | 475+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/i3/i3_guide.rmd | 182+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/i3/kb-lights.py | 35+++++++++++++++++++++++++++++++++++
A.config/i3/lock.png | 0
A.config/i3/lock.sh | 8++++++++
A.config/mimeapps.list | 26++++++++++++++++++++++++++
A.config/moc/config | 13+++++++++++++
A.config/moc/keymap | 188+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/moc/themes/theme | 32++++++++++++++++++++++++++++++++
A.config/mpd/mpd.conf | 29+++++++++++++++++++++++++++++
A.config/mpv/input.conf | 199+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/mutt/aliases | 13+++++++++++++
A.config/mutt/email.md | 40++++++++++++++++++++++++++++++++++++++++
A.config/mutt/gmailrc | 30++++++++++++++++++++++++++++++
A.config/mutt/mailcap | 11+++++++++++
A.config/mutt/muttcol | 151++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/mutt/muttimage.sh | 8++++++++
A.config/mutt/muttrc | 41+++++++++++++++++++++++++++++++++++++++++
A.config/mutt/personalrc | 23+++++++++++++++++++++++
A.config/neofetch/config | 431+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/polybar/config | 412+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/polybar/launch.sh | 16++++++++++++++++
A.config/qutebrowser/config.py | 1585+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/commands.py | 216+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/commands_full.py | 1508+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/luke_ranger_readme.md | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/rc.conf | 520+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/rifle.conf | 221+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ranger/scope.sh | 121+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/user-dirs.dirs | 1+
A.config/wall.png | 0
A.gtkrc-2.0 | 19+++++++++++++++++++
A.inputrc | 12++++++++++++
A.msmtprc | 25+++++++++++++++++++++++++
A.ncmpcpp/bindings | 612+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.ncmpcpp/config | 545+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.newsboat/config | 32++++++++++++++++++++++++++++++++
A.newsboat/urls | 1+
A.offlineimaprc | 43+++++++++++++++++++++++++++++++++++++++++++
A.tmux.conf | 177+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.urlview | 29+++++++++++++++++++++++++++++
A.vimrc | 235+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.xinitrc | 1+
ALICENSE.md | 3+++
MREADME.md | 54++++++++++++++++++++++++++++++++++++++++++++++++++++--
Apic.jpg | 0
76 files changed, 9373 insertions(+), 2 deletions(-)

diff --git a/.Renviron b/.Renviron @@ -0,0 +1,2 @@ + +R_LIBS_USER = ~/.R/library diff --git a/.Rprofile b/.Rprofile @@ -0,0 +1 @@ +options(repos=structure(c(CRAN="http://cran.revolutionanalytics.com/"))) diff --git a/.Xdefaults b/.Xdefaults @@ -0,0 +1,66 @@ +*foreground: #00cc00 +*foreground_bold: #a8a19f +*cursor: #a8a19f +*background: #1b1918 +!!*background: rgba(0, 0, 0, .7) + +!! black +*color0: #1b1918 +*color8: #766e6b +!! red +*color1: #f22c40 +*color9: #f22c40 +!! green +*color2: #5ab738 +*color10: #5ab738 +!! yellow +*color3: #d5911a +*color11: #d5911a +!! blue +*color4: #407ee7 +*color12: #407ee7 +!! magenta +*color5: #6666ea +*color13: #6666ea +!! cyan +*color6: #00ad9c +*color14: #00ad9c +!! white +*color7: #a8a19f +*color15: #f1efee + +URxvt.intensityStyles: false +URxvt.background: [70]#000000 +URxvt.depth: 32 +URxvt.font: xft:monospace:size=11 +URxvt.scrollBar: false +URxvt.cursorColor: white + +!! Extensions +URxvt.perl-ext-common: default,matcher,resize-font,url-select,keyboard-select +URxvt.colorUL: #4682B4 +!! url-select +URxvt.keysym.M-u: perl:url-select:select_next +URxvt.url-select.launcher: webview +URxvt.url-select.underline: true +!! keyboard-select: +URxvt.keysym.M-Escape: perl:keyboard-select:activate +!! resize-font +URxvt.resize-font.smaller: C-Down +URxvt.resize-font.bigger: C-Up +!! Matcher +URxvt.url-launcher: webview +URxvt.matcher.button: 1 + +rofi.color-enabled: true +rofi.color-window: #000, #000, #000 +rofi.color-normal: #111, #819396, #222, #008ed4, #ffffff +rofi.color-active: #002b37, #008ed4, #003643, #008ed4, #66c6ff +rofi.color-urgent: #002b37, #da4281, #003643, #008ed4, #890661 + +rofi.fake-transparency: true +rofi.lines: 3 +rofi.bw: 0 +rofi.opacity: "10" +rofi.hide-scrollbar: true +rofi.width: 30 diff --git a/.bash_profile b/.bash_profile @@ -0,0 +1,10 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc + +export PATH=$PATH:$HOME/.config/Scripts +export EDITOR="vim" +export TERMINAL="st" +export BROWSER="qutebrowser" diff --git a/.bashrc b/.bashrc @@ -0,0 +1,100 @@ +stty -ixon +shopt -s autocd #Allows you to cd into directory merely by typing the directory name. + +# For directory and config shortcuts: +source ~/.bash_shortcuts + +# Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file). +if [ "$EUID" -ne 0 ] + then 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)\]" + else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" +fi + +#Generic shortcuts: +alias music="ncmpcpp" +alias clock="ncmpcpp -s clock" +alias visualizer="ncmpcpp -s visualizer" +alias news="newsbeuter" +alias email="neomutt" +alias files="ranger" +alias chat="weechat" +alias audio="ncpamixer" +alias calender="calcurse" +alias getmail="offlineimap && notmuch new" +alias gm="offlineimap && notmuch new" + +o() { xdg-open $@ & } + +# System Maintainence +alias progs="pacman -Qet" # List programs I've installed +alias orphans="pacman -Qdt" # List orphan programs +alias upgr="neofetch && sudo pacman -Syyu --noconfirm && echo Update complete. | figlet" +alias atltime="sudo timedatectl set-timezone America/New_York && i3 restart" # Eastcoast time +alias tuctime="sudo timedatectl set-timezone America/Phoenix && i3 restart" # Arizona time +alias sdn="sudo shutdown now" +alias newnet="sudo systemctl restart NetworkManager" # Refresh wifi +alias nf="clear && neofetch" # Le Redditfetch +#Install an AUR package manually (for Parabola to get AUR access): +aurinstall() { curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz && tar -xvf $1.tar.gz && cd $1 && makepkg --noconfirm -si && cd .. && rm -rf $1 $1.tar.gz ;} +alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg + +# Some aliases +alias p="sudo pacman" +alias v="vim" +alias sv="sudo vim" +alias r="ranger" +alias sr="sudo ranger" +alias ka="killall" +alias g="git" +alias gitup="git push origin master" +alias gitpass="git config --global credential.helper cache" +alias tr="transmission-remote" +alias mkdir="mkdir -pv" +alias rf="source ~/.bashrc" +alias ref="~/.config/Scripts/shortcuts.sh && source ~/.bashrc" # Refresh shortcuts manually and reload bashrc +alias bars="bash ~/.config/polybar/launch.sh" # Run Polybar relaunch script +alias bw="wal -i ~/.config/wall.png" # Rerun pywal +weath() { curl wttr.in/$1 ;} # Check the weather (give city or leave blank). + +# Adding color +alias ls='ls -hN --color=auto --group-directories-first' +alias crep="grep --color=always" # Color grep - highlight desired sequence. +alias ccat="highlight --out-format=xterm256" #Color cat - print file with syntax highlighting. + +# Laptop management +alias lsc="screen.sh l" # Use laptop screen only +alias vsc="screen.sh v" # Use VGA only +alias dsc="screen.sh d" # Use both laptop and VGA screen +alias debase="sudo umount /home/Shared/Videos & screen.sh l && i3 restart" # Prep for taking my ThinkPad off Ultrabase + +# Internet +alias yt="youtube-dl --add-metadata -ic" # Download video link +alias yta="youtube-dl --add-metadata -xic" # Download only audio +alias YT="youtube-viewer" +alias ethspeed="speedometer -r enp0s25" +alias wifispeed="speedometer -r wlp3s0" +alias starwars="telnet towel.blinkenlights.nl" +alias tpbs="clear && figlet -c TPB Search && ~/.config/Scripts/tpb.sh" # Pirate Bay search + +# TeX +alias Txa="cp ~/Documents/LaTeX/article.tex" +alias Txs="cp ~/Documents/LaTeX/beamer.tex" +alias Txh="cp ~/Documents/LaTeX/handout.tex" +alias TC='texclear' + +# Audio and Music +alias mute="pamixer -m" +alias unmute="pamixer -u" +alias vu="pamixer --allow-boost -i 5" +alias vd="pamixer --allow-boost -d 5" +alias pause="mpc toggle" +alias next="mpc next" +alias prev="mpc prev" +alias trupause="mpc pause" +alias beg="mpc seek 0%" +alias lilbak="mpc seek -10" +alias lilfor="mpc seek +10" +alias bigbak="mpc seek -120" +alias bigfor="mpc seek +120" + +hello-larbs() { sed -i -e '/LARBS/,$d' ~/.config/i3/config ;} diff --git a/.calcurse/conf b/.calcurse/conf @@ -0,0 +1,25 @@ +appearance.calendarview=monthly +appearance.compactpanels=no +appearance.defaultpanel=calendar +appearance.layout=1 +appearance.notifybar=yes +appearance.sidebarwidth=1 +appearance.theme=red on default +appearance.todoview=show-completed +daemon.enable=no +daemon.log=no +format.inputdate=1 +format.notifydate=%a %F +format.notifytime=%T +format.outputdate=%D +general.autogc=no +general.autosave=yes +general.confirmdelete=yes +general.confirmquit=no +general.firstdayofweek=sunday +general.periodicsave=0 +general.progressbar=yes +general.systemdialogs=no +notification.command=printf '\a' +notification.notifyall=flagged-only +notification.warning=300 diff --git a/.calcurse/keys b/.calcurse/keys @@ -0,0 +1,70 @@ +# +# Calcurse keys configuration file +# +# This file sets the keybindings used by Calcurse. +# Lines beginning with "#" are comments, and ignored by Calcurse. +# To assign a keybinding to an action, this file must contain a line +# with the following syntax: +# +# ACTION KEY1 KEY2 ... KEYn +# +# Where ACTION is what will be performed when KEY1, KEY2, ..., or KEYn +# will be pressed. +# +# To define bindings which use the CONTROL key, prefix the key with 'C-'. +# The escape, space bar and horizontal Tab key can be specified using +# the 'ESC', 'SPC' and 'TAB' keyword, respectively. +# Arrow keys can also be specified with the UP, DWN, LFT, RGT keywords. +# Last, Home and End keys can be assigned using 'KEY_HOME' and 'KEY_END' +# keywords. +# +# A description of what each ACTION keyword is used for is available +# from calcurse online configuration menu. + +generic-cancel ESC +generic-select SPC +generic-credits @ +generic-help ? +generic-quit q Q +generic-save s S ^S +generic-reload R +generic-copy c +generic-paste p ^V +generic-change-view TAB +generic-import i I +generic-export x X +generic-goto g G +generic-other-cmd o O +generic-config-menu C +generic-redraw ^R +generic-add-appt ^A +generic-add-todo ^T +generic-prev-day T ^H +generic-next-day t ^L +generic-prev-week W ^K +generic-next-week w ^J +generic-prev-month M +generic-next-month m +generic-prev-year Y +generic-next-year y +generic-scroll-down ^N +generic-scroll-up ^P +generic-goto-today ^G +generic-command : +move-right l L RGT +move-left h H LFT +move-down j J DWN +move-up k K UP +start-of-week 0 +end-of-week $ +add-item a A +del-item d D +edit-item e E +view-item v V +pipe-item | +flag-item ! +repeat r +edit-note n N +view-note > +raise-priority + +lower-priority - diff --git a/.config/Scripts/audio_alsa.sh b/.config/Scripts/audio_alsa.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#This is the ffmpeg command that the screencast shortcut in i3 will run. + +#Picks a file name for the output file based on availability: + +while [[ -f $HOME/audio$n.flac ]] +do + n=$((n+1)) +done +filename="$HOME/audio$n.flac" + +#The actual ffmpeg command: + +ffmpeg -y \ + -f alsa -ar 44100 -i hw:1 \ + $filename + diff --git a/.config/Scripts/audio_pulse.sh b/.config/Scripts/audio_pulse.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#This is the ffmpeg command that the audio shortcut in i3 will run. + +#Picks a file name for the output file based on availability: + +while [[ -f $HOME/audio$n.flac ]] +do + n=$((n+1)) +done +filename="$HOME/audio$n.flac" + +#The actual ffmpeg command: + +ffmpeg \ +-f alsa -i default \ +-c:a flac \ +$filename diff --git a/.config/Scripts/clear.sh b/.config/Scripts/clear.sh @@ -0,0 +1 @@ +find . -maxdepth 1 -regextype gnu-awk -regex "^.*\.(pyc|p yo|bak|swp|aux|log|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete diff --git a/.config/Scripts/configs b/.config/Scripts/configs @@ -0,0 +1,17 @@ +cfb ~/.bashrc +cfz ~/.zshrc +cfv ~/.vimrc +cfr ~/.config/ranger/rc.conf +cfi ~/.config/i3/config +cfq ~/.config/qutebrowser/config.py +cfm ~/.config/mutt/muttrc +cfM ~/.config/moc/keymap +cff ~/.config/Scripts/folders +cfc ~/.config/Scripts/configs +cft ~/.config/termite/config +cfT ~/.tmux.conf +eb ~/Documents/LaTeX/uni.bib +cv ~/Documents/LaTeX/cv.tex +cfa ~/.config/mutt/aliases +cfp ~/.config/polybar/config +cfd ~/.Xdefaults diff --git a/.config/Scripts/extract b/.config/Scripts/extract @@ -0,0 +1,30 @@ +#!/bin/bash +# there are two different ways this script can work. +# for the first way, uncomment the two lines after the if and place two '.' in front of the /$1 +# this creates a new directory in the directory where the compressed file is and dumps the content in it +# for the second way, comment the two lines under the if and place just one '.' in front of the /$1 +# this just dumps the content of the compressed file in the same directory of the compressed file +if [ -f $1 ] ; then + NAME=${1%.*} + mkdir $NAME && cd $NAME + case $1 in + *.tar.bz2) tar xvjf ../$1 ;; + *.tar.gz) tar xvzf ../$1 ;; + *.tar.xz) tar xvJf ../$1 ;; + *.lzma) unlzma ../$1 ;; + *.bz2) bunzip2 ../$1 ;; + *.rar) unrar x -ad ../$1 ;; + *.gz) gunzip ../$1 ;; + *.tar) tar xvf ../$1 ;; + *.tbz2) tar xvjf ../$1 ;; + *.tgz) tar xvzf ../$1 ;; + *.zip) unzip ../$1 ;; + *.Z) uncompress ../$1 ;; + *.7z) 7z x ../$1 ;; + *.xz) unxz ../$1 ;; + *.exe) cabextract ../$1 ;; + *) echo "extract: '$1' - unknown archive method" ;; + esac +else +echo "$1 - file does not exist" + fi diff --git a/.config/Scripts/flash_win.sh b/.config/Scripts/flash_win.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +#Flashes the active window. + +#Requires transset-df and a composite manager, like xcompmgr. + +transset -a -m 0 +sleep .1 +transset -a -x 1 +sleep .1 +transset -a -m 0 +sleep .1 +transset -a -x 1 diff --git a/.config/Scripts/folders b/.config/Scripts/folders @@ -0,0 +1,10 @@ +h ~ +d ~/Documents +D ~/Downloads +pp ~/Pictures +vv ~/Videos +m ~/Music +b ~/Books +s ~/.config/Scripts +r / +cf ~/.config diff --git a/.config/Scripts/offlineimap-daemon.py b/.config/Scripts/offlineimap-daemon.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +import subprocess +import signal +import threading +import sys + +import dbus +from dbus.mainloop.glib import DBusGMainLoop +from gi.repository import GLib + + +class OfflineimapCtl(object): + def __init__(self): + self.daemon_proc = None + self.run_ev = threading.Event() + self.run_daemon = False + + def run(self): + t = threading.Thread(target=self._watch_daemon, daemon=True) + t.start() + + def _watch_daemon(self): + while True: + self.run_ev.wait() + self.run_ev.clear() + if self.run_daemon: + self.is_running = True + print('offlineimap is being started') + self._spawn_daemon() + print('offlineimap has stopped') + self.run_ev.set() # check state and restart if needed + + def _spawn_daemon(self): + self.daemon_proc = subprocess.Popen(['offlineimap', '-u', 'basic'], shell=False) + self.daemon_proc.wait() + self.daemon_proc = None + + def start(self): + print('starting offlineimap') + self.run_daemon = True + self.run_ev.set() + + def stop(self): + print('stopping offlineimap') + self.run_daemon = False + if self.daemon_proc: + try: + self.daemon_proc.send_signal(signal.SIGUSR2) + except OSError: + print('Unable to stop offlineimap') + + def restart(self): + print('restarting offlineimap') + if self.run_daemon: + self.stop() + self.start() + + def onConnectivityChanged(self, state): + # 70 means fully connected + if state == 70: + self.start() + else: + self.stop() + +def main(): + oi_ctl = OfflineimapCtl() + oi_ctl.run() + + try: + bus = dbus.SystemBus(mainloop=DBusGMainLoop()) + network_manager = bus.get_object( + 'org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') + network = dbus.Interface(network_manager, + dbus_interface='org.freedesktop.NetworkManager') + + network.connect_to_signal('StateChanged', oi_ctl.onConnectivityChanged) + + # send current state as first event + state = network.state() + oi_ctl.onConnectivityChanged(state) + + except dbus.exceptions.DBusException: + print('Unable to connect to dbus') + sys.exit(3) + + # start receiving events from dbus + loop = GLib.MainLoop() + loop.run() + +if __name__ == '__main__': + main() diff --git a/.config/Scripts/offlineimap-daemonctl.sh b/.config/Scripts/offlineimap-daemonctl.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# this script runs offline imap as daemon (configured to check periodically) + +LOG=~/.offlineimap/sync.log +PIDFILE=~/.offlineimap/pid + +# if not present on PATH, those vars must point to proper locations +THIS_SCRIPT=offlineimap-daemonctl.sh +PYTHON_DAEMON=offlineimap-daemon.py + +daemon(){ + $PYTHON_DAEMON 2>&1 | + # add timestamps to logs + (while read line; do + echo `date` "$line" >> $LOG + done) +} + +stop(){ + kill -USR2 `cat $PIDFILE` +} + +refresh(){ + kill -USR1 `cat $PIDFILE` +} + +case "$1" in + '--daemon' | '-d' ) + nohup $THIS_SCRIPT < /dev/null > /dev/null 2>&1 & + ;; + '--kill' | '-k' ) + stop + ;; + '--refresh' | '-r' ) + refresh + ;; + * ) + daemon + ;; +esac+ \ No newline at end of file diff --git a/.config/Scripts/remaps b/.config/Scripts/remaps @@ -0,0 +1 @@ +keycode 135 = Super_R NoSymbol Super_R diff --git a/.config/Scripts/resize-font b/.config/Scripts/resize-font @@ -0,0 +1,169 @@ +# vim:ft=perl:fenc=utf-8 +# Copyright (c) 2009-, Simon Lundström <simmel@soy.se> +# Copyright (c) 2014 Maarten de Vries <maarten@de-vri.es> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +# Usage: +# Set your font in ~/.Xresources: +# urxvt.font: xft:Inconsolata:pixelsize=12 +# to set it with pixels or +# urxvt.font: xft:Inconsolata:size=12 +# to set it with points. + +# And re-bind some keymappings (if you want, below are the defaults): +# URxvt.keysym.C-minus: resize-font:smaller +# URxvt.keysym.C-plus: resize-font:bigger +# URxvt.keysym.C-equal: resize-font:reset +# URxvt.keysym.C-question: resize-font:show +# + +my @fonts = ( + {'name' => 'font', 'code' => 710}, + {'name' => 'boldFont', 'code' => 711}, + {'name' => 'italicFont', 'code' => 712}, + {'name' => 'boldItalicFont', 'code' => 713}, +); + +my @fixed = qw(4x6 5x7 5x8 6x9 6x10 6x12 6x13 7x13 7x14 8x13 8x16 9x15 9x18 10x20 12x24); + +sub on_start { + my ($self) = @_; + + foreach (@fonts) { + $_->{'default'} = $self->resource($_->{'name'}); + } +} + +sub on_init { + my ($self) = @_; + my $commands = { + "smaller" => "C-minus", + "bigger" => "C-plus", + "reset" => "C-equal", + "show" => "C-question", + }; + bind_hotkeys($self, $commands); + + () +} + +sub bind_hotkeys { + my ($self, $commands) = @_; + + for (keys %$commands) { + my $hotkey = $$commands{$_}; + my $hotkey_bound = $self->{'term'}->x_resource("keysym.$hotkey"); + if (!defined($hotkey_bound) ) { + # Support old-style key bindings + if ($self->x_resource("%.$_")) { + $hotkey = $self->x_resource("%.$_"); + } + + # FIXME If we're bound to a keysym, don't bind the default. + $self->bind_action($hotkey, "%:$_") or + warn "unable to register '$hotkey' as hotkey for $_"; + } + else { + if ($hotkey_bound !~ /^resize-font:/) { + warn "Hotkey $$commands{$_} already bound to $hotkey_bound, not binding to resize-font:$_ by default."; + } + } + } +} + +sub on_action { + my ($self, $string) = @_; + my $regex = qr"(?!pixelsize=)(\d+)"; + + if ($string eq "bigger") { + foreach (@fonts) { + next if not defined($_->{'default'}); + update_font_size($self, $_, +2); + } + } + elsif ($string eq "smaller") { + foreach (@fonts) { + next if not defined($_->{'default'}); + update_font_size($self, $_, -2); + } + } + elsif ($string eq "reset") { + foreach (@fonts) { + next if not defined($_->{'default'}); + set_font($self, $_, $_->{'default'}); + } + } + elsif ($string eq "show") { + + my $term = $self->{'term'}; + $term->{'resize-font'}{'overlay'} = { + ov => $term->overlay_simple(0, -1, format_font_info($self)), + to => urxvt::timer + ->new + ->start(urxvt::NOW + 1) + ->cb(sub { + delete $term->{'resize-font'}{'overlay'}; + }), + }; + } + + () +} + +sub get_font { + my ($self, $name) = @_; + return $self->resource($name); +} + +sub set_font { + my ($self, $font, $new) = @_; + $self->cmd_parse(sprintf("\33]%d;%s\007", $font->{'code'}, $new)); +} + +sub update_font_size { + my ($self, $font, $delta) = @_; + my $regex = qr"(?<=size=)(\d+)"; + my $current = get_font($self, $font->{'name'}); + + my ($index) = grep { $fixed[$_] eq $current } 0..$#fixed; + if ($index or $index eq 0) { + my $inc = $delta / abs($delta); + $index += $inc; + if ($index < 0) { $index = 0; } + if ($index > $#fixed) { $index = $#fixed; } + $current = $fixed[$index]; + } + else { + $current =~ s/$regex/$1+$delta/ge; + } + set_font($self, $font, $current); +} + +sub format_font_info { + my ($self) = @_; + + my $width = 0; + foreach (@fonts) { + my $length = length($_->{'name'}); + $width = $length > $width ? $length : $width; + } + ++$width; + + my $info = ''; + foreach (@fonts) { + $info .= sprintf("%-${width}s %s\n", $_->{'name'} . ':', get_font($self, $_->{'name'})); + } + + return $info; +} diff --git a/.config/Scripts/screen.sh b/.config/Scripts/screen.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#Feed this script either: +# "l" for laptop screen only, +# "v" for vga screen only, +# or "d" for dual vga/laptop. + +d() { if [[ $(xrandr -q | grep VGA1\ con) ]] + then param $1 + else echo "No VGA input detected." + fi ;} +dual() { xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1 ;} +laptop() { xrandr --output LVDS1 --auto --output VGA1 --off ;} +vga() { xrandr --output VGA1 --auto --output LVDS1 --off ;} +#mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;} + +param() { +case $1 in + d) dual ;; + v) vga ;; + l) laptop ;; + *) echo -e "Invalid parameter. Add one of the following:\n\"d\" for dualscreen laptop and VGA.\n\"l\" for laptop only\n\"v\" for VGA only." ;; +esac ;} +d $1 diff --git a/.config/Scripts/screencast_alsa.sh b/.config/Scripts/screencast_alsa.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +#This is the ffmpeg command that the screencast shortcut in i3 will run. + +#Picks a file name for the output file based on availability: + +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" + +#The actual ffmpeg command: + +ffmpeg -y \ +-f x11grab \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ +-thread_queue_size 1024 \ + -f alsa -ar 44100 -i hw:1 \ + -c:v libx264 -r 30 -c:a flac $filename + #-c:v ffvhuff -r 30 -c:a flac $filename diff --git a/.config/Scripts/screencast_pulse.sh b/.config/Scripts/screencast_pulse.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +#This is the ffmpeg command that the screencast shortcut in i3 will run. + +#Picks a file name for the output file based on availability: + +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" + +#The actual ffmpeg command: + +ffmpeg -y \ +-f x11grab \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ +-f alsa -i default \ + -c:v libx264 -r 30 -c:a flac $filename + #-c:v ffvhuff -r 30 -c:a flac $filename + #-f pulse -ac 1 -ar 44100 -i default \ diff --git a/.config/Scripts/shortcuts.sh b/.config/Scripts/shortcuts.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Config locations +folders="$HOME/.config/Scripts/folders" +configs="$HOME/.config/Scripts/configs" + +# Output locations +bash_shortcuts="$HOME/.bash_shortcuts" +ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" +qute_shortcuts="$HOME/.config/qutebrowser/shortcuts.py" + +# Ensuring that output locations are properly sourced +cat ~/.bashrc | grep "source ~/.bash_shortcuts" >/dev/null && + echo Bashrc already ready. || + (echo "source ~/.bash_shortcuts" >> ~/.bashrc && + echo Bashrc now prepared for shortcuts.) + +cat ~/.config/ranger/rc.conf | grep "source ~/.config/ranger/shortcuts.conf" >/dev/null && + echo Rc.conf already ready. || + (echo "source ~/.config/ranger/shortcuts.conf" >> ~/.config/ranger/rc.conf && + echo rc.conf now prepared for shortcuts.) + +cat ~/.config/qutebrowser/config.py | grep shortcuts.py >/dev/null && + echo "Qutebrowser's config.py already ready." || + (echo "config.source('shortcuts.py')" >> ~/.config/qutebrowser/config.py && + echo "qutebrowser's config.py now prepared for shortcuts.") + +#Delete old shortcuts +echo "# vim: filetype=sh" > $bash_shortcuts +echo "# ranger shortcuts" > $ranger_shortcuts +echo "# qutebrowser shortcuts" > $qute_shortcuts + +writeDirs() { echo "alias $1='cd $2 && ls -a'" >> $bash_shortcuts + echo "map g$1 cd $2" >> $ranger_shortcuts + echo "map t$1 tab_new $2" >> $ranger_shortcuts + echo "map m$1 shell mv %s $2" >> $ranger_shortcuts + echo "map Y$1 shell cp -r %s $2" >> $ranger_shortcuts + echo "config.bind(';$1', 'set downloads.location.directory $2 ;; hint links download')" >> $qute_shortcuts ;} + +writeConfs() { + echo "alias $1='vim $2'" >> $bash_shortcuts + echo "map $1 shell vim $2" >> $ranger_shortcuts ;} + +IFS=$'\n' +set -f +for line in $(cat "$folders"); do + line=$(echo $line | sed 's/#.*//') + key=$(echo $line | awk '{print $1}') + dir=$(echo $line | awk '{print $2}') + [ "$dir" == "" ] || writeDirs $key $dir +done && echo "Directory shortcuts done." + +set -f +for line in $(cat "$configs"); +do + line=$(echo $line | sed 's/#.*//') + short=$(echo $line | awk '{print $1}') + conf=$(echo $line | awk '{print $2}') + [ "$conf" == "" ] || writeConfs $short $conf +done && echo "Config file shortcuts done." + +echo "All done!" diff --git a/.config/Scripts/speedvid.sh b/.config/Scripts/speedvid.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +base=$(basename $1) +ext="${base##*.}" +base="${base%.*}" + +ffmpeg -i $1 -vf "setpts=$2*PTS" -an $base'_sped.'$ext diff --git a/.config/Scripts/transmission.sh b/.config/Scripts/transmission.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ -f $(pgrep transmission) ]; + then + urxvt -e transmission-remote-cli + else + transmission-daemon && urxvt -e transmission-remote-cli +fi diff --git a/.config/Scripts/video.sh b/.config/Scripts/video.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +#This is the ffmpeg command that the screencast shortcut in i3 will run. + +#Picks a file name for the output file based on availability: + +while [[ -f $HOME/video$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/video$n.mkv" + + +#The actual ffmpeg command: + +ffmpeg \ +-f x11grab \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ + -c:v libx264 -qp 0 -r 30 $filename + #-c:v ffvhuff -r 30 -c:a flac $filename diff --git a/.config/Scripts/webview b/.config/Scripts/webview @@ -0,0 +1,23 @@ +#!/bin/bash + +# Feed script a url. +# Opens the url with xdg-open unless it is an image, +# in which case it downloads in feh. + +ext="${1##*.}" +mpvFiles="mkv mp4 gif" +fehFiles="png jpg jpeg jpe" +wgetFiles="mp3 flac opus mp3?source=feed pdf" + +pgrep i3 ifi3="i3 exec" + +if echo $fehFiles | grep -w $ext > /dev/null; then + nohup feh "$1" >/dev/null & +#elif [[ "$ext" == "gif" ]]; then +elif echo $mpvFiles | grep -w $ext > /dev/null; then + nohup mpv --loop --quiet "$1" > /dev/null & +elif echo $wgetFiles | grep -w $ext > /dev/null; then + nohup wget "$1" >/dev/null & +else + nohup $BROWSER "$1" >/dev/null & +fi diff --git a/.config/Scripts/welcome b/.config/Scripts/welcome @@ -0,0 +1,4 @@ +#!/bin/bash +dialog --title "Welcome to LARBS!" --msgbox "If you're new to the system, hold down the Windows key and press F1 for a full tutorial! + +(This infobox will greet you at each login until you run the command \"hello-larbs\" in the terminal.)" 10 60 diff --git a/.config/compton.conf b/.config/compton.conf @@ -0,0 +1,56 @@ +# vim: filetype=conf +backend = "glx"; +paint-on-overlay = true; +glx-no-stencil = true; +glx-no-rebind-pixmap = true; +vsync = "opengl-swc"; + +# These are important. The first one enables the opengl backend. The last one is the vsync method. Depending on the driver you might need to use a different method. +# The other options are smaller performance tweaks that work well in most cases. +# You can find the rest of the options here: https://github.com/chjj/compton/wiki/perf-guide, and here: https://github.com/chjj/compton/wiki/vsync-guide + + +# Shadow +shadow = true; # Enabled client-side shadows on windows. +no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows. +no-dnd-shadow = true; # Don't draw shadows on DND windows. +clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental). +shadow-radius = 7; # The blur radius for shadows. (default 12) +shadow-offset-x = -7; # The left offset for shadows. (default -15) +shadow-offset-y = -7; # The top offset for shadows. (default -15) +shadow-exclude = [ + "! name~=''", + "n:e:Notification", + "n:e:Plank", + "n:e:Docky", + "g:e:Synapse", + "g:e:Kupfer", + "g:e:WC_Cronograph", + "g:e:Conky", + "n:w:*Firefox*", + "n:w:*Chrome*", + "n:w:*Chromium*", + "class_g ?= 'Notify-osd'", + "class_g ?= 'Cairo-dock'", + "class_g ?= 'Xfce4-notifyd'", + "class_g ?= 'Xfce4-power-manager'" +]; + +# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches +# (most applications are fine, only apps that do weird things with xshapes or argb are affected). +# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. + +# Fading +fading = false; # Fade windows during opacity changes. +fade-delta = 4; # The time between steps in a fade in milliseconds. (default 10). +fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028). +fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03). +#no-fading-openclose = true; # Fade windows in/out when opening/closing + +detect-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what. + +# Window type settings +wintypes: +{ + tooltip = { fade = true; shadow = false; }; +}; diff --git a/.config/feh/keys b/.config/feh/keys @@ -0,0 +1,12 @@ +zoom_in K XF86Forward +zoom_out J XF86Back +next_img L space +prev_img BackSpace H + +scroll_up k Up +scroll_down j Down +scroll_right l Right +scroll_left h Left + +toggle_fullscreen f +save_filelist F diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf @@ -0,0 +1,24 @@ +<?xml version='1.0'?> +<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> +<fontconfig> + + <alias> + <family>serif</family> + <prefer><family>Tinos</family></prefer> + </alias> + <alias> + <family>sans-serif</family> + <prefer><family>Arimo</family></prefer> + </alias> + <alias> + <family>sans</family> + <prefer><family>Arimo</family></prefer> + </alias> + <alias> + <family>monospace</family> + <prefer><family>Tamzen</family></prefer> + </alias> + +</fontconfig> + + diff --git a/.config/i3/config b/.config/i3/config @@ -0,0 +1,475 @@ +# vim: filetype=i3 + +# This is Luke Smith's i3-gaps configuration file. +# Me: http://lukesmith.xyz +# Email: luke@lukesmith.xyz +# YouTube: https://youtube.com/c/LukeSmithxyz +# Github: https://github.com/LukeSmithxyz + +# Be sure that you have your $BROWSER environmental variable set to your favorite browser. +# E.g., put `export BROWSER="firefox"` into your bash_profile + +# #---Basic Definitions---# # +#Needed for i3-gaps +for_window [class="^.*"] border pixel 3 +gaps inner 15 +gaps outer 15 +font pango:mono 9 +set $mod Mod4 +set $term --no-startup-id st +set $video --no-startup-id bash ~/.config/Scripts/video.sh +set $stoprec --no-startup-id killall ffmpeg & killall screenkey + + +# #---Starting External Scripts---# # +#Music player daemon: +exec --no-startup-id mpd +#Torrent daemon: +exec --no-startup-id transmission-daemon +#Mount other drives: +exec --no-startup-id sudo mount -a +#Composite manager: +exec --no-startup-id compton --xrender-sync-fence +#Try to load VGA screen if available: +exec --no-startup-id ~/.config/Scripts/screen.sh v +#Launch Polybar where appropriate: +exec_always --no-startup-id ~/.config/polybar/launch.sh +#Start the offlineimap daemon; +exec --no-startup-id killall python ~/.config/Scripts/offlineimap-daemon.py +exec --no-startup-id python ~/.config/Scripts/offlineimap-daemon.py +#Add wallpaper: +exec --no-startup-id feh --bg-scale ~/.config/wall.png +#exec_always --no-startup-id wal -c -i ~/.config/wall.png +#Remaps the caps lock button to escape and uses the US international keyboard with dead keys +exec_always --no-startup-id setxkbmap -option caps:escape +#exec_always --no-startup-id setxkbmap -layout us -variant altgr-intl -option caps:escape +#Remap Menu button to Super: +#exec_always --no-startup-id xmodmap -e 'keycode 135 = Super_R' +bindsym Menu exec --no-startup-id xmodmap -e 'keycode 135 = Super_R' +#Unclutter makes the mouse invisible after a brief period +exec --no-startup-id unclutter + +#OPENRC +#set $shutdown sudo openrc-shutdown -p +#set $reboot sudo openrc-shutdown -r +#set $netrefresh --no-startup-id sudo rc-service NetworkManager restart + +#SYSTEMD +set $shutdown sudo shutdown -h now +set $reboot sudo reboot +set $netrefresh --no-startup-id sudo systemctl restart NetworkManager + +###---Audio and Music Definitions---### + +##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( + +# #---Audio and Music Definitions---# # +# For mpc: +set $music --no-startup-id st -e ncmpcpp +set $pause --no-startup-id mpc toggle +set $trupause --no-startup-id mpc pause +set $next --no-startup-id mpc next +set $prev --no-startup-id mpc prev +set $lilfor --no-startup-id mpc seek +10 +set $bigfor --no-startup-id mpc seek +120 +set $lilbak --no-startup-id mpc seek -10 +set $bigbak --no-startup-id mpc seek -120 +set $beg --no-startup-id mpc seek 0% + +# 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 + +#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 +#set $screencast --no-startup-id bash ~/.config/Scripts/screencast_alsa.sh +#set $audio --no-startup-id bash ~/.config/Scripts/audio_alsa.sh + +#For PULSEAUDIO/PAMIXER +set $inc --no-startup-id pamixer --allow-boost -i 5 +set $biginc --no-startup-id pamixer --allow-boost -i 15 +set $dec --no-startup-id pamixer --allow-boost -d 5 +set $bigdec --no-startup-id pamixer --allow-boost -d 15 +set $mute --no-startup-id pamixer --allow-boost -t +set $micmute --no-startup-id pamixer --allow-boost -t +set $truemute --no-startup-id pamixer -m +set $screencast --no-startup-id bash ~/.config/Scripts/screencast_pulse.sh +set $audio --no-startup-id bash ~/.config/Scripts/audio_pulse.sh + +# #---Basic Bindings---# # +bindsym $mod+Return exec $term +##bindsym $mod+Shift+Return exec $term -e tmux + +bindsym $mod+Shift+space floating toggle +bindsym $mod+space focus mode_toggle + +bindsym $mod+Escape workspace prev +bindsym $mod+Shift+Escape exec i3-msg exit + +# bindsym $mod+BackSpace +bindsym $mod+Shift+BackSpace exec $reboot + +# bindsym $mod+grave +##bindsym $mod+asciitilde + +#STOP/HIDE EVERYTHING: +bindsym $mod+Shift+Delete exec $truemute ; exec $truepause ; workspace lmao ; exec $term -e htop ; exec $term -e ranger + +# #---Letter Key Bindings---# # +bindsym $mod+q kill +bindsym $mod+Shift+q kill + +bindsym $mod+w exec $term -e sudo wifi-menu +bindsym $mod+Shift+w exec --no-startup-id $BROWSER + +bindsym $mod+e exec $term -e neomutt +##bindsym $mod+Shift+e + +bindsym $mod+r exec $term -e ranger +bindsym $mod+Shift+r exec $term -e sudo ranger / + +bindsym $mod+t split toggle +bindsym $mod+Shift+t gaps inner current set 15; gaps outer current set 15 + +bindsym $mod+y exec $term -e calcurse +bindsym $mod+Shift+y resize shrink width 10 px or 10ppt + +bindsym $mod+u [instance="dropdown"] scratchpad show; [instance="dropdown"] move position center +bindsym $mod+Shift+u resize shrink height 10 px or 10 ppt + +bindsym $mod+i exec $term -e htop +bindsym $mod+Shift+i resize grow height 10 px or 10 ppt + +bindsym $mod+o sticky toggle +bindsym $mod+Shift+o resize grow width 10 px or 10 ppt + +bindsym $mod+p exec $pause +bindsym $mod+Shift+p exec mypaint + +bindsym $mod+a [instance="math"] scratchpad show; [instance="math"] move position center +bindsym $mod+Shift+a exec $term -e ncpamixer + +bindsym $mod+s gaps inner current plus 5 +bindsym $mod+Shift+s gaps inner current minus 5 + +bindsym $mod+d exec rofi -show run +bindsym $mod+Shift+d gaps inner current set 0; gaps outer current set 0 + +bindsym $mod+f fullscreen toggle +##bindsym $mod+Shift+f + +bindsym $mod+g workspace prev +bindsym $mod+Shift+g exec --no-startup-id gimp; workspace $ws5 + +bindsym $mod+h focus left +bindsym $mod+Shift+h move left 30 + +bindsym $mod+j focus down +bindsym $mod+Shift+j move down 30 + +bindsym $mod+k focus up +bindsym $mod+Shift+k move up 30 + +bindsym $mod+l focus right +bindsym $mod+Shift+l move right 30 + +bindsym $mod+z gaps outer current plus 5 +bindsym $mod+Shift+z gaps outer current minus 5 + +bindsym $mod+x exec --no-startup-id ~/.config/i3/lock.sh +bindsym $mod+Shift+x exec $shutdown + +# Bindings to make the webcam float and stick. +for_window [title="video0 - mpv"] floating enable +for_window [title="video0 - mpv"] sticky enable + +bindsym $mod+c exec --no-startup-id mpv --geometry=-0-0 --autofit=30% /dev/video0 +bindsym $mod+Shift+c exec killall mpv /dev/video0 + +bindsym $mod+v exec $term -e ncmpcpp -s visualizer +bindsym $mod+Shift+v exec projectM-pulseaudio + +##bindsym $mod+b exec $prev +bindsym $mod+Shift+b exec --no-startup-id blender; workspace $ws6 + +bindsym $mod+n exec $term -e newsboat +##bindsym $mod+Shift+n + +bindsym $mod+m exec $music +bindsym $mod+Shift+m exec $mute + + +# #---Workspace Bindings---# # +bindsym $mod+Home workspace $ws1 +bindsym $mod+Shift+Home move container to workspace $ws1 +bindsym $mod+End workspace $ws10 +bindsym $mod+Shift+End move container to workspace $ws10 +bindsym $mod+Prior workspace prev +bindsym $mod+Shift+Prior move container to workspace prev +bindsym $mod+Next workspace next +bindsym $mod+Shift+Next move container to workspace next +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+XF86Back workspace prev +##bindsym $mod+Shift+XF86Back +bindsym $mod+XF86Forward workspace next +##bindsym $mod+Shift+XF86Forward +bindsym $mod+semicolon workspace next +bindsym $mod+apostrophe split horizontal ;; exec $term +bindsym $mod+slash split vertical ;; exec $term +bindsym $mod+Shift+slash kill +bindsym $mod+backslash workspace back_and_forth + +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 +bindsym $mod+0 workspace $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9 +bindsym $mod+Shift+0 move container to workspace $ws10 + +for_window [class="Blender"] move to workspace $ws6 +for_window [class="Thunderbird"] move to workspace $ws9 +for_window [class="marble"] move to workspace $ws7 +#for_window [class="Firefox"] move to workspace $ws2 +for_window [title="GIMP Startup"] move workspace $ws5 +for_window [class="Gimp"] move workspace $ws5 +for_window [window_role="gimp-dock"] floating disable; move left; resize shrink width 50 px or 50ppt +for_window [window_role="gimp-toolbox"] floating disable; move right; resize grow width 30 px or 30ppt +for_window [window_role="tr-main"] move to workspace $ws8 +for_window [window_role="GtkFileChooserDialog"] resize shrink height 10 px + + +workspace $ws6 gaps inner 0 +workspace $ws6 gaps outer 0 +workspace $ws5 gaps inner 0 +workspace $ws5 gaps outer 0 +workspace $ws8 gaps inner 0 +workspace $ws8 gaps outer 0 + +# #---Function Buttons---# # +##bindsym F1 nop +##bindsym F2 +##bindsym F3 +##bindsym F4 +##bindsym F5 +##bindsym F6 +##bindsym F7 +##bindsym F8 +##bindsym F9 +##bindsym F10 +bindsym F11 fullscreen toggle +##bindsym F12 + +bindsym $mod+F1 exec --no-startup-id mupdf ~/.config/i3/i3_guide.pdf +bindsym $mod+F2 restart +bindsym $mod+F3 exec --no-startup-id arandr +bindsym $mod+F4 exec --no-startup-id sudo zzz +bindsym $mod+F5 exec --no-startup-id $netrefresh +bindsym $mod+F6 exec --no-startup-id $term -e transmission-remote-cli +##bindsym $mod+F7 +##bindsym $mod+F8 +bindsym $mod+F9 exec --no-startup-id sudo mount -a +bindsym $mod+F10 exec --no-startup-id ~/.config/Scripts/screen.sh l ;; exec --no-startup-id ~/.config/polybar/launch.sh +bindsym $mod+F11 exec --no-startup-id ~/.config/Scripts/screen.sh v ;; exec --no-startup-id ~/.config/polybar/launch.sh +bindsym $mod+F12 exec --no-startup-id ~/.config/Scripts/screen.sh d ;; exec --no-startup-id ~/.config/polybar/launch.sh + + +# #---Arrow Keys---# # +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + + +# #---Media Keys---# # + +# Volume keys +bindsym $mod+plus exec $inc +bindsym $mod+Shift+plus exec $biginc +bindsym $mod+minus exec $dec +bindsym $mod+Shift+minus exec $bigdec +bindsym $mod+less exec $prev +bindsym $mod+Shift+less exec $beg +bindsym $mod+greater exec $next +bindsym $mod+Shift+greater exec $next + +# For advancing forward/backward in an mpd song +bindsym $mod+bracketleft exec $lilbak +bindsym $mod+Shift+bracketleft exec $bigbak +bindsym $mod+bracketright exec $lilfor +bindsym $mod+Shift+bracketright exec $bigfor + +# Print screen takes a screenshot. +# With shift, it takes one only of the given window. +bindsym Print exec --no-startup-id scrot +bindsym Shift+Print exec --no-startup-id scrot -u + +# For recording audio/video or stop recording. Also screenkey for visual typing. +bindsym $mod+Print exec --no-startup-id screenkey +bindsym $mod+Scroll_Lock exec $audio +bindsym $mod+Insert exec $screencast +bindsym $mod+Pause exec $video +bindsym $mod+Delete exec $stoprec +##bindsym XF86Launch1 exec $stoprec +bindsym XF86Launch1 exec $stoprec & xset dpms force off + +# #---Dropdown/Scratchpad Windows---# # +# First I have a tmux window used for background scripts. +# I'll later bind this to mod+u. +for_window [instance="dropdown"] floating enable +for_window [instance="dropdown"] resize set 625 400 +for_window [instance="dropdown"] move scratchpad +for_window [instance="dropdown"] border pixel 3 +exec --no-startup-id $term -n dropdown -e tmux + +# Then I have a window running R I use for basic arithmetic +# I'll later bind this to mod+a. +for_window [instance="math"] floating enable +for_window [instance="math"] resize set 800 300 +for_window [instance="math"] move scratchpad +for_window [instance="math"] border pixel 5 +exec --no-startup-id $term -n math -f mono:pixelsize=24 -e R -q + + +# #---Extra XF86 Keys---# # +# These are the extra media keys that some keyboards have. +bindsym XF86AudioMute exec $mute +bindsym XF86AudioLowerVolume exec $dec +bindsym XF86AudioRaiseVolume exec $inc +bindsym XF86PowerOff exec $shutdown +##bindsym XF86Copy exec +##bindsym XF86Open exec +##bindsym XF86Paste exec +##bindsym XF86Cut exec +##bindsym XF86MenuKB exec +bindsym XF86Calculator exec $term -e R -q +bindsym XF86Sleep exec sudo zzz +##bindsym XF86WakeUp exec +bindsym XF86Explorer exec $term -e ranger +##bindsym XF86Send exec +##bindsym XF86Xfer exec +bindsym XF86WWW exec --no-startup-id $BROWSER +##bindsym XF86DOS exec +bindsym XF86ScreenSaver exec exec --no-startup-id ~/.config/i3/lock.sh +##bindsym XF86RotateWindows exec +##bindsym XF86TaskPane exec +##bindsym XF86Favorites exec +bindsym XF86MyComputer exec $term -e ranger +##bindsym XF86Back exec +##bindsym XF86Forward exec +bindsym XF86Eject exec sudo umount -R /mnt +bindsym XF86AudioNext exec $next +bindsym XF86AudioPlay exec $pause +bindsym XF86AudioPrev exec $prev +bindsym XF86AudioStop exec $pause +bindsym XF86AudioRecord exec $audio +bindsym XF86AudioRewind exec $lilbak +bindsym XF86AudioForward exec $lilfor +##bindsym XF86Phone exec +##bindsym XF86Tools exec +bindsym XF86HomePage exec $BROWSER https://lukesmith.xyz +bindsym XF86Reload restart +##bindsym XF86ScrollUp exec +##bindsym XF86ScrollDown exec +##bindsym XF86New exec +##bindsym XF86LaunchA exec +##bindsym XF86LaunchB exec +##bindsym XF86Launch2 exec +##bindsym XF86Launch3 exec +##bindsym XF86Launch4 exec +##bindsym XF86Launch5 exec +##bindsym XF86Launch6 exec +##bindsym XF86Launch7 exec +##bindsym XF86Launch8 exec +##bindsym XF86Launch9 exec +bindsym XF86AudioMicMute exec $micmute +##bindsym XF86TouchpadToggle exec +bindsym XF86TouchpadOn exec --no-startup-id exec synclient TouchpadOff=0 +bindsym XF86TouchpadOff exec --no-startup-id exec synclient TouchpadOff=1 +bindsym XF86Suspend exec --no-startup-id ~/.config/i3/lock.sh +bindsym XF86Close kill +bindsym XF86WebCam exec mpv /dev/video0 +bindsym XF86Mail exec $term -e neomutt +bindsym XF86Messenger exec $term -e weechat +bindsym XF86Search exec $BROWSER https://duckduckgo.com +##bindsym XF86Go exec +##bindsym XF86Finance exec +##bindsym XF86Game exec +bindsym XF86Shop exec $BROWSER https://ebay.com +bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15 +bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15 +bindsym XF86AudioMedia exec $music +bindsym XF86Display exec --no-startup-id arandr +#bindsym XF86KbdLightOnOff exec +bindsym XF86KbdBrightnessDown exec --no-startup-id python3.6 ~/.i3/kb-lights.py - +bindsym XF86KbdBrightnessUp exec --no-startup-id python3.6 ~/.i3/kb-lights.py + +#bindsym XF86Reply exec +#bindsym XF86MailForward exec +#bindsym XF86Save exec +bindsym XF86Documents exec $term -e ranger ~/Documents +##bindsym XF86Battery exec +##bindsym XF86Bluetooth exec +bindsym XF86WLAN exec --no-startup-id sudo systemctl restart NetworkManager diff --git a/.config/i3/i3_guide.rmd b/.config/i3/i3_guide.rmd @@ -0,0 +1,182 @@ +--- +title: A Friendly Guide to Luke's i3 Rice +author: Luke Smith +output: pdf_document +linkcolor: blue +--- + +Use vim keys (h/j/k/l) to navigate this document. Pressing W will fit it to window width. + and - zoom in and out. f to toggle fullscreen. q to quit. (These are general mupdf shortcuts.) + ++ Mod+F1 will show this document at any time. ++ By "Mod" I mean the Super Key, usually known as "the Windows Key." + +Questions or suggestions? Email me at [luke@lukesmith.xyz](mailto:luke@lukesmith.xyz). + +## Basic goals and principles of this system: + ++ Naturalness -- Remove the border between mind and matter: everything important should be as few keypresses as possible away from you, and you shouldn't have to think about what you're doing. Immersion. ++ Economy -- Programs should be simple and light on system resources and highly extensible. Because of this, many are terminal or small ncurses programs that have all the magic inside of them. ++ Keyboard/vim-centrality -- All terminal programs (and other programs) use vim keys when possible. Your hands never need leave the home row or thereabout. + +## General changes + ++ Capslock is now an alternative escape. Makes vim-craft much more efficient. ++ The menu button (usually between the right Alt and Ctrl) is an alternative Super/Mod button. This is to make one-handing on my laptops easier. ++ The rice also uses the US International keyboard by default. This allows you to type a lot of characters in many different European languages. If you'd like to change this, you need only remove the `setxkbmap` line in the i3 config. + +# The Polybar Status Bar + +If you're new to i3, notice the status bar on the top of the screen. This is Polybar. To the left side, you'll see the numbers of your current workspace(s). If you have a song playing in mpd, its name will appear to the left as well. On the right side, you'll see various system status notifiers, date, CPU tempurature, remaining hard drive space, etc. I'm sure you can figure it out. Several modules will be click-sensitive, although if you're using my system as indended, you probably won't be doing much clicking. + +# Key Bindings + +## Window basics + +Notice the case sensitivity of the shortcuts. + +Be sure you play around with these. Be flexible with the basic commands and the rice will grow on you quick. + ++ Mod+Enter -- Spawn terminal ++ Mod+q or Q -- Close window ++ Mod+d -- rofi (For running commands or programs without shortcuts) ++ Mod+t -- Toggle between spawning vertically and horizontally ++ Mod+f or F11 -- Fullscreen ++ Mod+h/j/k/l -- Move to different windows ++ Mod+H/J/K/L -- Move a window around ++ Mod+Y/U/I/O -- Resize windows ++ Mod+/ -- Spawn vertical terminal ++ Mod+' -- Spawn horizontal terminal ++ Mod+s/S -- Increase/decrease inner gaps ++ Mod+z/Z -- Increase/decrease outer gaps ++ Mod+D -- Reduce gaps to 0 pixels ++ Mod+T -- Restore gaps to default (15 pixels) ++ Mod+Shift+Space -- Make a window float (you can still resize and move floating windows with the same keys above) ++ Mod+Space -- Switch focus from a floating window to a non-floating one (or vice versa) + +## Basic Programs + ++ Mod+r -- ranger (file browser/manager) ++ Mod+e -- mutt (email) ++ Mod+m -- ncmpcpp (music player) ++ Mod+a -- R calculator (be sure to close with Mod+a for reusability) ++ 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+A -- ncpamixer (audio system control) ++ mod+w -- wifi-menu (accessing wifi networks) + +## Larger programs + ++ Mod+W -- qutebrowser ++ Mod+B -- Blender (video and 3d editor) ++ Mod+G -- GIMP (for general image manipulation) ++ Mod+P -- MyPaint (for light sketching) + +## System + ++ Mod+R -- ranger as root user ++ Mod+x -- i3lock (Enter password to return) ++ Mod+X -- shutdown now (Be careful with this one!) ++ Mod+Shift+Backspace -- reboot (And this one!) ++ Mod+Shift+Escape -- exit i3 (And this one as well!) ++ Mod+F1 -- Shows this document ++ Mod+F2 -- Refresh i3 ++ Mod+F3 -- arandr (For adding screens/HDMI/VGA connections) ++ Mod+F4 -- Hibernate ++ Mod+F6 -- transmission torrent client (cli) ++ Mod+F5 -- Reset Network Manager, search for new networks ++ Mod+F7 -- <++> ++ Mod+F8 -- <++> ++ Mod+F10 -- Switch to laptop screen ++ Mod+F11 -- Switch to VGA display (if available) ++ Mod+F12 -- Switch to dual VGA/laptop display (if available) + +## Audio + +I use ncmpcpp as a music player, which is a front end for mpd. If you prefer cmus or mocp, I have commented out shortcuts you can activate for it instead in the i3 config. + ++ Mod+m -- ncmpcpp music player ++ Mod+. -- Next track ++ Mod+, -- Previous track ++ Mod+< -- Restart track ++ Mod+p -- Pause ++ Mod+M -- Mute all audio ++ Mod+v -- visualizer ++ Mod+- -- Decrease volume (holding shift increases amount) ++ Mod++ -- Increase volume (holding shift increases amount) ++ Mod+[ -- Back 10 seconds (holding shift increases amount) ++ Mod+] -- Forward 10 seconds (holding shift increases amount) ++ Mod+A -- ncpamixer (general volume sink/source control) + +## Workspaces + +There are ten workspaces. They work just like those in vanilla i3 with some additions. + ++ Mod+(Number) -- Go to that number workspace ++ Mod+Shift+(Number) -- Send window to that workspace ++ Mod+Tab -- Go to previous workspace ++ Mod+g or escape -- Go to left workspace ++ Mod+; -- Go to right workspace ++ Mod+Shift+Delete -- "Porno-mode" Press this key sequence if you want to hide what you have on your screen. Moves to a totally new workspace, mutes sound, pauses music and brings up distraction windows. + +## Recording + +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. + ++ Print Screen -- Take a scrot screenshot ++ Shift+Print Screen -- Take a scrot screenshot of only selected window ++ Mod+Insert -- Begin screencast ++ Mod+ScrollLock -- Begin audio recording ++ Mod+Pause -- Begin screen recording without audio ++ Mod+Print Screen -- Start screenkey ++ Mod+Delete -- kills ffmpeg and screenkey, thus ending recordings and screen ++ ThinkVantage button (on Thinkpads) -- kills ffmpeg and screenkey, thus ending recordings + +Each of the recording scripts are located in `~/.config/Scripts/`. You can check them out or modify them if needed. + +## 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. + +# Special traits of my rice + +## 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. + +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. + +## 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 81 and growing. + +Each line has a shortcut key/keys and its target. These can be used in serveral applications. In bash, simply press `d`, the shortcut for `~/Documents` and you will cd there (and automatically `ls -a`). + +ranger works similarly. When in ranger, just press `g` then the shortcut of the folder you want to go to. You may also press `t` plus the shortcut to open a new tab there. `m` plus the shortcut moves the selected files to the folder and `Y` copies them there. **Get good at this. It will make management of even the most complex file system easy.** + +Lastly qutebrowser implements these shortcuts as well. When you see a file or image you want to download, press `;` followed by the folder shortcut and qutebrowser will let you select the file with its hint system. The file will then download to the directory you chose. + +## Dynamically constructed configs + +Each time you save changes to either the config shortcut file or the folder shortcut file in vim, vim will automatically run a bash script that updates your bash/ranger config, allowing you to use your new shortcuts in your next instance of bash/ranger or after resourcing your rc files. + +# Explore and customize + +Don't like something about the rice? Change it. If you have a problem, try figuring it out yourself, but if you can't, ask on my YouTube or by my email. + +EDIT: July 31, 2017. All the feedback I've gotten is tremendous and I'm glad this has gotten so many people into customization! + +# Contact + +[luke@lukesmith.xyz](mailto:luke@lukesmith.xyz) -- For questions! + +[http://lukesmith.xyz](http://lukesmith.xyz) -- For stalking! + +[Send Me Money!](https://paypal.me/LukeMSmith) -- For gratitude! + +[My Github Page](https://github.com/LukeSmithxyz) -- For the code behind it! + +[Twitter](https://twitter.com/lukesfiat) -- For updates! + +[RSS](http://lukesmith.xyz/rss.xml) -- For even better updates! diff --git a/.config/i3/kb-lights.py b/.config/i3/kb-lights.py @@ -0,0 +1,35 @@ +#!/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/.config/i3/lock.png b/.config/i3/lock.png Binary files differ. diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh @@ -0,0 +1,8 @@ +#!/bin/bash +scrot /tmp/screen.png +#convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png +#convert /tmp/screen.png -paint 3 -modulate 80 /tmp/screen.png +convert /tmp/screen.png -paint 3 /tmp/screen.png +[[ -f ~/.config/i3/lock.png ]] && convert /tmp/screen.png ~/.config/i3/lock.png -gravity center -composite -matte /tmp/screen.png +mocp -P +i3lock -u -e -i /tmp/screen.png diff --git a/.config/mimeapps.list b/.config/mimeapps.list @@ -0,0 +1,26 @@ +[Default Applications] +x-scheme-handler/http=userapp-Firefox-L5HJ0Y.desktop +x-scheme-handler/https=userapp-Firefox-L5HJ0Y.desktop +x-scheme-handler/ftp=userapp-Firefox-L5HJ0Y.desktop +x-scheme-handler/chrome=userapp-Firefox-L5HJ0Y.desktop +text/html=userapp-Firefox-L5HJ0Y.desktop +application/x-extension-htm=userapp-Firefox-L5HJ0Y.desktop +application/x-extension-html=userapp-Firefox-L5HJ0Y.desktop +application/x-extension-shtml=userapp-Firefox-L5HJ0Y.desktop +application/xhtml+xml=userapp-Firefox-L5HJ0Y.desktop +application/x-extension-xhtml=userapp-Firefox-L5HJ0Y.desktop +application/x-extension-xht=userapp-Firefox-L5HJ0Y.desktop +application/pdf=mupdf.desktop + +[Added Associations] +x-scheme-handler/http=userapp-Firefox-L5HJ0Y.desktop; +x-scheme-handler/https=userapp-Firefox-L5HJ0Y.desktop; +x-scheme-handler/ftp=userapp-Firefox-L5HJ0Y.desktop; +x-scheme-handler/chrome=userapp-Firefox-L5HJ0Y.desktop; +text/html=userapp-Firefox-L5HJ0Y.desktop; +application/x-extension-htm=userapp-Firefox-L5HJ0Y.desktop; +application/x-extension-html=userapp-Firefox-L5HJ0Y.desktop; +application/x-extension-shtml=userapp-Firefox-L5HJ0Y.desktop; +application/xhtml+xml=userapp-Firefox-L5HJ0Y.desktop; +application/x-extension-xhtml=userapp-Firefox-L5HJ0Y.desktop; +application/x-extension-xht=userapp-Firefox-L5HJ0Y.desktop; diff --git a/.config/moc/config b/.config/moc/config @@ -0,0 +1,13 @@ +Keymap = ${HOME}/.config/moc/keymap +Theme = ${HOME}/.config/moc/themes/theme +#readtags = no +QueueNextSongReturn = no +FormatString = "%(n:%n :)%(t:%t:)%(a: \(by %a\):)%(A: \(in %A\):)" +##%(A: \(%A\):)" + +MusicDir = ${HOME}/Music +Fastdir1 = ${HOME}/Talks/Audiobooks +Fastdir2 = ${HOME}/Talks/Lectures +Fastdir3 = ${HOME}/Talks/Podcasts +Fastdir4 = ${HOME}/Downloads +Fastdir5 = ${HOME}/Creations diff --git a/.config/moc/keymap b/.config/moc/keymap @@ -0,0 +1,188 @@ +# This is the example keymap file for MOC. You can define your own key +# bindings for MOC commands by creating your own keymap file and setting +# the 'Keymap' option in ~/.moc/config. +# +# The format of this file is: +# +# - Lines beginning with # are comments. +# - Blank lines are ignored. +# - Every other line is expected to be in one of the formats: +# +# COMMAND = [KEY ...] +# COMMAND += KEY ... +# +# The KEY can be: +# +# - Just a char, like i, L, ", * +# - CTRL-KEY sequence: ^k (CTRL-k), ^4 +# - ALT-KEY (meta) sequence: M-j (ALT-j), M-/ +# - Special keys: DOWN, UP +# LEFT, RIGHT +# HOME, END +# BACKSPACE +# INS, DEL +# ENTER +# PAGE_UP, PAGE_DOWN +# SPACE, TAB +# KEYPAD_CENTER +# ESCAPE +# F1 - F12 +# +# Note that the use of a digit as a KEY is deprecated. +# +# Maximum number of KEYs for one COMMAND is 5. +# +# Omitting the KEY for a COMMAND will unbind all its default keys. They +# will also be automatically unbound when you bind new KEYs to it. Individual +# default KEYs will be automatically unbound when they are explicitly bound +# to some other COMMAND. +# +# Using the '+=' form will cause the KEYs to be appended to any existing +# (default or explicit) bindings for the COMMAND. Appending an existing +# default binding for the same COMMAND will cause MOC to think of that KEY +# as then being explicitly bound. +# +# Only one binding for any given COMMAND can appear in the keymap file. One +# exception to this is that if the default keys for a COMMAND are explicitly +# unbound then a subsequent binding may appear for it. A second exception +# is that multiple appending bindings may appear. +# +# Meta-key detection is sensitive to the ESCDELAY environment variable (see +# the manpage for ncurses(3)). In its absence, MOC resets the default +# delay to 25ms. If you need to emulate meta-key sequences using the ESC +# key, then you may need to set the value of ESCDELAY back to its ncurses +# default of 1000ms (but doing so will make the response to the ESC key +# sluggish). +# +# If MOC's keypresses are being filtered through some other program (in a +# GUI environment, for example) which also does meta-key detection, then +# MOC is at the mercy of the timings with which that program presents them. +# +# Default key configuration for MOC (and a list of all available commands): + +# MOC control keys: +quit_client = q +quit = Q + +# Menu and interface control keys: +go = ENTER l +menu_down = DOWN j +menu_up = UP k +menu_page_down = PAGE_DOWN ^d d +menu_page_up = PAGE_UP ^p ^u u +menu_first_item = HOME g +menu_last_item = END G +search_menu = / +toggle_read_tags = f +toggle_show_time = ^t +toggle_show_format = ^f +toggle_menu = TAB +#toggle_layout = L +#toggle_hidden_files = H +next_search = ^g ^n +#show_lyrics = L +theme_menu = T +help = ? +refresh = ^r +reload = r + +# Audio playing and positioning keys: +seek_forward = RIGHT +seek_backward = LEFT +seek_forward_fast = ] +seek_backward_fast = [ +pause = p SPACE +stop = s +next = n L ^l +previous = b H ^h +toggle_shuffle = S +toggle_repeat = R +toggle_auto_next = X N +#toggle_mixer = x +go_url = o + +# Volume control keys: +volume_down_1 = < +volume_up_1 = > +volume_down_5 = , - +volume_up_5 = . = +volume_10 = M-1 +volume_20 = M-2 +volume_30 = M-3 +volume_40 = M-4 +volume_50 = M-5 +volume_60 = M-6 +volume_70 = M-7 +volume_80 = M-8 +volume_90 = M-9 + +# Directory navigation keys: defaults are Shift-number +# (i.e., 'shift 1' -> '!' -> 'Fastdir1'). +go_to_a_directory = i +go_to_music_directory = M-m +go_to_fast_dir1 = M-a +go_to_fast_dir2 = M-l +go_to_fast_dir3 = M-p +go_to_fast_dir4 = M-d +go_to_fast_dir5 = M-c +go_to_fast_dir6 = ^ +go_to_fast_dir7 = & +go_to_fast_dir8 = * +go_to_fast_dir9 = ( +go_to_fast_dir10 = ) +#go_to_playing_file = G +go_up = h + +# Playlist specific keys: +add_file = a +add_directory = A +#plist_add_stream = u +delete_from_playlist = x +playlist_full_paths = P +plist_move_up = K +plist_move_down = J +save_playlist = V +remove_dead_entries = Y +clear_playlist = C + +# Queue manipulation keys: +enqueue_file = z +clear_queue = Z + +# User interaction control: +history_up = UP +history_down = DOWN +delete_to_start = ^u +delete_to_end = ^k +cancel = ^x ESCAPE +hide_message = M + +# Softmixer specific keys: +toggle_softmixer = w +#toggle_make_mono = J + +# Equalizer specific keys: +toggle_equalizer = E +equalizer_refresh = e +#equalizer_prev = K +#equalizer_next = k + +# External commands: +mark_start = ' +mark_end = " +exec_command1 = F1 +exec_command2 = F2 +exec_command3 = F3 +exec_command4 = F4 +exec_command5 = F5 +exec_command6 = F6 +exec_command7 = F7 +exec_command8 = F8 +exec_command9 = F9 +exec_command10 = F10 + +# The following commands are available but not assigned to any keys by +# default: +# +# toggle_percent Switch on/off play progress bar time percentage +# diff --git a/.config/moc/themes/theme b/.config/moc/themes/theme @@ -0,0 +1,32 @@ +background = default default +frame = red default +window_title = white default +directory = blue default bold +selected_directory = black blue bold +playlist = white default bold +selected_playlist = black blue bold +file = yellow default +selected_file = black yellow +marked_file = green default bold +marked_selected_file = black blue bold +info = blue default bold +status = white default +title = white default bold +state = white default bold +current_time = white default bold +time_left = white default +total_time = white default bold +time_total_frames = white default +sound_parameters = white default bold +legend = white default +disabled = blue default +enabled = white default bold +empty_mixer_bar = white default +filled_mixer_bar = black cyan +empty_time_bar = white default +filled_time_bar = black cyan +entry = red default +entry_title = black cyan +error = red default bold +message = green default bold +plist_time = white default bold diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf @@ -0,0 +1,29 @@ +####### MPD CONFIG ####### + +# Required files +db_file "~/.config/mpd/database" +log_file "~/.config/mpd/log" + +# Optional +music_directory "~/Music" +playlist_directory "~/.config/mpd/playlists" +pid_file "~/.config/mpd/pid" +state_file "~/.config/mpd/state" +sticker_file "~/.config/mpd/sticker.sql" + +max_output_buffer_size "16384" + +audio_output { + type "alsa" + name "mpd alsamixer-output" + mixer_type "software" +} + +audio_output { +type "fifo" +name "toggle_visualizer" +path "/tmp/mpd.fifo" +format "44100:16:2" +} + +####### END MPD CONFIG ####### diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf @@ -0,0 +1,199 @@ +# mpv keybindings +# +# Location of user-defined bindings: ~/.config/mpv/input.conf +# +# Lines starting with # are comments. Use SHARP to assign the # key. +# Copy this file and uncomment and edit the bindings you want to change. +# +# List of commands and further details: DOCS/man/input.rst +# List of special keys: --input-keylist +# Keybindings testing mode: mpv --input-test --force-window --idle +# +# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore'). +# +# Strings need to be quoted and escaped: +# KEY show-text "This is a single backslash: \\ and a quote: \" !" +# +# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with +# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal). +# +# The default keybindings are hardcoded into the mpv binary. +# You can disable them completely with: --no-input-default-bindings + +# Developer note: +# On compilation, this file is baked into the mpv binary, and all lines are +# uncommented (unless '#' is followed by a space) - thus this file defines the +# default key bindings. + +# If this is enabled, treat all the following bindings as default. +#default-bindings start + +#MOUSE_BTN0 ignore # don't do anything +#MOUSE_BTN0_DBL cycle fullscreen # toggle fullscreen on/off +#MOUSE_BTN2 cycle pause # toggle pause on/off +#MOUSE_BTN3 seek 10 +#MOUSE_BTN4 seek -10 +#MOUSE_BTN5 add volume -2 +#MOUSE_BTN6 add volume 2 + +# Mouse wheels, touchpad or other input devices that have axes +# if the input devices supports precise scrolling it will also scale the +# numeric value accordingly +#AXIS_UP seek 10 +#AXIS_DOWN seek -10 +#AXIS_LEFT seek 5 +#AXIS_RIGHT seek -5 + +## Seek units are in seconds, but note that these are limited by keyframes +#RIGHT seek 5 +#LEFT seek -5 +#UP seek 60 +#DOWN seek -60 +# Do smaller, always exact (non-keyframe-limited), seeks with shift. +# Don't show them on the OSD (no-osd). +#Shift+RIGHT no-osd seek 1 exact +#Shift+LEFT no-osd seek -1 exact +#Shift+UP no-osd seek 5 exact +#Shift+DOWN no-osd seek -5 exact +# Skip to previous/next subtitle (subject to some restrictions; see manpage) +#Ctrl+LEFT no-osd sub-seek -1 +#Ctrl+RIGHT no-osd sub-seek 1 +#PGUP add chapter 1 # skip to next chapter +#PGDWN add chapter -1 # skip to previous chapter +#Shift+PGUP seek 600 +#Shift+PGDWN seek -600 +#[ multiply speed 0.9091 # scale playback speed +#] multiply speed 1.1 +#{ multiply speed 0.5 +#} multiply speed 2.0 +#BS set speed 1.0 # reset speed to normal +#q quit +#Q quit-watch-later +#q {encode} quit 4 +#ESC set fullscreen no +#ESC {encode} quit 4 +#p cycle pause # toggle pause/playback mode +#. frame-step # advance one frame and pause +#, frame-back-step # go back by one frame and pause +#SPACE cycle pause +#> playlist-next # skip to next file +#ENTER playlist-next # skip to next file +#< playlist-prev # skip to previous file +#O no-osd cycle-values osd-level 3 1 # cycle through OSD mode +#o show-progress +#P show-progress +#I show-text "${filename}" # display filename in osd +#z add sub-delay -0.1 # subtract 100 ms delay from subs +#x add sub-delay +0.1 # add +#ctrl++ add audio-delay 0.100 # this changes audio/video sync +#ctrl+- add audio-delay -0.100 +#9 add volume -2 +#/ add volume -2 +#0 add volume 2 +#* add volume 2 +#m cycle mute +#1 add contrast -1 +#2 add contrast 1 +#3 add brightness -1 +#4 add brightness 1 +#5 add gamma -1 +#6 add gamma 1 +#7 add saturation -1 +#8 add saturation 1 +#Alt+0 set window-scale 0.5 +#Alt+1 set window-scale 1.0 +#Alt+2 set window-scale 2.0 +# toggle deinterlacer (automatically inserts or removes required filter) +#d cycle deinterlace +#r add sub-pos -1 # move subtitles up +#t add sub-pos +1 # down +#v cycle sub-visibility +# stretch SSA/ASS subtitles with anamorphic videos to match historical +#V cycle sub-ass-vsfilter-aspect-compat +# switch between applying no style overrides to SSA/ASS subtitles, and +# overriding them almost completely with the normal subtitle style +#u cycle-values sub-ass-style-override "force" "no" +#j cycle sub # cycle through subtitles +#J cycle sub down # ...backwards +#SHARP cycle audio # switch audio streams +#_ cycle video +#T cycle ontop # toggle video window ontop of other windows +#f cycle fullscreen # toggle fullscreen +#s screenshot # take a screenshot +#S screenshot video # ...without subtitles +#Ctrl+s screenshot window # ...with subtitles and OSD, and scaled +#Alt+s screenshot each-frame # automatically screenshot every frame +#w add panscan -0.1 # zoom out with -panscan 0 -fs +#e add panscan +0.1 # in +# cycle video aspect ratios; "-1" is the container aspect +#A cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1" +#POWER quit +#PLAY cycle pause +#PAUSE cycle pause +#PLAYPAUSE cycle pause +#STOP quit +#FORWARD seek 60 +#REWIND seek -60 +#NEXT playlist-next +#PREV playlist-prev +#VOLUME_UP add volume 2 +#VOLUME_DOWN add volume -2 +#MUTE cycle mute +#CLOSE_WIN quit +#CLOSE_WIN {encode} quit 4 +#E cycle edition # next edition +#l ab-loop # Set/clear A-B loop points +#L cycle-values loop "inf" "no" # toggle infinite looping +#ctrl+c quit 4 + +# Apple Remote section +#AR_PLAY cycle pause +#AR_PLAY_HOLD quit +#AR_CENTER cycle pause +#AR_CENTER_HOLD quit +#AR_NEXT seek 10 +#AR_NEXT_HOLD seek 120 +#AR_PREV seek -10 +#AR_PREV_HOLD seek -120 +#AR_MENU show-progress +#AR_MENU_HOLD cycle mute +#AR_VUP add volume 2 +#AR_VUP_HOLD add chapter 1 +#AR_VDOWN add volume -2 +#AR_VDOWN_HOLD add chapter -1 + +# For tv:// +#h cycle tv-channel -1 # previous channel +#k cycle tv-channel +1 # next channel + +# For dvb:// +#H cycle dvb-channel-name -1 # previous channel +#K cycle dvb-channel-name +1 # next channel + +# +# Legacy bindings (may or may not be removed in the future) +# +#! add chapter -1 # skip to previous chapter +#@ add chapter 1 # next + +# +# Not assigned by default +# (not an exhaustive list of unbound commands) +# + +# ? add sub-scale +0.1 # increase subtitle font size +# ? add sub-scale -0.1 # decrease subtitle font size +# ? sub-step -1 # immediately display next subtitle +# ? sub-step +1 # previous +# ? cycle angle # switch DVD/Bluray angle +# ? add balance -0.1 # adjust audio balance in favor of left +# ? add balance 0.1 # right +# ? cycle sub-forced-only # toggle DVD forced subs +# ? cycle program # cycle transport stream programs +# ? stop # stop playback (quit or enter idle mode) + +l seek 5 +h seek -5 +j seek -60 +k seek 60 +S cycle sub diff --git a/.config/mutt/aliases b/.config/mutt/aliases @@ -0,0 +1,13 @@ +#Here you can put email aliases. Here's an example: + +alias luke luke@lukesmith.xyz + +#When you put "luke" as the recipient in mutt, it will automatically direct it to my email address. + +#You can also put multiple emails under one aliases: + +alias project_members billy@gmail.com, sally@gmail.com, amanda@gmail.com, chad@gmail.com + +#With the above alias, if you put "project_members" as the recipient, mutt will fill in all the emails above as the recipients. +# +#This is extremely useful, so take advantage of it! diff --git a/.config/mutt/email.md b/.config/mutt/email.md @@ -0,0 +1,40 @@ +# Luke's mutt/OfflineIMAP/msmtp/notmuch setup + +## My email setup gives you the following: + ++ A clean, fast and vim-like terminal interface to send and read email (mutt) ++ OfflineIMAP, which takes keep a copy of all of your mail offline, allowing you to read and ++ notmuch as an email indexer, which allows you to easily search email by content within mutt. ++ A looping script which continually uses OfflineIMAP to check mail, and if there is new mail, it will both notify you with a ding and then tell notmuch to quickly index the new mail for searching. + +All of these features are well synced together and require just a little setup. + +To use my email setup, be sure to have `neomutt`, `offlineimap`, `msmtp` `notmuch` and `notmuch-mutt` installed. + +Note that the notification sound will work on i3 by default. You can edit the notification command that runs in `.config/Scripts/check.sh`. + +## How to set it up. + +To use this setup, you have to add your email settings where required. + +There are several steps after which everything should work nicely. + ++ **First**, open `.offlineimaprc` and add your email account and server info (details are in that file. ++ To index your mail for quick searching, run `notmuch setup` and give your mail directory (`~/.Mail` by default in my configs) ++ Then you can go ahead and start syncing your email by running `offlineimap -o`. This will download your mail from all the accounts you use to `~/.Mail`. + + If you want to use my autosync loop script, make sure to check `.config/Scripts/inboxes` to ensure that your inboxes are there. ++ Next, add your email account info to `.msmtprc`. ++ And the same to `.config/mutt/personalrc` or `.config/mutt/gmailrc` or your own rc file. + + (mutt will try to load the `gmailrc` by default. You can change this in `.config/mutt/muttrc`.) + +## Updating + +As I said before, I have a loop script in `.config/Scripts/mailsyncloop.sh` which will run OfflineIMAPs every few minutes and will play a notification sound and run notmuch if new mail is found. + +I suggest running this scipt in a tty or tmux session, so you can check up on it if you really want. That's what I do. + +## Enjoy your email! + +If you're using my i3 config, you can run mutt with `mutt`. Explore the `muttrc` to see my bindings and add your own. + +If you're not using my i3 config, you may want to move `muttrc` to `~/.muttrc`, because I keep my `muttrc` in the `.config` directory to different reasons, but it will look only in `~` by default. diff --git a/.config/mutt/gmailrc b/.config/mutt/gmailrc @@ -0,0 +1,30 @@ +# vim: filetype=muttrc +# Gmail app password should be generated for this configuration file. Never use your proper password in a standard text field. +set imap_user = "YOURNAME@gmail.com" +set smtp_url = "smtp://YOURNAME@smtp.gmail.com:587/" +set from = "YOURNAME@gmail.com" +set realname = "YOUR ACTUAL NAME" +set mbox_type = Maildir +set sendmail = "/usr/bin/msmtp -a gmail" +set folder = "~/.Mail/Gmail" +set spoolfile = "+INBOX" +set record = /dev/null +set mbox = "+[Gmail].All Mail" +set postponed = "+[Gmail].Drafts" +set header_cache = ~/.config/mutt/gmail/cache/headers +set message_cachedir = ~/.config/mutt/gmail/cache/bodies +set certificate_file = ~/.config/mutt/gmail/certificates +set ssl_starttls = yes +set ssl_force_tls = yes + +mailboxes +INBOX + +bind index g noop +macro index gi "<change-folder>=INBOX<enter>" "Go to inbox" +macro index ga "<change-folder>=[Gmail].All Mail<enter>" "Go to all mail" +macro index gs "<change-folder>=[Gmail].Sent Mail<enter>" "Go to sent mail" +macro index gS "<change-folder>=[Gmail].Spam<enter>" "Go to spam" +macro index gt "<change-folder>=[Gmail].Trash<enter>" "Go to trash" +macro index gd "<change-folder>=[Gmail].Drafts<enter>" "Go to drafts" +macro index gl "<change-folder>=lingcircle<enter>" "Go to lingcircle" +macro index gr "<change-folder>=ugaroml<enter>" "Go to ugaroml" diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap @@ -0,0 +1,11 @@ +#text/html; qutebrowser %s &; test=test -n "$DISPLAY"; needsterminal; + +text/html; w3m -I %{charset} -T text/html; copiousoutput; +#text/html; mv %s %s.html && qutebrowser %s.html > /dev/null; needsterminal; +# +application/pdf; mv %s %s.pdf && mupdf %s.pdf > /dev/null; needsterminal; + +image/*; ~/.config/mutt/muttimage.sh %s ; copiousoutput + +#application/pdf; pdftotext '%s' -; copiousoutput; description=PDF Document; +#nametemplate=%s.pdf diff --git a/.config/mutt/muttcol b/.config/mutt/muttcol @@ -0,0 +1,151 @@ +# vim: filetype=muttrc + +# +# +# make sure that you are using mutt linked against slang, not ncurses, or +# suffer the consequences of weird color issues. use "mutt -v" to check this. + +# custom body highlights ----------------------------------------------- +# highlight my name and other personally relevant strings +#color body yellow default "(ethan|schoonover)" +# custom index highlights ---------------------------------------------- +# messages which mention my name in the body +#color index yellow default "~b \"phil(_g|\!| gregory| gold)|pgregory\" !~N !~T !~F !~p !~P" +#color index J_cream brightwhite "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~N !~T !~F !~p !~P" +#color index yellow cyan "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~T !~F !~p !~P" +#color index yellow J_magent "~b \"phil(_g|\!| gregory| gold)|pgregory\" ~F !~p !~P" +## messages which are in reference to my mails +#color index J_magent default "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" !~N !~T !~F !~p !~P" +#color index J_magent brightwhite "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~N !~T !~F !~p !~P" +#color index J_magent cyan "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~T !~F !~p !~P" +#color index J_magent red "~x \"(mithrandir|aragorn)\\.aperiodic\\.net|thorin\\.hillmgt\\.com\" ~F !~p !~P" + +# for background in 16 color terminal, valid background colors include: +# base03, bg, black, any of the non brights + +# basic colors --------------------------------------------------------- +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +#color status J_black J_status +color status brightyellow black +color indicator brightblack yellow +color tree yellow default # arrow in threads + +# basic monocolor screen +mono bold bold +mono underline underline +mono indicator reverse +mono error bold + +# index ---------------------------------------------------------------- + +#color index red default "~D(!~p|~p)" # deleted +#color index black default ~F # flagged +#color index brightred default ~= # duplicate messages +#color index brightgreen default "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest +#color index J_base default "~A~N!~T!~p!~Q!~F!~D" # the rest, new +color index red default "~A" # all messages +color index brightred default "~E" # expired messages +color index blue default "~N" # new messages +color index blue default "~O" # old messages +color index brightmagenta default "~Q" # messages that have been replied to +color index brightgreen default "~R" # read messages +color index blue default "~U" # unread messages +color index blue default "~U~$" # unread, unreferenced messages +color index brightyellow default "~v" # messages part of a collapsed thread +color index brightyellow default "~P" # messages from me +color index cyan default "~p!~F" # messages to me +color index cyan default "~N~p!~F" # new messages to me +color index cyan default "~U~p!~F" # unread messages to me +color index brightgreen default "~R~p!~F" # messages to me +color index red default "~F" # flagged messages +color index red default "~F~p" # flagged messages to me +color index red default "~N~F" # new flagged messages +color index red default "~N~F~p" # new flagged messages to me +color index red default "~U~F~p" # new flagged messages to me +color index black red "~D" # deleted messages +color index brightcyan default "~v~(!~N)" # collapsed thread with no unread +color index yellow default "~v~(~N)" # collapsed thread with some unread +color index green default "~N~v~(~N)" # collapsed thread with unread parent +# statusbg used to indicated flagged when foreground color shows other status +# for collapsed thread +color index red black "~v~(~F)!~N" # collapsed thread with flagged, no unread +color index yellow black "~v~(~F~N)" # collapsed thread with some unread & flagged +color index green black "~N~v~(~F~N)" # collapsed thread with unread parent & flagged +color index green black "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged +color index cyan black "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly +color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) +#color index yellow default "~(~N)" # messages in threads with some unread +#color index green default "~S" # superseded messages +#color index red default "~T" # tagged messages +#color index brightred red "~=" # duplicated messages + +# message headers ------------------------------------------------------ + +#color header brightgreen default "^" +color hdrdefault brightgreen default +color header brightyellow default "^(From)" +color header blue default "^(Subject)" + +# body ----------------------------------------------------------------- + +color quoted blue default +color quoted1 cyan default +color quoted2 yellow default +color quoted3 red default +color quoted4 brightred default + +color signature brightgreen default +color bold black default +color underline black default +color normal default default +# +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ + |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ + |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? + +## pgp + +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" + +# yes, an insance URL regex +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" +# and a heavy handed email regex +#color body J_magent default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +# Various smilies and the like +#color body brightwhite default "<[Gg]>" # <g> +#color body brightwhite default "<[Bb][Gg]>" # <bg> +#color body yellow default " [;:]-*[})>{(<|]" # :-) etc... +# *bold* +#color body blue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +#mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +# _underline_ +#color body blue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +# /italic/ (Sometimes gets directory names) +#color body blue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +#mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + +# Border lines. +#color body blue default "( *[-+=#*~_]){6,}" + +#folder-hook . "color status J_black J_status " +#folder-hook gmail/inbox "color status J_black yellow " +#folder-hook gmail/important "color status J_black yellow " + diff --git a/.config/mutt/muttimage.sh b/.config/mutt/muttimage.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +#### Determine size of Terminal +height=`stty size | awk 'BEGIN {FS = " "} {print $1;}'` +width=`stty size | awk 'BEGIN {FS = " "} {print $2;}'` + +### Display Image / offset with mutt bar +echo -e "2;3;\n0;1;210;20;$((width*7-250));$((height*14-100));0;0;0;0;$1\n4;\n3;" | /usr/lib/w3m/w3mimgdisplay & diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc @@ -0,0 +1,41 @@ +source ~/.config/mutt/gmailrc +source ~/.config/mutt/muttcol +source ~/.config/mutt/aliases + +set sort = 'reverse-date' +set editor = vim +#set copy = no +set timeout = "5" +set mail_check = "10" +set mailcap_path = ~/.config/mutt/mailcap +set date_format="%m/%d %I:%M" +set index_format="%2C %Z %d %-15.15F %s (%-4.4c)" + +auto_view text/html +alternative_order text/plain text/enriched text/html + +mono bold bold +mono underline underline +mono indicator reverse +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.s' +color index_size green default +color normal default default +color body brightred default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ +color body brightblue default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ + +bind editor <space> noop +bind index G last-entry +bind index gg first-entry +bind index d half-down +bind index u half-up +bind index D delete-message +bind index U undelete-message +bind index F search +bind index R group-reply + +auto_view application/pdf + +macro index,pager U "<enter-command>set pipe_decode = yes<enter><pipe-message>urlview<enter><enter-command>set pipe_decode = no<enter>""view URLs" diff --git a/.config/mutt/personalrc b/.config/mutt/personalrc @@ -0,0 +1,23 @@ +# vim: filetype=muttrc +set imap_user = "YOU@YOURDOMAIN.COM" +set smtp_url = "SMTPSERVERINFO:PORT" +set realname = "YOUR NAME" +set mbox_type = Maildir +set sendmail = "/usr/bin/msmtp -a personal" +set folder = "~/.Mail/Personal" +set spoolfile = +INBOX +set record = +INBOX.Sent +set postponed = +INBOX.Drafts +set header_cache = ~/.config/mutt/Personal/cache/headers +set message_cachedir = ~/.config/mutt/Personal/cache/bodies +set certificate_file = ~/.config/mutt/Personal/certificates +set ssl_starttls = yes +set ssl_force_tls = yes + +bind index g noop +bind index gg first-entry +macro index gi "<change-folder>=INBOX<enter>" "Go to inbox" +macro index gs "<change-folder>=INBOX.Sent<enter>" "Go to sent" +macro index gd "<change-folder>=INBOX.Drafts<enter>" "Go to drafts" +macro index gj "<change-folder>=INBOX.Junk<enter>" "Go to junk" +macro index gt "<change-folder>=INBOX.Trash<enter>" "Go to trash" diff --git a/.config/neofetch/config b/.config/neofetch/config @@ -0,0 +1,431 @@ +#!/usr/bin/env bash +# vim:fdm=marker +# +# Neofetch config file +# https://github.com/dylanaraps/neofetch + +# Speed up script by not using unicode +export LC_ALL=C +export LANG=C + +# Info Options {{{ + + +# Info +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +printinfo () { + info title + info underline + + info "Model" model + info "OS" distro + info "Kernel" kernel + info "Uptime" uptime + info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wmtheme + #info "Theme" theme + #info "Icons" icons + info "Terminal" term + info "Terminal Font" termfont + info "CPU" cpu + info "GPU" gpu + info "Memory" memory + + info "CPU Usage" cpu_usage + info "Disk" disk + #info "Battery" battery + #info "Font" font + #info "Song" song + # info "Local IP" localip + # info "Public IP" publicip + #info "Users" users + #info "Birthday" birthday + + info linebreak + info cols +} + + +# Kernel + +# Show more kernel info +# --kernel_shorthand on/off +kernel_shorthand="on" + + +# Distro + +# Shorten the output of distro (tiny, on, off) +# NOTE: This is only possible on Linux +distro_shorthand="off" + +# Mac OS X hide/show build version +# --osx_buildversion on/off +osx_buildversion="on" + +# Mac OS X hide/show codename +# --osx_codename on/off +osx_codename="on" + +# Show 'x86_64' and 'x86' in 'Distro:' output. +# --os_arch on/off +os_arch="on" + + +# Uptime + +# Shorten the output of the uptime function +# --uptime_shorthand tiny, on, off +uptime_shorthand="off" + + +# Shell + +# Show the path to $SHELL +# --shell_path on/off +shell_path="on" + +# Show $SHELL's version +# --shell_version on/off +shell_version="off" + + +# CPU + +# CPU speed type +# Only works on Linux with cpufreq. +# --speed_type current, min, max, bios, +# scaling_current, scaling_min, scaling_max +speed_type="max" + +# CPU Shorthand +# Set shorthand setting +# --cpu_shorthand name, speed, tiny, on, off +cpu_shorthand="off" + +# CPU Usage display +# Set CPU usage display setting +# --cpu_display bar, infobar, barinfo, off +cpu_display="off" + +# CPU Cores +# Display CPU cores in output +# --cpu_cores on/off +cpu_cores="on" + + +# GPU + +# Shorten output of the getgpu funcion +# --gpu_shorthand on/off/tiny +gpu_shorthand="on" + +# Enable/Disable GPU Brand +# --gpu_brand on/off +gpu_brand="on" + +# Resolution + +# Display refresh rate next to each monitor +# Unsupported on Windows +# --refresh_rate on/off +refresh_rate="off" + + +# Gtk Theme / Icons + +# Shorten output (Hide [GTK2] etc) +# --gtk_shorthand on/off +gtk_shorthand="off" + + +# Enable/Disable gtk2 theme/icons output +# --gtk2 on/off +gtk2="on" + +# Enable/Disable gtk3 theme/icons output +# --gtk3 on/off +gtk3="on" + + +# Battery + +# Which battery to display. +# By default we display all batteries. +# NOTE: Only works on Linux. +# --battery_num all, 0, 1, 2, etc +battery_num="all" + +# Whether or not to print each battery on the same line. +# By default each battery gets its own line and title. +# NOTE: Only works on Linux. +# --battery_shorthand on/off +battery_shorthand="off" + + +# IP Address + +# Website to ping for the public IP +# --ip_host url +public_ip_host="http://ident.me" + + +# Song + +# Print the Artist and Title on seperate lines +# --song_shorthand on/off +song_shorthand="off" + + +# Birthday + +# Whether to show a long pretty output +# or a shortened one +# NOTE: Long pretty output doesn't work on OpenBSD or NetBSD. +# --birthday_shorthand on/off +birthday_shorthand="off" + +# Whether to show the time in the output +# --birthday_time on/off +birthday_time="on" + +# Date format to use when printing birthday +# --birthday_format "format" +birthday_format="+%a %d %b %Y %l:%M %p" + + +# }}} + +# Text Colors {{{ + + +# Text Colors +# Each number represents a different part of +# the text in this order: +# title, @, underline, subtitle, colon, info +# colors=(4 6 1 8 8 6) +# You can also specify: +# fg (foreground color) +colors=(distro) + + +# }}} + +# Text Options {{{ + + +# Toggle bold text +# --bold on/off +bold="on" + +# Enable/Disable Underline +# --underline on/off +underline_enabled="on" + +# Underline character +# --underline_char char +underline_char="-" + + +# }}} + +# Color Blocks {{{ + + +# Color block range +# --block_range start end +start=0 +end=7 + +# Toggle color blocks +# --color_blocks on/off +color_blocks="on" + +# Color block width in spaces +# --block_width num +block_width=2 + +# Color block height in lines +# --block_height num +block_height=1 + + +# }}} + +# Progress Bars {{{ + + +# Progress bar character +# --progress_char elapsed_char total_char +progress_char_elapsed="-" +progress_char_total="=" + +# Progress border +# --progress_border on/off +progress_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# --progress_length num +progress_length="15" + +# Progress bar colors +# When set to distro, uses your distro's logo colors +# Takes: num, "distro" +# --progress_colors col col +progress_color_elapsed="distro" +progress_color_total="distro" + +# Customize how the info is displayed. +# bar: Only the progress bar is displayed. +# infobar: The bar is displayed after the info. +# barinfo: The bar is displayed before the info. +# off: Only the info is displayed. +# +# --memory_display bar/infobar/barinfo/off +# --battery_display bar/infobar/barinfo/off +# --disk_display bar/infobar/barinfo/off +memory_display="off" +battery_display="off" +disk_display="off" + + +# }}} + +# Image Options {{{ + + +# Image Source +# --image wall, ascii, /path/to/img, /path/to/dir/, off +image="wall" + +# Thumbnail directory +thumbnail_dir="$HOME/.cache/thumbnails/neofetch" + +# W3m-img path +# Some systems have this in another location +w3m_img_path="/usr/lib/w3m/w3mimgdisplay" + +# Image position +# Only works with the w3m backend +# --image_position left/right +image_position="left" + +# Crop mode +# --crop_mode normal/fit/fill +crop_mode="normal" + +# Crop offset +# Only affects normal mode. +# --crop_offset northwest/north/northeast/west/center +# east/southwest/south/southeast +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# --size auto, 00px, 00%, none +image_size="auto" + +# Right gap between image and text +# --gap num +gap=2 + +# Image offsets +# --xoffset px +# --yoffset px +yoffset=0 +xoffset=0 + + +# }}} + +# Ascii Options {{{ + + +# Default ascii image to use +# When this is set to distro it will use your +# distro's logo as the ascii. +# --ascii 'distro', path/to/ascii +ascii="distro" + +# Ascii distro +# Which distro's ascii art to display. +# --ascii_distro 'auto', 'distro_name' +ascii_distro="auto" + +# Ascii colors +# When this is set to distro it will use your +# ditro's colors to color the ascii. +# NOTE: You can also set this to a range of colors +# which will allow you to custom color distro logos +# --ascii_colors distro +# --ascii_colors 2 4 5 6 +ascii_colors=(distro) + +# Logo size +# Arch, Crux and Gentoo have a smaller logo +# variant. Changing the value below to small +# will make neofetch use the small logo. +# --ascii_logo_size small, normal +ascii_logo_size="normal" + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# --ascii_bold on/off +ascii_bold="off" + + +# }}} + +# Scrot Options {{{ + + +# Whether or not to always take a screenshot +# You can manually take a screenshot with "--scrot" or "-s" +scrot="off" + +# Screenshot program to launch +# --scrot_cmd +scrot_cmd="scrot -c -d 3" + +# Scrot dir +# Where to save the screenshots +# --scrot_dir /path/to/screenshot/folder +scrot_dir="$HOME/Pictures/" + +# Scrot filename +# What to name the screenshots +# --scrot_name str +scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png" + +# Image upload host +# Where to upload the image. +# Possible values: imgur, teknik +image_host="imgur" + +# Imgur api key +# This is an api key for neofetch, you can sign up for your own +# here: http://api.imgur.com/oauth2/addclient +imgur_client_id="0e8b44d15e9fc95" + + +# }}} + +# Config Options {{{ + + +# Enable/Disable config file +# --config off, none +config="on" + +# Path to custom config file location +# --config path/to/config +config_file="${XDG_CONFIG_HOME:-${HOME}/.config}/neofetch/config" + + +# }}} diff --git a/.config/polybar/config b/.config/polybar/config @@ -0,0 +1,412 @@ +; vim:ft=dosini +;===================================================== +; +; To learn more about how to configure Polybar +; go to https://github.com/jaagr/polybar +; +; The README contains alot of information +; +;===================================================== + +[colors] +;background = ${xrdb:color0} +background = #00000000 +background-alt = #444 +foreground = ${xrdb:color7} +;foreground = #dfdfdf +foreground-alt = #555 +primary = ${xrdb:color3} +;primary = ${xrdb:color3} +secondary = ${xrdb:color5} +;secondary = #e60053 +alert = #bd2c40 +col = #00f +;fg = ${xrdb:color7} +;bg = ${xrdb:color2} + +[bar/example] +;monitor = ${env:MONITOR:HDMI-1} +;monitor = ${env:MONITOR} +monitor = ${env:MONITOR:LVDS-1} +width = 100% +height = 24 +;offset-x = 1% +;offset-y = 1% +;radius = 6.0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = {$xrdb:color1} + +border-size = 0 +border-color = #00000000 + +padding-left = 0 +padding-right = 0 + +module-margin-left = 1 +module-margin-right = 2 + +font-0 = mono:pixelsize=9;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = Wuncon Siji:pixelsize=9;1 + +#modules-left = i3 +modules-left = i3 mpd +#modules-center = mpd +#modules-right = volume wlan eth battery temperature date +modules-right = home filesystem volume wlan eth battery temperature date + +tray-position = right +tray-padding = 0 +;tray-transparent = true +;tray-background = #0063ff + +;wm-restack = bspwm +;wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +scroll-up = i3wm-wsnext +scroll-down = i3wm-wsprev + +[module/xwindow] +type = internal/xwindow +label = %title:0:30:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} +format-prefix-underline = ${colors.secondary} + +label-layout = %layout% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/home] +type = internal/fs +interval = 25 + +mount-0 = /home + +label-mounted = %{F#0a81f5}~%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} +[module/bspwm] +type = internal/bspwm + +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +[module/i3] +type = internal/i3 +format = <label-state> <label-mode> +index-sort = true +wrapping-scroll = false + +; Only show workspaces on the same output as the bar +;pin-workspaces = true + +label-mode-padding = 2 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %index% +label-focused-background = ${xrdb:color0} +;label-focused-background = ${module/bspwm.label-focused-background} +label-focused-underline = ${module/bspwm.label-focused-underline} +label-focused-padding = ${module/bspwm.label-focused-padding} + +; unfocused = Inactive workspace on any monitor +label-unfocused = %index% +label-unfocused-padding = ${module/bspwm.label-occupied-padding} + +; visible = Active workspace on unfocused monitor +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %index% +label-urgent-background = ${module/bspwm.label-urgent-background} +label-urgent-padding = ${module/bspwm.label-urgent-padding} + +[module/mpd] +type = internal/mpd +format-online = <label-song> <label-time> +#<icon-prev> <toggle> <icon-next> +#<toggle> + +icon-prev =  +icon-stop =  +icon-play =  +icon-pause =  +icon-next =  +#icon-prev = <- +#icon-stop = X +#icon-play-prefix = #f00 +#icon-play = (Paused) +#icon-pause = +#icon-next = -> + +;bar-progress-width = 45 +;bar-progress-indicator = | +;bar-progress-fill = - +;bar-progress-empty = - + +label-song = %artist% - %title% +label-song-maxlen = 70 +label-song-ellipsis = true + +[module/xbacklight] +type = internal/xbacklight + +format = <label> <bar> +label = BL + +bar-width = 10 +bar-indicator = | +bar-indicator-foreground = #ff +bar-indicator-font = 2 +bar-fill = ─ +bar-fill-font = 2 +bar-fill-foreground = #9f78e1 +bar-empty = ─ +bar-empty-font = 2 +bar-empty-foreground = ${colors.foreground-alt} + +[module/backlight-acpi] +inherit = module/xbacklight +type = internal/backlight +card = intel_backlight + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} +format-underline = ${xrdb:color1} +label = %percentage%% + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = " " +format-prefix-foreground = ${colors.foreground-alt} +format-underline = ${xrdb:color6} +label = %percentage_used%% + +[module/wlan] +type = internal/network +interface = wlp3s0 +interval = 3.0 + +format-connected = <ramp-signal> <label-connected> +format-connected-underline = ${xrdb:color5} +;format-connected-underline = #9f78e1 +label-connected = %essid% + +;format-disconnected = +format-disconnected = <label-disconnected> +format-disconnected-underline = ${self.format-connected-underline} +;label-disconnected = %ifname% disconnected +label-disconnected = no wifi +label-disconnected-foreground = ${colors.foreground-alt} + +ramp-signal-0 =  +ramp-signal-1 =  +ramp-signal-2 =  +ramp-signal-3 =  +ramp-signal-4 =  +ramp-signal-foreground = ${colors.foreground-alt} + +[module/eth] +type = internal/network +interface = enp0s25 +interval = 3.0 + +format-connected-underline = ${xrdb:color2} +;format-connected-underline = ${xrdb:color10} +format-connected-prefix = " " +format-connected-prefix-foreground = ${colors.foreground-alt} +label-connected = %local_ip% + +;format-disconnected = +format-disconnected = <label-disconnected> +format-disconnected-underline = ${self.format-connected-underline} +;label-disconnected = %ifname% disconnected +label-disconnected = no eth +label-disconnected-foreground = ${colors.foreground-alt} + +[module/date] +type = internal/date +interval = 5 + +date = " %a, %b %d, %Y" +;date-alt = " %a, %b %d, %Y at %I:%M%p" +;date-alt = " %Y-%m-%d" + +time = " at %I:%M%p" +;time-alt = %H:%M:%S +;time-alt = %H:%M:%S + +format-prefix =  +format-prefix-foreground = ${colors.foreground-alt} +format-underline = ${xrdb:color12} +;format-underline = #0a6cf5 + +label = %date% %time% + +[module/volume] +type = internal/volume + +format-volume = <label-volume> <bar-volume> +label-volume = VOL +label-volume-foreground = ${root.foreground} + +format-muted-prefix = " " +format-muted-foreground = ${colors.foreground-alt} +label-muted = sound muted + +bar-volume-width = 10 +bar-volume-foreground-0 = ${xrdb:color10} +bar-volume-foreground-1 = ${xrdb:color10} +bar-volume-foreground-2 = ${xrdb:color10} +bar-volume-foreground-3 = ${xrdb:color10} +bar-volume-foreground-4 = ${xrdb:color10} +bar-volume-foreground-5 = ${xrdb:color11} +bar-volume-foreground-6 = ${xrdb:color1} +bar-volume-gradient = false +bar-volume-indicator = | +bar-volume-indicator-font = 2 +bar-volume-fill = = +bar-volume-fill-font = 2 +bar-volume-empty = = +bar-volume-empty-font = 2 +bar-volume-empty-foreground = ${colors.foreground-alt} + +[module/battery] +type = internal/battery +battery = BAT0 +adapter = ADP1 +full-at = 98 + +;format-charging = Charging... <label-charging> +format-charging = <animation-charging> <label-charging> +format-charging-underline = ${xrdb:color3} + +;format-discharging = <label-discharging> +format-discharging = <ramp-capacity> <label-discharging> +format-discharging-underline = ${self.format-charging-underline} + +format-full-prefix = " " +format-full-prefix-foreground = ${colors.foreground-alt} +format-full-underline = ${self.format-charging-underline} + +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-foreground = ${colors.foreground-alt} + +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-foreground = ${colors.foreground-alt} +animation-charging-framerate = 750 + +[module/temperature] +type = internal/temperature +thermal-zone = 0 +warn-temperature = 60 + +format = <ramp> <label> +format-underline = ${xrdb:color1} +;format-underline = #f50a4d +format-warn = <ramp> <label-warn> +format-warn-underline = ${self.format-underline} + +label = %temperature% +label-warn = %temperature% +label-warn-foreground = ${colors.secondary} + +ramp-0 =  +ramp-1 =  +ramp-2 =  +ramp-foreground = ${colors.foreground-alt} + +[module/powermenu] +type = custom/menu + +format-spacing = 1 + +label-open =  +label-open-foreground = ${colors.secondary} +label-close =  cancel +label-close-foreground = ${colors.secondary} +label-separator = | +label-separator-foreground = ${colors.foreground-alt} + +menu-0-0 = reboot +menu-0-0-exec = menu-open-1 +menu-0-1 = power off +menu-0-1-exec = menu-open-2 + +menu-1-0 = cancel +menu-1-0-exec = menu-open-0 +menu-1-1 = reboot +menu-1-1-exec = sudo reboot + +menu-2-0 = power off +menu-2-0-exec = sudo poweroff +menu-2-1 = cancel +menu-2-1-exec = menu-open-0 + +[settings] +screenchange-reload = true +;compositing-background = xor +;compositing-background = screen +;compositing-foreground = source +;compositing-border = over + +[global/wm] +margin-top = 5 +margin-bottom = 5 + diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh @@ -0,0 +1,16 @@ +#!/bin/bash +#!/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/.config/qutebrowser/config.py b/.config/qutebrowser/config.py @@ -0,0 +1,1585 @@ +## Autogenerated config.py +## Documentation: +## qute://help/configuring.html +## qute://help/settings.html + +## This is here so configs done via the GUI are still loaded. +## Remove it to not load settings done via the GUI. +config.load_autoconfig() + +## Aliases for commands. The keys of the given dictionary are the +## aliases, while the values are the commands they map to. +## Type: Dict +c.aliases = {'w': 'session-save', 'q': 'quit', 'wq': 'quit --save'} + +## How often (in milliseconds) to auto-save config/cookies/etc. +## Type: Int +c.auto_save.interval = 15000 + +## Always restore open sites when qutebrowser is reopened. +## Type: Bool +c.auto_save.session = False + +## The backend to use to display websites. qutebrowser supports two +## different web rendering engines / backends, QtWebKit and QtWebEngine. +## QtWebKit was discontinued by the Qt project with Qt 5.6, but picked up +## as a well maintained fork: https://github.com/annulen/webkit/wiki - +## qutebrowser only supports the fork. QtWebEngine is Qt's official +## successor to QtWebKit. It's slightly more resource hungry that +## QtWebKit and has a couple of missing features in qutebrowser, but is +## generally the preferred choice. This setting requires a restart. +## Type: String +## Valid values: +## - webengine: Use QtWebEngine (based on Chromium) +## - webkit: Use QtWebKit (based on WebKit, similar to Safari) +c.backend = 'webengine' + +## This setting can be used to map keys to other keys. When the key used +## as dictionary-key is pressed, the binding for the key used as +## dictionary-value is invoked instead. This is useful for global +## remappings of keys, for example to map Ctrl-[ to Escape. Note that +## when a key is bound (via `bindings.default` or `bindings.commands`), +## the mapping is ignored. +## Type: Dict +c.bindings.key_mappings = {'<Ctrl-[>': '<Escape>', '<Ctrl-6>': '<Ctrl-^>', '<Ctrl-M>': '<Return>', '<Ctrl-J>': '<Return>', '<Shift-Return>': '<Return>', '<Enter>': '<Return>', '<Shift-Enter>': '<Return>', '<Ctrl-Enter>': '<Ctrl-Return>'} + +## Background color of the completion widget category headers. +## Type: QssColor +c.colors.completion.category.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #888888, stop:1 #505050)' + +## Bottom border color of the completion widget category headers. +## Type: QssColor +c.colors.completion.category.border.bottom = 'black' + +## Top border color of the completion widget category headers. +## Type: QssColor +c.colors.completion.category.border.top = 'black' + +## Foreground color of completion widget category headers. +## Type: QtColor +c.colors.completion.category.fg = 'white' + +## Background color of the completion widget for even rows. +## Type: QssColor +c.colors.completion.even.bg = '#333333' + +## Text color of the completion widget. +## Type: QtColor +c.colors.completion.fg = 'white' + +## Background color of the selected completion item. +## Type: QssColor +c.colors.completion.item.selected.bg = '#e8c000' + +## Bottom border color of the selected completion item. +## Type: QssColor +c.colors.completion.item.selected.border.bottom = '#bbbb00' + +## Top border color of the completion widget category headers. +## Type: QssColor +c.colors.completion.item.selected.border.top = '#bbbb00' + +## Foreground color of the selected completion item. +## Type: QtColor +c.colors.completion.item.selected.fg = 'black' + +## Foreground color of the matched text in the completion. +## Type: QssColor +c.colors.completion.match.fg = '#ff4444' + +## Background color of the completion widget for odd rows. +## Type: QssColor +c.colors.completion.odd.bg = '#444444' + +## Color of the scrollbar in completion view +## Type: QssColor +c.colors.completion.scrollbar.bg = '#333333' + +## Color of the scrollbar handle in completion view. +## Type: QssColor +c.colors.completion.scrollbar.fg = 'white' + +## Background color for the download bar. +## Type: QssColor +c.colors.downloads.bar.bg = 'black' + +## Background color for downloads with errors. +## Type: QtColor +c.colors.downloads.error.bg = 'red' + +## Foreground color for downloads with errors. +## Type: QtColor +c.colors.downloads.error.fg = 'white' + +## Color gradient start for download backgrounds. +## Type: QtColor +c.colors.downloads.start.bg = '#0000aa' + +## Color gradient start for download text. +## Type: QtColor +c.colors.downloads.start.fg = 'white' + +## Color gradient stop for download backgrounds. +## Type: QtColor +c.colors.downloads.stop.bg = '#00aa00' + +## Color gradient end for download text. +## Type: QtColor +c.colors.downloads.stop.fg = 'white' + +## Color gradient interpolation system for download backgrounds. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +c.colors.downloads.system.bg = 'rgb' + +## Color gradient interpolation system for download text. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +c.colors.downloads.system.fg = 'rgb' + +## Background color for hints. Note that you can use a `rgba(...)` value +## for transparency. +## Type: QssColor +c.colors.hints.bg = 'qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 247, 133, 0.8), stop:1 rgba(255, 197, 66, 0.8))' + +## Font color for hints. +## Type: QssColor +c.colors.hints.fg = 'black' + +## Font color for the matched part of hints. +## Type: QssColor +c.colors.hints.match.fg = 'green' + +## Background color of the keyhint widget. +## Type: QssColor +c.colors.keyhint.bg = 'rgba(0, 0, 0, 80%)' + +## Text color for the keyhint widget. +## Type: QssColor +c.colors.keyhint.fg = '#FFFFFF' + +## Highlight color for keys to complete the current keychain. +## Type: QssColor +c.colors.keyhint.suffix.fg = '#FFFF00' + +## Background color of an error message. +## Type: QssColor +c.colors.messages.error.bg = 'red' + +## Border color of an error message. +## Type: QssColor +c.colors.messages.error.border = '#bb0000' + +## Foreground color of an error message. +## Type: QssColor +c.colors.messages.error.fg = 'white' + +## Background color of an info message. +## Type: QssColor +c.colors.messages.info.bg = 'black' + +## Border color of an info message. +## Type: QssColor +c.colors.messages.info.border = '#333333' + +## Foreground color an info message. +## Type: QssColor +c.colors.messages.info.fg = 'white' + +## Background color of a warning message. +## Type: QssColor +c.colors.messages.warning.bg = 'darkorange' + +## Border color of a warning message. +## Type: QssColor +c.colors.messages.warning.border = '#d47300' + +## Foreground color a warning message. +## Type: QssColor +c.colors.messages.warning.fg = 'white' + +## Background color for prompts. +## Type: QssColor +c.colors.prompts.bg = '#444444' + +## Border used around UI elements in prompts. +## Type: String +c.colors.prompts.border = '1px solid gray' + +## Foreground color for prompts. +## Type: QssColor +c.colors.prompts.fg = 'white' + +## Background color for the selected item in filename prompts. +## Type: QssColor +c.colors.prompts.selected.bg = 'grey' + +## Background color of the statusbar in caret mode. +## Type: QssColor +c.colors.statusbar.caret.bg = 'purple' + +## Foreground color of the statusbar in caret mode. +## Type: QssColor +c.colors.statusbar.caret.fg = 'white' + +## Background color of the statusbar in caret mode with a selection. +## Type: QssColor +c.colors.statusbar.caret.selection.bg = '#a12dff' + +## Foreground color of the statusbar in caret mode with a selection. +## Type: QssColor +c.colors.statusbar.caret.selection.fg = 'white' + +## Background color of the statusbar in command mode. +## Type: QssColor +c.colors.statusbar.command.bg = 'black' + +## Foreground color of the statusbar in command mode. +## Type: QssColor +c.colors.statusbar.command.fg = 'white' + +## Background color of the statusbar in private browsing + command mode. +## Type: QssColor +c.colors.statusbar.command.private.bg = 'grey' + +## Foreground color of the statusbar in private browsing + command mode. +## Type: QssColor +c.colors.statusbar.command.private.fg = 'white' + +## Background color of the statusbar in insert mode. +## Type: QssColor +c.colors.statusbar.insert.bg = 'darkgreen' + +## Foreground color of the statusbar in insert mode. +## Type: QssColor +c.colors.statusbar.insert.fg = 'white' + +## Background color of the statusbar. +## Type: QssColor +c.colors.statusbar.normal.bg = 'black' + +## Foreground color of the statusbar. +## Type: QssColor +c.colors.statusbar.normal.fg = 'white' + +## Background color of the statusbar in private browsing mode. +## Type: QssColor +c.colors.statusbar.private.bg = '#666666' + +## Foreground color of the statusbar in private browsing mode. +## Type: QssColor +c.colors.statusbar.private.fg = 'white' + +## Background color of the progress bar. +## Type: QssColor +c.colors.statusbar.progress.bg = 'white' + +## Foreground color of the URL in the statusbar on error. +## Type: QssColor +c.colors.statusbar.url.error.fg = 'orange' + +## Default foreground color of the URL in the statusbar. +## Type: QssColor +c.colors.statusbar.url.fg = 'white' + +## Foreground color of the URL in the statusbar for hovered links. +## Type: QssColor +c.colors.statusbar.url.hover.fg = 'aqua' + +## Foreground color of the URL in the statusbar on successful load +## (http). +## Type: QssColor +c.colors.statusbar.url.success.http.fg = 'white' + +## Foreground color of the URL in the statusbar on successful load +## (https). +## Type: QssColor +c.colors.statusbar.url.success.https.fg = 'lime' + +## Foreground color of the URL in the statusbar when there's a warning. +## Type: QssColor +c.colors.statusbar.url.warn.fg = 'yellow' + +## Background color of the tab bar. +## Type: QtColor +c.colors.tabs.bar.bg = '#555555' + +## Background color of unselected even tabs. +## Type: QtColor +c.colors.tabs.even.bg = 'darkgrey' + +## Foreground color of unselected even tabs. +## Type: QtColor +c.colors.tabs.even.fg = 'white' + +## Color for the tab indicator on errors. +## Type: QtColor +c.colors.tabs.indicator.error = '#ff0000' + +## Color gradient start for the tab indicator. +## Type: QtColor +c.colors.tabs.indicator.start = '#0000aa' + +## Color gradient end for the tab indicator. +## Type: QtColor +c.colors.tabs.indicator.stop = '#00aa00' + +## Color gradient interpolation system for the tab indicator. +## Type: ColorSystem +## Valid values: +## - rgb: Interpolate in the RGB color system. +## - hsv: Interpolate in the HSV color system. +## - hsl: Interpolate in the HSL color system. +## - none: Don't show a gradient. +c.colors.tabs.indicator.system = 'rgb' + +## Background color of unselected odd tabs. +## Type: QtColor +c.colors.tabs.odd.bg = 'grey' + +## Foreground color of unselected odd tabs. +## Type: QtColor +c.colors.tabs.odd.fg = 'white' + +## Background color of selected even tabs. +## Type: QtColor +c.colors.tabs.selected.even.bg = 'black' + +## Foreground color of selected even tabs. +## Type: QtColor +c.colors.tabs.selected.even.fg = 'white' + +## Background color of selected odd tabs. +## Type: QtColor +c.colors.tabs.selected.odd.bg = 'black' + +## Foreground color of selected odd tabs. +## Type: QtColor +c.colors.tabs.selected.odd.fg = 'white' + +## Background color for webpages if unset (or empty to use the theme's +## color) +## Type: QtColor +c.colors.webpage.bg = 'white' + +## How many commands to save in the command history. 0: no history / -1: +## unlimited +## Type: Int +c.completion.cmd_history_max_items = 100 + +## The height of the completion, in px or as percentage of the window. +## Type: PercOrInt +c.completion.height = '50%' + +## Move on to the next part when there's only one possible completion +## left. +## Type: Bool +c.completion.quick = True + +## Padding of scrollbar handle in the completion window (in px). +## Type: Int +c.completion.scrollbar.padding = 2 + +## Width of the scrollbar in the completion window (in px). +## Type: Int +c.completion.scrollbar.width = 12 + +## When to show the autocompletion window. +## Type: String +## Valid values: +## - always: Whenever a completion is available. +## - auto: Whenever a completion is requested. +## - never: Never. +c.completion.show = 'always' + +## Shrink the completion to be smaller than the configured size if there +## are no scrollbars. +## Type: Bool +c.completion.shrink = False + +## How to format timestamps (e.g. for the history completion). +## Type: TimestampTemplate +c.completion.timestamp_format = '%Y-%m-%d' + +## How many URLs to show in the web history. 0: no history / -1: +## unlimited +## Type: Int +c.completion.web_history_max_items = -1 + +## Whether quitting the application requires a confirmation. +## Type: ConfirmQuit +## Valid values: +## - always: Always show a confirmation. +## - multiple-tabs: Show a confirmation if multiple tabs are opened. +## - downloads: Show a confirmation if downloads are running +## - never: Never show a confirmation. +c.confirm_quit = ['never'] + +## Whether support for the HTML 5 web application cache feature is +## enabled. An application cache acts like an HTTP cache in some sense. +## For documents that use the application cache via JavaScript, the +## loader engine will first ask the application cache for the contents, +## before hitting the network. +## Type: Bool +c.content.cache.appcache = True + +## The maximum number of pages to hold in the global memory page cache. +## The Page Cache allows for a nicer user experience when navigating +## forth or back to pages in the forward/back history, by pausing and +## resuming up to _n_ pages. For more information about the feature, +## please refer to: http://webkit.org/blog/427/webkit-page-cache-i-the- +## basics/ +## Type: Int +c.content.cache.maximum_pages = 0 + +## Size of the HTTP network cache. Null to use the default value. With +## QtWebEngine, the maximum supported value is 2147483647 (~2 GB). +## Type: Int +c.content.cache.size = None + +## Control which cookies to accept. +## Type: String +## Valid values: +## - all: Accept all cookies. +## - no-3rdparty: Accept cookies from the same origin only. +## - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. +## - never: Don't accept cookies at all. +c.content.cookies.accept = 'no-3rdparty' + +## Store cookies. Note this option needs a restart with QtWebEngine on Qt +## < 5.9. +## Type: Bool +c.content.cookies.store = True + +## Default encoding to use for websites. The encoding must be a string +## describing an encoding such as _utf-8_, _iso-8859-1_, etc. +## Type: String +c.content.default_encoding = 'iso-8859-1' + +## Enable extra tools for Web developers. This needs to be enabled for +## `:inspector` to work and also adds an _Inspect_ entry to the context +## menu. For QtWebEngine, see `--enable-webengine-inspector` in +## `qutebrowser --help` instead. +## Type: Bool +c.content.developer_extras = False + +## Try to pre-fetch DNS entries to speed up browsing. +## Type: Bool +c.content.dns_prefetch = True + +## Expand each subframe to its contents. This will flatten all the frames +## to become one scrollable page. +## Type: Bool +c.content.frame_flattening = False + +## Allow websites to request geolocations. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +c.content.geolocation = 'ask' + +## Value to send in the `Accept-Language` header. +## Type: String +c.content.headers.accept_language = 'en-US,en' + +## Set custom headers for qutebrowser HTTP requests. +## Type: Dict +c.content.headers.custom = {} + +## Value to send in the `DNT` header. When this is set to true, +## qutebrowser asks websites to not track your identity. If set to null, +## the DNT header is not sent at all. +## Type: Bool +c.content.headers.do_not_track = True + +## Send the Referer header. The Referer header tells websites from which +## website you were coming from when visting them. +## Type: String +## Valid values: +## - always: Always send the Referer. +## - never: Never send the Referer. This is not recommended, as some sites may break. +## - same-domain: Only send the Referer for the same domain. This will still protect your privacy, but shouldn't break any sites. +c.content.headers.referer = 'same-domain' + +## User agent to send. Unset to send the default. +## Type: String +c.content.headers.user_agent = None + +## Whether host blocking is enabled. +## Type: Bool +c.content.host_blocking.enabled = True + +## List of URLs of lists which contain hosts to block. The file can be +## in one of the following formats: - An `/etc/hosts`-like file - One +## host per line - A zip-file of any of the above, with either only one +## file, or a file named `hosts` (with any extension). +## Type: List of Url +c.content.host_blocking.lists = ['https://www.malwaredomainlist.com/hostslist/hosts.txt', 'http://someonewhocares.org/hosts/hosts', 'http://winhelp2002.mvps.org/hosts.zip', 'http://malwaredomains.lehigh.edu/files/justdomains.zip', 'https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext'] + +## List of domains that should always be loaded, despite being ad- +## blocked. Domains may contain * and ? wildcards and are otherwise +## required to exactly match the requested domain. Local domains are +## always exempt from hostblocking. +## Type: List of String +c.content.host_blocking.whitelist = ['piwik.org'] + +## Enable or disable hyperlink auditing (`<a ping>`). +## Type: Bool +c.content.hyperlink_auditing = False + +## Whether images are automatically loaded in web pages. +## Type: Bool +c.content.images = True + +## Show javascript alerts. +## Type: Bool +c.content.javascript.alert = True + +## Whether JavaScript can read from or write to the clipboard. With +## QtWebEngine, writing the clipboard as response to a user interaction +## is always allowed. +## Type: Bool +c.content.javascript.can_access_clipboard = False + +## Whether JavaScript can close tabs. +## Type: Bool +c.content.javascript.can_close_tabs = False + +## Whether JavaScript can open new tabs without user interaction. +## Type: Bool +c.content.javascript.can_open_tabs_automatically = False + +## Enables or disables JavaScript. +## Type: Bool +c.content.javascript.enabled = True + +## Log levels to use for JavaScript console logging messages. When a +## JavaScript message with the level given in the dictionary key is +## logged, the corresponding dictionary value selects the qutebrowser +## logger to use. On QtWebKit, the "unknown" setting is always used. +## Type: Dict +c.content.javascript.log = {'unknown': 'debug', 'info': 'debug', 'warning': 'debug', 'error': 'debug'} + +## Use the standard JavaScript modal dialog for `alert()` and `confirm()` +## Type: Bool +c.content.javascript.modal_dialog = False + +## Show javascript prompts. +## Type: Bool +c.content.javascript.prompt = True + +## Whether locally loaded documents are allowed to access other local +## urls. +## Type: Bool +c.content.local_content_can_access_file_urls = True + +## Whether locally loaded documents are allowed to access remote urls. +## Type: Bool +c.content.local_content_can_access_remote_urls = False + +## Whether support for HTML 5 local storage and Web SQL is enabled. +## Type: Bool +c.content.local_storage = True + +## Allow websites to record audio/video. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +c.content.media_capture = 'ask' + +## Location of a netrc-file for HTTP authentication. If unset, `~/.netrc` +## is used. +## Type: File +c.content.netrc_file = None + +## Allow websites to show notifications. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +c.content.notifications = 'ask' + +## Enable pdf.js to view PDF files in the browser. Note that the files +## can still be downloaded by clicking the download button in the pdf.js +## viewer. +## Type: Bool +c.content.pdfjs = False + +## Enables or disables plugins in Web pages. +## Type: Bool +c.content.plugins = False + +## Whether the background color and images are also drawn when the page +## is printed. +## Type: Bool +c.content.print_element_backgrounds = True + +## Open new windows in private browsing mode which does not record +## visited pages. +## Type: Bool +c.content.private_browsing = False + +## The proxy to use. In addition to the listed values, you can use a +## `socks://...` or `http://...` URL. +## Type: Proxy +## Valid values: +## - system: Use the system wide proxy. +## - none: Don't use any proxy +c.content.proxy = 'system' + +## Send DNS requests over the configured proxy. +## Type: Bool +c.content.proxy_dns_requests = True + +## Validate SSL handshakes. +## Type: BoolAsk +## Valid values: +## - true +## - false +## - ask +c.content.ssl_strict = 'ask' + +## A list of user stylesheet filenames to use. +## Type: List of File, or File +c.content.user_stylesheets = [] + +## Enables or disables WebGL. +## Type: Bool +c.content.webgl = True + +## Whether load requests should be monitored for cross-site scripting +## attempts. Suspicious scripts will be blocked and reported in the +## inspector's JavaScript console. Enabling this feature might have an +## impact on performance. +## Type: Bool +c.content.xss_auditing = False + +## The directory to save downloads to. If unset, a sensible os-specific +## default is used. +## Type: Directory +c.downloads.location.directory = None + +## Prompt the user for the download location. If set to false, +## `downloads.location.directory` will be used. +## Type: Bool +c.downloads.location.prompt = False + + +## Remember the last used download directory. +## Type: Bool +c.downloads.location.remember = True + +## What to display in the download filename input. +## Type: String +## Valid values: +## - path: Show only the download path. +## - filename: Show only download filename. +## - both: Show download path and filename. +c.downloads.location.suggestion = 'path' + +## The default program used to open downloads. If null, the default +## internal handler is used. Any `{}` in the string will be expanded to +## the filename, else the filename will be appended. +## Type: String +c.downloads.open_dispatcher = None + +## Where to show the downloaded files. +## Type: VerticalPosition +## Valid values: +## - top +## - bottom +c.downloads.position = 'top' + +## Number of milliseconds to wait before removing finished downloads. If +## set to -1, downloads are never removed. +## Type: Int +c.downloads.remove_finished = 500 + +## The editor (and arguments) to use for the `open-editor` command. `{}` +## gets replaced by the filename of the file to be edited. +## Type: ShellCommand +c.editor.command = ['gvim', '-f', '{}'] + +## Encoding to use for the editor. +## Type: Encoding +c.editor.encoding = 'utf-8' + +## Font used in the completion categories. +## Type: Font +c.fonts.completion.category = 'bold 10pt monospace' + +## Font used in the completion widget. +## Type: Font +c.fonts.completion.entry = '10pt monospace' + +## Font used for the debugging console. +## Type: QtFont +c.fonts.debug_console = '10pt monospace' + +## Font used for the downloadbar. +## Type: Font +c.fonts.downloads = '10pt monospace' + +## Font used for the hints. +## Type: Font +c.fonts.hints = 'bold 10pt monospace' + +## Font used in the keyhint widget. +## Type: Font +c.fonts.keyhint = '10pt monospace' + +## Font used for error messages. +## Type: Font +c.fonts.messages.error = '10pt monospace' + +## Font used for info messages. +## Type: Font +c.fonts.messages.info = '10pt monospace' + +## Font used for warning messages. +## Type: Font +c.fonts.messages.warning = '10pt monospace' + +## Default monospace fonts. Whenever "monospace" is used in a font +## setting, it's replaced with the fonts listed here. +## Type: Font +c.fonts.monospace = '"xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal' + +## Font used for prompts. +## Type: Font +c.fonts.prompts = '10pt sans-serif' + +## Font used in the statusbar. +## Type: Font +c.fonts.statusbar = '10pt monospace' + +## Font used in the tab bar. +## Type: QtFont +c.fonts.tabs = '10pt monospace' + +## Font family for cursive fonts. +## Type: FontFamily +c.fonts.web.family.cursive = '' + +## Font family for fantasy fonts. +## Type: FontFamily +c.fonts.web.family.fantasy = '' + +## Font family for fixed fonts. +## Type: FontFamily +c.fonts.web.family.fixed = '' + +## Font family for sans-serif fonts. +## Type: FontFamily +c.fonts.web.family.sans_serif = '' + +## Font family for serif fonts. +## Type: FontFamily +c.fonts.web.family.serif = '' + +## Font family for standard fonts. +## Type: FontFamily +c.fonts.web.family.standard = '' + +## The default font size for regular text. +## Type: Int +c.fonts.web.size.default = 16 + +## The default font size for fixed-pitch text. +## Type: Int +c.fonts.web.size.default_fixed = 13 + +## The hard minimum font size. +## Type: Int +c.fonts.web.size.minimum = 0 + +## The minimum logical font size that is applied when zooming out. +## Type: Int +c.fonts.web.size.minimum_logical = 6 + +## Controls when a hint can be automatically followed without pressing +## Enter. +## Type: String +## Valid values: +## - always: Auto-follow whenever there is only a single hint on a page. +## - unique-match: Auto-follow whenever there is a unique non-empty match in either the hint string (word mode) or filter (number mode). +## - full-match: Follow the hint when the user typed the whole hint (letter, word or number mode) or the element's text (only in number mode). +## - never: The user will always need to press Enter to follow a hint. +c.hints.auto_follow = 'always' + +## A timeout (in milliseconds) to ignore normal-mode key bindings after a +## successful auto-follow. +## Type: Int +c.hints.auto_follow_timeout = 0 + +## CSS border value for hints. +## Type: String +c.hints.border = '1px solid #E3BE23' + +## Chars used for hint strings. +## Type: UniqueCharString +c.hints.chars = 'asdfghjkl' + +## The dictionary file to be used by the word hints. +## Type: File +c.hints.dictionary = '/usr/share/dict/words' + +## Which implementation to use to find elements to hint. +## Type: String +## Valid values: +## - javascript: Better but slower +## - python: Slightly worse but faster +c.hints.find_implementation = 'python' + +## Hide unmatched hints in rapid mode. +## Type: Bool +c.hints.hide_unmatched_rapid_hints = True + +## Minimum number of chars used for hint strings. +## Type: Int +c.hints.min_chars = 1 + +## Mode to use for hints. +## Type: String +## Valid values: +## - number: Use numeric hints. (In this mode you can also type letters from the hinted element to filter and reduce the number of elements that are hinted.) +## - letter: Use the chars in the `hints.chars` setting. +## - word: Use hints words based on the html elements and the extra words. +c.hints.mode = 'letter' + +## A comma-separated list of regexes to use for 'next' links. +## Type: List of Regex +c.hints.next_regexes = ['\\bnext\\b', '\\bmore\\b', '\\bnewer\\b', '\\b[>→≫]\\b', '\\b(>>|»)\\b', '\\bcontinue\\b'] + +## A comma-separated list of regexes to use for 'prev' links. +## Type: List of Regex +c.hints.prev_regexes = ['\\bprev(ious)?\\b', '\\bback\\b', '\\bolder\\b', '\\b[<←≪]\\b', '\\b(<<|«)\\b'] + +## Scatter hint key chains (like Vimium) or not (like dwb). Ignored for +## number hints. +## Type: Bool +c.hints.scatter = True + +## Make chars in hint strings uppercase. +## Type: Bool +c.hints.uppercase = False + +## The maximum time in minutes between two history items for them to be +## considered being from the same browsing session. Items with less time +## between them are grouped when being displayed in `:history`. Use -1 to +## disable separation. +## Type: Int +c.history_gap_interval = 30 + +## Find text on a page case-insensitively. +## Type: String +## Valid values: +## - always: Search case-insensitively +## - never: Search case-sensitively +## - smart: Search case-sensitively if there are capital chars +c.search.ignore_case = 'smart' + +## Forward unbound keys to the webview in normal mode. +## Type: String +## Valid values: +## - all: Forward all unbound keys. +## - auto: Forward unbound non-alphanumeric keys. +## - none: Don't forward any keys. +c.input.forward_unbound_keys = 'auto' + +## Leave insert mode if a non-editable element is clicked. +## Type: Bool +c.input.insert_mode.auto_leave = True + +## Automatically enter insert mode if an editable element is focused +## after loading the page. +## Type: Bool +c.input.insert_mode.auto_load = False + +## Switch to insert mode when clicking flash and other plugins. +## Type: Bool +c.input.insert_mode.plugins = False + +## Include hyperlinks in the keyboard focus chain when tabbing. +## Type: Bool +c.input.links_included_in_focus_chain = True + +## Timeout (in milliseconds) for partially typed key bindings. If the +## current input forms only partial matches, the keystring will be +## cleared after this time. +## Type: Int +c.input.partial_timeout = 5000 + +## Enable Opera-like mouse rocker gestures. This disables the context +## menu. +## Type: Bool +c.input.rocker_gestures = False + +## Enable Spatial Navigation. Spatial navigation consists in the ability +## to navigate between focusable elements in a Web page, such as +## hyperlinks and form controls, by using Left, Right, Up and Down arrow +## keys. For example, if a user presses the Right key, heuristics +## determine whether there is an element he might be trying to reach +## towards the right and which element he probably wants. +## Type: Bool +c.input.spatial_navigation = False + +## Keychains that shouldn't be shown in the keyhint dialog. Globs are +## supported, so `;*` will blacklist all keychains starting with `;`. Use +## `*` to disable keyhints. +## Type: List of String +c.keyhint.blacklist = [] + +## Time from pressing a key to seeing the keyhint dialog (ms). +## Type: Int +c.keyhint.delay = 500 + +## Time (in ms) to show messages in the statusbar for. Set to 0 to never +## clear messages. +## Type: Int +c.messages.timeout = 2000 + +## How to open links in an existing instance if a new one is launched. +## This happens when e.g. opening a link from a terminal. See +## `new_instance_open_target_window` to customize in which window the +## link is opened in. +## Type: String +## Valid values: +## - tab: Open a new tab in the existing window and activate the window. +## - tab-bg: Open a new background tab in the existing window and activate the window. +## - tab-silent: Open a new tab in the existing window without activating the window. +## - tab-bg-silent: Open a new background tab in the existing window without activating the window. +## - window: Open in a new window. +c.new_instance_open_target = 'tab' + +## Which window to choose when opening links as new tabs. When +## `new_instance_open_target` is not set to `window`, this is ignored. +## Type: String +## Valid values: +## - first-opened: Open new tabs in the first (oldest) opened window. +## - last-opened: Open new tabs in the last (newest) opened window. +## - last-focused: Open new tabs in the most recently focused window. +## - last-visible: Open new tabs in the most recently visible window. +c.new_instance_open_target_window = 'last-focused' + +## Show a filebrowser in upload/download prompts. +## Type: Bool +c.prompt.filebrowser = True + +## The rounding radius for the edges of prompts. +## Type: Int +c.prompt.radius = 8 + +## Additional arguments to pass to Qt, without leading `--`. With +## QtWebEngine, some Chromium arguments (see +## https://peter.sh/experiments/chromium-command-line-switches/ for a +## list) will work. This setting requires a restart. +## Type: List of String +c.qt.args = [] + +## Force a Qt platform to use. This sets the `QT_QPA_PLATFORM` +## environment variable and is useful to force using the XCB plugin when +## running QtWebEngine on Wayland. +## Type: String +c.qt.force_platform = None + +## Force software rendering for QtWebEngine. This is needed for +## QtWebEngine to work with Nouveau drivers. This setting requires a +## restart. +## Type: Bool +c.qt.force_software_rendering = False + +## Show a scrollbar. +## Type: Bool +c.scrolling.bar = False + +## Enable smooth scrolling for web pages. Note smooth scrolling does not +## work with the `:scroll-px` command. +## Type: Bool +c.scrolling.smooth = False + +## The name of the session to save by default. If this is set to null, +## the session which was last loaded is saved. +## Type: SessionName +c.session.default_name = None + +## Spell checking languages. You can check for available languages and +## install dictionaries using scripts/install_dict.py. Run the script +## with -h/--help for instructions. +## Type: List of String +## Valid values: +## - af-ZA: Afrikaans (South Africa) +## - bg-BG: Bulgarian (Bulgaria) +## - ca-ES: Catalan (Spain) +## - cs-CZ: Czech (Czech Republic) +## - da-DK: Danish (Denmark) +## - de-DE: German (Germany) +## - el-GR: Greek (Greece) +## - en-CA: English (Canada) +## - en-GB: English (United Kingdom) +## - en-US: English (United States) +## - es-ES: Spanish (Spain) +## - et-EE: Estonian (Estonia) +## - fa-IR: Farsi (Iran) +## - fo-FO: Faroese (Faroe Islands) +## - fr-FR: French (France) +## - he-IL: Hebrew (Israel) +## - hi-IN: Hindi (India) +## - hr-HR: Croatian (Croatia) +## - hu-HU: Hungarian (Hungary) +## - id-ID: Indonesian (Indonesia) +## - it-IT: Italian (Italy) +## - ko: Korean +## - lt-LT: Lithuanian (Lithuania) +## - lv-LV: Latvian (Latvia) +## - nb-NO: Norwegian (Norway) +## - nl-NL: Dutch (Netherlands) +## - pl-PL: Polish (Poland) +## - pt-BR: Portuguese (Brazil) +## - pt-PT: Portuguese (Portugal) +## - ro-RO: Romanian (Romania) +## - ru-RU: Russian (Russia) +## - sh: Serbo-Croatian +## - sk-SK: Slovak (Slovakia) +## - sl-SI: Slovenian (Slovenia) +## - sq: Albanian +## - sr: Serbian +## - sv-SE: Swedish (Sweden) +## - ta-IN: Tamil (India) +## - tg-TG: Tajik (Tajikistan) +## - tr-TR: Turkish (Turkey) +## - uk-UA: Ukrainian (Ukraine) +## - vi-VN: Vietnamese (Viet Nam) +c.spellcheck.languages = [] + +## Hide the statusbar unless a message is shown. +## Type: Bool +c.statusbar.hide = True + +## Padding for the statusbar. +## Type: Padding +c.statusbar.padding = {'top': 1, 'bottom': 1, 'left': 0, 'right': 0} + +## The position of the status bar. +## Type: VerticalPosition +## Valid values: +## - top +## - bottom +c.statusbar.position = 'bottom' + +## Open new tabs (middleclick/ctrl+click) in the background. +## Type: Bool +c.tabs.background = False + +## On which mouse button to close tabs. +## Type: String +## Valid values: +## - right: Close tabs on right-click. +## - middle: Close tabs on middle-click. +## - none: Don't close tabs using the mouse. +c.tabs.close_mouse_button = 'middle' + +## Scaling for favicons in the tab bar. The tab size is unchanged, so big +## favicons also require extra `tabs.padding`. +## Type: Float +c.tabs.favicons.scale = 1.0 + +## Show favicons in the tab bar. +## Type: Bool +c.tabs.favicons.show = True + +## Padding for tab indicators +## Type: Padding +c.tabs.indicator.padding = {'top': 2, 'bottom': 2, 'left': 0, 'right': 4} + +## Behavior when the last tab is closed. +## Type: String +## Valid values: +## - ignore: Don't do anything. +## - blank: Load a blank page. +## - startpage: Load the start page. +## - default-page: Load the default page. +## - close: Close the window. +c.tabs.last_close = 'close' + +## Switch between tabs using the mouse wheel. +## Type: Bool +c.tabs.mousewheel_switching = True + +## How new tabs opened from another tab are positioned. +## Type: NewTabPosition +## Valid values: +## - prev: Before the current tab. +## - next: After the current tab. +## - first: At the beginning. +## - last: At the end. +c.tabs.new_position.related = 'next' + +## How new tabs which aren't opened from another tab are positioned. +## Type: NewTabPosition +## Valid values: +## - prev: Before the current tab. +## - next: After the current tab. +## - first: At the beginning. +## - last: At the end. +c.tabs.new_position.unrelated = 'last' + +## Padding around text for tabs +## Type: Padding +c.tabs.padding = {'top': 0, 'bottom': 0, 'left': 5, 'right': 5} + +## The position of the tab bar. +## Type: Position +## Valid values: +## - top +## - bottom +## - left +## - right +c.tabs.position = 'top' + +## Which tab to select when the focused tab is removed. +## Type: SelectOnRemove +## Valid values: +## - prev: Select the tab which came before the closed one (left in horizontal, above in vertical). +## - next: Select the tab which came after the closed one (right in horizontal, below in vertical). +## - last-used: Select the previously selected tab. +c.tabs.select_on_remove = 'next' + +## When to show the tab bar. +## Type: String +## Valid values: +## - always: Always show the tab bar. +## - never: Always hide the tab bar. +## - multiple: Hide the tab bar if only one tab is open. +## - switching: Show the tab bar when switching tabs. +c.tabs.show = 'multiple' + +## Time to show the tab bar before hiding it when tabs.show is set to +## 'switching'. +## Type: Int +c.tabs.show_switching_delay = 800 + +## Open a new window for every tab. +## Type: Bool +c.tabs.tabs_are_windows = False + +## Alignment of the text inside of tabs. +## Type: TextAlignment +## Valid values: +## - left +## - right +## - center +c.tabs.title.alignment = 'left' + +## The format to use for the tab title. The following placeholders are +## defined: * `{perc}`: The percentage as a string like `[10%]`. * +## `{perc_raw}`: The raw percentage, e.g. `10` * `{title}`: The title of +## the current web page * `{title_sep}`: The string ` - ` if a title is +## set, empty otherwise. * `{index}`: The index of this tab. * `{id}`: +## The internal tab ID of this tab. * `{scroll_pos}`: The page scroll +## position. * `{host}`: The host of the current web page. * `{backend}`: +## Either ''webkit'' or ''webengine'' * `{private}` : Indicates when +## private mode is enabled. +## Type: FormatString +c.tabs.title.format = '{index}: {title}' + +## The format to use for the tab title for pinned tabs. The same +## placeholders like for `tabs.title.format` are defined. +## Type: FormatString +c.tabs.title.format_pinned = '{index}' + +## The width of the tab bar if it's vertical, in px or as percentage of +## the window. +## Type: PercOrInt +c.tabs.width = '20%' + +## Width of the progress indicator (0 to disable). +## Type: Int +c.tabs.indicator.width = 3 + +## Whether to wrap when changing tabs. +## Type: Bool +c.tabs.wrap = True + +## Whether to start a search when something else than a URL is entered. +## Type: String +## Valid values: +## - naive: Use simple/naive check. +## - dns: Use DNS requests (might be slow!). +## - never: Never search automatically. +c.url.auto_search = 'naive' + +## The page to open if :open -t/-b/-w is used without URL. Use +## `about:blank` for a blank page. +## Type: FuzzyUrl +c.url.default_page = '/home/luke/.config/startpage/startpage.html' + +## The URL segments where `:navigate increment/decrement` will search for +## a number. +## Type: FlagList +## Valid values: +## - host +## - path +## - query +## - anchor +c.url.incdec_segments = ['path', 'query'] + +## Definitions of search engines which can be used via the address bar. +## Maps a searchengine name (such as `DEFAULT`, or `ddg`) to a URL with a +## `{}` placeholder. The placeholder will be replaced by the search term, +## use `{{` and `}}` for literal `{`/`}` signs. The searchengine named +## `DEFAULT` is used when `url.auto_search` is turned on and something +## else than a URL was entered to be opened. Other search engines can be +## used by prepending the search engine name to the search term, e.g. +## `:open google qutebrowser`. +## Type: Dict +c.url.searchengines = { + 'DEFAULT': 'https://duckduckgo.com/?q={}', + 'i': 'https://duckduckgo.com/?q={}&iar=images&iax=images&ia=images', + 'vic': 'https://la.wikipedia.org/w/index.php?search={}&title=Specialis%3AQuaerere', + 'red': 'https://reddit.com/r/{}', + 'wt': 'http://en.wiktionary.org/?search={}', + 'osm': 'http://www.openstreetmap.org/search?query={}', + 'art': 'http://arizona.summon.serialssolutions.com/search?q={}', + 'book': 'http://sabio.library.arizona.edu/search/X?SEARCH={}', + 'lib': 'http://gen.lib.rus.ec/search.php?req={}', + 'tpb': 'http://thepiratebay.org/search/{}', + 'laincat': 'http://lainchan.org/{}/catalog.html', + 'tw': 'https://twitter.com/{}', + '8': 'https://8ch.net/{}', + 'eb': 'https://ebay.com/sch/{}', + 'etym': 'http://etymonline.com/index.php?allowed_in_frame=0&search={}', + 'ddg': 'https://duckduckgo.com/?q={}&t=ha&iar=images', + 'aw': 'https://wiki.archlinux.org/index.php?title=Special%3ASearch&search={}', + '4cat': 'https://boards.4chan.org/{}/catalog', + 'lain': 'http://lainchan.org/{}', + 'gw': 'https://wiki.gentoo.org/index.php?title=Special%3ASearch&search={}', + '8cat': 'https://8ch.net/{}/catalog.html', + 'yt': 'https://www.youtube.com/results?search_query={}', + 'ig': 'https://wiki.installgentoo.com/index.php?search={}&title=Special%3ASearch', + 'w': 'https://www.wikipedia.org/search-redirect.php?family=wikipedia&language=en&search={}&language=en&go=Go', + '4': 'https://boards.4chan.org/{}', + 'sk': 'https://www.skytorrents.in/search/all/ed/1/?l=en-us&q={}', + 'vw': 'https://wiki.voidlinux.eu/index.php?search={}&title=Special%3ASearch', + 'thw': 'http://www.thinkwiki.org/w/index.php?search={}&title=Special%3ASearch', + 'vw': 'http://vim.wikia.com/wiki/Special:Search?fulltext=Search&query={}', + 'bc': 'https://www.bitchute.com/search?q={}&sort=date_created%20desc', + 'mdbg': 'https://mdbg.net/chinese/dictionary?page=worddict&wdrst=0&wdqb={}', + } + + +## The page(s) to open at the start. +## Type: List of FuzzyUrl, or FuzzyUrl +c.url.start_pages = ['/home/luke/.config/startpage/startpage.html'] + +## The URL parameters to strip with `:yank url`. +## Type: List of String +c.url.yank_ignored_parameters = ['ref', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'] + +## Hide the window decoration when using wayland (requires restart) +## Type: Bool +c.window.hide_wayland_decoration = False + +## The format to use for the window title. The following placeholders are +## defined: * `{perc}`: The percentage as a string like `[10%]`. * +## `{perc_raw}`: The raw percentage, e.g. `10` * `{title}`: The title of +## the current web page * `{title_sep}`: The string ` - ` if a title is +## set, empty otherwise. * `{id}`: The internal window ID of this window. +## * `{scroll_pos}`: The page scroll position. * `{host}`: The host of +## the current web page. * `{backend}`: Either ''webkit'' or +## ''webengine'' * `{private}` : Indicates when private mode is enabled. +## Type: FormatString +c.window.title_format = '{perc}{title}{title_sep}qutebrowser' + +## The default zoom level. +## Type: Perc +c.zoom.default = '100%' + +## The available zoom levels. +## Type: List of Perc +c.zoom.levels = ['25%', '33%', '50%', '67%', '75%', '90%', '100%', '110%', '125%', '150%', '175%', '200%', '250%', '300%', '400%', '500%'] + +## How much to divide the mouse wheel movements to translate them into +## zoom increments. +## Type: Int +c.zoom.mouse_divider = 512 + +## Whether the zoom factor on a frame applies only to the text or to all +## content. +## Type: Bool +c.zoom.text_only = False + +## Bindings for normal mode +config.bind("'", 'enter-mode jump_mark') +config.bind('+', 'zoom-in') +config.bind('-', 'zoom-out') +config.bind('.', 'repeat-command') +config.bind('/', 'set-cmd-text /') +config.bind(':', 'set-cmd-text :') +config.bind(';I', 'hint images tab') +config.bind(';O', 'hint links fill :open -t -r {hint-url}') +config.bind(';R', 'hint --rapid links window') +config.bind(';Y', 'hint links yank-primary') +config.bind(';b', 'hint all tab-bg') +config.bind(';d', 'hint links download') +config.bind(';f', 'hint all tab-fg') +config.bind(';h', 'hint all hover') +config.bind(';i', 'hint images') +config.bind(';o', 'hint links fill :open {hint-url}') +config.bind(';r', 'hint --rapid links tab-bg') +config.bind(';t', 'hint inputs') +config.bind(';y', 'hint links yank') +config.bind('<Alt-1>', 'tab-focus 1') +config.bind('<Alt-2>', 'tab-focus 2') +config.bind('<Alt-3>', 'tab-focus 3') +config.bind('<Alt-4>', 'tab-focus 4') +config.bind('<Alt-5>', 'tab-focus 5') +config.bind('<Alt-6>', 'tab-focus 6') +config.bind('<Alt-7>', 'tab-focus 7') +config.bind('<Alt-8>', 'tab-focus 8') +config.bind('<Alt-9>', 'tab-focus -1') +config.bind('<Ctrl-A>', 'navigate increment') +config.bind('<Ctrl-Alt-p>', 'print') +config.bind('<Ctrl-B>', 'scroll-page 0 -1') +config.bind('<Ctrl-D>', 'scroll-page 0 0.5') +config.bind('<Ctrl-F5>', 'reload -f') +config.bind('<Ctrl-F>', 'scroll-page 0 1') +config.bind('<Ctrl-N>', 'open -w') +config.bind('<Ctrl-PgDown>', 'tab-next') +config.bind('<Ctrl-PgUp>', 'tab-prev') +config.bind('<Ctrl-Q>', 'quit') +config.bind('<Ctrl-Return>', 'follow-selected -t') +config.bind('<Ctrl-Shift-N>', 'open -p') +config.bind('<Ctrl-Shift-T>', 'undo') +config.bind('<Ctrl-Shift-W>', 'close') +config.bind('<Ctrl-T>', 'open -t') +config.bind('<Ctrl-Tab>', 'tab-focus last') +config.bind('<Ctrl-U>', 'scroll-page 0 -0.5') +config.bind('<Ctrl-V>', 'enter-mode passthrough') +config.bind('<Ctrl-W>', 'tab-close') +config.bind('<Ctrl-X>', 'navigate decrement') +config.bind('<Ctrl-^>', 'tab-focus last') +config.bind('<Ctrl-h>', 'home') +config.bind('<Ctrl-p>', 'tab-pin') +config.bind('<Ctrl-s>', 'stop') +config.bind('<Escape>', 'clear-keychain ;; search ;; fullscreen --leave') +config.bind('<F11>', 'fullscreen') +config.bind('<F5>', 'reload') +config.bind('<Return>', 'follow-selected') +config.bind('<back>', 'back') +config.bind('<forward>', 'forward') +config.bind('=', 'zoom') +config.bind('?', 'set-cmd-text ?') +config.bind('@', 'run-macro') +config.bind('B', 'set-cmd-text -s :quickmark-load -t') +config.bind('D', 'tab-close -o') +config.bind('F', 'hint all tab') +config.bind('G', 'scroll-to-perc') +config.bind('H', 'back') +config.bind('J', 'tab-prev') +config.bind('K', 'tab-next') +config.bind('L', 'forward') +config.bind('M', 'bookmark-add') +config.bind('N', 'search-prev') +config.bind('O', 'set-cmd-text -s :open -t') +config.bind('PP', 'open -t -- {primary}') +config.bind('Pp', 'open -t -- {clipboard}') +config.bind('R', 'reload -f') +config.bind('Sb', 'open qute://bookmarks#bookmarks') +config.bind('Sh', 'open qute://history') +config.bind('Sq', 'open qute://bookmarks') +config.bind('Ss', 'open qute://settings') +config.bind('T', 'tab-focus') +config.bind('ZQ', 'quit') +config.bind('ZZ', 'quit --save') +config.bind('[[', 'navigate prev') +config.bind(']]', 'navigate next') +config.bind('`', 'enter-mode set_mark') +config.bind('ad', 'download-cancel') +config.bind('b', 'set-cmd-text -s :quickmark-load') +config.bind('cd', 'download-clear') +config.bind('co', 'tab-only') +config.bind('d', 'scroll-page 0 0.5') +#config.bind('d', 'tab-close') +config.bind('f', 'hint') +config.bind('g$', 'tab-focus -1') +config.bind('g0', 'tab-focus 1') +config.bind('gB', 'set-cmd-text -s :bookmark-load -t') +config.bind('gC', 'tab-clone') +config.bind('gO', 'set-cmd-text :open -t -r {url:pretty}') +config.bind('gU', 'navigate up -t') +config.bind('g^', 'tab-focus 1') +config.bind('ga', 'open -t') +config.bind('gb', 'set-cmd-text -s :bookmark-load') +config.bind('gd', 'download') +config.bind('gf', 'view-source') +config.bind('gg', 'scroll-to-perc 0') +config.bind('gl', 'tab-move -') +config.bind('gm', 'tab-move') +config.bind('go', 'set-cmd-text :open {url:pretty}') +config.bind('gr', 'tab-move +') +config.bind('gt', 'set-cmd-text -s :buffer') +config.bind('gu', 'navigate up') +config.bind('h', 'scroll left') +config.bind('i', 'enter-mode insert') +config.bind('j', 'scroll down') +config.bind('k', 'scroll up') +config.bind('l', 'scroll right') +config.bind('m', 'quickmark-save') +config.bind('n', 'search-next') +config.bind('o', 'set-cmd-text -s :open') +config.bind('pP', 'open -- {primary}') +config.bind('pp', 'open -- {clipboard}') +config.bind('q', 'record-macro') +config.bind('r', 'reload') +config.bind('sf', 'save') +config.bind('sk', 'set-cmd-text -s :bind') +config.bind('sl', 'set-cmd-text -s :set -t') +config.bind('ss', 'set-cmd-text -s :set') +config.bind('th', 'back -t') +config.bind('tl', 'forward -t') +#config.bind('u', 'undo') +config.bind('u', 'scroll-page 0 -0.5') +config.bind('U', 'undo') +config.bind('v', 'enter-mode caret') +config.bind('wB', 'set-cmd-text -s :bookmark-load -w') +config.bind('wO', 'set-cmd-text :open -w {url:pretty}') +config.bind('wP', 'open -w -- {primary}') +config.bind('wb', 'set-cmd-text -s :quickmark-load -w') +config.bind('wf', 'hint all window') +config.bind('wh', 'back -w') +config.bind('wi', 'inspector') +config.bind('wl', 'forward -w') +config.bind('wo', 'set-cmd-text -s :open -w') +config.bind('wp', 'open -w -- {clipboard}') +config.bind('x', 'tab-close') +#config.bind('xO', 'set-cmd-text :open -b -r {url:pretty}') +#config.bind('xb', 'config-cycle statusbar.hide') +#config.bind('xo', 'set-cmd-text -s :open -b') +#config.bind('xt', 'config-cycle tabs.show always switching') +#config.bind('xx', 'config-cycle statusbar.hide ;; config-cycle tabs.show always switching') +config.bind('yD', 'yank domain -s') +config.bind('yP', 'yank pretty-url -s') +config.bind('yT', 'yank title -s') +config.bind('yY', 'yank -s') +config.bind('yd', 'yank domain') +config.bind('yp', 'yank pretty-url') +config.bind('yt', 'yank title') +config.bind('yy', 'yank') +config.bind('{{', 'navigate prev -t') +config.bind('}}', 'navigate next -t') + +## Bindings for caret mode +config.bind('$', 'move-to-end-of-line', mode='caret') +config.bind('0', 'move-to-start-of-line', mode='caret') +config.bind('<Ctrl-Space>', 'drop-selection', mode='caret') +config.bind('<Escape>', 'leave-mode', mode='caret') +config.bind('<Return>', 'yank selection', mode='caret') +config.bind('<Space>', 'toggle-selection', mode='caret') +config.bind('G', 'move-to-end-of-document', mode='caret') +config.bind('H', 'scroll left', mode='caret') +config.bind('J', 'scroll down', mode='caret') +config.bind('K', 'scroll up', mode='caret') +config.bind('L', 'scroll right', mode='caret') +config.bind('Y', 'yank selection -s', mode='caret') +config.bind('[', 'move-to-start-of-prev-block', mode='caret') +config.bind(']', 'move-to-start-of-next-block', mode='caret') +config.bind('b', 'move-to-prev-word', mode='caret') +config.bind('c', 'enter-mode normal', mode='caret') +config.bind('e', 'move-to-end-of-word', mode='caret') +config.bind('gg', 'move-to-start-of-document', mode='caret') +config.bind('h', 'move-to-prev-char', mode='caret') +config.bind('j', 'move-to-next-line', mode='caret') +config.bind('k', 'move-to-prev-line', mode='caret') +config.bind('l', 'move-to-next-char', mode='caret') +config.bind('v', 'toggle-selection', mode='caret') +config.bind('w', 'move-to-next-word', mode='caret') +config.bind('y', 'yank selection', mode='caret') +config.bind('{', 'move-to-end-of-prev-block', mode='caret') +config.bind('}', 'move-to-end-of-next-block', mode='caret') + +## Bindings for command mode +config.bind('<Alt-B>', 'rl-backward-word', mode='command') +config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command') +config.bind('<Alt-D>', 'rl-kill-word', mode='command') +config.bind('<Alt-F>', 'rl-forward-word', mode='command') +config.bind('<Ctrl-?>', 'rl-delete-char', mode='command') +config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command') +config.bind('<Ctrl-B>', 'rl-backward-char', mode='command') +config.bind('<Ctrl-D>', 'completion-item-del', mode='command') +config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command') +config.bind('<Ctrl-F>', 'rl-forward-char', mode='command') +config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='command') +config.bind('<Ctrl-K>', 'rl-kill-line', mode='command') +config.bind('<Ctrl-N>', 'command-history-next', mode='command') +config.bind('<Ctrl-P>', 'command-history-prev', mode='command') +config.bind('<Ctrl-Shift-Tab>', 'completion-item-focus prev-category', mode='command') +config.bind('<Ctrl-Tab>', 'completion-item-focus next-category', mode='command') +config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='command') +config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command') +config.bind('<Ctrl-Y>', 'rl-yank', mode='command') +config.bind('<Down>', 'command-history-next', mode='command') +config.bind('<Escape>', 'leave-mode', mode='command') +config.bind('<Return>', 'command-accept', mode='command') +config.bind('<Shift-Delete>', 'completion-item-del', mode='command') +config.bind('<Shift-Tab>', 'completion-item-focus prev', mode='command') +config.bind('<Tab>', 'completion-item-focus next', mode='command') +config.bind('<Up>', 'command-history-prev', mode='command') + +## Bindings for hint mode +config.bind('<Ctrl-B>', 'hint all tab-bg', mode='hint') +config.bind('<Ctrl-F>', 'hint links', mode='hint') +config.bind('<Ctrl-R>', 'hint --rapid links tab-bg', mode='hint') +config.bind('<Escape>', 'leave-mode', mode='hint') +config.bind('<Return>', 'follow-hint', mode='hint') + +## Bindings for insert mode +config.bind('<Ctrl-E>', 'open-editor', mode='insert') +config.bind('<Escape>', 'leave-mode', mode='insert') +config.bind('<Shift-Ins>', 'insert-text {primary}', mode='insert') + +## Bindings for passthrough mode +config.bind('<Ctrl-V>', 'leave-mode', mode='passthrough') + +## Bindings for prompt mode +config.bind('<Alt-B>', 'rl-backward-word', mode='prompt') +config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='prompt') +config.bind('<Alt-D>', 'rl-kill-word', mode='prompt') +config.bind('<Alt-F>', 'rl-forward-word', mode='prompt') +config.bind('<Ctrl-?>', 'rl-delete-char', mode='prompt') +config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='prompt') +config.bind('<Ctrl-B>', 'rl-backward-char', mode='prompt') +config.bind('<Ctrl-E>', 'rl-end-of-line', mode='prompt') +config.bind('<Ctrl-F>', 'rl-forward-char', mode='prompt') +config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='prompt') +config.bind('<Ctrl-K>', 'rl-kill-line', mode='prompt') +config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='prompt') +config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='prompt') +config.bind('<Ctrl-X>', 'prompt-open-download', mode='prompt') +config.bind('<Ctrl-Y>', 'rl-yank', mode='prompt') +config.bind('<Down>', 'prompt-item-focus next', mode='prompt') +config.bind('<Escape>', 'leave-mode', mode='prompt') +config.bind('<Return>', 'prompt-accept', mode='prompt') +config.bind('<Shift-Tab>', 'prompt-item-focus prev', mode='prompt') +config.bind('<Tab>', 'prompt-item-focus next', mode='prompt') +config.bind('<Up>', 'prompt-item-focus prev', mode='prompt') +config.bind('n', 'prompt-accept no', mode='prompt') +config.bind('y', 'prompt-accept yes', mode='prompt') + +## Bindings for register mode +config.bind('<Escape>', 'leave-mode', mode='register') + +config.source('shortcuts.py') diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py @@ -0,0 +1,216 @@ +# This is a sample commands.py. You can add your own commands here. +# +# Please refer to commands_full.py for all the default commands and a complete +# documentation. Do NOT add them all here, or you may end up with defunct +# commands when upgrading ranger. + +# You always need to import ranger.api.commands here to get the Command class: +from ranger.api.commands import * + +# A simple command for demonstration purposes follows. +#------------------------------------------------------------------------------ + +# You can import any python module as needed. +import os + +# Any class that is a subclass of "Command" will be integrated into ranger as a +# command. Try typing ":my_edit<ENTER>" in ranger! +class my_edit(Command): + # The so-called doc-string of the class will be visible in the built-in + # help that is accessible by typing "?c" inside ranger. + """:my_edit <filename> + + A sample command for demonstration purposes that opens a file in an editor. + """ + + # The execute method is called when you run this command in ranger. + def execute(self): + # self.arg(1) is the first (space-separated) argument to the function. + # This way you can write ":my_edit somefilename<ENTER>". + if self.arg(1): + # self.rest(1) contains self.arg(1) and everything that follows + target_filename = self.rest(1) + else: + # self.fm is a ranger.core.filemanager.FileManager object and gives + # you access to internals of ranger. + # self.fm.thisfile is a ranger.container.file.File object and is a + # reference to the currently selected file. + target_filename = self.fm.thisfile.path + + # This is a generic function to print text in ranger. + self.fm.notify("Let's edit the file " + target_filename + "!") + + # Using bad=True in fm.notify allows you to print error messages: + if not os.path.exists(target_filename): + self.fm.notify("The given file does not exist!", bad=True) + return + + # This executes a function from ranger.core.acitons, a module with a + # variety of subroutines that can help you construct commands. + # Check out the source, or run "pydoc ranger.core.actions" for a list. + self.fm.edit_file(target_filename) + + # The tab method is called when you press tab, and should return a list of + # suggestions that the user will tab through. + def tab(self): + # This is a generic tab-completion function that iterates through the + # content of the current directory. + return self._tab_directory_content() + + +# https://github.com/ranger/ranger/wiki/Integrating-File-Search-with-fzf +# Now, simply bind this function to a key, by adding this to your ~/.config/ranger/rc.conf: map <C-f> fzf_select +class fzf_select(Command): + """ + :fzf_select + + Find a file using fzf. + + With a prefix argument select only directories. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + # match only directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + else: + # match files and directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) +# fzf_locate +class fzf_locate(Command): + """ + :fzf_locate + + Find a file using fzf. + + With a prefix argument select only directories. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + command="locate home media | fzf -e -i" + else: + command="locate home media | fzf -e -i" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) + +class fzf_bring(Command): + """ + :fzf_bring + + Find a file using fzf and bring it to the current directory. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + if self.quantifier: + # match only directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + else: + # match files and directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m" + fzf = self.fm.execute_command(command, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) + + +import os +from ranger.core.loader import CommandLoader + +class compress(Command): + def execute(self): + """ Compress marked files to current directory """ + cwd = self.fm.thisdir + marked_files = cwd.get_selection() + + if not marked_files: + return + + def refresh(_): + cwd = self.fm.get_directory(original_path) + cwd.load_content() + + original_path = cwd.path + parts = self.line.split() + au_flags = parts[1:] + + descr = "compressing files in: " + os.path.basename(parts[1]) + obj = CommandLoader(args=['apack'] + au_flags + \ + [os.path.relpath(f.path, cwd.path) for f in marked_files], descr=descr) + + obj.signal_bind('after', refresh) + self.fm.loader.add(obj) + + def tab(self): + """ Complete with current folder name """ + + extension = ['.zip', '.tar.gz', '.rar', '.7z'] + return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension] + + + + +import os +from ranger.core.loader import CommandLoader + +class extracthere(Command): + def execute(self): + """ Extract copied files to current directory """ + copied_files = tuple(self.fm.copy_buffer) + + if not copied_files: + return + + def refresh(_): + cwd = self.fm.get_directory(original_path) + cwd.load_content() + + one_file = copied_files[0] + cwd = self.fm.thisdir + original_path = cwd.path + au_flags = ['-X', cwd.path] + au_flags += self.line.split()[1:] + au_flags += ['-e'] + + self.fm.copy_buffer.clear() + self.fm.cut_buffer = False + if len(copied_files) == 1: + descr = "extracting: " + os.path.basename(one_file.path) + else: + descr = "extracting files from: " + os.path.basename(one_file.dirname) + obj = CommandLoader(args=['aunpack'] + au_flags \ + + [f.path for f in copied_files], descr=descr) + + obj.signal_bind('after', refresh) + self.fm.loader.add(obj) + + + diff --git a/.config/ranger/commands_full.py b/.config/ranger/commands_full.py @@ -0,0 +1,1508 @@ +# -*- coding: utf-8 -*- +# This file is part of ranger, the console file manager. +# This configuration file is licensed under the same terms as ranger. +# =================================================================== +# +# NOTE: If you copied this file to ~/.config/ranger/commands_full.py, +# then it will NOT be loaded by ranger, and only serve as a reference. +# +# =================================================================== +# This file contains ranger's commands. +# It's all in python; lines beginning with # are comments. +# +# Note that additional commands are automatically generated from the methods +# of the class ranger.core.actions.Actions. +# +# You can customize commands in the file ~/.config/ranger/commands.py. +# It has the same syntax as this file. In fact, you can just copy this +# file there with `ranger --copy-config=commands' and make your modifications. +# But make sure you update your configs when you update ranger. +# +# =================================================================== +# Every class defined here which is a subclass of `Command' will be used as a +# command in ranger. Several methods are defined to interface with ranger: +# execute(): called when the command is executed. +# cancel(): called when closing the console. +# tab(): called when <TAB> is pressed. +# quick(): called after each keypress. +# +# The return values for tab() can be either: +# None: There is no tab completion +# A string: Change the console to this string +# A list/tuple/generator: cycle through every item in it +# +# The return value for quick() can be: +# False: Nothing happens +# True: Execute the command afterwards +# +# The return value for execute() and cancel() doesn't matter. +# +# =================================================================== +# Commands have certain attributes and methods that facilitate parsing of +# the arguments: +# +# self.line: The whole line that was written in the console. +# self.args: A list of all (space-separated) arguments to the command. +# self.quantifier: If this command was mapped to the key "X" and +# the user pressed 6X, self.quantifier will be 6. +# self.arg(n): The n-th argument, or an empty string if it doesn't exist. +# self.rest(n): The n-th argument plus everything that followed. For example, +# if the command was "search foo bar a b c", rest(2) will be "bar a b c" +# self.start(n): Anything before the n-th argument. For example, if the +# command was "search foo bar a b c", start(2) will be "search foo" +# +# =================================================================== +# And this is a little reference for common ranger functions and objects: +# +# self.fm: A reference to the "fm" object which contains most information +# about ranger. +# self.fm.notify(string): Print the given string on the screen. +# self.fm.notify(string, bad=True): Print the given string in RED. +# self.fm.reload_cwd(): Reload the current working directory. +# self.fm.thisdir: The current working directory. (A File object.) +# self.fm.thisfile: The current file. (A File object too.) +# self.fm.thistab.get_selection(): A list of all selected files. +# self.fm.execute_console(string): Execute the string as a ranger command. +# self.fm.open_console(string): Open the console with the given string +# already typed in for you. +# self.fm.move(direction): Moves the cursor in the given direction, which +# can be something like down=3, up=5, right=1, left=1, to=6, ... +# +# File objects (for example self.fm.thisfile) have these useful attributes and +# methods: +# +# cf.path: The path to the file. +# cf.basename: The base name only. +# cf.load_content(): Force a loading of the directories content (which +# obviously works with directories only) +# cf.is_directory: True/False depending on whether it's a directory. +# +# For advanced commands it is unavoidable to dive a bit into the source code +# of ranger. +# =================================================================== + +from ranger.api.commands import * + +class alias(Command): + """:alias <newcommand> <oldcommand> + + Copies the oldcommand as newcommand. + """ + + context = 'browser' + resolve_macros = False + + def execute(self): + if not self.arg(1) or not self.arg(2): + self.fm.notify('Syntax: alias <newcommand> <oldcommand>', bad=True) + else: + self.fm.commands.alias(self.arg(1), self.rest(2)) + +class cd(Command): + """:cd [-r] <dirname> + + The cd command changes the directory. + The command 'cd -' is equivalent to typing ``. + Using the option "-r" will get you to the real path. + """ + + def execute(self): + import os.path + if self.arg(1) == '-r': + self.shift() + destination = os.path.realpath(self.rest(1)) + if os.path.isfile(destination): + self.fm.select_file(destination) + return + else: + destination = self.rest(1) + + if not destination: + destination = '~' + + if destination == '-': + self.fm.enter_bookmark('`') + else: + self.fm.cd(destination) + + def tab(self): + import os + from os.path import dirname, basename, expanduser, join + + cwd = self.fm.thisdir.path + rel_dest = self.rest(1) + + bookmarks = [v.path for v in self.fm.bookmarks.dct.values() + if rel_dest in v.path ] + + # expand the tilde into the user directory + if rel_dest.startswith('~'): + rel_dest = expanduser(rel_dest) + + # define some shortcuts + abs_dest = join(cwd, rel_dest) + abs_dirname = dirname(abs_dest) + rel_basename = basename(rel_dest) + rel_dirname = dirname(rel_dest) + + try: + # are we at the end of a directory? + if rel_dest.endswith('/') or rel_dest == '': + _, dirnames, _ = next(os.walk(abs_dest)) + + # are we in the middle of the filename? + else: + _, dirnames, _ = next(os.walk(abs_dirname)) + dirnames = [dn for dn in dirnames \ + if dn.startswith(rel_basename)] + except (OSError, StopIteration): + # os.walk found nothing + pass + else: + dirnames.sort() + if self.fm.settings.cd_bookmarks: + dirnames = bookmarks + dirnames + + # no results, return None + if len(dirnames) == 0: + return + + # one result. since it must be a directory, append a slash. + if len(dirnames) == 1: + return self.start(1) + join(rel_dirname, dirnames[0]) + '/' + + # more than one result. append no slash, so the user can + # manually type in the slash to advance into that directory + return (self.start(1) + join(rel_dirname, dirname) for dirname in dirnames) + + +class chain(Command): + """:chain <command1>; <command2>; ... + + Calls multiple commands at once, separated by semicolons. + """ + def execute(self): + for command in self.rest(1).split(";"): + self.fm.execute_console(command) + + +class shell(Command): + escape_macros_for_shell = True + + def execute(self): + if self.arg(1) and self.arg(1)[0] == '-': + flags = self.arg(1)[1:] + command = self.rest(2) + else: + flags = '' + command = self.rest(1) + + if not command and 'p' in flags: + command = 'cat %f' + if command: + if '%' in command: + command = self.fm.substitute_macros(command, escape=True) + self.fm.execute_command(command, flags=flags) + + def tab(self): + from ranger.ext.get_executables import get_executables + if self.arg(1) and self.arg(1)[0] == '-': + command = self.rest(2) + else: + command = self.rest(1) + start = self.line[0:len(self.line) - len(command)] + + try: + position_of_last_space = command.rindex(" ") + except ValueError: + return (start + program + ' ' for program \ + in get_executables() if program.startswith(command)) + if position_of_last_space == len(command) - 1: + selection = self.fm.thistab.get_selection() + if len(selection) == 1: + return self.line + selection[0].shell_escaped_basename + ' ' + else: + return self.line + '%s ' + else: + before_word, start_of_word = self.line.rsplit(' ', 1) + return (before_word + ' ' + file.shell_escaped_basename \ + for file in self.fm.thisdir.files \ + if file.shell_escaped_basename.startswith(start_of_word)) + +class open_with(Command): + def execute(self): + app, flags, mode = self._get_app_flags_mode(self.rest(1)) + self.fm.execute_file( + files = [f for f in self.fm.thistab.get_selection()], + app = app, + flags = flags, + mode = mode) + + def tab(self): + return self._tab_through_executables() + + def _get_app_flags_mode(self, string): + """Extracts the application, flags and mode from a string. + + examples: + "mplayer f 1" => ("mplayer", "f", 1) + "aunpack 4" => ("aunpack", "", 4) + "p" => ("", "p", 0) + "" => None + """ + + app = '' + flags = '' + mode = 0 + split = string.split() + + if len(split) == 0: + pass + + elif len(split) == 1: + part = split[0] + if self._is_app(part): + app = part + elif self._is_flags(part): + flags = part + elif self._is_mode(part): + mode = part + + elif len(split) == 2: + part0 = split[0] + part1 = split[1] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + elif self._is_mode(part1): + mode = part1 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + elif len(split) >= 3: + part0 = split[0] + part1 = split[1] + part2 = split[2] + + if self._is_app(part0): + app = part0 + if self._is_flags(part1): + flags = part1 + if self._is_mode(part2): + mode = part2 + elif self._is_mode(part1): + mode = part1 + if self._is_flags(part2): + flags = part2 + elif self._is_flags(part0): + flags = part0 + if self._is_mode(part1): + mode = part1 + elif self._is_mode(part0): + mode = part0 + if self._is_flags(part1): + flags = part1 + + return app, flags, int(mode) + + def _is_app(self, arg): + return not self._is_flags(arg) and not arg.isdigit() + + def _is_flags(self, arg): + from ranger.core.runner import ALLOWED_FLAGS + return all(x in ALLOWED_FLAGS for x in arg) + + def _is_mode(self, arg): + return all(x in '0123456789' for x in arg) + + +class set_(Command): + """:set <option name>=<python expression> + + Gives an option a new value. + """ + name = 'set' # don't override the builtin set class + def execute(self): + name = self.arg(1) + name, value, _ = self.parse_setting_line() + self.fm.set_option_from_string(name, value) + + def tab(self): + from ranger.gui.colorscheme import get_all_colorschemes + name, value, name_done = self.parse_setting_line() + settings = self.fm.settings + if not name: + return sorted(self.firstpart + setting for setting in settings) + if not value and not name_done: + return (self.firstpart + setting for setting in settings \ + if setting.startswith(name)) + if not value: + # Cycle through colorschemes when name, but no value is specified + if name == "colorscheme": + return (self.firstpart + colorscheme for colorscheme \ + in get_all_colorschemes()) + return self.firstpart + str(settings[name]) + if bool in settings.types_of(name): + if 'true'.startswith(value.lower()): + return self.firstpart + 'True' + if 'false'.startswith(value.lower()): + return self.firstpart + 'False' + # Tab complete colorscheme values if incomplete value is present + if name == "colorscheme": + return (self.firstpart + colorscheme for colorscheme \ + in get_all_colorschemes() if colorscheme.startswith(value)) + + +class setlocal(set_): + """:setlocal path=<python string> <option name>=<python expression> + + Gives an option a new value. + """ + PATH_RE = re.compile(r'^\s*path="?(.*?)"?\s*$') + def execute(self): + import os.path + match = self.PATH_RE.match(self.arg(1)) + if match: + path = os.path.normpath(os.path.expanduser(match.group(1))) + self.shift() + elif self.fm.thisdir: + path = self.fm.thisdir.path + else: + path = None + + if path: + name = self.arg(1) + name, value, _ = self.parse_setting_line() + self.fm.set_option_from_string(name, value, localpath=path) + + +class setintag(setlocal): + """:setintag <tag or tags> <option name>=<option value> + + Sets an option for directories that are tagged with a specific tag. + """ + def execute(self): + tags = self.arg(1) + self.shift() + name, value, _ = self.parse_setting_line() + self.fm.set_option_from_string(name, value, tags=tags) + + +class default_linemode(Command): + def execute(self): + import re + from ranger.container.fsobject import FileSystemObject + + if len(self.args) < 2: + self.fm.notify("Usage: default_linemode [path=<regexp> | tag=<tag(s)>] <linemode>", bad=True) + + # Extract options like "path=..." or "tag=..." from the command line + arg1 = self.arg(1) + method = "always" + argument = None + if arg1.startswith("path="): + method = "path" + argument = re.compile(arg1[5:]) + self.shift() + elif arg1.startswith("tag="): + method = "tag" + argument = arg1[4:] + self.shift() + + # Extract and validate the line mode from the command line + linemode = self.rest(1) + if linemode not in FileSystemObject.linemode_dict: + self.fm.notify("Invalid linemode: %s; should be %s" % + (linemode, "/".join(FileSystemObject.linemode_dict)), bad=True) + + # Add the prepared entry to the fm.default_linemodes + entry = [method, argument, linemode] + self.fm.default_linemodes.appendleft(entry) + + # Redraw the columns + if hasattr(self.fm.ui, "browser"): + for col in self.fm.ui.browser.columns: + col.need_redraw = True + + def tab(self): + mode = self.arg(1) + return (self.arg(0) + " " + linemode + for linemode in self.fm.thisfile.linemode_dict.keys() + if linemode.startswith(self.arg(1))) + + +class quit(Command): + """:quit + + Closes the current tab. If there is only one tab, quit the program. + """ + + def execute(self): + if len(self.fm.tabs) <= 1: + self.fm.exit() + self.fm.tab_close() + + +class quitall(Command): + """:quitall + + Quits the program immediately. + """ + + def execute(self): + self.fm.exit() + + +class quit_bang(quitall): + """:quit! + + Quits the program immediately. + """ + name = 'quit!' + allow_abbrev = False + + +class terminal(Command): + """:terminal + + Spawns an "x-terminal-emulator" starting in the current directory. + """ + def execute(self): + import os + from ranger.ext.get_executables import get_executables + command = os.environ.get('TERMCMD', os.environ.get('TERM')) + if command not in get_executables(): + command = 'x-terminal-emulator' + if command not in get_executables(): + command = 'xterm' + self.fm.run(command, flags='f') + + +class delete(Command): + """:delete + + Tries to delete the selection. + + "Selection" is defined as all the "marked files" (by default, you + can mark files with space or v). If there are no marked files, + use the "current file" (where the cursor is) + + When attempting to delete non-empty directories or multiple + marked files, it will require a confirmation. + """ + + allow_abbrev = False + + def execute(self): + import os + if self.rest(1): + self.fm.notify("Error: delete takes no arguments! It deletes " + "the selected file(s).", bad=True) + return + + cwd = self.fm.thisdir + cf = self.fm.thisfile + if not cwd or not cf: + self.fm.notify("Error: no file selected for deletion!", bad=True) + return + + confirm = self.fm.settings.confirm_on_delete + many_files = (cwd.marked_items or (cf.is_directory and not cf.is_link \ + and len(os.listdir(cf.path)) > 0)) + + if confirm != 'never' and (confirm != 'multiple' or many_files): + self.fm.ui.console.ask("Confirm deletion of: %s (y/N)" % + ', '.join(f.relative_path for f in self.fm.thistab.get_selection()), + self._question_callback, ('n', 'N', 'y', 'Y')) + else: + # no need for a confirmation, just delete + for f in self.fm.tags.tags: + if str(f).startswith(self.fm.thisfile.path): + self.fm.tags.remove(f) + self.fm.delete() + + def _question_callback(self, answer): + if answer == 'y' or answer == 'Y': + for f in self.fm.tags.tags: + if str(f).startswith(self.fm.thisfile.path): + self.fm.tags.remove(f) + self.fm.delete() + + +class mark_tag(Command): + """:mark_tag [<tags>] + + Mark all tags that are tagged with either of the given tags. + When leaving out the tag argument, all tagged files are marked. + """ + do_mark = True + + def execute(self): + cwd = self.fm.thisdir + tags = self.rest(1).replace(" ","") + if not self.fm.tags: + return + for fileobj in cwd.files: + try: + tag = self.fm.tags.tags[fileobj.realpath] + except KeyError: + continue + if not tags or tag in tags: + cwd.mark_item(fileobj, val=self.do_mark) + self.fm.ui.status.need_redraw = True + self.fm.ui.need_redraw = True + + +class console(Command): + """:console <command> + + Open the console with the given command. + """ + def execute(self): + position = None + if self.arg(1)[0:2] == '-p': + try: + position = int(self.arg(1)[2:]) + self.shift() + except: + pass + self.fm.open_console(self.rest(1), position=position) + + +class load_copy_buffer(Command): + """:load_copy_buffer + + Load the copy buffer from confdir/copy_buffer + """ + copy_buffer_filename = 'copy_buffer' + def execute(self): + from ranger.container.file import File + from os.path import exists + try: + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'r') + except: + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) + self.fm.copy_buffer = set(File(g) \ + for g in f.read().split("\n") if exists(g)) + f.close() + self.fm.ui.redraw_main_column() + + +class save_copy_buffer(Command): + """:save_copy_buffer + + Save the copy buffer to confdir/copy_buffer + """ + copy_buffer_filename = 'copy_buffer' + def execute(self): + fname = None + try: + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'w') + except: + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) + f.write("\n".join(f.path for f in self.fm.copy_buffer)) + f.close() + + +class unmark_tag(mark_tag): + """:unmark_tag [<tags>] + + Unmark all tags that are tagged with either of the given tags. + When leaving out the tag argument, all tagged files are unmarked. + """ + do_mark = False + + +class mkdir(Command): + """:mkdir <dirname> + + Creates a directory with the name <dirname>. + """ + + def execute(self): + from os.path import join, expanduser, lexists + from os import makedirs + + dirname = join(self.fm.thisdir.path, expanduser(self.rest(1))) + if not lexists(dirname): + makedirs(dirname) + else: + self.fm.notify("file/directory exists!", bad=True) + + def tab(self): + return self._tab_directory_content() + + +class touch(Command): + """:touch <fname> + + Creates a file with the name <fname>. + """ + + resolve_macros = False + + def execute(self): + from os.path import join, expanduser, lexists + + fname = join(self.fm.thisdir.path, expanduser(self.rest(1))) + if not lexists(fname): + open(fname, 'a').close() + else: + self.fm.notify("file/directory exists!", bad=True) + + def tab(self): + return self._tab_directory_content() + + +class edit(Command): + """:edit <filename> + + Opens the specified file in vim + """ + + def execute(self): + if not self.arg(1): + self.fm.edit_file(self.fm.thisfile.path) + else: + self.fm.edit_file(self.rest(1)) + + def tab(self): + return self._tab_directory_content() + + +class eval_(Command): + """:eval [-q] <python code> + + Evaluates the python code. + `fm' is a reference to the FM instance. + To display text, use the function `p'. + + Examples: + :eval fm + :eval len(fm.directories) + :eval p("Hello World!") + """ + name = 'eval' + resolve_macros = False + + def execute(self): + if self.arg(1) == '-q': + code = self.rest(2) + quiet = True + else: + code = self.rest(1) + quiet = False + import ranger + global cmd, fm, p, quantifier + fm = self.fm + cmd = self.fm.execute_console + p = fm.notify + quantifier = self.quantifier + try: + try: + result = eval(code) + except SyntaxError: + exec(code) + else: + if result and not quiet: + p(result) + except Exception as err: + p(err) + + +class rename(Command): + """:rename <newname> + + Changes the name of the currently highlighted file to <newname> + """ + + resolve_macros = False + + def execute(self): + from ranger.container.file import File + from os import access + + new_name = self.rest(1) + + tagged = {} + old_name = self.fm.thisfile.relative_path + for f in self.fm.tags.tags: + if str(f).startswith(self.fm.thisfile.path): + tagged[f] = self.fm.tags.tags[f] + self.fm.tags.remove(f) + + if not new_name: + return self.fm.notify('Syntax: rename <newname>', bad=True) + + if new_name == old_name: + return + + if access(new_name, os.F_OK): + return self.fm.notify("Can't rename: file already exists!", bad=True) + + if self.fm.rename(self.fm.thisfile, new_name): + f = File(new_name) + self.fm.thisdir.pointed_obj = f + self.fm.thisfile = f + for t in tagged: + self.fm.tags.tags[t.replace(old_name,new_name)] = tagged[t] + self.fm.tags.dump() + + def tab(self): + return self._tab_directory_content() + +class rename_append(Command): + """:rename_append + + Creates an open_console for the rename command, automatically placing the cursor before the file extension. + """ + + def execute(self): + cf = self.fm.thisfile + if cf.relative_path.find('.') != 0 and cf.relative_path.rfind('.') != -1 and not cf.is_directory: + self.fm.open_console('rename ' + cf.relative_path, position=(7 + cf.relative_path.rfind('.'))) + else: + self.fm.open_console('rename ' + cf.relative_path) + +class chmod(Command): + """:chmod <octal number> + + Sets the permissions of the selection to the octal number. + + The octal number is between 0 and 777. The digits specify the + permissions for the user, the group and others. + + A 1 permits execution, a 2 permits writing, a 4 permits reading. + Add those numbers to combine them. So a 7 permits everything. + """ + + def execute(self): + mode = self.rest(1) + if not mode: + mode = str(self.quantifier) + + try: + mode = int(mode, 8) + if mode < 0 or mode > 0o777: + raise ValueError + except ValueError: + self.fm.notify("Need an octal number between 0 and 777!", bad=True) + return + + for file in self.fm.thistab.get_selection(): + try: + os.chmod(file.path, mode) + except Exception as ex: + self.fm.notify(ex) + + try: + # reloading directory. maybe its better to reload the selected + # files only. + self.fm.thisdir.load_content() + except: + pass + + +class bulkrename(Command): + """:bulkrename + + This command opens a list of selected files in an external editor. + After you edit and save the file, it will generate a shell script + which does bulk renaming according to the changes you did in the file. + + This shell script is opened in an editor for you to review. + After you close it, it will be executed. + """ + def execute(self): + import sys + import tempfile + from ranger.container.file import File + from ranger.ext.shell_escape import shell_escape as esc + py3 = sys.version_info[0] >= 3 + + # Create and edit the file list + filenames = [f.relative_path for f in self.fm.thistab.get_selection()] + listfile = tempfile.NamedTemporaryFile(delete=False) + listpath = listfile.name + + if py3: + listfile.write("\n".join(filenames).encode("utf-8")) + else: + listfile.write("\n".join(filenames)) + listfile.close() + self.fm.execute_file([File(listpath)], app='editor') + listfile = open(listpath, 'r') + new_filenames = listfile.read().split("\n") + listfile.close() + os.unlink(listpath) + if all(a == b for a, b in zip(filenames, new_filenames)): + self.fm.notify("No renaming to be done!") + return + + # Generate script + cmdfile = tempfile.NamedTemporaryFile() + script_lines = [] + script_lines.append("# This file will be executed when you close the editor.\n") + script_lines.append("# Please double-check everything, clear the file to abort.\n") + script_lines.extend("mv -vi -- %s %s\n" % (esc(old), esc(new)) \ + for old, new in zip(filenames, new_filenames) if old != new) + script_content = "".join(script_lines) + if py3: + cmdfile.write(script_content.encode("utf-8")) + else: + cmdfile.write(script_content) + cmdfile.flush() + + # Open the script and let the user review it, then check if the script + # was modified by the user + self.fm.execute_file([File(cmdfile.name)], app='editor') + cmdfile.seek(0) + script_was_edited = (script_content != cmdfile.read()) + + # Do the renaming + self.fm.run(['/bin/sh', cmdfile.name], flags='w') + cmdfile.close() + + # Retag the files, but only if the script wasn't changed during review, + # because only then we know which are the source and destination files. + if not script_was_edited: + tags_changed = False + for old, new in zip(filenames, new_filenames): + if old != new: + oldpath = self.fm.thisdir.path + '/' + old + newpath = self.fm.thisdir.path + '/' + new + if oldpath in self.fm.tags: + old_tag = self.fm.tags.tags[oldpath] + self.fm.tags.remove(oldpath) + self.fm.tags.tags[newpath] = old_tag + tags_changed = True + if tags_changed: + self.fm.tags.dump() + else: + fm.notify("files have not been retagged") + +class relink(Command): + """:relink <newpath> + + Changes the linked path of the currently highlighted symlink to <newpath> + """ + + def execute(self): + from ranger.container.file import File + + new_path = self.rest(1) + cf = self.fm.thisfile + + if not new_path: + return self.fm.notify('Syntax: relink <newpath>', bad=True) + + if not cf.is_link: + return self.fm.notify('%s is not a symlink!' % cf.relative_path, bad=True) + + if new_path == os.readlink(cf.path): + return + + try: + os.remove(cf.path) + os.symlink(new_path, cf.path) + except OSError as err: + self.fm.notify(err) + + self.fm.reset() + self.fm.thisdir.pointed_obj = cf + self.fm.thisfile = cf + + def tab(self): + if not self.rest(1): + return self.line+os.readlink(self.fm.thisfile.path) + else: + return self._tab_directory_content() + + +class help_(Command): + """:help + + Display ranger's manual page. + """ + name = 'help' + def execute(self): + def callback(answer): + if answer == "q": + return + elif answer == "m": + self.fm.display_help() + elif answer == "c": + self.fm.dump_commands() + elif answer == "k": + self.fm.dump_keybindings() + elif answer == "s": + self.fm.dump_settings() + + c = self.fm.ui.console.ask("View [m]an page, [k]ey bindings," + " [c]ommands or [s]ettings? (press q to abort)", callback, list("mkcsq") + [chr(27)]) + + +class copymap(Command): + """:copymap <keys> <newkeys1> [<newkeys2>...] + + Copies a "browser" keybinding from <keys> to <newkeys> + """ + context = 'browser' + + def execute(self): + if not self.arg(1) or not self.arg(2): + return self.fm.notify("Not enough arguments", bad=True) + + for arg in self.args[2:]: + self.fm.ui.keymaps.copy(self.context, self.arg(1), arg) + + +class copypmap(copymap): + """:copypmap <keys> <newkeys1> [<newkeys2>...] + + Copies a "pager" keybinding from <keys> to <newkeys> + """ + context = 'pager' + + +class copycmap(copymap): + """:copycmap <keys> <newkeys1> [<newkeys2>...] + + Copies a "console" keybinding from <keys> to <newkeys> + """ + context = 'console' + + +class copytmap(copymap): + """:copycmap <keys> <newkeys1> [<newkeys2>...] + + Copies a "taskview" keybinding from <keys> to <newkeys> + """ + context = 'taskview' + + +class unmap(Command): + """:unmap <keys> [<keys2>, ...] + + Remove the given "browser" mappings + """ + context = 'browser' + + def execute(self): + for arg in self.args[1:]: + self.fm.ui.keymaps.unbind(self.context, arg) + + +class cunmap(unmap): + """:cunmap <keys> [<keys2>, ...] + + Remove the given "console" mappings + """ + context = 'browser' + + +class punmap(unmap): + """:punmap <keys> [<keys2>, ...] + + Remove the given "pager" mappings + """ + context = 'pager' + + +class tunmap(unmap): + """:tunmap <keys> [<keys2>, ...] + + Remove the given "taskview" mappings + """ + context = 'taskview' + + +class map_(Command): + """:map <keysequence> <command> + + Maps a command to a keysequence in the "browser" context. + + Example: + map j move down + map J move down 10 + """ + name = 'map' + context = 'browser' + resolve_macros = False + + def execute(self): + if not self.arg(1) or not self.arg(2): + return self.fm.notify("Not enough arguments", bad=True) + + self.fm.ui.keymaps.bind(self.context, self.arg(1), self.rest(2)) + + +class cmap(map_): + """:cmap <keysequence> <command> + + Maps a command to a keysequence in the "console" context. + + Example: + cmap <ESC> console_close + cmap <C-x> console_type test + """ + context = 'console' + + +class tmap(map_): + """:tmap <keysequence> <command> + + Maps a command to a keysequence in the "taskview" context. + """ + context = 'taskview' + + +class pmap(map_): + """:pmap <keysequence> <command> + + Maps a command to a keysequence in the "pager" context. + """ + context = 'pager' + + +class scout(Command): + """:scout [-FLAGS] <pattern> + + Swiss army knife command for searching, traveling and filtering files. + The command takes various flags as arguments which can be used to + influence its behaviour: + + -a = automatically open a file on unambiguous match + -e = open the selected file when pressing enter + -f = filter files that match the current search pattern + -g = interpret pattern as a glob pattern + -i = ignore the letter case of the files + -k = keep the console open when changing a directory with the command + -l = letter skipping; e.g. allow "rdme" to match the file "readme" + -m = mark the matching files after pressing enter + -M = unmark the matching files after pressing enter + -p = permanent filter: hide non-matching files after pressing enter + -s = smart case; like -i unless pattern contains upper case letters + -t = apply filter and search pattern as you type + -v = inverts the match + + Multiple flags can be combined. For example, ":scout -gpt" would create + a :filter-like command using globbing. + """ + AUTO_OPEN = 'a' + OPEN_ON_ENTER = 'e' + FILTER = 'f' + SM_GLOB = 'g' + IGNORE_CASE = 'i' + KEEP_OPEN = 'k' + SM_LETTERSKIP = 'l' + MARK = 'm' + UNMARK = 'M' + PERM_FILTER = 'p' + SM_REGEX = 'r' + SMART_CASE = 's' + AS_YOU_TYPE = 't' + INVERT = 'v' + + def __init__(self, *args, **kws): + Command.__init__(self, *args, **kws) + self._regex = None + self.flags, self.pattern = self.parse_flags() + + def execute(self): + thisdir = self.fm.thisdir + flags = self.flags + pattern = self.pattern + regex = self._build_regex() + count = self._count(move=True) + + self.fm.thistab.last_search = regex + self.fm.set_search_method(order="search") + + if self.MARK in flags or self.UNMARK in flags: + value = flags.find(self.MARK) > flags.find(self.UNMARK) + if self.FILTER in flags: + for f in thisdir.files: + thisdir.mark_item(f, value) + else: + for f in thisdir.files: + if regex.search(f.relative_path): + thisdir.mark_item(f, value) + + if self.PERM_FILTER in flags: + thisdir.filter = regex if pattern else None + + # clean up: + self.cancel() + + if self.OPEN_ON_ENTER in flags or \ + self.AUTO_OPEN in flags and count == 1: + if os.path.exists(pattern): + self.fm.cd(pattern) + else: + self.fm.move(right=1) + + if self.KEEP_OPEN in flags and thisdir != self.fm.thisdir: + # reopen the console: + if not pattern: + self.fm.open_console(self.line) + else: + self.fm.open_console(self.line[0:-len(pattern)]) + + if self.quickly_executed and thisdir != self.fm.thisdir and pattern != "..": + self.fm.block_input(0.5) + + def cancel(self): + self.fm.thisdir.temporary_filter = None + self.fm.thisdir.refilter() + + def quick(self): + asyoutype = self.AS_YOU_TYPE in self.flags + if self.FILTER in self.flags: + self.fm.thisdir.temporary_filter = self._build_regex() + if self.PERM_FILTER in self.flags and asyoutype: + self.fm.thisdir.filter = self._build_regex() + if self.FILTER in self.flags or self.PERM_FILTER in self.flags: + self.fm.thisdir.refilter() + if self._count(move=asyoutype) == 1 and self.AUTO_OPEN in self.flags: + return True + return False + + def tab(self): + self._count(move=True, offset=1) + + def _build_regex(self): + if self._regex is not None: + return self._regex + + frmat = "%s" + flags = self.flags + pattern = self.pattern + + if pattern == ".": + return re.compile("") + + # Handle carets at start and dollar signs at end separately + if pattern.startswith('^'): + pattern = pattern[1:] + frmat = "^" + frmat + if pattern.endswith('$'): + pattern = pattern[:-1] + frmat += "$" + + # Apply one of the search methods + if self.SM_REGEX in flags: + regex = pattern + elif self.SM_GLOB in flags: + regex = re.escape(pattern).replace("\\*", ".*").replace("\\?", ".") + elif self.SM_LETTERSKIP in flags: + regex = ".*".join(re.escape(c) for c in pattern) + else: + regex = re.escape(pattern) + + regex = frmat % regex + + # Invert regular expression if necessary + if self.INVERT in flags: + regex = "^(?:(?!%s).)*$" % regex + + # Compile Regular Expression + options = re.LOCALE | re.UNICODE + if self.IGNORE_CASE in flags or self.SMART_CASE in flags and \ + pattern.islower(): + options |= re.IGNORECASE + try: + self._regex = re.compile(regex, options) + except: + self._regex = re.compile("") + return self._regex + + def _count(self, move=False, offset=0): + count = 0 + cwd = self.fm.thisdir + pattern = self.pattern + + if not pattern: + return 0 + if pattern == '.': + return 0 + if pattern == '..': + return 1 + + deq = deque(cwd.files) + deq.rotate(-cwd.pointer - offset) + i = offset + regex = self._build_regex() + for fsobj in deq: + if regex.search(fsobj.relative_path): + count += 1 + if move and count == 1: + cwd.move(to=(cwd.pointer + i) % len(cwd.files)) + self.fm.thisfile = cwd.pointed_obj + if count > 1: + return count + i += 1 + + return count == 1 + + +class filter_inode_type(Command): + """ + :filter_inode_type [dfl] + + Displays only the files of specified inode type. Parameters + can be combined. + + d display directories + f display files + l display links + """ + + FILTER_DIRS = 'd' + FILTER_FILES = 'f' + FILTER_LINKS = 'l' + + def execute(self): + if not self.arg(1): + self.fm.thisdir.inode_type_filter = None + else: + self.fm.thisdir.inode_type_filter = lambda file: ( + True if ((self.FILTER_DIRS in self.arg(1) and file.is_directory) or + (self.FILTER_FILES in self.arg(1) and file.is_file and not file.is_link) or + (self.FILTER_LINKS in self.arg(1) and file.is_link)) else False) + self.fm.thisdir.refilter() + + +class grep(Command): + """:grep <string> + + Looks for a string in all marked files or directories + """ + + def execute(self): + if self.rest(1): + action = ['grep', '--line-number'] + action.extend(['-e', self.rest(1), '-r']) + action.extend(f.path for f in self.fm.thistab.get_selection()) + self.fm.execute_command(action, flags='p') + + +# Version control commands +# -------------------------------- +class stage(Command): + """ + :stage + + Stage selected files for the corresponding version control system + """ + def execute(self): + from ranger.ext.vcs import VcsError + + filelist = [f.path for f in self.fm.thistab.get_selection()] + self.fm.thisdir.vcs_outdated = True +# for f in self.fm.thistab.get_selection(): +# f.vcs_outdated = True + + try: + self.fm.thisdir.vcs.add(filelist) + except VcsError: + self.fm.notify("Could not stage files.") + + self.fm.reload_cwd() + + +class unstage(Command): + """ + :unstage + + Unstage selected files for the corresponding version control system + """ + def execute(self): + from ranger.ext.vcs import VcsError + + filelist = [f.path for f in self.fm.thistab.get_selection()] + self.fm.thisdir.vcs_outdated = True +# for f in self.fm.thistab.get_selection(): +# f.vcs_outdated = True + + try: + self.fm.thisdir.vcs.reset(filelist) + except VcsError: + self.fm.notify("Could not unstage files.") + + self.fm.reload_cwd() + + +class diff(Command): + """ + :diff + + Displays a diff of selected files against the last committed version + """ + def execute(self): + from ranger.ext.vcs import VcsError + import tempfile + + L = self.fm.thistab.get_selection() + if len(L) == 0: return + + filelist = [f.path for f in L] + vcs = L[0].vcs + + diff = vcs.get_raw_diff(filelist=filelist) + if len(diff.strip()) > 0: + tmp = tempfile.NamedTemporaryFile() + tmp.write(diff.encode('utf-8')) + tmp.flush() + + pager = os.environ.get('PAGER', ranger.DEFAULT_PAGER) + self.fm.run([pager, tmp.name]) + else: + raise Exception("diff is empty") + + +class log(Command): + """ + :log + + Displays the log of the current repo or files + """ + def execute(self): + from ranger.ext.vcs import VcsError + import tempfile + + L = self.fm.thistab.get_selection() + if len(L) == 0: return + + filelist = [f.path for f in L] + vcs = L[0].vcs + + log = vcs.get_raw_log(filelist=filelist) + tmp = tempfile.NamedTemporaryFile() + tmp.write(log.encode('utf-8')) + tmp.flush() + + pager = os.environ.get('PAGER', ranger.DEFAULT_PAGER) + self.fm.run([pager, tmp.name]) + +class flat(Command): + """ + :flat <level> + + Flattens the directory view up to the specified level. + + -1 fully flattened + 0 remove flattened view + """ + + def execute(self): + try: + level = self.rest(1) + level = int(level) + except ValueError: + level = self.quantifier + if level < -1: + self.fm.notify("Need an integer number (-1, 0, 1, ...)", bad=True) + self.fm.thisdir.unload() + self.fm.thisdir.flat = level + self.fm.thisdir.load_content() + + +# Metadata commands +# -------------------------------- + +class prompt_metadata(Command): + """ + :prompt_metadata <key1> [<key2> [<key3> ...]] + + Prompt the user to input metadata for multiple keys in a row. + """ + + _command_name = "meta" + _console_chain = None + def execute(self): + prompt_metadata._console_chain = self.args[1:] + self._process_command_stack() + + def _process_command_stack(self): + if prompt_metadata._console_chain: + key = prompt_metadata._console_chain.pop() + self._fill_console(key) + else: + for col in self.fm.ui.browser.columns: + col.need_redraw = True + + def _fill_console(self, key): + metadata = self.fm.metadata.get_metadata(self.fm.thisfile.path) + if key in metadata and metadata[key]: + existing_value = metadata[key] + else: + existing_value = "" + text = "%s %s %s" % (self._command_name, key, existing_value) + self.fm.open_console(text, position=len(text)) + + +class meta(prompt_metadata): + """ + :meta <key> [<value>] + + Change metadata of a file. Deletes the key if value is empty. + """ + + def execute(self): + key = self.arg(1) + value = self.rest(1) + update_dict = dict() + update_dict[key] = self.rest(2) + selection = self.fm.thistab.get_selection() + for f in selection: + self.fm.metadata.set_metadata(f.path, update_dict) + self._process_command_stack() + + def tab(self): + key = self.arg(1) + metadata = self.fm.metadata.get_metadata(self.fm.thisfile.path) + if key in metadata and metadata[key]: + return [" ".join([self.arg(0), self.arg(1), metadata[key]])] + else: + return [self.arg(0) + " " + key for key in sorted(metadata) + if key.startswith(self.arg(1))] + + +class linemode(default_linemode): + """ + :linemode <mode> + + Change what is displayed as a filename. + + - "mode" may be any of the defined linemodes (see: ranger.core.linemode). + "normal" is mapped to "filename". + """ + + def execute(self): + mode = self.arg(1) + + if mode == "normal": + mode = DEFAULT_LINEMODE + + if mode not in self.fm.thisfile.linemode_dict: + self.fm.notify("Unhandled linemode: `%s'" % mode, bad=True) + return + + self.fm.thisdir._set_linemode_of_children(mode) + + # Ask the browsercolumns to redraw + for col in self.fm.ui.browser.columns: + col.need_redraw = True diff --git a/.config/ranger/luke_ranger_readme.md b/.config/ranger/luke_ranger_readme.md @@ -0,0 +1,83 @@ +# Luke's ranger setup + +## Basic Ranger shortcuts + +These are the basic key binds in ranger, even outside of my configs. Note that they are mostly vim-based. + ++ h/j/k/l -- Move left/down/up/right (where left moves up in the directory structure, right moves into a folder) ++ Space -- select/highlight file ++ dd -- cut selected files ++ yy -- copy/yank selected files ++ pp -- paste/move cut/copied files ++ / -- search, when (n/N) next/previos result ++ zh or CTRL-h -- show hidden files ++ Renaming files: + + cw -- rename file from scratch + + A -- rename file adding to the end + + aa -- rename file appending before the extension + + I -- rename file adding at the beginning + +## Shortcuts + +I've added many folder-specific shortcuts; refer to rc.conf for the specifics, but here's the idea. There are for "verbs:" + ++ g -- "go or cd" ++ t -- "new tab" ++ m -- "move file" ++ Y -- "yank or copy file" + +These "verbs" take "nouns" or "arguments," like these: + ++ d -- "~/Documents" ++ D -- "~/Downloads" ++ cf -- "~/.config" ++ And many others, including those you add! + +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. + +## Many little additions! + ++ Basic additions: + + V -- Make a new file and edit it in vim + + cW -- rename *all* selected files, editing in your text editor + + mkd -- Make a directory/folder + + sc -- Makes a link/shortcut (ln -sT) + + D -- delete selected file + + X -- Extract a zip/rar/tar.gz, whatever. Runs a script that picks the right command for the right archive. + + Z -- zips a folder up into a .tar.gz archive. + + CTRL-f -- Fuzzy find a file + + CTRL-l -- Fuzzy locate a file ++ Document manipulation: + + p1s -- print this file on the default printer, one-sided (lpr) + + p2s -- print this file on the default printer, double-sided (lpr) + + MP -- convert to a .pdf with pandoc (I use this to convert markdown, etc.) + + MX -- compile selected document in XeLaTeX + + ML -- compile selected document in LaTeX + + TC -- clear all non-visible TeX build files in this directory + + Txa -- copy article template to new file + + Txs -- copy slideshow/beamer template to new file + + Txh -- copy handout template to new file ++ Image commands: + + bg -- (for i3 users) makes an image your background (assuming i3 is looking at ~/.config/wall.png for your background) + + bw -- runs Pywal on the selected image, making it your background and generating a color scheme based off of it. + + C -- rotates an image (requires imagemagick) + + F -- flips an image (requires imagemagick) + + TR -- add transparency to image file ++ mpd/mpc shortcuts + + MS -- Start mpd + + MK -- kill mpd + + MN -- Start playing selected song/folder now + + Ma -- Enqueue selected song/folder + + Mp -- Pause + + Mn -- Next track + + Mb -- Previous track + + Mo -- Restart track ++ Audio tagging with eye3D: + + Ta -- change artist name + + TA -- change album name + + Tb -- change album artist + + Tt -- change title + + Tn -- change track number ++ Downloading: + + ytv -- Download online video (paste in url) (requires youtube-dl) + + yta -- Download audio of online video (paste in url) (requires youtube-dl) diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf @@ -0,0 +1,520 @@ +###SETTINGS### + +set column_ratios 1,3,4 +#set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ +set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$ +set show_hidden false +set confirm_on_delete multiple +set preview_script ~/.config/ranger/scope.sh +set use_preview_script true +set automatically_count_files true +set open_all_images true +set vcs_aware false +set vcs_backend_git enabled +set vcs_backend_hg disabled +set vcs_backend_bzr disabled +set preview_images true +set preview_images_method w3m +set unicode_ellipsis false +set show_hidden_bookmarks false +set colorscheme default +set preview_files true +set preview_directories true +set collapse_preview true +set save_console_history false +set status_bar_on_top false +set draw_progress_bar_in_status_bar true +set draw_borders false +set dirname_in_tabs false +set mouse_enabled true +set display_size_in_main_column true +set display_size_in_status_bar true +set display_tags_in_all_columns true +set update_title false +set update_tmux_title true +set shorten_title 3 +set tilde_in_titlebar true +set max_history_size 20 +set max_console_history_size 50 +set scroll_offset 8 +set flushinput true +set padding_right true +set autosave_bookmarks false +set autoupdate_cumulative_size false +set show_cursor false +set sort natural +set sort_reverse false +set sort_case_insensitive true +set sort_directories_first true +set sort_unicode false +set xterm_alt_key false +set cd_bookmarks false +set preview_max_size 0 +set show_selection_in_titlebar true +set idle_delay 2000 +set metadata_deep_search false + + +###ALIASES### +alias e edit +alias q quit +alias q! quitall +alias qa quitall +alias qall quitall +alias setl setlocal + +alias filter scout -prt +alias find scout -aeit +alias mark scout -mr +alias unmark scout -Mr +alias search scout -rs +alias search_inc scout -rts +alias travel scout -aefiklst + + +###BASIC KEYS### + +#BASIC +map Q quit! +map q quit +copymap q ZZ ZQ + +#map R reload_cwd +map <C-r> reset +#map <C-l> redraw_window +map <C-c> abort +map <esc> change_mode normal + +map i display_file +map ? help +#map W display_log +map w taskview_open +map S shell $SHELL + +map : console +map ; console +map ! console shell%space +map @ console -p6 shell %s +map # console shell -p%space +#map s console shell%space +map r chain draw_possible_programs; console open_with%space +map f console find%space +map cd console cd%space + + +# Change the line mode +#map Mf linemode filename +#map Mi linemode fileinfo +#map Mp linemode permissions +#map Mt linemode metatitle + +#moc +#map Mc shell mocp -c +#map Ma shell mocp -a %s +#map Ms shell mocp -p +#map MS shell mocp -S +#map Mp shell mocp -G +#map Mn shell mocp -f +#map Mb shell mocp -r +#map MN shell mocp -s && mocp -c && mocp -a %s && mocp -p +#map Mo shell mocp -j 0%% +#map MK shell killall mocp + + + +# Tagging / Marking +map at tag_toggle +map ut tag_remove +map "<any> tag_toggle tag=%any +map <Space> mark_files toggle=True +map va mark_files all=True toggle=True +map uv mark_files all=True val=False +map vs toggle_visual_mode +map uV toggle_visual_mode reverse=True + + + +# For the nostalgics: Midnight Commander bindings +map <F1> help +map <F3> display_file +map <F4> edit +map <F5> copy +map <F5> console shell echo "require(rmarkdown); render_site()" | R --vanilla +map <F6> cut +map <F7> console mkdir%space +map <F8> console delete +map <F10> exit + + +# In case you work on a keyboard with dvorak layout +map <UP> move up=1 +map <DOWN> move down=1 +map <LEFT> move left=1 +map <RIGHT> move right=1 +map <HOME> move to=0 +map <END> move to=-1 +map <PAGEDOWN> move down=1 pages=True +map <PAGEUP> move up=1 pages=True +map <CR> move right=1 +map <DELETE> console delete +map <INSERT> console touch%space + + +# VIM-like +copymap <UP> k +copymap <DOWN> j +copymap <LEFT> h +copymap <RIGHT> l +copymap <HOME> gg +copymap <END> G +copymap <PAGEDOWN> <C-F> +copymap <PAGEUP> <C-B> + +map J move down=0.5 pages=True +map K move up=0.5 pages=True +copymap J <C-D> +copymap K <C-U> + + +# Jumping around +map H history_go -1 +map L history_go 1 +map ] move_parent 1 +map [ move_parent -1 +map } traverse + +#DEFAULT MOVEMENT +map ge cd /etc +map gu cd /usr +#map gl cd -r . +map gL cd -r %f +#map gv cd /var +map gM cd /mnt +map gr cd / +map gR eval fm.cd(ranger.RANGERDIR) +map g? cd /usr/share/doc/ranger + +# Tabs +map <C-n> tab_new ~ +map <C-w> tab_close +map <TAB> tab_move 1 +map <S-TAB> tab_move -1 +map <A-Right> tab_move 1 +map <A-Left> tab_move -1 +#map gt tab_move 1 +#map gT tab_move -1 +map gn tab_new ~ +#map gc tab_close +map tt tab_close +map uq tab_restore +map <a-1> tab_open 1 +map <a-2> tab_open 2 +map <a-3> tab_open 3 +map <a-4> tab_open 4 +map <a-5> tab_open 5 +map <a-6> tab_open 6 +map <a-7> tab_open 7 +map <a-8> tab_open 8 +map <a-9> tab_open 9 + + +# External Programs +map E edit +map du shell -p du --max-depth=1 -h --apparent-size +map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh +map yp shell -f echo -n %%d/%%f | xsel -i; xsel -o | xsel -i -b +map yd shell -f echo -n %%d | xsel -i; xsel -o | xsel -i -b +map yn shell -f echo -n %%f | xsel -i; xsel -o | xsel -i -b + + +# Filesystem Operations +map = chmod +map cw console rename%space +map aa rename_append +map A eval fm.open_console('rename ' + fm.thisfile.relative_path) +map I eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7) +map pp paste +map po paste overwrite=True +map pP paste append=True +map pO paste overwrite=True append=True +map pl paste_symlink relative=False +map pL paste_symlink relative=True +map phl paste_hardlink +map pht paste_hardlinked_subtree + +map dD console delete + +map dd cut +map ud uncut +map da cut mode=add +map dr cut mode=remove + +map yy copy +map uy uncut +map ya copy mode=add +map yr copy mode=remove + + +# Temporary workarounds +map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) +map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) +map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) +map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) +map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) +map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) +map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) +map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) + + +# Searching +map / console search%space +map n search_next +map N search_next forward=False +map ct search_next order=tag +map cs search_next order=size +map ci search_next order=mimetype +map cc search_next order=ctime +map cm search_next order=mtime +map ca search_next order=atime + + +# Sorting +map or toggle_option sort_reverse +map oz set sort=random +map os chain set sort=size; set sort_reverse=False +map ob chain set sort=basename; set sort_reverse=False +map on chain set sort=natural; set sort_reverse=False +map om chain set sort=mtime; set sort_reverse=False +map oc chain set sort=ctime; set sort_reverse=False +map oa chain set sort=atime; set sort_reverse=False +map ot chain set sort=type; set sort_reverse=False +map oe chain set sort=extension; set sort_reverse=False + +map oS chain set sort=size; set sort_reverse=True +map oB chain set sort=basename; set sort_reverse=True +map oN chain set sort=natural; set sort_reverse=True +map oM chain set sort=mtime; set sort_reverse=True +map oC chain set sort=ctime; set sort_reverse=True +map oA chain set sort=atime; set sort_reverse=True +map oT chain set sort=type; set sort_reverse=True +map oE chain set sort=extension; set sort_reverse=True + +map dc get_cumulative_size + + +# Settings +map zc toggle_option collapse_preview +map zd toggle_option sort_directories_first +map zh toggle_option show_hidden +map <C-h> toggle_option show_hidden +map zi toggle_option flushinput +map zm toggle_option mouse_enabled +map zp toggle_option preview_files +map zP toggle_option preview_directories +map zs toggle_option sort_case_insensitive +map zu toggle_option autoupdate_cumulative_size +map zv toggle_option use_preview_script +map zf console filter%space + + +# Bookmarks +#map `<any> enter_bookmark %any +#map '<any> enter_bookmark %any +#map mm<any> set_bookmark %any +#map um<any> unset_bookmark %any + +#map m<bg> draw_bookmarks +#copymap m<bg> um<bg> `<bg> '<bg> + + +# Generate all the chmod bindings with some python help: +eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) + +eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) + + +###CONSOLE KEYS### +# Basic +cmap <tab> eval fm.ui.console.tab() +cmap <s-tab> eval fm.ui.console.tab(-1) +cmap <ESC> eval fm.ui.console.close() +cmap <CR> eval fm.ui.console.execute() +#cmap <C-l> redraw_window + +copycmap <ESC> <C-c> +copycmap <CR> <C-j> + + +# Move around +cmap <up> eval fm.ui.console.history_move(-1) +cmap <down> eval fm.ui.console.history_move(1) +cmap <left> eval fm.ui.console.move(left=1) +cmap <right> eval fm.ui.console.move(right=1) +cmap <home> eval fm.ui.console.move(right=0, absolute=True) +cmap <end> eval fm.ui.console.move(right=-1, absolute=True) + + +# Line Editing +cmap <backspace> eval fm.ui.console.delete(-1) +cmap <delete> eval fm.ui.console.delete(0) +cmap <C-w> eval fm.ui.console.delete_word() +cmap <A-d> eval fm.ui.console.delete_word(backward=False) +cmap <C-k> eval fm.ui.console.delete_rest(1) +cmap <C-u> eval fm.ui.console.delete_rest(-1) +cmap <C-y> eval fm.ui.console.paste() + +# And of course the emacs way +#copycmap <up> <C-p> +#copycmap <down> <C-n> +#copycmap <left> <C-b> +#copycmap <right> <C-f> +#copycmap <home> <C-a> +#copycmap <end> <C-e> +#copycmap <delete> <C-d> +#copycmap <backspace> <C-h> + + +# Note: There are multiple ways to express backspaces. <backspace> (code 263) +# and <backspace2> (code 127). To be sure, use both. +copycmap <backspace> <backspace2> + +# This special expression allows typing in numerals: +cmap <allow_quantifiers> false + + + +###PAGER KEYS### +# Movement +pmap <down> pager_move down=1 +pmap <up> pager_move up=1 +pmap <left> pager_move left=4 +pmap <right> pager_move right=4 +pmap <home> pager_move to=0 +pmap <end> pager_move to=-1 +pmap <pagedown> pager_move down=1.0 pages=True +pmap <pageup> pager_move up=1.0 pages=True +pmap <C-d> pager_move down=0.5 pages=True +pmap <C-u> pager_move up=0.5 pages=True + +copypmap <UP> k <C-p> +copypmap <DOWN> j <C-n> <CR> +copypmap <LEFT> h +copypmap <RIGHT> l +copypmap <HOME> g +copypmap <END> G +copypmap <C-d> d +copypmap <C-u> u +copypmap <PAGEDOWN> n f <C-F> <Space> +copypmap <PAGEUP> p b <C-B> + + +# Basic +#pmap <C-l> redraw_window +pmap <ESC> pager_close +copypmap <ESC> q Q i <F3> +pmap E edit_file + +# =================================================================== +# == Taskview Keybindings +# =================================================================== + +# Movement +tmap <up> taskview_move up=1 +tmap <down> taskview_move down=1 +tmap <home> taskview_move to=0 +tmap <end> taskview_move to=-1 +tmap <pagedown> taskview_move down=1.0 pages=True +tmap <pageup> taskview_move up=1.0 pages=True +tmap <C-d> taskview_move down=0.5 pages=True +tmap <C-u> taskview_move up=0.5 pages=True + +copytmap <UP> k <C-p> +copytmap <DOWN> j <C-n> <CR> +copytmap <HOME> g +copytmap <END> G +copytmap <C-u> u +copytmap <PAGEDOWN> n f <C-F> <Space> +copytmap <PAGEUP> p b <C-B> + +# Changing priority and deleting tasks +tmap J eval -q fm.ui.taskview.task_move(-1) +tmap K eval -q fm.ui.taskview.task_move(0) +tmap dd eval -q fm.ui.taskview.task_remove() +tmap <pagedown> eval -q fm.ui.taskview.task_move(-1) +tmap <pageup> eval -q fm.ui.taskview.task_move(0) +tmap <delete> eval -q fm.ui.taskview.task_remove() + +# Basic +#tmap <C-l> redraw_window +tmap <ESC> taskview_close +copytmap <ESC> q Q w <C-c> + + +map sp console shell bash ~/.config/Scripts/speedvid.sh %f%space +map x shell chmod -x %s + +#General +map V console shell vim%space +map cW bulkrename %s +map mkd console mkdir%space +map sc console shell ln -sT%space +map D console delete +map X shell ~/.config/Scripts/extract %f +map Z shell tar -cvzf %f.tar.gz %f +map <C-f> fzf_select +map <C-l> fzf_locate + +#Document Manipulation +map p1s shell lpr -o sides=one-sided %f +map p2s shell lpr -o sides=two-sided-long-edge %f +map MP shell pandoc %f -o %f.pdf +map MX shell xelatex %f +map ML shell latex %f +map TC shell ~/.config/Scripts/texclear +map Txa console shell cp ~/Documents/LaTeX/article.tex%space +map Txs console shell cp ~/Documents/LaTeX/beamer.tex%space +map Txh console shell cp ~/Documents/LaTeX/handout.tex%space + +#Image commands +map bg shell cp %f ~/.config/wall.png && feh --bg-scale %f +map bw shell wal -c -i %f && cp %f ~/.config/wall.png +map C shell killall w3mimgdisplay && convert -rotate 90 %s %s +map F shell killall w3mimgdisplay && convert -flop %s %s +map bl shell killall w3mimgdisplay && convert %s -resize 1440x1080\> bl_%s +map TR shell convert %s -transparent white %s + +#Music (mpd) shortcuts +map MS shell mpd +map MK shell killall mpd +map Ma shell mpc add "%s" +map Ms shell mpc play +map Mp shell mpc toggle +map Mn shell mpc next +map Mb shell mpc prev +map MN shell mpc stop && mpc clear && mpc add "%s" +map Mo shell mpc seek 0% + +#Audio tagging (Requires eyeD3) +map Ta eval fm.open_console('shell eyeD3 -a ' + fm.thisfile.relative_path, position=15) +#Artist +map TA eval fm.open_console('shell eyeD3 -A ' + fm.thisfile.relative_path, position=15) +#Album +map Tb eval fm.open_console('shell eyeD3 -b ' + fm.thisfile.relative_path, position=15) +#Album artist +map Tt eval fm.open_console('shell eyeD3 -t "" ' + fm.thisfile.relative_path, position=16) +map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, position=16) + +#Downloading +map ytv console shell youtube-dl -ic%space +map yta console shell youtube-dl -xic%space + +# Shortcuts +source ~/.config/ranger/shortcuts.conf diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf @@ -0,0 +1,221 @@ +# vim: ft=cfg +# +# This is the configuration file of "rifle", ranger's file executor/opener. +# Each line consists of conditions and a command. For each line the conditions +# are checked and if they are met, the respective command is run. +# +# Syntax: +# <condition1> , <condition2> , ... = command +# +# The command can contain these environment variables: +# $1-$9 | The n-th selected file +# $@ | All selected files +# +# If you use the special command "ask", rifle will ask you what program to run. +# +# Prefixing a condition with "!" will negate its result. +# These conditions are currently supported: +# match <regexp> | The regexp matches $1 +# ext <regexp> | The regexp matches the extension of $1 +# mime <regexp> | The regexp matches the mime type of $1 +# name <regexp> | The regexp matches the basename of $1 +# path <regexp> | The regexp matches the absolute path of $1 +# has <program> | The program is installed (i.e. located in $PATH) +# env <variable> | The environment variable "variable" is non-empty +# file | $1 is a file +# directory | $1 is a directory +# number <n> | change the number of this command to n +# terminal | stdin, stderr and stdout are connected to a terminal +# X | $DISPLAY is not empty (i.e. Xorg runs) +# +# There are also pseudo-conditions which have a "side effect": +# flag <flags> | Change how the program is run. See below. +# label <label> | Assign a label or name to the command so it can +# | be started with :open_with <label> in ranger +# | or `rifle -p <label>` in the standalone executable. +# else | Always true. +# +# Flags are single characters which slightly transform the command: +# f | Fork the program, make it run in the background. +# | New command = setsid $command >& /dev/null & +# r | Execute the command with root permissions +# | New command = sudo $command +# t | Run the program in a new terminal. If $TERMCMD is not defined, +# | rifle will attempt to extract it from $TERM. +# | New command = $TERMCMD -e $command +# Note: The "New command" serves only as an illustration, the exact +# implementation may differ. +# Note: When using rifle in ranger, there is an additional flag "c" for +# only running the current file even if you have marked multiple files. + +#------------------------------------------- +# Websites +#------------------------------------------- +# Rarely installed browsers get higher priority; It is assumed that if you +# install a rare browser, you probably use it. Firefox/konqueror/w3m on the +# other hand are often only installed as fallback browsers. + +ext x?html?, has surf, X, flag f = surf -- file://"$1" +ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@" +ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@" +ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" +ext x?html?, has dwb, X, flag f = dwb -- "$@" +ext x?html?, has jumanji, X, flag f = jumanji -- "$@" +ext x?html?, has luakit, X, flag f = luakit -- "$@" +ext x?html?, has uzbl, X, flag f = uzbl -- "$@" +ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@" +ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@" +ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@" +ext x?html?, has midori, X, flag f = midori -- "$@" +ext x?html?, has chromium, X, flag f = chromium -- "$@" +ext x?html?, has opera, X, flag f = opera -- "$@" +ext x?html?, has firefox, X, flag f = firefox -- "$@" +ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@" +ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@" +ext x?html?, has epiphany, X, flag f = epiphany -- "$@" +ext x?html?, has konqueror, X, flag f = konqueror -- "$@" +ext x?html?, has elinks, terminal = elinks "$@" +ext x?html?, has links2, terminal = links2 "$@" +ext x?html?, has links, terminal = links "$@" +ext x?html?, has lynx, terminal = lynx -- "$@" +ext x?html?, has w3m, terminal = w3m "$@" + +#------------------------------------------- +# Misc +#------------------------------------------- +# Define the "editor" for text files as first action +mime ^text, label editor = $EDITOR -- "$@" +mime ^text, label pager = "$PAGER" -- "$@" +!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" +!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" + +ext 1 = man "$1" +ext s[wmf]c, has zsnes, X = zsnes "$1" +ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1" +ext nes, has fceux, X = fceux "$1" +ext exe = wine "$1" +name ^[mM]akefile$ = make + +#-------------------------------------------- +# Code +#------------------------------------------- +ext py = python -- "$1" +ext pl = perl -- "$1" +ext rb = ruby -- "$1" +ext js = node -- "$1" +ext sh = sh -- "$1" +ext php = php -- "$1" + +#-------------------------------------------- +# Audio without X +#------------------------------------------- +mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@" +mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@" +mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" +ext midi?, terminal, has wildmidi = wildmidi -- "$@" + +#-------------------------------------------- +# Video/Audio with a GUI +#------------------------------------------- +mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@" +mime ^video|audio, has smplayer, X, flag f = smplayer "$@" +mime ^video, has mpv, X, flag f = mpv -- "$@" +mime ^video, has mpv, X, flag f = mpv --fs -- "$@" +mime ^video, has mpv, X, flag f = mpv --loop -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@" +mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -- "$@" +mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@" +mime ^video|audio, has vlc, X, flag f = vlc -- "$@" +mime ^video|audio, has totem, X, flag f = totem -- "$@" +mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@" + +#-------------------------------------------- +# Video without X: +#------------------------------------------- +mime ^video, terminal, !X, has mpv = mpv -- "$@" +mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" +mime ^video, terminal, !X, has mplayer = mplayer -- "$@" + +#------------------------------------------- +# Documents +#------------------------------------------- +ext pdf, has llpp, X, flag f = llpp "$@" +ext pdf, has zathura, X, flag f = zathura -- "$@" +ext pdf, has mupdf, X, flag f = mupdf "$@" +ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@" +ext pdf, has apvlv, X, flag f = apvlv -- "$@" +ext pdf, has xpdf, X, flag f = xpdf -- "$@" +ext pdf, has evince, X, flag f = evince -- "$@" +ext pdf, has atril, X, flag f = atril -- "$@" +ext pdf, has okular, X, flag f = okular -- "$@" +ext pdf, has epdfview, X, flag f = epdfview -- "$@" +ext pdf, has qpdfview, X, flag f = qpdfview "$@" + +ext epub, has mupdf, X, flag f = mupdf "$@" + +ext docx, has abiword, X, flag f = abiword "$@" + +ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER" + +ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@" +ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@" +ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@" + +ext djvu, has zathura,X, flag f = zathura -- "$@" +ext djvu, has evince, X, flag f = evince -- "$@" +ext djvu, has atril, X, flag f = atril -- "$@" + +#------------------------------------------- +# Image Viewing: +#------------------------------------------- +mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" +mime ^image/svg, has display, X, flag f = display -- "$@" +mime ^image/gif, has mpv, X, flag f = mpv --loop -- "$@" +mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@" +mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@" + +mime ^image, has sxiv, X, flag f = sxiv -- "$@" +mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@" +mime ^image, has mirage, X, flag f = mirage -- "$@" +mime ^image, has ristretto, X, flag f = ristretto "$@" +mime ^image, has eog, X, flag f = eog -- "$@" +mime ^image, has eom, X, flag f = eom -- "$@" +mime ^image, has gimp, X, flag f = gimp -- "$@" +mime ^image, has pinta, X, flag f = pinta -- "$@" +mime ^image, has mypaint, X, flag f = mypaint -- "$@" +mime ^image, has kolourpaint, X, flag f = kolourpaint -- "$@" +ext xcf, X, flag f = gimp -- "$@" + +#------------------------------------------- +# Archives +#------------------------------------------- +# This requires atool +ext jar = java -jar "$@" + +ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has als = als -- "$@" | "$PAGER" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -- "$@" | "$PAGER" +ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@" +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@" + +# Fallback: +ext tar|gz, has tar = tar vvtf "$@" | "$PAGER" +ext tar|gz, has tar = tar vvxf "$@" + +#------------------------------------------- +# Misc +#------------------------------------------- +label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1" +label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1" +label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" +label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" + +# Define the editor for non-text files + pager as last action + !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask +label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@" +label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@" + +ext blend, has blender, X, flag f = blender -- "$@" diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env sh +# ranger supports enhanced previews. If the option "use_preview_script" +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. + +# NOTES: This script is considered a configuration file. If you upgrade +# ranger, it will be left untouched. (You must update it yourself.) +# Also, ranger disables STDIN here, so interactive scripts won't work properly + +# Meanings of exit codes: +# code | meaning | action of ranger +# -----+------------+------------------------------------------- +# 0 | success | success. display stdout as preview +# 1 | no preview | failure. display no preview at all +# 2 | plain text | display the plain content of the file +# 3 | fix width | success. Don't reload when width changes +# 4 | fix height | success. Don't reload when height changes +# 5 | fix both | success. Don't ever reload +# 6 | image | success. display the image $cached points to as an image preview +# 7 | image | success. display the file directly as an image + +# Meaningful aliases for arguments: +path="$1" # Full path of the selected file +width="$2" # Width of the preview pane (number of fitting characters) +height="$3" # Height of the preview pane (number of fitting characters) +cached="$4" # Path that should be used to cache image previews +preview_images="$5" # "True" if image previews are enabled, "False" otherwise. + +maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln + +# Find out something about the file: +mimetype=$(file --mime-type -Lb "$path") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') + +# Functions: +# runs a command and saves its output into $output. Useful if you need +# the return value AND want to use the output in a pipe +try() { output=$(eval '"$@"'); } + +# writes the output of the previously used "try" command +dump() { /bin/echo "$output"; } + +# a common post-processing function used after most commands +trim() { head -n "$maxln"; } + +# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success +safepipe() { "$@"; test $? = 0 -o $? = 141; } + +# Image previews, if enabled in ranger. +if [ "$preview_images" = "True" ]; then + case "$mimetype" in + # Image previews for SVG files, disabled by default. + ###image/svg+xml) + ### convert "$path" "$cached" && exit 6 || exit 1;; + # Image previews for image files. w3mimgdisplay will be called for all + # image files (unless overriden as above), but might fail for + # unsupported types. + image/*) + exit 7;; + # Image preview for video, disabled by default.: + ###video/*) + ### ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; + esac +fi + +case "$extension" in + # Archive extensions: + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + try als "$path" && { dump | trim; exit 0; } + try acat "$path" && { dump | trim; exit 3; } + try bsdtar -lf "$path" && { dump | trim; exit 0; } + exit 1;; + rar) + # avoid password prompt by providing empty password + try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; + 7z) + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # PDF documents: + pdf) + try pdftotext -l 10 -nopgbrk -q "$path" - && \ + { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + # BitTorrent Files + torrent) + try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; + # ODT Files + odt|ods|odp|sxw) + try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; + # HTML Pages: + htm|html|xhtml) + try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + ;; # fall back to highlight/cat if the text browsers fail +esac + +case "$mimetype" in + # Syntax highlight for text files: + text/* | */xml) + if [ "$(tput colors)" -ge 256 ]; then + pygmentize_format=terminal256 + highlight_format=xterm256 + else + pygmentize_format=terminal + highlight_format=ansi + fi + try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } + try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } + exit 2;; + # Ascii-previews of images: + image/*) + img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + exiftool "$path" && exit 5 + # Use sed to remove spaces so the output fits into the narrow window + try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; +esac + +exit 1 diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs @@ -0,0 +1 @@ +XDG_DESKTOP_DIR="$HOME/" diff --git a/.config/wall.png b/.config/wall.png Binary files differ. diff --git a/.gtkrc-2.0 b/.gtkrc-2.0 @@ -0,0 +1,19 @@ +# DO NOT EDIT! This file will be overwritten by LXAppearance. +# Any customization should be done in ~/.gtkrc-2.0.mine instead. + +include "/home/luke/.gtkrc-2.0.mine" +gtk-theme-name="Blackbird" +gtk-icon-theme-name="Adwaita" +gtk-font-name="Sans 10" +gtk-cursor-theme-name="Adwaita" +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_TEXT +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle="hintfull" +gtk-xft-rgba="rgb" diff --git a/.inputrc b/.inputrc @@ -0,0 +1,12 @@ +$include /etc/inputrc +set editing-mode vi +$if mode=vi + +set keymap vi-command +# these are for vi-command mode +Control-l: clear-screen + +set keymap vi-insert +# these are for vi-insert mode +Control-l: clear-screen +$endif diff --git a/.msmtprc b/.msmtprc @@ -0,0 +1,25 @@ +# vim: filetype=config +#These are settings for all accounts. +account default +protocol smtp +auth on +tls on +tls_nocertcheck + +#Below are example accounts. Comment out what you don't use. + +#Here is an example gmail account. +account gmail +from YOURNAME@gmail.com +user YOURNAME@gmail.com +password "PASSWORD" +host smtp.gmail.com +port 587 + +#Here is another example account. Search for your email host's SMTP server and add the information here. +account personal +from USER@DOMMAIN.COM +user USER@DOMMAIN.COM +password "PASSWORD" +host HOST-SERVER +port XXX diff --git a/.ncmpcpp/bindings b/.ncmpcpp/bindings @@ -0,0 +1,612 @@ +############################################################## +## This is the example bindings file. Copy it to ## +## ~/.ncmpcpp/bindings or $XDG_CONFIG_HOME/ncmpcpp/bindings ## +## and set up your preferences ## +############################################################## +## +##### General rules ##### +## +## 1) Because each action has runtime checks whether it's +## ok to run it, a few actions can be bound to one key. +## Actions will be bound in order given in configuration +## file. When a key is pressed, first action in order +## will test itself whether it's possible to run it. If +## test succeeds, action is executed and other actions +## bound to this key are ignored. If it doesn't, next +## action in order tests itself etc. +## +## 2) It's possible to bind more that one action at once +## to a key. It can be done using the following syntax: +## +## def_key "key" +## action1 +## action2 +## ... +## +## This creates a chain of actions. When such chain is +## executed, each action in chain is run until the end of +## chain is reached or one of its actions fails to execute +## due to its requirements not being met. If multiple actions +## and/or chains are bound to the same key, they will be +## consecutively run until one of them gets fully executed. +## +## 3) When ncmpcpp starts, bindings configuration file is +## parsed and then ncmpcpp provides "missing pieces" +## of default keybindings. If you want to disable some +## bindings, there is a special action called 'dummy' +## for that purpose. Eg. if you want to disable ability +## to crop playlists, you need to put the following +## into configuration file: +## +## def_key "C" +## dummy +## +## After that ncmpcpp will not bind any default action +## to this key. +## +## 4) To let you write simple macros, the following special +## actions are provided: +## +## - push_character "character" - pushes given special +## character into input queue, so it will be immediately +## picked by ncmpcpp upon next call to readKey function. +## Accepted values: mouse, up, down, page_up, page_down, +## home, end, space, enter, insert, delete, left, right, +## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\, +## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace. +## In addition, most of these names can be prefixed with +## alt-/ctrl-/shift- to be recognized with the appropriate +## modifier key(s). +## +## - push_characters "string" - pushes given string into +## input queue. +## +## - require_runnable "action" - checks whether given action +## is runnable and fails if it isn't. This is especially +## useful when mixed with previous two functions. Consider +## the following macro definition: +## +## def_key "key" +## push_characters "custom_filter" +## apply_filter +## +## If apply_filter can't be currently run, we end up with +## sequence of characters in input queue which will be +## treated just as we typed them. This may lead to unexpected +## results (in this case 'c' will most likely clear current +## playlist, 'u' will trigger database update, 's' will stop +## playback etc.). To prevent such thing from happening, we +## need to change above definition to this one: +## +## def_key "key" +## require_runnable "apply_filter" +## push_characters "custom_filter" +## apply_filter +## +## Here, first we test whether apply_filter can be actually run +## before we stuff characters into input queue, so if condition +## is not met, whole chain is aborted and we're fine. +## +## - require_screen "screen" - checks whether given screen is +## currently active. accepted values: browser, clock, help, +## media_library, outputs, playlist, playlist_editor, +## search_engine, tag_editor, visualizer, last_fm, lyrics, +## selected_items_adder, server_info, song_info, +## sort_playlist_dialog, tiny_tag_editor. +## +## - run_external_command "command" - runs given command using +## system() function. +## +## 5) In addition to binding to a key, you can also bind actions +## or chains of actions to a command. If it comes to commands, +## syntax is very similar to defining keys. Here goes example +## definition of a command: +## +## def_command "quit" [deferred] +## stop +## quit +## +## If you execute the above command (which can be done by +## invoking action execute_command, typing 'quit' and pressing +## enter), ncmpcpp will stop the player and then quit. Note the +## presence of word 'deferred' enclosed in square brackets. It +## tells ncmpcpp to wait for confirmation (ie. pressing enter) +## after you typed quit. Instead of 'deferred', 'immediate' +## could be used. Then ncmpcpp will not wait for confirmation +## (enter) and will execute the command the moment it sees it. +## +## Note: while command chains are executed, internal environment +## update (which includes current window refresh and mpd status +## update) is not performed for performance reasons. However, it +## may be desirable to do so in some situration. Therefore it's +## possible to invoke by hand by performing 'update enviroment' +## action. +## +## Note: There is a difference between: +## +## def_key "key" +## action1 +## +## def_key "key" +## action2 +## +## and +## +## def_key "key" +## action1 +## action2 +## +## First one binds two single actions to the same key whilst +## second one defines a chain of actions. The behavior of +## these two is different and is described in (1) and (2). +## +## Note: Function def_key accepts non-ascii characters. +## +##### List of unbound actions ##### +## +## The following actions are not bound to any key/command: +## +## - set_volume +## +# +#def_key "mouse" +# mouse_event +# +#def_key "up" +# scroll_up +# +#def_key "shift-up" +# select_item +# scroll_up +# +#def_key "down" +# scroll_down +# +#def_key "shift-down" +# select_item +# scroll_down +# +#def_key "[" +# scroll_up_album +# +#def_key "]" +# scroll_down_album +# +#def_key "{" +# scroll_up_artist +# +#def_key "}" +# scroll_down_artist +# +#def_key "page_up" +# page_up +# +#def_key "page_down" +# page_down +# +#def_key "home" +# move_home +# +#def_key "end" +# move_end +# +#def_key "insert" +# select_item +# +#def_key "enter" +# enter_directory +# +#def_key "enter" +# toggle_output +# +#def_key "enter" +# run_action +# +#def_key "enter" +# play_item +# +#def_key "space" +# add_item_to_playlist +# +#def_key "space" +# toggle_lyrics_update_on_song_change +# +#def_key "space" +# toggle_visualization_type +# +#def_key "delete" +# delete_playlist_items +# +#def_key "delete" +# delete_browser_items +# +#def_key "delete" +# delete_stored_playlist +# +#def_key "right" +# next_column +# +#def_key "right" +# slave_screen +# +#def_key "right" +# volume_up +# +#def_key "+" +# volume_up +# +#def_key "left" +# previous_column +# +#def_key "left" +# master_screen +# +#def_key "left" +# volume_down +# +#def_key "-" +# volume_down +# +#def_key ":" +# execute_command +# +#def_key "tab" +# next_screen +# +#def_key "shift-tab" +# previous_screen +# +#def_key "f1" +# show_help +# +#def_key "1" +# show_playlist +# +#def_key "2" +# show_browser +# +#def_key "2" +# change_browse_mode +# +#def_key "3" +# show_search_engine +# +#def_key "3" +# reset_search_engine +# +#def_key "4" +# show_media_library +# +#def_key "4" +# toggle_media_library_columns_mode +# +#def_key "5" +# show_playlist_editor +# +#def_key "6" +# show_tag_editor +# +#def_key "7" +# show_outputs +# +#def_key "8" +# show_visualizer +# +#def_key "=" +# show_clock +# +#def_key "@" +# show_server_info +# +#def_key "s" +# stop +# +#def_key "p" +# pause +# +#def_key ">" +# next +# +#def_key "<" +# previous +# +#def_key "ctrl-h" +# jump_to_parent_directory +# +#def_key "ctrl-h" +# replay_song +# +#def_key "backspace" +# jump_to_parent_directory +# +#def_key "backspace" +# replay_song +# +#def_key "f" +# seek_forward +# +#def_key "b" +# seek_backward +# +#def_key "r" +# toggle_repeat +# +#def_key "z" +# toggle_random +# +#def_key "y" +# save_tag_changes +# +#def_key "y" +# start_searching +# +#def_key "y" +# toggle_single +# +#def_key "R" +# toggle_consume +# +#def_key "Y" +# toggle_replay_gain_mode +# +#def_key "T" +# toggle_add_mode +# +#def_key "|" +# toggle_mouse +# +#def_key "#" +# toggle_bitrate_visibility +# +#def_key "Z" +# shuffle +# +#def_key "x" +# toggle_crossfade +# +#def_key "X" +# set_crossfade +# +#def_key "u" +# update_database +# +#def_key "ctrl-s" +# sort_playlist +# +#def_key "ctrl-s" +# toggle_browser_sort_mode +# +#def_key "ctrl-s" +# toggle_media_library_sort_mode +# +#def_key "ctrl-r" +# reverse_playlist +# +#def_key "ctrl-f" +# apply_filter +# +#def_key "ctrl-_" +# select_found_items +# +#def_key "/" +# find +# +#def_key "/" +# find_item_forward +# +#def_key "?" +# find +# +#def_key "?" +# find_item_backward +# +#def_key "." +# next_found_item +# +#def_key "," +# previous_found_item +# +#def_key "w" +# toggle_find_mode +# +#def_key "e" +# edit_song +# +#def_key "e" +# edit_library_tag +# +#def_key "e" +# edit_library_album +# +#def_key "e" +# edit_directory_name +# +#def_key "e" +# edit_playlist_name +# +#def_key "e" +# edit_lyrics +# +#def_key "i" +# show_song_info +# +#def_key "I" +# show_artist_info +# +#def_key "g" +# jump_to_position_in_song +# +#def_key "l" +# show_lyrics +# +#def_key "ctrl-v" +# select_range +# +#def_key "v" +# reverse_selection +# +#def_key "V" +# remove_selection +# +#def_key "B" +# select_album +# +#def_key "a" +# add_selected_items +# +#def_key "c" +# clear_playlist +# +#def_key "c" +# clear_main_playlist +# +#def_key "C" +# crop_playlist +# +#def_key "C" +# crop_main_playlist +# +#def_key "m" +# move_sort_order_up +# +#def_key "m" +# move_selected_items_up +# +#def_key "n" +# move_sort_order_down +# +#def_key "n" +# move_selected_items_down +# +#def_key "M" +# move_selected_items_to +# +#def_key "A" +# add +# +#def_key "S" +# save_playlist +# +#def_key "o" +# jump_to_playing_song +# +#def_key "G" +# jump_to_browser +# +#def_key "G" +# jump_to_playlist_editor +# +#def_key "~" +# jump_to_media_library +# +#def_key "E" +# jump_to_tag_editor +# +#def_key "U" +# toggle_playing_song_centering +# +#def_key "P" +# toggle_display_mode +# +#def_key "\\" +# toggle_interface +# +#def_key "!" +# toggle_separators_between_albums +# +#def_key "L" +# toggle_lyrics_fetcher +# +#def_key "F" +# fetch_lyrics_in_background +# +#def_key "alt-l" +# toggle_fetching_lyrics_in_background +# +#def_key "ctrl-l" +# toggle_screen_lock +# +#def_key "`" +# toggle_library_tag_type +# +#def_key "`" +# refetch_lyrics +# +#def_key "`" +# add_random_items +# +#def_key "ctrl-p" +# set_selected_items_priority +# +#def_key "q" +# quit +# +# +def_key "f" + find +def_key "f" + find_item_forward + +def_key "+" + show_clock +def_key "=" + volume_up + +def_key "j" + scroll_down +def_key "k" + scroll_up + +def_key "ctrl-u" + page_up +#push_characters "kkkkkkkkkkkkkkk" +def_key "ctrl-d" + page_down +#push_characters "jjjjjjjjjjjjjjj" +def_key "u" + page_up +#push_characters "kkkkkkkkkkkkkkk" +def_key "d" + page_down +#push_characters "jjjjjjjjjjjjjjj" +def_key "h" + previous_column +def_key "l" + next_column + +def_key "." + show_lyrics + +def_key "n" + next_found_item +def_key "N" + previous_found_item + +# not used but bound +def_key "J" + move_sort_order_down +def_key "K" + move_sort_order_up +def_key "h" + jump_to_parent_directory +def_key "l" + enter_directory +def_key "l" + run_action +def_key "l" + play_item +def_key "m" + show_media_library +def_key "m" + toggle_media_library_columns_mode +def_key "t" + show_tag_editor +def_key "v" + show_visualizer +def_key "G" + move_end +def_key "g" + move_home +#jump_to_position_in_song +def_key "U" + update_database diff --git a/.ncmpcpp/config b/.ncmpcpp/config @@ -0,0 +1,545 @@ +############################################################################## +## This is the example configuration file. Copy it to $HOME/.ncmpcpp/config ## +## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences. ## +############################################################################## +# +##### directories ###### +## +## Directory for storing ncmpcpp related files. Changing it is useful if you +## want to store everything somewhere else and provide command line setting for +## alternative location to config file which defines that while launching +## ncmpcpp. +## +# +#ncmpcpp_directory = ~/.ncmpcpp +# +## +## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other +## MPD clients (eg. ncmpc) also use that location. +## +# +#lyrics_directory = ~/.lyrics +# +##### connection settings ##### +# +#mpd_host = localhost +# +#mpd_port = 6600 +# +#mpd_connection_timeout = 5 +# +## Needed for tag editor and file operations to work. +## +mpd_music_dir = "~/Music" +# +#mpd_crossfade_time = 5 +# +##### music visualizer ##### +## +## Note: In order to make music visualizer work you'll need to use mpd fifo +## output, whose format parameter has to be set to 44100:16:1 for mono +## visualization or 44100:16:2 for stereo visualization. Example configuration +## (it has to be put into mpd.conf): +## +## audio_output { +## type "fifo" +## name "Visualizer feed" +## path "/tmp/mpd.fifo" +## format "44100:16:2" +## } +## +# +#visualizer_fifo_path = /tmp/mpd.fifo +# +## +## Note: Below parameter is needed for ncmpcpp to determine which output +## provides data for visualizer and thus allow syncing between visualization and +## sound as currently there are some problems with it. +## +# +#visualizer_output_name = Visualizer feed +# +## +## If you set format to 44100:16:2, make it 'yes'. +## +#visualizer_in_stereo = yes +# +## +## Note: Below parameter defines how often ncmpcpp has to "synchronize" +## visualizer and audio outputs. 30 seconds is optimal value, but if you +## experience synchronization problems, set it to lower value. Keep in mind +## that sane values start with >=10. +## +# +#visualizer_sync_interval = 30 +# +## +## Note: To enable spectrum frequency visualization you need to compile ncmpcpp +## with fftw3 support. +## +# +## Available values: spectrum, wave, wave_filled, ellipse. +## +visualizer_type = spectrum +# +#visualizer_look = ●卐 +#visualizer_look = 卐 +# +#visualizer_color = blue, cyan, green, yellow, magenta, red +# +## Alternative subset of 256 colors for terminals that support it. +## +#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161 +# +##### system encoding ##### +## +## ncmpcpp should detect your charset encoding but if it failed to do so, you +## can specify charset encoding you are using here. +## +## Note: You can see whether your ncmpcpp build supports charset detection by +## checking output of `ncmpcpp --version`. +## +## Note: Since MPD uses UTF-8 by default, setting this option makes sense only +## if your encoding is different. +## +# +#system_encoding = "" +# +##### delays ##### +# +## Time of inactivity (in seconds) after playlist highlighting will be disabled +## (0 = always on). +## +#playlist_disable_highlight_delay = 5 +# +## Defines how long messages are supposed to be visible. +## +message_delay_time = 1 +# +##### song format ##### +## +## For a song format you can use: +## +## %l - length +## %f - filename +## %D - directory +## %a - artist +## %A - album artist +## %t - title +## %b - album +## %y - date +## %n - track number (01/12 -> 01) +## %N - full track info (01/12 -> 01/12) +## %g - genre +## %c - composer +## %p - performer +## %d - disc +## %C - comment +## %P - priority +## $R - begin right alignment +## +## If you want to make sure that a part of the format is displayed only when +## certain tags are present, you can archieve it by grouping them with brackets, +## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are +## present or '' otherwise. It is also possible to define a list of +## alternatives by providing several groups and separating them with '|', +## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is +## not present. +## +## Note: If you want to set limit on maximal length of a tag, just put the +## appropriate number between % and character that defines tag type, e.g. to +## make album take max. 20 terminal cells, use '%20b'. +## +## In addition, formats support markers used for text attributes. They are +## followed by character '$'. After that you can put: +## +## - 0 - default window color (discards all other colors) +## - 1 - black +## - 2 - red +## - 3 - green +## - 4 - yellow +## - 5 - blue +## - 6 - magenta +## - 7 - cyan +## - 8 - white +## - 9 - end of current color +## - b - bold text +## - u - underline text +## - r - reverse colors +## - a - use alternative character set +## +## If you don't want to use a non-color attribute anymore, just put it again, +## but this time insert character '/' between '$' and attribute character, +## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with +## reversed colors. +## +## If you want to use 256 colors and/or background colors in formats (the naming +## scheme is described below in section about color definitions), it can be done +## with the syntax $(COLOR), e.g. to set the artist tag to one of the +## non-standard colors and make it have yellow background, you need to write +## $(197_yellow)%a$(end). Note that for standard colors this is interchangable +## with attributes listed above. +## +## Note: colors can be nested. +## +# +song_list_format = {$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9} +# +song_status_format = $b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f} +# +song_library_format = {%n - }{%t}|{%f} +# +alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b +# +alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} +# +current_item_prefix = $(cyan)$r$b +# +current_item_suffix = $/r$(end)$/b +# +current_item_inactive_column_prefix = $(magenta)$r +# +current_item_inactive_column_suffix = $/r$(end) +# +#now_playing_prefix = $b +# +#now_playing_suffix = $/b +# +#browser_playlist_prefix = "$2playlist$9 " +# +#selected_item_prefix = $6 +# +#selected_item_suffix = $9 +# +#modified_item_prefix = $3> $9 +# +## +## Note: attributes are not supported for the following variables. +## +#song_window_title_format = {%a - }{%t}|{%f} +## +## Note: Below variables are used for sorting songs in browser. The sort mode +## determines how songs are sorted, and can be used in combination with a sort +## format to specify a custom sorting format. Available values for +## browser_sort_mode are "name", "mtime", "format" and "noop". +## +# +#browser_sort_mode = name +# +#browser_sort_format = {%a - }{%t}|{%f} {(%l)} +# +##### columns settings ##### +## +## syntax of song columns list format is "column column etc." +## +## - syntax for each column is: +## +## (width of the column)[color of the column]{displayed tag} +## +## Note: Width is by default in %, if you want a column to have fixed size, add +## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of +## screen (so the real width will depend on actual screen size), whereas +## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen +## is. +## +## - color is optional (if you want the default one, leave the field empty). +## +## Note: You can give a column additional attributes by putting appropriate +## character after displayed tag character. Available attributes are: +## +## - r - column will be right aligned +## - E - if tag is empty, empty tag marker won't be displayed +## +## You can also: +## +## - give a column custom name by putting it after attributes, separated with +## character ':', e.g. {lr:Length} gives you right aligned column of lengths +## named "Length". +## +## - define sequence of tags, that have to be displayed in case predecessor is +## empty in a way similar to the one in classic song format, i.e. using '|' +## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to +## display artist tag and then composer and performer if previous ones are not +## available. +## +# +#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l} +# +##### various settings ##### +# +## +## Note: Custom command that will be executed each time song changes. Useful for +## notifications etc. +## +#execute_on_song_change = "" +# +## +## Note: Custom command that will be executed each time player state +## changes. The environment variable MPD_PLAYER_STATE is set to the current +## state (either unknown, play, pause, or stop) for its duration. +## +# +#execute_on_player_state_change = "" +# +#playlist_show_mpd_host = no +# +#playlist_show_remaining_time = no +# +#playlist_shorten_total_times = no +# +#playlist_separate_albums = no +# +## +## Note: Possible display modes: classic, columns. +## +#playlist_display_mode = columns +# +browser_display_mode = columns +# +#search_engine_display_mode = classic +# +#playlist_editor_display_mode = classic +# +#discard_colors_if_item_is_selected = yes +# +#show_duplicate_tags = true +# +#incremental_seeking = yes +# +#seek_time = 1 +# +#volume_change_step = 2 +# +#autocenter_mode = no +# +#centered_cursor = no +# +## +## Note: You can specify third character which will be used to build 'empty' +## part of progressbar. +## +progressbar_look = -> +# +## Available values: database, playlist. +## +#default_place_to_search_in = database +# +## Available values: classic, alternative. +## +#user_interface = classic +# +#data_fetching_delay = yes +# +## Available values: artist, album_artist, date, genre, composer, performer. +## +media_library_primary_tag = album_artist +# +media_library_albums_split_by_date = no +# +## Available values: wrapped, normal. +## +#default_find_mode = wrapped +# +#default_tag_editor_pattern = %n - %t +# +#header_visibility = yes +# +#statusbar_visibility = yes +# +#titles_visibility = yes +# +#header_text_scrolling = yes +# +#cyclic_scrolling = no +# +#lines_scrolled = 2 +# +#lyrics_fetchers = lyricwiki, azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet +# +#follow_now_playing_lyrics = no +# +#fetch_lyrics_for_current_song_in_background = no +# +#store_lyrics_in_song_dir = no +# +#generate_win32_compatible_filenames = yes +# +#allow_for_physical_item_deletion = no +# +## +## Note: If you set this variable, ncmpcpp will try to get info from last.fm in +## language you set and if it fails, it will fall back to english. Otherwise it +## will use english the first time. +## +## Note: Language has to be expressed as an ISO 639 alpha-2 code. +## +#lastfm_preferred_language = en +# +#space_add_mode = add_remove +# +#show_hidden_files_in_local_browser = no +# +## +## How shall screen switcher work? +## +## - "previous" - switch between the current and previous screen. +## - "screen1,...,screenN" - switch between given sequence of screens. +## +## Screens available for use: help, playlist, browser, search_engine, +## media_library, playlist_editor, tag_editor, outputs, visualizer, clock, +## lyrics, last_fm. +## +#screen_switcher_mode = playlist, browser +# +## +## Note: You can define startup screen by choosing screen from the list above. +## +startup_screen = media_library +# +## +## Note: You can define startup slave screen by choosing screen from the list +## above or an empty value for no slave screen. +## +#startup_slave_screen = "" +# +#startup_slave_screen_focus = no +# +## +## Default width of locked screen (in %). Acceptable values are from 20 to 80. +## +# +#locked_screen_width_part = 50 +# +#ask_for_locked_screen_width_part = yes +# +#jump_to_now_playing_song_at_start = yes +# +#ask_before_clearing_playlists = yes +# +#clock_display_seconds = no +# +display_volume_level = no +# +#display_bitrate = no +# +#display_remaining_time = no +# +## Available values: none, basic, extended, perl. +## +#regular_expressions = perl +# +## +## Note: if below is enabled, ncmpcpp will ignore leading "The" word while +## sorting items in browser, tags in media library, etc. +## +ignore_leading_the = yes +# +## +## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and +## filtering lists. This takes an effect only if boost was compiled with ICU +## support. +## +#ignore_diacritics = no +# +#block_search_constraints_change_if_items_found = yes +# +#mouse_support = yes +# +#mouse_list_scroll_whole_page = yes +# +#empty_tag_marker = <empty> +# +#tags_separator = " | " +# +#tag_editor_extended_numeration = no +# +#media_library_sort_by_mtime = no +# +#enable_window_title = yes +# +## +## Note: You can choose default search mode for search engine. Available modes +## are: +## +## - 1 - use mpd built-in searching (no regexes, pattern matching) +## +## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but +## if your mpd is on a remote machine, downloading big database to process +## it can take a while +## +## - 3 - match only exact values (this mode uses mpd function for searching in +## database and local one for searching in current playlist) +## +# +#search_engine_default_search_mode = 1 +# +external_editor = vim +# +## Note: set to yes if external editor is a console application. +## +use_console_editor = yes +# +##### colors definitions ##### +## +## It is possible to set a background color by setting a color value +## "<foreground>_<background>", e.g. red_black will set foregound color to red +## and background color to black. +## +## In addition, for terminals that support 256 colors it is possible to set one +## of them by using a number in range [1, 256] instead of color name, +## e.g. numerical value corresponding to red_black is 2_1. To find out if the +## terminal supports 256 colors, run ncmpcpp and check out the bottom of the +## help screen for list of available colors and their numerical values. +## +## What is more, there are two special values for the background color: +## "transparent" and "current". The first one explicitly sets the background to +## be transparent, while the second one allows you to preserve current +## background color and change only the foreground one. It's used implicitly +## when background color is not specified. +## +## Moreover, it is possible to attach format information to selected color +## variables by appending to their end a colon followed by one or more format +## flags, e.g. black:b or red:ur. The following variables support this syntax: +## visualizer_color, color1, color2, empty_tag_color, volume_color, +## state_line_color, state_flags_color, progressbar_color, +## progressbar_elapsed_color, player_state_color, statusbar_time_color, +## alternative_ui_separator_color. +## +## Note: due to technical limitations of older ncurses version, if 256 colors +## are used there is a possibility that you'll be able to use only colors with +## transparent background. +# +#colors_enabled = yes +# +empty_tag_color = magenta +# +#header_window_color = magenta +# +#volume_color = default +# +#state_line_color = default +# +#state_flags_color = default:b +# +#main_window_color = white +# +#color1 = white +# +#color2 = green +# +progressbar_color = black:b +# +progressbar_elapsed_color = blue:b +# +statusbar_color = red +# +statusbar_time_color = cyan:b +# +#player_state_color = default:b +# +#alternative_ui_separator_color = black:b +# +#window_border_color = green +# +#active_window_border = red +# diff --git a/.newsboat/config b/.newsboat/config @@ -0,0 +1,32 @@ +auto-reload yes + +external-url-viewer "urlview" + +bind-key j down +bind-key k up +bind-key j next articlelist +bind-key k prev articlelist +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key G end +bind-key g home +bind-key d pagedown +bind-key u pageup +bind-key l open +bind-key h quit +bind-key n next-unread +bind-key N prev-unread +bind-key D pb-download +bind-key U show-urls + +color listnormal cyan default +color listfocus black yellow standout bold +color listnormal_unread blue default +color listfocus_unread yellow default bold +color info red black bold +color article cyan default + + +browser webview +macro w open-in-browser +macro v set browser "i3 exec mpv"; open-in-browser ; set browser $BROWSER diff --git a/.newsboat/urls b/.newsboat/urls @@ -0,0 +1 @@ +http://lukesmith.xyz/rss.xml diff --git a/.offlineimaprc b/.offlineimaprc @@ -0,0 +1,43 @@ +# vim filetype=config +# Here are settings for all accounts. +[general] +accounts = gmail, personal +starttls = yes +ssl = yes +autorefresh = 1 + + +# Here's an example Gmail account, just add in a username and password to use your own. +[Account gmail] + +localrepository = gmail-local +remoterepository = gmail-remote + +[Repository gmail-remote] +type = Gmail +remoteuser = YOURNAME@gmail.com +remotepass = $PASSWORD +#Note that the line below will not sync Gmail's redundant "All Mail" box. You can add other inboxes here you don't want to sync. +folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail'] +sslcacertfile = /etc/ssl/certs/ca-certificates.crt + +[Repository gmail-local] +type = Maildir +localfolders = ~/.Mail/Gmail + +# Here's an other more general example. Add your username, password and IMAP server information, which you can look this up on your email host's website. +[Account personal] + +localrepository = personal-local +remoterepository = personal-remote + +[Repository personal-remote] +type = IMAP +remoteuser = USER@DOMAIN.COM +remotepass = $PASSWORD +remotehost = SERVER-ADDRESS +sslcacertfile = /etc/ssl/certs/ca-certificates.crt + +[Repository personal-local] +type = Maildir +localfolders = ~/.Mail/Personal diff --git a/.tmux.conf b/.tmux.conf @@ -0,0 +1,177 @@ +############################## +# _ +# | |_ _ __ ___ _ ___ __ +# | __| '_ ` _ \| | | \ \/ / +# | |_| | | | | | |_| |> < +# \__|_| |_| |_|\__,_/_/\_\ +# +############################# +# +# COPY AND PASTE +# http://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future +# +# Use vim keybindings in copy mode +setw -g mode-keys vi + +# Setup 'v' to begin selection as in Vim +#bind-key -t vi-copy v begin-selection +#bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" + +# Update default binding of `Enter` to also use copy-pipe +# unbind -t vi-copy Enter +# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" +# +############################################################################ +############################################################################ +# Reset Prefix +############################################################################ +set -g prefix C-a +bind-key a send-prefix # for nested tmux sessions + +############################################################################ +# Global options +############################################################################ +# large history +set-option -g history-limit 10000 + +# colors +setw -g mode-bg black +set-option -g default-terminal "screen-256color" #"xterm-256color" # "screen-256color" +set-option -g pane-active-border-fg green + +# utf8 support +#set-window-option -g utf8 on + + +# basic settings +set-window-option -g xterm-keys on # for vim +set-window-option -g mode-keys vi # vi key +set-window-option -g monitor-activity on +set-window-option -g window-status-current-fg white +setw -g window-status-current-attr reverse + +# Automatically set window title +setw -g automatic-rename + +# use mouse # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ +#setw -g mode-mouse on +#setw -g mouse-resize-pane on +#set -g mouse-select-window on +#set -g mouse-select-pane on +set -g mouse on +set -g history-limit 30000 +set -g terminal-overrides 'xterm*:smcup@:rmcup@' + +# vi movement keys +# set-option -g status-keys vi + +############################################################################ +# Status Bar +############################################################################ +#set-option -g status-utf8 on +set-option -g status-justify right +set-option -g status-bg black # colour213 # pink +set-option -g status-fg cyan +set-option -g status-interval 5 +set-option -g status-left-length 30 +set-option -g status-left '#[fg=magenta]» #[fg=blue,bold]#T#[default]' +set-option -g status-right '#[fg=red,bold][[ #(git branch) branch ]] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]' +set-option -g visual-activity on + +# Titles (window number, program name, active (or not) +set-option -g set-titles on +set-option -g set-titles-string '#H:#S.#I.#P #W #T' + + +############################################################################ +# Unbindings +############################################################################ +#unbind [ # copy mode bound to escape key +unbind j +unbind C-b # unbind default leader key +unbind '"' # unbind horizontal split +unbind % # unbind vertical split + + +############################################################################ +# Bindings +############################################################################ +# reload tmux conf +bind-key r source-file ~/.tmux.conf + +#bind Escape copy-mode + +# new split in current pane (horizontal / vertical) +bind-key c split-window -v # split pane horizontally +bind-key v split-window -h # split pane vertically + +# list panes +bind-key Space list-panes + +# break-pane +bind-key Enter break-pane + +# join-pane [-dhv] [-l size | -p percentage] [-s src-pane] +# [-t:dst-window.dst-pane] (destination window (dot) destination pane +# (alias: joinp) +# +#bind C-j command-prompt "joinp" +#bind C-j command-prompt "join-pane" +#bind-key j command-prompt "join-pane -s '%%'" +#bind-key j command-prompt "joinp -t:0" +bind-key Space command-prompt "joinp -t:%%" # %% = prompt for window.pane [-V|H] # vert|hor split + +#previous pane +bind-key -n C-up prev +bind-key -n C-left prev + +#next pane +bind-key -n C-right next +bind-key -n C-down next + +############################################################################ +# windows +############################################################################ +set-window-option -g window-status-current-bg red +bind C-j previous-window +bind C-k next-window +bind-key C-a last-window # C-a C-a for last active window +bind A command-prompt "rename-window %%" +# By default, all windows in a session are constrained to the size of the +# smallest client connected to that session, +# even if both clients are looking at different windows. +# It seems that in this particular case, Screen has the better default +# where a window is only constrained in size if a smaller client +# is actively looking at it. +setw -g aggressive-resize on + +############################################################################ +# panes +############################################################################ +# Navigation --------------------------------------------------------------- +# use the vim motion keys to move between panes +bind-key h select-pane -L +bind-key j select-pane -D +bind-key k select-pane -U +bind-key l select-pane -R + +# Resizing --------------------------------------------------------------- +bind-key C-h resize-pane -L +bind-key C-j resize-pane -D +bind-key C-k resize-pane -U +bind-key C-l resize-pane -R + +# use vim motion keys while in copy mode +setw -g mode-keys vi + +############################################################################ +# layouts +############################################################################ +bind o select-layout "active-only" +bind M-- select-layout "even-vertical" +bind M-| select-layout "even-horizontal" +bind M-r rotate-window + + +# focus on first window +# select-window -t 0 diff --git a/.urlview b/.urlview @@ -0,0 +1,29 @@ +############################################################################### +# Urlview configuration file. +# man urlview <Man page> +# +# Put this file in: $HOME/.urlview +# Put url_handler.sh in: /usr/bin +# +# You can call 'urlview' while in 'mutt' by pressing the Ctrl b keys. +# Put these macros in your $HOME/.muttrc file. +# +# macro index \cb |urlview\n +# macro pager \cb |urlview\n +# +# You can call 'urlview' while in 'tin' by pressing | then a for article, +# put urlview as the pipe command. +# +# Regular expression to use to match URLs. + +#REGEXP (((http|https|ftp|gopher)|mailto):(//)?[^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] +REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):] + +# Command to invoke for selected URL. Use lynx, netscape, or url_handler.sh +# shell script. Alternatively, you can leave COMMAND unset and set the BROWSER +# environment variable instead. + +#COMMAND lynx %s +#COMMAND netscape -remote 'openURL(%s)' +COMMAND webview + diff --git a/.vimrc b/.vimrc @@ -0,0 +1,235 @@ +" Load Pathogen for plugins: + execute pathogen#infect() + execute pathogen#helptags() + +" Some basics: + set nocompatible + filetype plugin on + "colorscheme wal + syntax on + set encoding=utf-8 + set number + set relativenumber + +"au BufWinLeave * mkview +"au BufWinEnter * silent loadview +let g:instant_markdown_autostart = 0 + +let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} "Interpret .md files, etc. as .markdown + +"Make calcurse notes markdown compatible: + autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown + +"Spell-check set to F6: + map <F6> :setlocal spell! spelllang=en_us,es<CR> + +"Toggle DeadKeys set to F7 (for accent marks): + so ~/.vim/luke/deadkeys.vim + nm <F7> :call ToggleDeadKeys()<CR> + +"Goyo plugin makes text more readable when writing prose: + map <F10> :Goyo<CR> + inoremap <F10> <esc>:Goyo<CR>a + +"Enable Goyo by default for mutt writting + autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=72 + autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo + +"Enable autocompletion: + set wildmode=longest,list,full + set wildmenu + +"Automatically deletes all tralling whitespace on save. + autocmd BufWritePre * %s/\s\+$//e + +"When shortcut files are updated, renew bash and ranger configs with new +"material: + autocmd BufWritePost ~/.config/Scripts/folders,~/.config/Scripts/configs !bash ~/.config/Scripts/shortcuts.sh + +" Runs a script that cleans out tex build files whenever I close out of a .tex file. + autocmd VimLeave *.tex !texclear + +" Use urlview to choose and open a url: + :noremap <leader>u :w<Home>silent <End> !urlview<CR> + +"Copy selected text to system clipboard (requires gvim installed): + vnoremap <C-c> "+y + +"C-T for new tab + nnoremap <C-t> :tabnew<cr> + +"""BASIC TOOLS +"Navigating with guides + inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l + vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l + map <Space><Tab> <Esc>/<++><Enter>"_c4l + inoremap ;gui <++> +"For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) + inoremap jw <Esc> + inoremap wj <Esc> +"Shortcutting split navigation, saving a keypress: + map <C-h> <C-w>h + map <C-j> <C-w>j + map <C-k> <C-w>k + map <C-l> <C-w>l + +"Replace all is aliased to S. Visual mode shortcut doesn't work yet for some +"reason... + nnoremap S :%s//g<Left><Left> + vnoremap S noop + vnoremap S :s//g<Left><Left> + +"""LATEX + " Word count: + autocmd FileType tex map <F3> :w !detex \| wc -w<CR> + autocmd FileType tex inoremap <F3> <Esc>:w !detex \| wc -w<CR> + " Compile document using xelatex: + autocmd FileType tex inoremap <F5> <Esc>:!xelatex<spacE><c-r>%<Enter>a + autocmd FileType tex nnoremap <F5> :!xelatex<spacE><c-r>%<Enter> + " Code snippets + autocmd FileType tex inoremap ;fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i + autocmd FileType tex inoremap ;fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA + autocmd FileType tex inoremap ;exe \begin{exe}<Enter>\ex<Space><Enter>\end{exe}<Enter><Enter><++><Esc>3kA + autocmd FileType tex inoremap ;em \emph{}<++><Esc>T{i + autocmd FileType tex inoremap ;bf \textbf{}<++><Esc>T{i + autocmd FileType tex vnoremap ; <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a + "autocmd FileType tex vnoremap : <ESC>`<i{\<ESC>`>2la}<ESC>?{\\<Enter>la + autocmd FileType tex inoremap {{ <Esc>F{i + autocmd FileType tex inoremap }} <Esc>f}a + autocmd FileType tex inoremap ;it \textit{}<++><Esc>T{i + autocmd FileType tex inoremap ;ct \textcite{}<++><Esc>T{i + autocmd FileType tex inoremap ;cp \parencite{}<++><Esc>T{i + autocmd FileType tex inoremap ;glos {\gll<Space><++><Space>\\<Enter><++><Space>\\<Enter>\trans{``<++>''}}<Esc>2k2bcw + autocmd FileType tex inoremap ;x \begin{xlist}<Enter>\ex<Space><Enter>\end{xlist}<Esc>kA<Space> + autocmd FileType tex inoremap ;ol \begin{enumerate}<Enter><Enter>\end{enumerate}<Enter><Enter><++><Esc>3kA\item<Space> + autocmd FileType tex inoremap ;ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space> + autocmd FileType tex inoremap ;li <Enter>\item<Space> + autocmd FileType tex inoremap ;ref \ref{}<Space><++><Esc>T{i + autocmd FileType tex inoremap ;tab \begin{tabular}<Enter><++><Enter>\end{tabular}<Enter><Enter><++><Esc>4kA{}<Esc>i + autocmd FileType tex inoremap ;ot \begin{tableau}<Enter>\inp{<++>}<Tab>\const{<++>}<Tab><++><Enter><++><Enter>\end{tableau}<Enter><Enter><++><Esc>5kA{}<Esc>i + autocmd FileType tex inoremap ;can \cand{}<Tab><++><Esc>T{i + autocmd FileType tex inoremap ;con \const{}<Tab><++><Esc>T{i + autocmd FileType tex inoremap ;v \vio{}<Tab><++><Esc>T{i + autocmd FileType tex inoremap ;a \href{}{<++>}<Space><++><Esc>2T{i + autocmd FileType tex inoremap ;sc \textsc{}<Space><++><Esc>T{i + autocmd FileType tex inoremap ;chap \chapter{}<Enter><Enter><++><Esc>2kf}i + autocmd FileType tex inoremap ;sec \section{}<Enter><Enter><++><Esc>2kf}i + autocmd FileType tex inoremap ;ssec \subsection{}<Enter><Enter><++><Esc>2kf}i + autocmd FileType tex inoremap ;sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i + autocmd FileType tex inoremap ;st <Esc>F{i*<Esc>f}i + autocmd FileType tex inoremap ;beg \begin{DELRN}<Enter><++><Enter>\end{DELRN}<Enter><Enter><++><Esc>4k0fR:MultipleCursorsFind<Space>DELRN<Enter>c + autocmd FileType tex inoremap ;up <Esc>/usepackage<Enter>o\usepackage{}<Esc>i + autocmd FileType tex nnoremap ;up /usepackage<Enter>o\usepackage{}<Esc>i + autocmd FileType tex inoremap ;tt \texttt{}<Space><++><Esc>T{i + autocmd FileType tex inoremap ;bt {\blindtext} + autocmd FileType tex inoremap ;nu $\varnothing$ + autocmd FileType tex inoremap ;col \begin{columns}[T]<Enter>\begin{column}{.5\textwidth}<Enter><Enter>\end{column}<Enter>\begin{column}{.5\textwidth}<Enter><++><Enter>\end{column}<Enter>\end{columns}<Esc>5kA + autocmd FileType tex inoremap ;rn (\ref{})<++><Esc>F}i + +"""LATEX Logical symbols + autocmd FileType tex inoremap ;m $$<Space><++><Esc>2T$i + autocmd FileType tex inoremap ;M $$$$<Enter><Enter><++><Esc>2k$hi + autocmd FileType tex inoremap ;neg {\neg} + autocmd FileType tex inoremap ;V {\vee} + autocmd FileType tex inoremap ;or {\vee} + autocmd FileType tex inoremap ;L {\wedge} + autocmd FileType tex inoremap ;and {\wedge} + autocmd FileType tex inoremap ;ra {\rightarrow} + autocmd FileType tex inoremap ;la {\leftarrow} + autocmd FileType tex inoremap ;lra {\leftrightarrow} + autocmd FileType tex inoremap ;fa {\forall} + autocmd FileType tex inoremap ;ex {\exists} + autocmd FileType tex inoremap ;dia {\Diamond} + autocmd FileType tex inoremap ;box {\Box} + autocmd FileType tex inoremap ;gt {\textgreater} + autocmd FileType tex inoremap ;lt {\textless} +"""LaTeX Linguistics Shortcuts + autocmd Filetype tex inoremap ;nom {\textsc{nom}} + autocmd FileType tex inoremap ;acc {\textsc{acc}} + autocmd FileType tex inoremap ;dat {\textsc{dat}} + autocmd FileType tex inoremap ;gen {\textsc{gen}} + autocmd FileType tex inoremap ;abl {\textsc{abl}} + autocmd FileType tex inoremap ;voc {\textsc{voc}} + autocmd FileType tex inoremap ;loc {\textsc{loc}} + autocmd Filetype tex inoremap ;inst {\textsc{inst}} + autocmd FileType tex inoremap ;tipa \textipa{}<Space><++><Esc>T{i + +"For Indo-European +"autocmd FileType tex inoremap ;dh d\textsuperscript{h} +"autocmd FileType tex inoremap ;bh b\textsuperscript{h} +"autocmd FileType tex inoremap ;gh g\textsuperscript{h} +"autocmd FileType tex inoremap ;gwh g\textsuperscript{hw} +"autocmd FileType tex inoremap ;kw k\textsuperscript{w} +"autocmd FileType tex inoremap ;gw g\textsuperscript{w} +"autocmd FileType tex inoremap ;h1 {h\textsubscript{1}} +"autocmd FileType tex inoremap ;h2 {h\textsubscript{2}} +"autocmd FileType tex inoremap ;h3 {h\textsubscript{3}} +"autocmd FileType tex inoremap ;h4 {h\textsubscript{4}} + + +"""PHP +autocmd FileType php,html inoremap ;b <b></b><Space><++><Esc>FbT>i +autocmd FileType php,html inoremap ;i <em></em><Space><++><Esc>FeT>i +autocmd FileType php,html inoremap ;h1 <h1></h1><Enter><Enter><++><Esc>2kf<i +autocmd FileType php,html inoremap ;h2 <h2></h2><Enter><Enter><++><Esc>2kf<i +autocmd FileType php,html inoremap ;h3 <h3></h3><Enter><Enter><++><Esc>2kf<i +autocmd FileType php,html inoremap ;p <p></p><Enter><Enter><++><Esc>02kf>a +autocmd FileType php,html inoremap ;a <a<Space>href=""><++></a><Space><++><Esc>14hi +autocmd FileType php,html inoremap ;e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi +autocmd FileType php,html inoremap ;ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i +autocmd FileType php,html inoremap ;li <Esc>o<li></li><Esc>F>a +autocmd FileType php,html inoremap ;ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i +autocmd FileType php,html inoremap ;im <table<Space>class="image"><Enter><caption align="bottom"></caption><Enter><tr><td><a<space>href="pix/<++>"><img<Space>src="pix/<++>"<Space>width="<++>"></a></td></tr><Enter></table><Enter><Enter><++><Esc>4kf>a +autocmd FileType php,html inoremap ;td <td></td><++><Esc>Fdcit +autocmd FileType php,html inoremap ;tr <tr></tr><Enter><++><Esc>kf<i +autocmd FileType php,html inoremap ;th <th></th><++><Esc>Fhcit +autocmd FileType php,html inoremap ;tab <table><Enter></table><Esc>O +autocmd FileType php,html inoremap ;gr <font color="green"></font><Esc>F>a +autocmd FileType php,html inoremap ;rd <font color="red"></font><Esc>F>a +autocmd FileType php,html inoremap ;yl <font color="yellow"></font><Esc>F>a +autocmd FileType php,html inoremap ;dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit +autocmd FileType php,html inoremap ;dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc +"autocmd FileType php,html inoremap -- &ndash; +"autocmd FileType php,html inoremap --- &mdash; + + +""".bib +autocmd FileType bib inoremap ;a @article{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>journal<Space>=<Space>"<++>",<Enter>volume<Space>=<Space>"<++>",<Enter>pages<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i +autocmd FileType bib inoremap ;b @book{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>6kA,<Esc>i +autocmd FileType bib inoremap ;c @incollection{<Enter>author<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>booktitle<Space>=<Space>"<++>",<Enter>editor<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i + +"MARKDOWN + autocmd Filetype markdown,rmd inoremap ;n ---<Enter><Enter> + autocmd Filetype markdown,rmd inoremap ;b ****<++><Esc>F*hi + autocmd Filetype markdown,rmd inoremap ;s ~~~~<++><Esc>F~hi + autocmd Filetype markdown,rmd inoremap ;e **<++><Esc>F*i + autocmd Filetype markdown,rmd inoremap ;h ====<Space><++><Esc>F=hi + autocmd Filetype markdown,rmd inoremap ;i ![](<++>)<++><Esc>F[a + autocmd Filetype markdown,rmd inoremap ;a [](<++>)<++><Esc>F[a + autocmd Filetype markdown,rmd inoremap ;1 #<Space><Enter><++><Esc>kA + autocmd Filetype markdown,rmd inoremap ;2 ##<Space><Enter><++><Esc>kA + autocmd Filetype markdown,rmd inoremap ;3 ###<Space><Enter><++><Esc>kA + autocmd Filetype markdown,rmd inoremap ;l --------<Enter> + autocmd Filetype markdown map <F5> :!pandoc<space><C-r>%<space>-o<space><C-r>%.pdf<Enter><Enter> + autocmd Filetype rmd map <F5> :!echo<space>"require(rmarkdown);<space>render('<c-r>%')"<space>\|<space>R<space>--vanilla<enter> + autocmd Filetype rmd inoremap ;r ```{r,<space>echo=TRUE}<CR>```<CR><CR><esc>2kO + +""".xml +"autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><++></description><Enter></item> +autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>5kcit +autocmd FileType xml inoremap ;a <a href="<++>"><++></a><++><Esc>F"ci" + +"Insert the time: + noremap ;time :put<Space>=strftime('%c')<Enter> + inoremap ;time <esc>:put<Space>=strftime('%c')<Enter> + + +vmap <expr> ++ VMATH_YankAndAnalyse() +nmap ++ vip++ + +vnoremap K xkP`[V`] +vnoremap J xp`[V`] +vnoremap L >gv +vnoremap H <gv + +so ~/.vim/luke/ipa.vim diff --git a/.xinitrc b/.xinitrc @@ -0,0 +1 @@ +exec i3 diff --git a/LICENSE.md b/LICENSE.md @@ -0,0 +1,3 @@ +# License + +GPLv3 diff --git a/README.md b/README.md @@ -1,2 +1,52 @@ -# voidrice -My dotfiles for my Void Linux rice +# Luke's GNU/Linux Rice + +![pic](pic.jpg) + +There are my dotfiles! The name of the repo, "voidrice", came from the fact they were originally on my Void Linux machine, but these files are distro-independent. In fact, I now push changes from my X200 running Parabola or my X220 running Arch. + +## Programs whose configs can be found here + ++ i3 (i3-gaps) ++ urxvt (rxvt-unicode) (although these files us [my st build](https://github.com/lukesmithxyz/st) as the default terminal) ++ vim ++ bash ++ ranger ++ qutebrowser ++ mutt/msmtp/offlineimap (For offline syncing of email, with configs easy to change to a gmail account) ++ calcurse ++ ncmpcpp and mpd (my main music player) ++ Music on Console (moc and mocp as an alternative music player) ++ mpv ++ neofetch ++ compton (For transparency and to stop screen tearing) ++ And many little scripts I use + +## More documentation + +Check other config folders for more specific documentation. For example [config contains documentation on how to set up mutt with your email account. + +[i3 guide and config](.config/i3/i3_guide.md) + +[Email configuration](.config/mutt/email.md) + +[ranger configuration](.config/ranger/luke_ranger_readme.md) + +## Dynamic Configuration Files + +Store your favorite or high-traffic folders in `~/.config/Scripts/folders` or your most important config files in `~/.config/Scripts/configs` with keyboard shortcuts. When you add things to theses files my vimrc will automatically run `~/.config/Scripts/shortcuts.sh` which will dynamically generate shortcuts for these in bash, ranger and qutebrowser! + +Check out more info at the main repo for this: [shortcut-sync](https://github.com/lukesmithxyz/shortcut-sync). You will really want to take advantage of this for an extremely efficient setup! + +## Like my rice? + +Feel free to add other suggestions and I may implement them. + +I have a job, but every penny I get from followers or subscribers is more incentive to perfect what I'm doing. You can donate to me at [https://paypal.me/LukeMSmith](https://paypal.me/LukeMSmith). Donations are earmarked for whatever the donator wants, usually to go to funds for buying new equipment for the [YouTube channel](https://youtube.com/c/LukeSmithxyz). + +# Programs Used + ++ i3-gaps, NetworkManager,compton ++ Terminal apps -- ranger, ncmpcpp, mpd, htop, weechat, neomutt, calcurse, newsbeuter, transmission-remote-cli, w3m, youtube-dl, ffmpeg, scrot ++ Background stuff -- mpd, transmission ++ Lightweight non-terminal apps -- mupdf, feh, rofi, network manager applet, arandr, mpv ++ Big business programs -- qutebrowser, GIMP, Blender diff --git a/pic.jpg b/pic.jpg Binary files differ.