-** XDG
-:PROPERTIES:
-:header-args+: :tangle ~/.config/user-dirs.dirs
-:END:
-
-#+begin_src conf
-XDG_DESKTOP_DIR="$HOME/Desktop"
-XDG_DOCUMENTS_DIR="$HOME/usr/docs"
-XDG_DOWNLOAD_DIR="$HOME/usr/dls"
-XDG_MUSIC_DIR="$HOME/usr/music"
-XDG_PICTURES_DIR="$HOME/usr/pics"
-XDG_PUBLICSHARE_DIR="$HOME/usr/Public"
-XDG_TEMPLATES_DIR="$HOME/usr/Templates"
-XDG_VIDEOS_DIR="$HOME/usr/vids"
-#+end_src
-
-** Zathura
-:PROPERTIES:
-:header-args+: :tangle ~/.config/zathura/zathurarc
-:END:
-
-#+begin_src conf
-set smooth-scroll true
-set selection-clipboard clipboard
-set zoom-step 05
-set default-bg "#272727"
-set statusbar-bg "#272727"
-set inputbar-bg "#373737"
-#+end_src
-
-** Zsh
-
-My zsh setup is built on [[https://github.com/zimfw/zimfw][Zim]]. Further, my zshrc references [[https://github.com/junegunn/fzf][fzf]],
-[[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]], and [[https://github.com/hlissner/zsh-autopair][zsh-autopair]]; so be sure to have them
-installed.
-
-*** zimrc
-:PROPERTIES:
-:header-args+: :tangle ~/.zimrc
-:END:
-
-#+begin_src sh
-#################
-# CORE SETTINGS #
-#################
-
-#
-# Zim settings
-#
-
-# Select what modules you would like enabled.
-# The second line of modules may depend on options set by modules in the first
-# line. These dependencies are noted on the respective module's README.md.
-zmodules=(directory environment git git-info history input ssh utility custom \
- syntax-highlighting history-substring-search prompt completion)
-
-
-###################
-# MODULE SETTINGS #
-###################
-
-#
-# Prompt
-#
-
-# Set your desired prompt here
-zprompt_theme='pure'
-#PURE_PROMPT_SYMBOL=λ
-#PURE_PROMPT_SYMBOL=δ
-PURE_PROMPT_SYMBOL=➜
-
-#
-# Completion
-#
-
-# set an optional host-specific filename for the completion cache file
-# if none is provided, the default '.zcompdump' is used.
-#zcompdump_file=".zcompdump-${HOST}-${ZSH_VERSION}"
-
-#
-# Utility
-#
-
-# Uncomment to enable command correction prompts
-# See: http://zsh.sourceforge.net/Doc/Release/Options.html#Input_002fOutput
-setopt CORRECT
-
-#
-# Environment
-#
-
-# Set the string below to the desired terminal title format string.
-# The terminal title is redrawn upon directory change, however, variables like
-# ${PWD} are only evaluated once. Use prompt expansion strings for dynamic data:
-# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
-# The example below uses the following format: 'username@host:/current/directory'
-ztermtitle='%n@%m:%~'
-
-#
-# Input
-#
-
-# Uncomment to enable double-dot expansion.
-# This appends '../' to your input for each '.' you type after an initial '..'
-#zdouble_dot_expand='true'
-
-#
-# Syntax-Highlighting
-#
-
-# This determines what highlighters will be used with the syntax-highlighting module.
-# Documentation of the highlighters can be found here:
-# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
-# For (u)rxvt, termite and gnome-terminal users,
-# removing the 'cursor' highlighter will fix the disappearing cursor problem
-#zhighlighters=(main brackets cursor)
-zhighlighters=(main brackets pattern)
-
-#
-# SSH
-#
-
-# Load these ssh identities with the ssh module
-zssh_ids=(id_ed25519_bandali)
-
-#
-# Pacman
-#
-
-# Set (optional) pacman front-end.
-zpacman_frontend='yay'
-
-# Load any helper scripts as defined here
-#zpacman_helper=(aur)
-
-
-#+end_src
-
-*** zlogin
-:PROPERTIES:
-:header-args+: :tangle ~/.zlogin
-:END:
-
-#+begin_src sh
-#
-# User configuration sourced by login shells
-#
-
-# Initialize zim
-[[ -s ${ZIM_HOME}/login_init.zsh ]] && source ${ZIM_HOME}/login_init.zsh
-
-#+end_src
-
-*** zprofile
-:PROPERTIES:
-:header-args+: :tangle ~/.zprofile
-:END:
-
-#+begin_src sh
-#PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
-#PATH=$HOME/.gem/ruby/2.4.0/bin:$PATH
-export PATH=$HOME/.local/bin:$HOME/.cabal/bin:$HOME/.cargo/bin:$HOME/.elan/bin:$PATH
-export XDG_CONFIG_HOME=$HOME/.config
-export XDG_DATA_HOME=$HOME/.local/share
-export XDG_DATA_DIRS=/usr/local/share:/usr/share
-export MAILDIR="$HOME/mail"
-export CVS_RSH=ssh
-#export MATHMODELS=$HOME/src/eiffel/mathmodels
-#export RUST_SRC_PATH=~/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src
-#export PATH=$PATH:$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/
-
-# Eiffel2Java stuff
-#export JAVA_HOME=/usr/lib/jvm/default
-#export CPATH=$CPATH:"$JAVA_HOME/include:$JAVA_HOME/include/linux"
-#export LIBRARY_PATH=$LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
-#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$JAVA_HOME/jre/lib/amd64/server"
-
-#export PATH="$HOME/usr/build/pvs:$PATH"
-#export SBCLISP_HOME=/usr/share/sbcl-source
-#export PVS_LIBRARY_PATH="$HOME/usr/build/pvs/nasalib"
-
-export MOZ_USE_XINPUT2=1 # precise scrolling in firefox
-
-#export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
-#export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
-
-export NIXPKGS=$HOME/src/git/nixpkgs
-
-if [ -e /home/amin/.nix-profile/etc/profile.d/nix.sh ]; then . /home/amin/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
-
-export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
-export PATH="/$HOME/.config/guix/current/bin${PATH:+:}$PATH"
-export SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
-export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
-export GIT_SSL_CAINFO="$SSL_CERT_FILE"
-#+end_src
-
-*** zshenv
-:PROPERTIES:
-:header-args+: :tangle ~/.zshenv
-:END:
-
-#+begin_src sh
-# Ensure that a non-login, non-interactive shell has a defined environment.
-if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
- source "${ZDOTDIR:-$HOME}/.zprofile"
-fi
-#+end_src
-
-*** zshrc
-:PROPERTIES:
-:header-args+: :tangle ~/.zshrc
-:END:
-
-#+begin_src sh
-# Bash-like navigation
-#export WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
-#export WORDCHARS='*?-[]~=&;!#$%^(){}<>'
-export WORDCHARS='*?[]~=&;!#$%^(){}<>'
-#ZLE_SPACE_SUFFIX_CHARS=$'|&'
-
-#disable -r time # disable shell reserved word
-#alias time='time -p' # -p for POSIX output
-
-# rehash if last command was pacaur or pacman
-# (so that zsh picks up changes in $PATH immediately)
-TRAPUSR1() { rehash}; precmd() { [[ $history[$[ HISTCMD -1 ]] == *(pacaur|pacman)* ]] && killall -USR1 zsh }
-
-#
-# User configuration sourced by interactive shells
-#
-
-# Define zim location
-export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
-
-# Start zim
-[[ -s ${ZIM_HOME}/init.zsh ]] && source ${ZIM_HOME}/init.zsh
-
-ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
-#ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red,bold'
-
-setopt globdots
-
-source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
-# source ~/.zsh/zsh-autopair/autopair.zsh
-
-
-### fzf ###
-
-source /usr/share/fzf/key-bindings.zsh
-source /usr/share/fzf/completion.zsh
-
-# Accept history selection instead of putting it on
-# the command line
-fzf-history-widget-accept() {
- fzf-history-widget
- zle accept-line
-}
-#zle -N fzf-history-widget-accept
-#bindkey '^R' fzf-history-widget-accept
-
-# alt+c preview
-export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
-
-### fzf ###
-
-
-# aliases
-alias mpv="mpv --ytdl-format mp4"
-alias mv="mv -iv"
-alias cp="cp -iv"
-alias scl=systemctl
-alias jcl=journalctl
-alias m="mbsync uwaterloo; mbsync amin"
-alias best="youtube-dl -f best"
-alias sd="ssh deb"
-alias sf="ssh fp"
-alias sn="ssh nix"
-
-aur() {
- cd ~/usr/build
- git clone https://aur.archlinux.org/${1}.git
- cd ${1}
-}
-
-# i-beam cursor
-echo -e "\033[5 q"
-#echo -e "\033[6 q"
-
-#+end_src
-
-* Scripts
-
-This section contains various useful scripts and the ones used by the
-programs above. For instance, =toggle-tablet= for switching to and
-from tablet mode on my X220T, =toggle-presentation-mode= for toggling
-Xfce's presentation mode which keeps the screen awake, and
-=rofi-light= a small utility that uses [[https://github.com/DaveDavenport/rofi][Rofi]] to ask and [[https://github.com/haikarainen/light][light]] to set an
-exact brightness value.
-
-** battery-percentage-time
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/battery-percentage-time :shebang "#!/bin/sh"
-:END:
-
-#+begin_src sh :tangle no
-dbus_send() {
- label=$1
- dbus-send --print-reply=literal --system \
- --dest=org.freedesktop.UPower \
- /org/freedesktop/UPower/devices/battery_BAT0 \
- org.freedesktop.DBus.Properties.Get \
- string:org.freedesktop.UPower.Device \
- string:"${label}" | awk '{print $3}'
-}
-
-perc=$(dbus_send 'Percentage')
-state=$(dbus_send 'State')
-
-if [ "$state" -eq 2 ]; then # Discharging
- secs=$(dbus_send 'TimeToEmpty')
-elif [ "$state" -eq 1 ]; then # Charging
- secs=$(dbus_send 'TimeToFull')
-fi
-
-printf '%s%%%%%2dh%02dm \n' "$perc" $((secs / 3600)) $((secs % 3600 / 60))
-#+end_src
-
-** my-i3status.py
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/my-i3status.py :shebang "#!/usr/bin/env python2"
-:END:
-
-#+begin_src python :comments none
-# -*- coding: utf-8 -*-
-
-# This script is a simple wrapper which prefixes each i3status line with custom
-# information. It is based on:
-# https://github.com/i3/i3status/blob/master/contrib/wrapper.py
-#
-# In ~/.i3status.conf, add the following line:
-# output_format = "i3bar"
-# in the 'general' section.
-# Then, in ~/.config/i3/config or ~/.config/sway/config add:
-# status_command i3status | my-i3status.py
-# in the 'bar' section. Make sure my-i3status.py is in $PATH.
-#
-# © 2012 Valentin Haenel <valentin.haenel@gmx.de>
-# © 2018 Amin Bandali <bandali@gnu.org>
-#
-# This program is free software. It comes without any warranty, to the extent
-# permitted by applicable law. You can redistribute it and/or modify it under
-# the terms of the Do What The Fuck You Want To Public License (WTFPL), Version
-# 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
-# details.
-
-import sys
-import json
-import os
-
-def get_nosleep():
- """ Return true if ~/.nosleep exists. """
- return os.path.isfile(os.path.expanduser("~/.nosleep"))
-
-def print_line(message):
- """ Non-buffered printing to stdout. """
- sys.stdout.write(message + '\n')
- sys.stdout.flush()
-
-def read_line():
- """ Interrupted respecting reader for stdin. """
- # try reading a line, removing any extra whitespace
- try:
- line = sys.stdin.readline().strip()
- # i3status sends EOF, or an empty line
- if not line:
- sys.exit(3)
- return line
- # exit on ctrl-c
- except KeyboardInterrupt:
- sys.exit()
-
-if __name__ == '__main__':
- # Skip the first line which contains the version header.
- print_line(read_line())
-
- # The second line contains the start of the infinite array.
- print_line(read_line())
-
- while True:
- line, prefix = read_line(), ''
- # ignore comma at start of lines
- if line.startswith(','):
- line, prefix = line[1:], ','
-
- if get_nosleep():
- j = json.loads(line)
- # insert information into the start of the json, but could be anywhere
- j.insert(0, {'full_text' : '🖵 ', 'name' : 'nosleep'})
- # and echo back new encoded json
- print_line(prefix+json.dumps(j))
- else:
- print_line(prefix+line)
-#+end_src
-
-** rofi-light
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/rofi-light :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash
-cur=$(light -G)
-val=$(rofi -dmenu -mesg "light $cur" -p "light -S " -l 0 -width 12)
-[ -n "$val" ] && light -S $val
-#+end_src
-
-** rofi-remmina.py
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/rofi-remmina.py :shebang "#!/usr/bin/env python2"
-:END:
-
-#+begin_src python
-import ConfigParser
-import os
-from subprocess import Popen, PIPE
-
-remmina_dir = os.path.expanduser("~/.local/share/remmina")
-
-fdict = dict()
-
-for f in os.listdir(remmina_dir):
- fp = os.path.join(remmina_dir, f)
- c = ConfigParser.ConfigParser()
- c.read(fp)
- n = c.get('remmina', 'name')
- fdict[n] = fp
-
-lines = max(min(15, len(fdict)), 1);
-width = len(max(fdict.keys(), key=len))
-rofi = Popen(["rofi", "-i", "-dmenu", \
- "-l", str(lines), "-width", str(width), \
- "-p", "connection"], stdout=PIPE, stdin=PIPE)
-selected = rofi.communicate("\n" \
- .join(fdict.keys()) \
- .encode("utf-8"))[0] \
- .decode("utf-8") \
- .strip()
-rofi.wait()
-
-r = Popen(["remmina", "-c", fdict[selected]])
-r.wait()
-#+end_src
-
-** s (run sway)
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/s :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash
-export _JAVA_AWT_WM_NONREPARENTING=1
-export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
-light -Nr 2
-source $HOME/.zprofile
-sway
-#+end_src
-
-** sway-ws-util
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/sway-ws-util :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash
-curr_ws=$(swaymsg -t get_workspaces | jq -r '.[] | select(.focused==true).name')
-[[ $curr_ws -eq 1 ]] && prev_ws=10 || prev_ws=$((curr_ws-1))
-[[ $curr_ws -eq 10 ]] && next_ws=1 || next_ws=$((curr_ws+1))
-dest_ws=-1
-op=-1
-
-if [ "$1" = "switch" ] || [ "$1" = "move" ]; then
- op="$1"
- if [ "$2" = "prev" ]; then
- dest_ws="$prev_ws"
- elif [ "$2" = "next" ]; then
- dest_ws="$next_ws"
- else
- echo "Usage: $0 $1 {prev|next} [follow]"
- exit 1
- fi
-else
- echo "Usage: $0 {switch|move} {prev|next} [follow]"
- exit 1
-fi
-
-if [ "$op" = "switch" ]; then
- sway workspace "$dest_ws"
-elif [ "$op" = "move" ]; then
- sway move container to workspace "$dest_ws"
- if [ "$3" = "follow" ]; then
- sway workspace "$dest_ws"
- fi
-fi
-#+end_src
-
-** toggle-layout
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/toggle-layout :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash :tangle no
-lang="$(setxkbmap -print | grep xkb_symbols | cut -d'+' -f 2)"
-
-if [ "$lang" = "us" ]; then
- setxkbmap ir
-else
- setxkbmap us
- # xmodmap $HOME/.Xmodmap
-fi
-#+end_src
-
-** toggle-presentation-mode
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/toggle-presentation-mode :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash :tangle no
-xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T
-#+end_src
-
-** toggle-tablet
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/toggle-tablet :shebang "#!/bin/bash"
-:END:
-
-This script toggles between a 'normal' mode and a 'tablet' mode, doing
-a few things:
-
-- rotates the screen using =xrandr=, so that rotating the physical
- display of my X220t would have the laptop's battery on the right
- hand side,
-- enables touch screen,
-- properly rotates the stylus pen and touch screen pointers, and
-- toggles between RGB and Vertical BGR sub-pixel order.
-
-#+begin_src bash :tangle no
-case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in
- 0) # Screen is not rotated, we should rotate it right (90°)
- xrandr -o 3
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 1
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 1
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 1
- xfconf-query -c xsettings -p /Xft/RGBA -s vbgr
- ;;
- 1) # Currently top is rotated right, we should set it normal (0°)
- xrandr -o 0
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 0
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 0
- xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 0
- xfconf-query -c xsettings -p /Xft/RGBA -s rgb
- ;;
- *)
- echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation'" >&2
- exit 1
- ;;
-esac
-#+end_src
-
-** unlock-def-gk.py
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/unlock-def-gk.py :shebang "#!/usr/bin/env python2"
-:END:
-
-#+begin_src python :tangle no
-import gnomekeyring as gk
-# list_item_ids_sync('login')[0] == 1L
-gk.unlock_sync('Default_keyring',gk.item_get_info_sync('login',1L).get_secret())
-#+end_src
-
-** volume-info
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/volume-info :shebang "#!/bin/sh"
-:END:
-
-#+begin_src sh :tangle no
-cur_vol=$(pamixer --get-volume)
-
-if [ $(pamixer --get-mute) = true ]; then
- printf 'mt \n' "$cur_vol"
-else
- printf '%02d \n' "$cur_vol"
-fi
-#+end_src
-
-** wp
-
-My little wallpaper changer script.
-
-*** wp
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/wp :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash :tangle no
-export DISPLAY=:0
-
-case "$1" in
- "day")
- feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
- ;;
- "night")
- feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
- ;;
- *)
- echo $"Usage: $0 {day|night}"
- exit 1
-esac
-#+end_src
-
-*** wp-auto
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/wp-auto :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash :tangle no
-SED=$(which sed)
-ROFI=$(which rofi)
-
-export DISPLAY=:0
-HOUR=$(date +%H)
-
-if [ -z "${SED}" ]
-then
- echo "Did not find 'sed', script cannot continue."
- exit 1
-fi
-if [ -z "${ROFI}" ]
-then
- echo "Did not find rofi, there is no point to continue."
- exit 1
-fi
-
-###
-# Create if not exists, then removes #include of .theme file (if present) and add the selected theme to the end.
-# Repeated calls should leave the config clean-ish
-###
-function set_theme()
-{
- CDIR="${HOME}/.config/rofi/"
- if [ ! -d "${CDIR}" ]
- then
- mkdir -p ${CDIR}
- fi
- if [ -f "${CDIR}/config" ]
- then
- ${SED} -i "/rofi\.theme: .*\.rasi$/d" "${CDIR}/config"
- fi
- echo "rofi.theme: ${1}" >> "${CDIR}/config"
-
-}
-
-if [ "$HOUR" -gt "19" ] || [ "$HOUR" -lt "7" ]
- then
- feh --bg-scale $HOME/usr/pics/island_night_by_arsenixc-d6cz757.jpg
- xrdb -merge $HOME/.Xresources.d/gruvbox-dark.xresources
- set_theme "/usr/share/rofi/themes//gruvbox-dark.rasi"
- else
- feh --bg-scale $HOME/usr/pics/island_day_by_arsenixc-d6ctqon.jpg
- xrdb -merge $HOME/.Xresources.d/gruvbox-light.xresources
- set_theme "/usr/share/rofi/themes//gruvbox-light.rasi"
-fi
-#+end_src
-
-*** wp.service
-:PROPERTIES:
-:header-args+: :tangle ~/.config/systemd/user/wp.service
-:END:
-
-#+begin_src conf :tangle no
-[Unit]
-Description=wallpaper service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/bin/bash -c %h/.local/bin/wp-auto
-#+end_src
-
-*** wp.timer
-:PROPERTIES:
-:header-args+: :tangle ~/.config/systemd/user/wp.timer
-:END:
-
-#+begin_src conf :tangle no
-[Unit]
-[Unit]
-Description=wallpaper timer
-
-[Timer]
-OnCalendar=07,21:00
-Unit=wp.service
-Persistent=true
-
-[Install]
-WantedBy=timers.target
-#+end_src
-
-** zathura-sync.sh
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/zathura-sync.sh :shebang "#!/bin/sh"
-:END:
-
-#+begin_src sh
-pos="$1"
-pdffile="$2"
-zathura --synctex-forward "$pos" "$pdffile" || \
- (
- zathura -x "emacsclient --eval '(progn (switch-to-buffer (file-name-nondirectory \"%{input}\")) (goto-line %{line}))'" "$pdffile" &
- sleep 1; zathura --synctex-forward "$pos" "$pdffile" )
-#+end_src
-** Fun :)
-
-*** eat-em
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/eat-em :shebang "#!/bin/sh"
-:END:
-
-#+begin_src sh
-# Original Posted at http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
-# [ESC] character in original post removed here.
-
-# ANSI Color -- use these variables to easily have different color
-# and format output. Make sure to output the reset sequence after
-# colors (f = foreground, b = background), and use the 'off'
-# feature for anything you turn on.
-
-initializeANSI()
-{
- esc="$(echo -en '\e')"
-
- blackf="${esc}[30m"; redf="${esc}[31m"; greenf="${esc}[32m"
- yellowf="${esc}[33m" bluef="${esc}[34m"; purplef="${esc}[35m"
- cyanf="${esc}[36m"; whitef="${esc}[37m"
-
- blackb="${esc}[40m"; redb="${esc}[41m"; greenb="${esc}[42m"
- yellowb="${esc}[43m" blueb="${esc}[44m"; purpleb="${esc}[45m"
- cyanb="${esc}[46m"; whiteb="${esc}[47m"
-
- boldon="${esc}[1m"; boldoff="${esc}[22m"
- italicson="${esc}[3m"; italicsoff="${esc}[23m"
- ulon="${esc}[4m"; uloff="${esc}[24m"
- invon="${esc}[7m"; invoff="${esc}[27m"
-
- reset="${esc}[0m"
-}
-
-# note in this first use that switching colors doesn't require a reset
-# first - the new color overrides the old one.
-
-#clear
-
-initializeANSI
-
-cat << EOF
-
- ${yellowf} ▄███████▄${reset} ${redf} ▄██████▄${reset} ${greenf} ▄██████▄${reset} ${bluef} ▄██████▄${reset} ${purplef} ▄██████▄${reset} ${cyanf} ▄██████▄${reset}
- ${yellowf}▄█████████▀▀${reset} ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄${reset} ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄${reset} ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄${reset} ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄${reset} ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
- ${yellowf}███████▀${reset} ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███${reset} ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███${reset} ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███${reset} ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███${reset} ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
- ${yellowf}███████▄${reset} ${redf}████████████${reset} ${greenf}████████████${reset} ${bluef}████████████${reset} ${purplef}████████████${reset} ${cyanf}████████████${reset}
- ${yellowf}▀█████████▄▄${reset} ${redf}██▀██▀▀██▀██${reset} ${greenf}██▀██▀▀██▀██${reset} ${bluef}██▀██▀▀██▀██${reset} ${purplef}██▀██▀▀██▀██${reset} ${cyanf}██▀██▀▀██▀██${reset}
- ${yellowf} ▀███████▀${reset} ${redf}▀ ▀ ▀ ▀${reset} ${greenf}▀ ▀ ▀ ▀${reset} ${bluef}▀ ▀ ▀ ▀${reset} ${purplef}▀ ▀ ▀ ▀${reset} ${cyanf}▀ ▀ ▀ ▀${reset}
-
- ${boldon}${yellowf} ▄███████▄ ${redf} ▄██████▄ ${greenf} ▄██████▄ ${bluef} ▄██████▄ ${purplef} ▄██████▄ ${cyanf} ▄██████▄${reset}
- ${boldon}${yellowf}▄█████████▀▀ ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄ ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄ ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄ ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄ ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
- ${boldon}${yellowf}███████▀ ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███ ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███ ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███ ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███ ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
- ${boldon}${yellowf}███████▄ ${redf}████████████ ${greenf}████████████ ${bluef}████████████ ${purplef}████████████ ${cyanf}████████████${reset}
- ${boldon}${yellowf}▀█████████▄▄ ${redf}██▀██▀▀██▀██ ${greenf}██▀██▀▀██▀██ ${bluef}██▀██▀▀██▀██ ${purplef}██▀██▀▀██▀██ ${cyanf}██▀██▀▀██▀██${reset}
- ${boldon}${yellowf} ▀███████▀ ${redf}▀ ▀ ▀ ▀ ${greenf}▀ ▀ ▀ ▀ ${bluef}▀ ▀ ▀ ▀ ${purplef}▀ ▀ ▀ ▀ ${cyanf}▀ ▀ ▀ ▀${reset}
-
-EOF
-#+end_src
-
-*** invade-em
-:PROPERTIES:
-:header-args+: :tangle ~/.local/bin/invade-em :shebang "#!/bin/bash"
-:END:
-
-#+begin_src bash
-#
-# ANSI color scheme script featuring Space Invaders
-#
-# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
-# Modified by lolilolicon
-#
-
-f=3 b=4
-for j in f b; do
- for i in {0..7}; do
- printf -v $j$i %b "\e[${!j}${i}m"
- done
-done
-bld=$'\e[1m'
-rst=$'\e[0m'
-
-cat << EOF
-
- $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
- $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
- $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst
- $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst
-
- $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst
- $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst
- $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst
- $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst
-
-
- $f7▌$rst
-
- $f7▌$rst
-
- $f7 ▄█▄ $rst
- $f7▄█████████▄$rst
- $f7▀▀▀▀▀▀▀▀▀▀▀$rst
-
-EOF
-#+end_src