diff --git a/.Renviron b/.Renviron new file mode 100644 index 0000000..f43bae9 --- /dev/null +++ b/.Renviron @@ -0,0 +1,2 @@ + +R_LIBS_USER = ~/.R/library diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 0000000..c28339c --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +options(repos=structure(c(CRAN="http://cran.revolutionanalytics.com/"))) diff --git a/.Xdefaults b/.Xdefaults new file mode 100644 index 0000000..78c5235 --- /dev/null +++ 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 new file mode 100644 index 0000000..5bf53be --- /dev/null +++ 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 new file mode 100644 index 0000000..bc8cbbb --- /dev/null +++ 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 new file mode 100644 index 0000000..e829390 --- /dev/null +++ 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 new file mode 100644 index 0000000..f188702 --- /dev/null +++ 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 new file mode 100755 index 0000000..cda07a2 --- /dev/null +++ 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 new file mode 100755 index 0000000..21e46ea --- /dev/null +++ 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 new file mode 100755 index 0000000..af13a73 --- /dev/null +++ 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 new file mode 100644 index 0000000..1548730 --- /dev/null +++ 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 new file mode 100755 index 0000000..aaf2911 --- /dev/null +++ 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 new file mode 100644 index 0000000..91d6416 --- /dev/null +++ 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 new file mode 100644 index 0000000..850623c --- /dev/null +++ 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 new file mode 100755 index 0000000..fea76fc --- /dev/null +++ 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 new file mode 100755 index 0000000..18daf3d --- /dev/null +++ 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 new file mode 100644 index 0000000..aa5a5f2 --- /dev/null +++ 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 new file mode 100644 index 0000000..cc89a96 --- /dev/null +++ b/.config/Scripts/resize-font @@ -0,0 +1,169 @@ +# vim:ft=perl:fenc=utf-8 +# Copyright (c) 2009-, Simon Lundström +# Copyright (c) 2014 Maarten de Vries +# +# 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 new file mode 100755 index 0000000..03a8e79 --- /dev/null +++ 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 new file mode 100755 index 0000000..95c1d5d --- /dev/null +++ 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 new file mode 100755 index 0000000..bb1b5b5 --- /dev/null +++ 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 new file mode 100755 index 0000000..0976e5f --- /dev/null +++ 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 new file mode 100755 index 0000000..ba3a4f6 --- /dev/null +++ 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 new file mode 100755 index 0000000..794f6bb --- /dev/null +++ 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 new file mode 100755 index 0000000..ac3dc5c --- /dev/null +++ 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 new file mode 100755 index 0000000..17462fc --- /dev/null +++ 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 new file mode 100755 index 0000000..2e33713 --- /dev/null +++ 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 new file mode 100644 index 0000000..8ad5733 --- /dev/null +++ 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 new file mode 100755 index 0000000..b5e3872 --- /dev/null +++ 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 new file mode 100755 index 0000000..2360968 --- /dev/null +++ b/.config/fontconfig/fonts.conf @@ -0,0 +1,24 @@ + + + + + + serif + Tinos + + + sans-serif + Arimo + + + sans + Arimo + + + monospace + Tamzen + + + + + diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..9f4d1f2 --- /dev/null +++ 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 new file mode 100644 index 0000000..bd663f4 --- /dev/null +++ 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 new file mode 100755 index 0000000..f492de0 --- /dev/null +++ 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 new file mode 100644 index 0000000..cd8b228 Binary files /dev/null and b/.config/i3/lock.png differ diff --git a/.config/i3/lock.sh b/.config/i3/lock.sh new file mode 100755 index 0000000..6537bef --- /dev/null +++ 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 new file mode 100644 index 0000000..d450b3d --- /dev/null +++ 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 new file mode 100644 index 0000000..d558392 --- /dev/null +++ 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 new file mode 100644 index 0000000..77f0141 --- /dev/null +++ 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 new file mode 100755 index 0000000..561ccec --- /dev/null +++ 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 new file mode 100644 index 0000000..560ea97 --- /dev/null +++ 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 new file mode 100644 index 0000000..0a9b5fd --- /dev/null +++ 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 new file mode 100644 index 0000000..86a2029 --- /dev/null +++ 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 new file mode 100644 index 0000000..a7504fd --- /dev/null +++ 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 new file mode 100644 index 0000000..c86573a --- /dev/null +++ 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 "=INBOX" "Go to inbox" +macro index ga "=[Gmail].All Mail" "Go to all mail" +macro index gs "=[Gmail].Sent Mail" "Go to sent mail" +macro index gS "=[Gmail].Spam" "Go to spam" +macro index gt "=[Gmail].Trash" "Go to trash" +macro index gd "=[Gmail].Drafts" "Go to drafts" +macro index gl "=lingcircle" "Go to lingcircle" +macro index gr "=ugaroml" "Go to ugaroml" diff --git a/.config/mutt/mailcap b/.config/mutt/mailcap new file mode 100644 index 0000000..0e8631e --- /dev/null +++ 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 new file mode 100644 index 0000000..e9d6def --- /dev/null +++ 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]>" # +#color body brightwhite default "<[Bb][Gg]>" # +#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 new file mode 100755 index 0000000..b67de83 --- /dev/null +++ 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 new file mode 100644 index 0000000..8341228 --- /dev/null +++ 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 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 "set pipe_decode = yesurlviewset pipe_decode = no""view URLs" diff --git a/.config/mutt/personalrc b/.config/mutt/personalrc new file mode 100644 index 0000000..a372456 --- /dev/null +++ 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 "=INBOX" "Go to inbox" +macro index gs "=INBOX.Sent" "Go to sent" +macro index gd "=INBOX.Drafts" "Go to drafts" +macro index gj "=INBOX.Junk" "Go to junk" +macro index gt "=INBOX.Trash" "Go to trash" diff --git a/.config/neofetch/config b/.config/neofetch/config new file mode 100755 index 0000000..ece8c0b --- /dev/null +++ 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 new file mode 100644 index 0000000..7b1290e --- /dev/null +++ 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 = +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 = +# +# + +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 =