Merge
						commit
						0d68784dcc
					
				| 
						 | 
					@ -16,4 +16,13 @@ font:
 | 
				
			||||||
colors:
 | 
					colors:
 | 
				
			||||||
  primary:
 | 
					  primary:
 | 
				
			||||||
    foreground: '0x111111'
 | 
					    foreground: '0x111111'
 | 
				
			||||||
    background: '0xdddddd'
 | 
					    background: '0xcccccc'
 | 
				
			||||||
 | 
					  normal:
 | 
				
			||||||
 | 
					    black: '0x000000'
 | 
				
			||||||
 | 
					    red: '0xcc3333'
 | 
				
			||||||
 | 
					    green: '0x33cc33'
 | 
				
			||||||
 | 
					    yellow: '0x885800'
 | 
				
			||||||
 | 
					    blue: '0x3333cc'
 | 
				
			||||||
 | 
					    magenta: '0xcc33cc'
 | 
				
			||||||
 | 
					    cyan: '0x33cccc'
 | 
				
			||||||
 | 
					    white: '0xcccccc'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,12 +48,13 @@ alias df="df -kTh"
 | 
				
			||||||
alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
 | 
					alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
 | 
				
			||||||
alias o="xdg-open"
 | 
					alias o="xdg-open"
 | 
				
			||||||
alias path="echo -e ${PATH//:/\\n}" # Pretty print path variables
 | 
					alias path="echo -e ${PATH//:/\\n}" # Pretty print path variables
 | 
				
			||||||
alias wiki="vim +WikiIndex"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Programs
 | 
					# Programs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
alias feh="feh -B black --scale-down --auto-zoom"
 | 
					alias feh="feh -B black --scale-down --auto-zoom"
 | 
				
			||||||
alias fm='pcmanfm'
 | 
					alias fm='pcmanfm'
 | 
				
			||||||
 | 
					alias v="nvim"
 | 
				
			||||||
 | 
					alias w="nvim +WikiIndex"
 | 
				
			||||||
alias g='git'
 | 
					alias g='git'
 | 
				
			||||||
alias lm='xbacklight -set'
 | 
					alias lm='xbacklight -set'
 | 
				
			||||||
alias py='python'
 | 
					alias py='python'
 | 
				
			||||||
| 
						 | 
					@ -64,7 +65,15 @@ alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
 | 
				
			||||||
 | 
					
 | 
				
			||||||
reboot_to_windows ()
 | 
					reboot_to_windows ()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  # Check if grub is installed by checking if the command exists, if it does
 | 
				
			||||||
 | 
					  # not, then assume that the system is using systemd-boot
 | 
				
			||||||
 | 
					  if grub-install --version &>/dev/null; then
 | 
				
			||||||
    windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
 | 
					    windows_title=$(grep -i windows /boot/grub/grub.cfg | cut -d "'" -f 2)
 | 
				
			||||||
    sudo grub-reboot "$windows_title" && sudo reboot
 | 
					    sudo grub-reboot "$windows_title"
 | 
				
			||||||
 | 
					    echo "Grub set to reboot to Windows"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    sudo bootctl set-oneshot windows.conf
 | 
				
			||||||
 | 
					    echo "Systemd set to reboot to Windows"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
alias reboot-to-windows='reboot_to_windows'
 | 
					alias reboot-to-windows='reboot_to_windows'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										81
									
								
								.bashrc
								
								
								
								
							
							
						
						
									
										81
									
								
								.bashrc
								
								
								
								
							| 
						 | 
					@ -3,13 +3,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
source /etc/os-release
 | 
					source /etc/os-release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Aliases {{{
 | 
				
			||||||
# Load aliases dynamically
 | 
					# Load aliases dynamically
 | 
				
			||||||
[ -f "$HOME/.bash_aliases" ] && source "$HOME/.bash_aliases"
 | 
					[ -f "$HOME/.bash_aliases" ] && source "$HOME/.bash_aliases"
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Add ~/.bin to PATH
 | 
					# Prompt {{{
 | 
				
			||||||
export PATH=~/.bin:$PATH
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Prompt
 | 
					 | 
				
			||||||
get_branch_name() {
 | 
					get_branch_name() {
 | 
				
			||||||
  git symbolic-ref --quiet --short HEAD 2>/dev/null \
 | 
					  git symbolic-ref --quiet --short HEAD 2>/dev/null \
 | 
				
			||||||
    || git rev-parse --short HEAD 2>/dev/null \
 | 
					    || git rev-parse --short HEAD 2>/dev/null \
 | 
				
			||||||
| 
						 | 
					@ -19,16 +18,35 @@ get_git_info() {
 | 
				
			||||||
  git rev-parse --is-inside-work-tree &>/dev/null || return
 | 
					  git rev-parse --is-inside-work-tree &>/dev/null || return
 | 
				
			||||||
  echo -e " $(get_branch_name)"
 | 
					  echo -e " $(get_branch_name)"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export PS1="\u \w ❭\[$(tput sgr0)\] "
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# History
 | 
					PS1="\u \w ❭\[$(tput sgr0)\] "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Ellipsis when deep in directory
 | 
				
			||||||
 | 
					export PROMPT_DIRTRIM=2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export PS1
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Path {{{
 | 
				
			||||||
 | 
					# Add ~/.bin to PATH
 | 
				
			||||||
 | 
					export PATH=~/.bin:$PATH
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# History {{{
 | 
				
			||||||
export HISTCONTROL=ignoreboth:erasedups
 | 
					export HISTCONTROL=ignoreboth:erasedups
 | 
				
			||||||
export HISTSIZE=500000
 | 
					export HISTSIZE=500000
 | 
				
			||||||
# Omit `clear, ls...`; commands prepended with space
 | 
					# Omit `clear, ls...`; commands prepended with space
 | 
				
			||||||
export HISTIGNORE="clear:l: *"
 | 
					export HISTIGNORE="clear:l: *"
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Man pages
 | 
					# Man pages {{{
 | 
				
			||||||
export MANWIDTH=120
 | 
					export MANWIDTH=120
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Editor {{{
 | 
				
			||||||
 | 
					# Set vim as default editor
 | 
				
			||||||
 | 
					export EDITOR=nvim
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Vim
 | 
					# Vim
 | 
				
			||||||
export EDITOR=vim
 | 
					export EDITOR=vim
 | 
				
			||||||
| 
						 | 
					@ -58,11 +76,50 @@ export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
 | 
				
			||||||
export NVM_DIR="$HOME/.nvm"
 | 
					export NVM_DIR="$HOME/.nvm"
 | 
				
			||||||
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
 | 
					[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# X11
 | 
					# X11 {{{
 | 
				
			||||||
export XDG_SESSION_TYPE=X11
 | 
					export XDG_SESSION_TYPE=X11
 | 
				
			||||||
 | 
					export XDG_CONFIG_HOME=$HOME/.config
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Jupyter
 | 
					# Nix package manager {{{
 | 
				
			||||||
 | 
					# Add ~/.nix-profile/bin to PATH
 | 
				
			||||||
 | 
					export PATH=~/.nix-profile/bin:$PATH
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# FZF {{{
 | 
				
			||||||
 | 
					# Check if fzf is installed
 | 
				
			||||||
 | 
					if [ -f "/usr/bin/fzf" ]; then
 | 
				
			||||||
 | 
					  # Fuzzy finder setup
 | 
				
			||||||
 | 
					  export FZF_COMPLETION_TRIGGER='**'
 | 
				
			||||||
 | 
					  export FZF_DEFAULT_COMMAND='ag --hidden --skip-vcs-ignores -t -g ""'
 | 
				
			||||||
 | 
					  export FZF_DEFAULT_OPTS="
 | 
				
			||||||
 | 
					  --pointer='❭'
 | 
				
			||||||
 | 
					  --height 10%
 | 
				
			||||||
 | 
					  --color=fg:-1,bg:-1"
 | 
				
			||||||
 | 
					  export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
 | 
				
			||||||
 | 
					  export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
 | 
				
			||||||
 | 
					  source /usr/share/fzf/completion.bash
 | 
				
			||||||
 | 
					  source /usr/share/fzf/key-bindings.bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  _fzf_setup_completion path vim
 | 
				
			||||||
 | 
					  _fzf_setup_completion path zathura
 | 
				
			||||||
 | 
					  _fzf_setup_completion path xournalpp
 | 
				
			||||||
 | 
					  _fzf_setup_completion path nvim
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  echo "fzf not installed"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Node {{{
 | 
				
			||||||
 | 
					# Move nvm folder away from home directory
 | 
				
			||||||
 | 
					export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
 | 
				
			||||||
 | 
					# Pretty much what is in `/usr/share/nvm/init-nvm.sh` but we add the `--no-use`
 | 
				
			||||||
 | 
					# flag to `nvm.sh` to make it lazy
 | 
				
			||||||
 | 
					source /usr/share/nvm/nvm.sh --no-use
 | 
				
			||||||
 | 
					source /usr/share/nvm/bash_completion
 | 
				
			||||||
 | 
					source /usr/share/nvm/install-nvm-exec
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Jupyter {{{
 | 
				
			||||||
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
 | 
					export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
 | 
				
			||||||
 | 
					# }}}
 | 
				
			||||||
# Ellipsis when deep in directory
 | 
					 | 
				
			||||||
export PROMPT_DIRTRIM=2
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +0,0 @@
 | 
				
			||||||
#!/usr/bin/env bash
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
sudo rtcwake -m no -l -t "$(date +%s -d 'tomorrow 09:30')"
 | 
					 | 
				
			||||||
							
								
								
									
										2
									
								
								.bin/cam
								
								
								
								
							
							
						
						
									
										2
									
								
								.bin/cam
								
								
								
								
							| 
						 | 
					@ -2,4 +2,4 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Open webcam window
 | 
					# Open webcam window
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ffplay -f v4l2 -s 640x480 -i /dev/video0 >/dev/null 2>&1 & disown
 | 
					ffplay -f v4l2 -x 640 -y 480 -i /dev/video0 >/dev/null 2>&1 & disown
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,6 +4,6 @@ options="nl:en\nen:nl\nnl:fr\nfr:nl\nen:fr\nfr:en\nnl:de\nde:nl"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0)
 | 
					selected=$(echo -e "$options" | dmenu -p "s?:t?" -i -l 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
notify-send --app-name= -t 3000 "$(trans $selected -b "$(dmenu -p $selected &)" \
 | 
					notify-send --app-name= -t 3000 "$(trans "$selected" -b "$(dmenu -p "$selected" &)" \
 | 
				
			||||||
  | tr -d '\n' \
 | 
					  | tr -d '\n' \
 | 
				
			||||||
  | xclip -sel clip -f)"
 | 
					  | xclip -sel clip -f)"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Generate menu of book filenames and save paths
 | 
					# Generate menu of book filenames and save paths
 | 
				
			||||||
# Preview window contains metadata
 | 
					# Preview window contains metadata
 | 
				
			||||||
selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1 --preview 'pdfinfo {}' --preview-window=right:70%:wrap)"
 | 
					# selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1 --preview 'pdfinfo {}' --preview-window=right:70%:wrap)"
 | 
				
			||||||
 | 
					selected="$(find /home/h/doc/books/ -regex '.*\.\(pdf\|epub\|djvu\)' -type f | sort | fzf --delimiter=/ --with-nth=-1)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Open and redirect output to /dev/null
 | 
					# Open and redirect output to /dev/null
 | 
				
			||||||
zathura "$selected" 2> /dev/null &
 | 
					zathura "$selected" --fork
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,11 +11,12 @@ update() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  font_list=$(fc-list -f "%{fullname}\n")
 | 
					  font_list=$(fc-list -f "%{fullname}\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  echo "$font_list" | while read -r line ; do
 | 
					  echo "$font_list" | while read line ; do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    first="$(echo "$line" | cut -d',' -f1)"
 | 
					    first="$(echo "$line" | cut -d',' -f1)"
 | 
				
			||||||
    last="$(echo "$line" | cut -d',' -f2)"
 | 
					    last="$(echo "$line" | cut -d',' -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if "$(contains_dash "$first")"; then
 | 
					    if $(contains_dash "$first"); then
 | 
				
			||||||
      echo "$last" >> "$fn"
 | 
					      echo "$last" >> "$fn"
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      echo "$first" >> "$fn"
 | 
					      echo "$first" >> "$fn"
 | 
				
			||||||
| 
						 | 
					@ -25,5 +26,5 @@ update() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "$1" in
 | 
					case "$1" in
 | 
				
			||||||
  --update) update;;
 | 
					  --update) update;;
 | 
				
			||||||
  *) sort "$fn" | uniq | awk 'NF' | fzf;;
 | 
					  *) cat "$fn" | sort | uniq | awk 'NF' | fzf;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sudo pacman -Qtdq | sudo pacman -Rns -
 | 
				
			||||||
							
								
								
									
										28
									
								
								.bin/pomo
								
								
								
								
							
							
						
						
									
										28
									
								
								.bin/pomo
								
								
								
								
							| 
						 | 
					@ -13,17 +13,23 @@ from argparse import ArgumentParser
 | 
				
			||||||
from time import sleep
 | 
					from time import sleep
 | 
				
			||||||
from plyer import notification
 | 
					from plyer import notification
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def clear():
 | 
					def clear():
 | 
				
			||||||
    os.system('echo -n "" > /tmp/pomo')
 | 
					    os.system('echo -n "" > /tmp/pomo')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
atexit.register(clear)
 | 
					atexit.register(clear)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
parser = ArgumentParser()
 | 
					parser = ArgumentParser()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
parser.add_argument('-p', '--prep-duration', type=int, help='Preparation duration of a session', default=0)
 | 
					parser.add_argument('-p', '--prep-duration', type=int,
 | 
				
			||||||
parser.add_argument('-w', '--work-duration', type=int, help='Duration of a session', default=25)
 | 
					                    help='Pre session duration', default=0)
 | 
				
			||||||
parser.add_argument('-b', '--break-duration', type=int, help='Duration of a break', default=5)
 | 
					parser.add_argument('-w', '--work-duration', type=int,
 | 
				
			||||||
parser.add_argument('-r', '--repeats', type=int, help='Numer of sessions', default=1)
 | 
					                    help='Session duration', default=25)
 | 
				
			||||||
 | 
					parser.add_argument('-b', '--break-duration', type=int,
 | 
				
			||||||
 | 
					                    help='Break duration', default=5)
 | 
				
			||||||
 | 
					parser.add_argument('-r', '--repeats', type=int,
 | 
				
			||||||
 | 
					                    help='Numer of sessions', default=1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
args = parser.parse_args()
 | 
					args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,26 +38,30 @@ work_duration  = args.work_duration * 60
 | 
				
			||||||
break_duration = args.break_duration * 60
 | 
					break_duration = args.break_duration * 60
 | 
				
			||||||
repeats = args.repeats
 | 
					repeats = args.repeats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def make_countdown(color):
 | 
					def make_countdown(color):
 | 
				
			||||||
    def countdown(duration):
 | 
					    def countdown(duration):
 | 
				
			||||||
    while duration!= 0:
 | 
					        while duration != 0:
 | 
				
			||||||
            mins = duration // 60
 | 
					            mins = duration // 60
 | 
				
			||||||
            secs = duration % 60
 | 
					            secs = duration % 60
 | 
				
			||||||
      os.system('echo -n "{:s} {:02d}:{:02d} \x01" > /tmp/pomo'.format(color, mins, secs))
 | 
					            # os.system('echo -n "{:s} {:02d}:{:02d} \x01" > /tmp/pomo'.format(color, mins, secs))
 | 
				
			||||||
 | 
					            os.system('echo -n "{:02d}:{:02d}" > /tmp/pomo'.format(mins, secs))
 | 
				
			||||||
            sleep(1)
 | 
					            sleep(1)
 | 
				
			||||||
            duration -= 1
 | 
					            duration -= 1
 | 
				
			||||||
    return countdown
 | 
					    return countdown
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
prep_countdown = make_countdown("\x01")
 | 
					prep_countdown = make_countdown("\x01")
 | 
				
			||||||
work_countdown = make_countdown("\x03")
 | 
					work_countdown = make_countdown("\x03")
 | 
				
			||||||
break_countdown = make_countdown("\x02")
 | 
					break_countdown = make_countdown("\x02")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
prep_countdown(prep_duration)
 | 
					prep_countdown(prep_duration)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
while repeats!=0:
 | 
					while repeats != 0:
 | 
				
			||||||
    notification.notify(title="Get started")
 | 
					    notification.notify(title="Get started")
 | 
				
			||||||
    work_countdown(work_duration)
 | 
					    work_countdown(work_duration)
 | 
				
			||||||
 | 
					    if break_duration != 0:
 | 
				
			||||||
        notification.notify(title="Time for a break")
 | 
					        notification.notify(title="Time for a break")
 | 
				
			||||||
        break_countdown(break_duration)
 | 
					        break_countdown(break_duration)
 | 
				
			||||||
  notification.notify(title="Break is over, set a new timer")
 | 
					        notification.notify(title="Break is over, back to work")
 | 
				
			||||||
  repeats-=1
 | 
					    repeats -= 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Script to create script
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -z "$1" ]; then
 | 
				
			||||||
 | 
					    echo "Script name required"
 | 
				
			||||||
 | 
					    exit
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					path="$HOME/.bin/$1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Prevent overwriting existing script
 | 
				
			||||||
 | 
					set -o noclobber
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Create script
 | 
				
			||||||
 | 
					cat > "$path" << EOF
 | 
				
			||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					chmod +x "$path"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Open script in editor on line 3
 | 
				
			||||||
 | 
					"$EDITOR" +3 "$path"
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					channels:
 | 
				
			||||||
 | 
					  - conda-forge
 | 
				
			||||||
 | 
					  - defaults
 | 
				
			||||||
 | 
					channel_priority: strict
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					channels:
 | 
				
			||||||
 | 
					  - conda-forge
 | 
				
			||||||
 | 
					  - defaults
 | 
				
			||||||
 | 
					channel_priority: strict
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					prev_img      h
 | 
				
			||||||
 | 
					next_img      l
 | 
				
			||||||
 | 
					scroll_left   L
 | 
				
			||||||
 | 
					scroll_right  H
 | 
				
			||||||
 | 
					scroll_up     J
 | 
				
			||||||
 | 
					scroll_down   K
 | 
				
			||||||
 | 
					zoom_in       j
 | 
				
			||||||
 | 
					zoom_out      k
 | 
				
			||||||
 | 
					zoom_fit      z
 | 
				
			||||||
 | 
					zoom_default  =
 | 
				
			||||||
 | 
					mirror        bar
 | 
				
			||||||
 | 
					close         q Q
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					feh \
 | 
				
			||||||
 | 
					-B black \
 | 
				
			||||||
 | 
					--auto-zoom
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,56 @@
 | 
				
			||||||
 | 
					[General]
 | 
				
			||||||
 | 
					buttons=@Variant(\0\0\0\x7f\0\0\0\vQList<int>\0\0\0\0\xf\0\0\0\0\0\0\0\x2\0\0\0\x3\0\0\0\x4\0\0\0\x5\0\0\0\x6\0\0\0\x12\0\0\0\x13\0\0\0\a\0\0\0\t\0\0\0\x10\0\0\0\n\0\0\0\v\0\0\0\r\0\0\0\xe)
 | 
				
			||||||
 | 
					checkForUpdates=false
 | 
				
			||||||
 | 
					contrastOpacity=127
 | 
				
			||||||
 | 
					contrastUiColor=#ffffff
 | 
				
			||||||
 | 
					copyPathAfterSave=true
 | 
				
			||||||
 | 
					disabledTrayIcon=false
 | 
				
			||||||
 | 
					drawColor=#ff0044
 | 
				
			||||||
 | 
					drawFontSize=7
 | 
				
			||||||
 | 
					drawThickness=1
 | 
				
			||||||
 | 
					fontFamily=Inter
 | 
				
			||||||
 | 
					saveLastRegion=true
 | 
				
			||||||
 | 
					savePath=/home/h/doc/clips
 | 
				
			||||||
 | 
					savePathFixed=true
 | 
				
			||||||
 | 
					showDesktopNotification=false
 | 
				
			||||||
 | 
					showHelp=false
 | 
				
			||||||
 | 
					showSidePanelButton=true
 | 
				
			||||||
 | 
					showStartupLaunchMessage=false
 | 
				
			||||||
 | 
					startupLaunch=true
 | 
				
			||||||
 | 
					uiColor=#484848
 | 
				
			||||||
 | 
					undoLimit=106
 | 
				
			||||||
 | 
					userColors=picker, #800000, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ffffff, #000000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Shortcuts]
 | 
				
			||||||
 | 
					TYPE_ARROW=A
 | 
				
			||||||
 | 
					TYPE_CIRCLE=C
 | 
				
			||||||
 | 
					TYPE_CIRCLECOUNT=
 | 
				
			||||||
 | 
					TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
 | 
				
			||||||
 | 
					TYPE_COPY=Ctrl+C
 | 
				
			||||||
 | 
					TYPE_DELETE_CURRENT_TOOL=Del
 | 
				
			||||||
 | 
					TYPE_DRAWER=D
 | 
				
			||||||
 | 
					TYPE_EXIT=Ctrl+Q
 | 
				
			||||||
 | 
					TYPE_IMAGEUPLOADER=Return
 | 
				
			||||||
 | 
					TYPE_MARKER=M
 | 
				
			||||||
 | 
					TYPE_MOVESELECTION=Ctrl+M
 | 
				
			||||||
 | 
					TYPE_MOVE_DOWN=Down
 | 
				
			||||||
 | 
					TYPE_MOVE_LEFT=Left
 | 
				
			||||||
 | 
					TYPE_MOVE_RIGHT=Right
 | 
				
			||||||
 | 
					TYPE_MOVE_UP=Up
 | 
				
			||||||
 | 
					TYPE_OPEN_APP=Ctrl+O
 | 
				
			||||||
 | 
					TYPE_PENCIL=P
 | 
				
			||||||
 | 
					TYPE_PIN=
 | 
				
			||||||
 | 
					TYPE_PIXELATE=B
 | 
				
			||||||
 | 
					TYPE_RECTANGLE=R
 | 
				
			||||||
 | 
					TYPE_REDO=Ctrl+Shift+Z
 | 
				
			||||||
 | 
					TYPE_RESIZE_DOWN=Shift+Down
 | 
				
			||||||
 | 
					TYPE_RESIZE_LEFT=Shift+Left
 | 
				
			||||||
 | 
					TYPE_RESIZE_RIGHT=Shift+Right
 | 
				
			||||||
 | 
					TYPE_RESIZE_UP=Shift+Up
 | 
				
			||||||
 | 
					TYPE_SAVE=Ctrl+S
 | 
				
			||||||
 | 
					TYPE_SELECTION=S
 | 
				
			||||||
 | 
					TYPE_SELECTIONINDICATOR=
 | 
				
			||||||
 | 
					TYPE_SELECT_ALL=Ctrl+A
 | 
				
			||||||
 | 
					TYPE_TEXT=T
 | 
				
			||||||
 | 
					TYPE_TOGGLE_PANEL=Space
 | 
				
			||||||
 | 
					TYPE_UNDO=Ctrl+Z
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					set runtimepath^=~/.vim runtimepath+=~/.vim/after
 | 
				
			||||||
 | 
					let &packpath = &runtimepath
 | 
				
			||||||
 | 
					source ~/.vimrc
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,40 @@
 | 
				
			||||||
 | 
					backend = "glx";
 | 
				
			||||||
 | 
					glx-no-stencil = true;
 | 
				
			||||||
 | 
					glx-copy-from-font = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					active-opacity = 1.0;
 | 
				
			||||||
 | 
					inactive-opacity = 0.8;
 | 
				
			||||||
 | 
					frame-opacity = 0.8;
 | 
				
			||||||
 | 
					inactive-opacity-override = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					shadow = true;
 | 
				
			||||||
 | 
					shadow-radius = 16;
 | 
				
			||||||
 | 
					shadow-opacity = 0.5;
 | 
				
			||||||
 | 
					shadow-offset-x = -16;
 | 
				
			||||||
 | 
					shadow-offset-y = -16;
 | 
				
			||||||
 | 
					shadow-color = "#000000"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fading = true;
 | 
				
			||||||
 | 
					fade-in-step = 0.05;
 | 
				
			||||||
 | 
					fade-out-step = 0.05;
 | 
				
			||||||
 | 
					fade-delta = 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					shadow-exclude = ["class_g = 'Rofi'", "class_g = 'albert'", "class_g = 'trayer'"];
 | 
				
			||||||
 | 
					focus-exclude = ["class_g = 'Rofi'", "class_g = 'albert'", "class_g = 'trayer'"];
 | 
				
			||||||
 | 
					blur-background-exclude = ["class_g = 'Rofi'", "class_g = 'albert'", "class_g = 'trayer'"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blur-background = true;
 | 
				
			||||||
 | 
					blur-inactive = true;
 | 
				
			||||||
 | 
					blur-method = "dual_kawase";
 | 
				
			||||||
 | 
					blur-strength = 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					wintypes:
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  dock = { shadow = false; };
 | 
				
			||||||
 | 
					  dnd = { shadow = false; };
 | 
				
			||||||
 | 
					  tooltip = { shadow = false; };
 | 
				
			||||||
 | 
					  menu        = { opacity = false; };
 | 
				
			||||||
 | 
					  dropdown_menu = { opacity = false; };
 | 
				
			||||||
 | 
					  popup_menu    = { opacity = false; };
 | 
				
			||||||
 | 
					  utility       = { opacity = false; };
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
| 
						 | 
					@ -7,9 +7,9 @@ unmap f
 | 
				
			||||||
map f toggle_fullscreen
 | 
					map f toggle_fullscreen
 | 
				
			||||||
map [fullscreen] f toggle_fullscreen
 | 
					map [fullscreen] f toggle_fullscreen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Theme
 | 
					# Initial theme
 | 
				
			||||||
set default-bg "#ffffff"
 | 
					set default-bg "#cccccc"
 | 
				
			||||||
set default-fg "#eee"
 | 
					set default-fg "#111"
 | 
				
			||||||
set statusbar-bg "#111"
 | 
					set statusbar-bg "#111"
 | 
				
			||||||
set statusbar-fg "#777"
 | 
					set statusbar-fg "#777"
 | 
				
			||||||
set inputbar-bg "#111"
 | 
					set inputbar-bg "#111"
 | 
				
			||||||
| 
						 | 
					@ -23,14 +23,10 @@ set completion-highlight-bg "#333"
 | 
				
			||||||
set highlight-fg "#ccc"
 | 
					set highlight-fg "#ccc"
 | 
				
			||||||
set highlight-color "#111"
 | 
					set highlight-color "#111"
 | 
				
			||||||
set highlight-active-color "#333"
 | 
					set highlight-active-color "#333"
 | 
				
			||||||
 | 
					set index-fg "#eee"
 | 
				
			||||||
# Dark mode
 | 
					set index-bg "#111"
 | 
				
			||||||
set recolor
 | 
					set index-active-fg "#eee"
 | 
				
			||||||
set recolor-darkcolor "#aaa"
 | 
					set index-active-bg "#333"
 | 
				
			||||||
set recolor-lightcolor "#111"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# midnight mode    
 | 
					 | 
				
			||||||
map <F1> focus_inputbar "set default-bg \#111111"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Hide status bar
 | 
					# Hide status bar
 | 
				
			||||||
set guioptions none
 | 
					set guioptions none
 | 
				
			||||||
| 
						 | 
					@ -38,5 +34,32 @@ set render-loading "false"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
map J zoom out
 | 
					map J zoom out
 | 
				
			||||||
map K zoom in
 | 
					map K zoom in
 | 
				
			||||||
map i recolor
 | 
					 | 
				
			||||||
unmap q
 | 
					unmap q
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Hack for switching color themes (change default background too on recolor)
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Default to light recolor
 | 
				
			||||||
 | 
					set recolor
 | 
				
			||||||
 | 
					set recolor-lightcolor "#cccccc"
 | 
				
			||||||
 | 
					set recolor-darkcolor "#111"
 | 
				
			||||||
 | 
					set recolor-keephue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# No recolor
 | 
				
			||||||
 | 
					map <F1> focus_inputbar ":set recolor true"
 | 
				
			||||||
 | 
					map <F2> focus_inputbar ":set recolor false"
 | 
				
			||||||
 | 
					map <F3> focus_inputbar ":set default-bg \#fff"
 | 
				
			||||||
 | 
					map 1 feedkeys "<F2><Return><F3><Return>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Light recolor
 | 
				
			||||||
 | 
					map <F4> focus_inputbar ":set default-bg \#cccccc"
 | 
				
			||||||
 | 
					map <F5> focus_inputbar ":set recolor-lightcolor \#cccccc"
 | 
				
			||||||
 | 
					map <F6> focus_inputbar ":set recolor-darkcolor \#111"
 | 
				
			||||||
 | 
					map 2 feedkeys "<F1><Return><F4><Return><F5><Return><F6><Return>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Dark recolor
 | 
				
			||||||
 | 
					map <F7> focus_inputbar ":set default-bg \#111"
 | 
				
			||||||
 | 
					map <F8> focus_inputbar ":set recolor-lightcolor \#111"
 | 
				
			||||||
 | 
					map <F9> focus_inputbar ":set recolor-darkcolor \#aaa"
 | 
				
			||||||
 | 
					map 3 feedkeys "<F1><Return><F7><Return><F8><Return><F9><Return>"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										256
									
								
								.vimrc
								
								
								
								
							
							
						
						
									
										256
									
								
								.vimrc
								
								
								
								
							| 
						 | 
					@ -104,12 +104,13 @@ nn <leader>so :so %<cr>
 | 
				
			||||||
call plug#begin()
 | 
					call plug#begin()
 | 
				
			||||||
" Coc
 | 
					" Coc
 | 
				
			||||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
 | 
					Plug 'neoclide/coc.nvim', {'branch': 'release'}
 | 
				
			||||||
 | 
					Plug 'github/copilot.vim'
 | 
				
			||||||
" General
 | 
					" General
 | 
				
			||||||
 | 
					Plug 'unblevable/quick-scope'
 | 
				
			||||||
Plug 'tpope/vim-commentary'
 | 
					Plug 'tpope/vim-commentary'
 | 
				
			||||||
Plug 'machakann/vim-sandwich'
 | 
					Plug 'machakann/vim-sandwich'
 | 
				
			||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
 | 
					Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
 | 
				
			||||||
Plug 'junegunn/fzf.vim'
 | 
					Plug 'junegunn/fzf.vim'
 | 
				
			||||||
Plug 'vimwiki/vimwiki'
 | 
					 | 
				
			||||||
" JS and TypeScript
 | 
					" JS and TypeScript
 | 
				
			||||||
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
 | 
					Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
 | 
				
			||||||
Plug 'leafgarland/typescript-vim', { 'for': ['typescript', 'typescript.tsx'] }
 | 
					Plug 'leafgarland/typescript-vim', { 'for': ['typescript', 'typescript.tsx'] }
 | 
				
			||||||
| 
						 | 
					@ -119,6 +120,11 @@ Plug 'evanleck/vim-svelte', {'branch': 'main'}
 | 
				
			||||||
Plug 'neoclide/jsonc.vim'
 | 
					Plug 'neoclide/jsonc.vim'
 | 
				
			||||||
" LaTeX & markdown
 | 
					" LaTeX & markdown
 | 
				
			||||||
Plug 'lervag/vimtex'
 | 
					Plug 'lervag/vimtex'
 | 
				
			||||||
 | 
					" Wiki
 | 
				
			||||||
 | 
					Plug 'lervag/wiki.vim'
 | 
				
			||||||
 | 
					Plug 'hektor/taskwiki'
 | 
				
			||||||
 | 
					" Markdown
 | 
				
			||||||
 | 
					Plug 'vim-pandoc/vim-pandoc'
 | 
				
			||||||
Plug 'vim-pandoc/vim-pandoc-syntax'
 | 
					Plug 'vim-pandoc/vim-pandoc-syntax'
 | 
				
			||||||
" TidalCycles
 | 
					" TidalCycles
 | 
				
			||||||
Plug 'supercollider/scvim'
 | 
					Plug 'supercollider/scvim'
 | 
				
			||||||
| 
						 | 
					@ -129,29 +135,77 @@ call plug#end()
 | 
				
			||||||
"""""""""""""""
 | 
					"""""""""""""""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Coc
 | 
					" Coc
 | 
				
			||||||
 | 
					" `.../sandwich` {{{
 | 
				
			||||||
 | 
					nmap s <Nop>
 | 
				
			||||||
 | 
					xmap s <Nop>
 | 
				
			||||||
 | 
					let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `neoclide/coc.nvim` {{{
 | 
				
			||||||
let g:coc_global_extensions = [
 | 
					let g:coc_global_extensions = [
 | 
				
			||||||
 | 
					  \'coc-dictionary',
 | 
				
			||||||
 | 
					  \'coc-syntax',
 | 
				
			||||||
  \'coc-eslint',
 | 
					  \'coc-eslint',
 | 
				
			||||||
  \'coc-prettier',
 | 
					  \'coc-prettier',
 | 
				
			||||||
  \'coc-tsserver',
 | 
					  \'coc-tsserver',
 | 
				
			||||||
  \'coc-python',
 | 
					 | 
				
			||||||
  \'coc-html',
 | 
					  \'coc-html',
 | 
				
			||||||
  \'coc-emmet',
 | 
					  \'coc-emmet',
 | 
				
			||||||
  \'coc-css',
 | 
					  \'coc-css',
 | 
				
			||||||
  \'coc-svg',
 | 
					  \'coc-svg',
 | 
				
			||||||
  \'coc-svelte',
 | 
					  \'coc-svelte',
 | 
				
			||||||
 | 
					  \'coc-jedi',
 | 
				
			||||||
  \'coc-json',
 | 
					  \'coc-json',
 | 
				
			||||||
  \'coc-markdownlint',
 | 
					 | 
				
			||||||
  \'coc-yaml',
 | 
					  \'coc-yaml',
 | 
				
			||||||
  \'coc-snippets',
 | 
					  \'coc-snippets',
 | 
				
			||||||
  \'coc-clangd'
 | 
					  \'coc-clangd',
 | 
				
			||||||
 | 
					  \'coc-bibtex' 
 | 
				
			||||||
  \]
 | 
					  \]
 | 
				
			||||||
" Autocomplete
 | 
					" Autocomplete
 | 
				
			||||||
imap <tab> <Plug>(coc-snippets-expand)
 | 
					"
 | 
				
			||||||
nn <leader>es :CocCommand snippets.editSnippets<cr>
 | 
					
 | 
				
			||||||
ino <silent><expr><c-j> pumvisible() ? "\<c-n>" :
 | 
					" `coc-snippets`
 | 
				
			||||||
  \ coc#refresh()
 | 
					
 | 
				
			||||||
ino <expr><c-k> pumvisible() ? "\<C-p>" : "k"
 | 
					" TODO: is this block even necessary anymore?
 | 
				
			||||||
 | 
					"
 | 
				
			||||||
 | 
					" I use `coc-snippets-exand-jump` here as it is more flexible afaics
 | 
				
			||||||
 | 
					" As stated in the docs:
 | 
				
			||||||
 | 
					" `coc-snippets-expand`      Expand snippet w/ current inserted text
 | 
				
			||||||
 | 
					" `coc-snippets-expand-jump` Expand snippet or jump to next placeholder of current snippet if possible
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Use tab for expansion in every context Don't use it for jumping as
 | 
				
			||||||
 | 
					" expansions have priority over jumping (which is not always what you want)
 | 
				
			||||||
 | 
					"
 | 
				
			||||||
 | 
					" E.g. You don't want to expand `time` to say `12:05` upon `<tab>`bing to go
 | 
				
			||||||
 | 
					" from arguments to body in a function snippet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inor <silent><expr> <TAB> 
 | 
				
			||||||
 | 
					  \ coc#pum#visible() ? coc#_select_confirm() :
 | 
				
			||||||
 | 
					  \ coc#expandable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
 | 
				
			||||||
 | 
					  \ "\<TAB>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Use <c-j> and <c-k> to move through suggestions
 | 
				
			||||||
 | 
					" Open suggestions if not yet open
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inor <silent><expr> <c-j> coc#pum#visible() ? coc#pum#next(1) : coc#refresh()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" NOTE: As the followning interfered with digraphs, I replaced `coc#refresh`
 | 
				
			||||||
 | 
					" with `"\<C-g>u\<c-k>"` which afaik just does c-k when no completion menu is
 | 
				
			||||||
 | 
					" shown
 | 
				
			||||||
 | 
					" ```
 | 
				
			||||||
 | 
					" inor <silent><expr> <c-k> coc#pum#visible() ? coc#pum#prev(1) : coc#refresh()
 | 
				
			||||||
 | 
					" ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inor <silent><expr> <c-k> coc#pum#visible() ? coc#pum#prev(1) : "\<C-g>u\<c-k>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" NOTE: this is cutting text in visual mode, it is replaces `$VISUAL` on next
 | 
				
			||||||
 | 
					" expansion
 | 
				
			||||||
 | 
					"
 | 
				
			||||||
 | 
					" although I mapped it, I have yet to test this feature
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vmap <tab> <Plug>(coc-snippets-select)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ino <expr><cr> complete_info()["selected"] != "-1" ? "\<c-y>" : "\<c-g>u\<CR>"
 | 
					ino <expr><cr> complete_info()["selected"] != "-1" ? "\<c-y>" : "\<c-g>u\<CR>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Show doccumentation
 | 
					" Show doccumentation
 | 
				
			||||||
fu! s:show_documentation()
 | 
					fu! s:show_documentation()
 | 
				
			||||||
  if (index(['vim','help'], &filetype) >= 0)
 | 
					  if (index(['vim','help'], &filetype) >= 0)
 | 
				
			||||||
| 
						 | 
					@ -160,13 +214,21 @@ fu! s:show_documentation()
 | 
				
			||||||
    call CocAction('doHover')
 | 
					    call CocAction('doHover')
 | 
				
			||||||
  endif
 | 
					  endif
 | 
				
			||||||
endfunction
 | 
					endfunction
 | 
				
			||||||
nnoremap K :call show_documentation()
 | 
					nn <leader>es :CocCommand snippets.editSnippets<cr>
 | 
				
			||||||
" Code action on cursor position
 | 
					" Code action on cursor position
 | 
				
			||||||
nm <leader>do <Plug>(coc-codeaction)
 | 
					nm <leader>do <Plug>(coc-codeaction)
 | 
				
			||||||
" Coc statusline
 | 
					" Commands
 | 
				
			||||||
se statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
 | 
					 | 
				
			||||||
" Prettier command
 | 
					 | 
				
			||||||
com! -nargs=0 Prettier :CocCommand prettier.formatFile
 | 
					com! -nargs=0 Prettier :CocCommand prettier.formatFile
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `.../copilot` {{{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let g:copilot_node_command = "/home/h/.config/nvm/versions/node/v16.18.0/bin/node"
 | 
				
			||||||
 | 
					let g:copilot_no_tab_map = v:true
 | 
				
			||||||
 | 
					imap <c-l> <Plug>(copilot-next)
 | 
				
			||||||
 | 
					imap <c-h> <Plug>(copilot-prev)
 | 
				
			||||||
 | 
					imap <silent><script><expr> <s-tab> copilot#Accept("\<CR>")
 | 
				
			||||||
 | 
					" Show Copilot node v16 as it does not work with v18 yet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" LaTex
 | 
					" LaTex
 | 
				
			||||||
let g:vimtex_view_method='zathura'
 | 
					let g:vimtex_view_method='zathura'
 | 
				
			||||||
| 
						 | 
					@ -202,9 +264,77 @@ let g:fzf_colors =
 | 
				
			||||||
  \ 'marker':  ['fg', 'Keyword'],
 | 
					  \ 'marker':  ['fg', 'Keyword'],
 | 
				
			||||||
  \ 'spinner': ['fg', 'Label'], }
 | 
					  \ 'spinner': ['fg', 'Label'], }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Wiki
 | 
					let g:ag_working_path_mode="r"
 | 
				
			||||||
let g:vimwiki_auto_chdir = 1
 | 
					
 | 
				
			||||||
let g:vimwiki_list = [{'path': '~/.vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `vim-pandoc/vim-pandoc` {{{
 | 
				
			||||||
 | 
					" `vim-pandoc/vim-pandoc-syntax`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					au FileType pandoc call pandoc#completion#Init()
 | 
				
			||||||
 | 
					let g:pandoc#filetypes#pandoc_markdown=0
 | 
				
			||||||
 | 
					let g:pandoc#spell#enabled=0
 | 
				
			||||||
 | 
					let g:pandoc#spell#default_langs=['en_us', 'nl_be']
 | 
				
			||||||
 | 
					let g:pandoc#syntax#conceal#urls=1
 | 
				
			||||||
 | 
					let g:pandoc#syntax#conceal#blacklist=[]
 | 
				
			||||||
 | 
					let g:pandoc#formatting#mode='a'
 | 
				
			||||||
 | 
					let g:pandoc#formatting#textwidth=90
 | 
				
			||||||
 | 
					let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `lervag/wiki.vim` {{{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Only load wiki.vim for wiki directory
 | 
				
			||||||
 | 
					let g:wiki_global_load=0
 | 
				
			||||||
 | 
					let g:wiki_root='~/.wiki'
 | 
				
			||||||
 | 
					let g:wiki_index_name='index'
 | 
				
			||||||
 | 
					let g:wiki_zotero_root='~/doc/Zotero'
 | 
				
			||||||
 | 
					let g:wiki_filetypes=['md']
 | 
				
			||||||
 | 
					let g:wiki_completion_case_sensitive=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Mappings
 | 
				
			||||||
 | 
					" Remap <leader>p
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					augroup filetype_pandoc
 | 
				
			||||||
 | 
					  autocmd!
 | 
				
			||||||
 | 
					  au BufRead,BufNewFile /home/h/.wiki/*.md nn <buffer><leader>p :WikiFzfPages<cr>
 | 
				
			||||||
 | 
					  au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap <expr><buffer> sv empty(g:wiki#link#get()) ? ':vs<CR><c-w>w' : '<Plug>(wiki-link-follow-vsplit)'
 | 
				
			||||||
 | 
					  au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap <expr><buffer> ss empty(g:wiki#link#get()) ? ':sp<CR><c-w>w' : '<Plug>(wiki-link-follow-split)'
 | 
				
			||||||
 | 
					augroup END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" If we are on a wiki link 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" let g:wiki_file_handlenmap r
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Links
 | 
				
			||||||
 | 
					let g:wiki_link_extension='.md'
 | 
				
			||||||
 | 
					" Do not automatically transform to link, use `<leader>wf` for this
 | 
				
			||||||
 | 
					let g:wiki_link_toggle_on_follow=0
 | 
				
			||||||
 | 
					let g:wiki_link_target_type='md'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let g:wiki_map_text_to_link='Slugify'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" E.g. transform `My link` into `[My link](my-link.md)`
 | 
				
			||||||
 | 
					function Slugify(text) abort
 | 
				
			||||||
 | 
					  return [substitute(tolower(a:text), '\s\+', '-', 'g'), a:text]
 | 
				
			||||||
 | 
					endfunction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vmap <leader>wf <Plug>(wiki-link-toggle-visual)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Automatically save when navigation
 | 
				
			||||||
 | 
					let g:wiki_write_on_nav=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `tools-life/taskwiki` {{{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let g:taskwiki_taskrc_location='/home/h/.config/task/taskrc'
 | 
				
			||||||
 | 
					let g:taskwiki_disable_concealcursor=1
 | 
				
			||||||
 | 
					let g:taskwiki_dont_preserve_folds=1
 | 
				
			||||||
 | 
					let g:taskwiki_dont_fold=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" JS and TypeScript
 | 
					" JS and TypeScript
 | 
				
			||||||
let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
 | 
					let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
 | 
				
			||||||
| 
						 | 
					@ -217,6 +347,13 @@ let g:svelte_indent_style = 0
 | 
				
			||||||
" JSONC (see https://github.com/neoclide/jsonc.vim/pull/9")
 | 
					" JSONC (see https://github.com/neoclide/jsonc.vim/pull/9")
 | 
				
			||||||
autocmd BufNewFile,BufRead */.vscode/*.json setlocal filetype=jsonc
 | 
					autocmd BufNewFile,BufRead */.vscode/*.json setlocal filetype=jsonc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" `.../quickscope` {{{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let g:qs_max_chars=80
 | 
				
			||||||
 | 
					let g:qs_lazy_highlight = 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" SuperCollider
 | 
					" SuperCollider
 | 
				
			||||||
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
 | 
					au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
 | 
				
			||||||
au Filetype supercollider packadd scvim
 | 
					au Filetype supercollider packadd scvim
 | 
				
			||||||
| 
						 | 
					@ -238,24 +375,89 @@ let g:fzf_action = {
 | 
				
			||||||
  \ 'ctrl-s': 'split',
 | 
					  \ 'ctrl-s': 'split',
 | 
				
			||||||
  \ 'ctrl-v': 'vsplit'
 | 
					  \ 'ctrl-v': 'vsplit'
 | 
				
			||||||
  \}
 | 
					  \}
 | 
				
			||||||
 | 
					" Insert path completion
 | 
				
			||||||
 | 
					ino <expr><c-f> fzf#vim#complete#path('rg --files --sort path')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Color theme & statusline
 | 
					" }}}
 | 
				
			||||||
""""""""""""""""""""""""""
 | 
					
 | 
				
			||||||
 | 
					" Color theme & statusline {{{
 | 
				
			||||||
 | 
					"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
se nosc
 | 
					 | 
				
			||||||
se nosmd
 | 
					 | 
				
			||||||
se ls=2
 | 
					se ls=2
 | 
				
			||||||
se stl=\ %0*%n
 | 
					se stl=\ %0*%n
 | 
				
			||||||
se stl+=\ %m
 | 
					se stl+=\ %m
 | 
				
			||||||
se stl+=\ %y%1*
 | 
					se stl+=\ %y%0*
 | 
				
			||||||
se stl+=\ %<%F
 | 
					se stl+=\ %<%F
 | 
				
			||||||
se stl+=\ %1*%=%5l%*
 | 
					se stl+=\ %0*%=%5l%*
 | 
				
			||||||
se stl+=%2*/%L%*
 | 
					se stl+=%0*/%L%*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
colo simple-dark
 | 
					colo yang
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Other
 | 
					" }}}
 | 
				
			||||||
"""""""""""""""""""""""
 | 
					
 | 
				
			||||||
 | 
					" Quick hacks {{{
 | 
				
			||||||
 | 
					"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fu! Compile()
 | 
				
			||||||
 | 
					  if expand('%:e') == "md" 
 | 
				
			||||||
 | 
					    :silent exec "!pandoc % -s -o /tmp/op.pdf &"
 | 
				
			||||||
 | 
					  endif
 | 
				
			||||||
 | 
					endfu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fu! Preview()
 | 
				
			||||||
 | 
					  :call Compile()
 | 
				
			||||||
 | 
					  :silent exec "!zathura /tmp/op.pdf &"
 | 
				
			||||||
 | 
					endfu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" VIM config hot reload
 | 
					" VIM config hot reload
 | 
				
			||||||
autocmd! bufwritepost .vimrc source %
 | 
					
 | 
				
			||||||
 | 
					au! bufwritepost .vimrc source $HOME/.vimrc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" TODO: separate to filetype specific files
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" JS
 | 
				
			||||||
 | 
					" Jump between `=` and `;`
 | 
				
			||||||
 | 
					au FileType javascript set mps+==:;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" JSONC (see https://github.com/neoclide/jsonc.vim/pull/9")
 | 
				
			||||||
 | 
					au BufNewFile,BufRead */.vscode/*.json setlocal filetype=jsonc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Hacky way to pass on active note to script for automated for HTML preview
 | 
				
			||||||
 | 
					au BufEnter /home/h/.wiki/*.md silent exe '!echo %:t > /home/h/.local/share/nvim/plugged/bro/current-page'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					highlight QuickScopeSecondary cterm=underline
 | 
				
			||||||
 | 
					highlight QuickScopePrimary ctermbg=253 ctermfg=232 cterm=none
 | 
				
			||||||
 | 
					highlight Pmenu ctermfg=232
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function! SynGroup()
 | 
				
			||||||
 | 
					    let l:s = synID(line('.'), col('.'), 1)
 | 
				
			||||||
 | 
					    echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
 | 
				
			||||||
 | 
					endfun
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					com! -nargs=0 Syn :call SynGroup()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Taken from /usr/share/vim/vim90/defaults.vim
 | 
				
			||||||
 | 
					augroup vimStartup
 | 
				
			||||||
 | 
					  au!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  " When editing a file, always jump to the last known cursor position.
 | 
				
			||||||
 | 
					  " Don't do it when the position is invalid, when inside an event handler
 | 
				
			||||||
 | 
					  " (happens when dropping a file on gvim) and for a commit message (it's
 | 
				
			||||||
 | 
					  " likely a different one than last time).
 | 
				
			||||||
 | 
					  autocmd BufReadPost *
 | 
				
			||||||
 | 
					    \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
 | 
				
			||||||
 | 
					    \ |   exe "normal! g`\""
 | 
				
			||||||
 | 
					    \ | endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					augroup END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Highlight todo's for every filetype
 | 
				
			||||||
 | 
					" https://stackoverflow.com/questions/11709965/vim-highlight-the-word-todo-for-every-filetype
 | 
				
			||||||
 | 
					augroup HiglightTODO
 | 
				
			||||||
 | 
					    autocmd!
 | 
				
			||||||
 | 
					    autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'TODO', -1)
 | 
				
			||||||
 | 
					    autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'FIXME', -1)
 | 
				
			||||||
 | 
					    autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', 'QUESTION', -1)
 | 
				
			||||||
 | 
					augroup END
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,19 @@
 | 
				
			||||||
# Vortex core
 | 
					# Keyboard configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Generated from [TsFreddie's MPC tool](https://tsdo.in/much-programming-core/)
 | 
					Keyboard configuration for the Vortex Core 40% keyboard.
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					Generated using [TsFreddie's MPC tool](https://tsdo.in/much-programming-core/).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note: this is assuming `Caps lock` is remapped to `Esc` on press and `Ctrl` on hold (e.g. using `caps2esc`).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Layer 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Macros are mainly used for shift, ctrl & alt modifiers.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Layer 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Lighting configuration layer with some macros for workspaces.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 72 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 10 KiB  | 
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 50 KiB  | 
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										21
									
								
								.xmobarrc
								
								
								
								
							
							
						
						
									
										21
									
								
								.xmobarrc
								
								
								
								
							| 
						 | 
					@ -1,13 +1,21 @@
 | 
				
			||||||
Config { overrideRedirect = False
 | 
					Config { overrideRedirect = False
 | 
				
			||||||
       , font =         "xft:Iosevka Term SS08:size=12:antialias=true"
 | 
					       , font =         "xft:Iosevka Term SS08:size=12:antialias=true"
 | 
				
			||||||
       , bgColor =      "#111"
 | 
					       , bgColor =      "#cccccc"
 | 
				
			||||||
       , fgColor =      "#ccc"
 | 
					       , fgColor =      "#111"
 | 
				
			||||||
       , position = TopW L 90
 | 
					       , position = TopW L 100
 | 
				
			||||||
       , commands = [ Run Cpu
 | 
					       , commands = [ Run Cpu
 | 
				
			||||||
                        [ "-L", "3"
 | 
					                        [ "-L", "3"
 | 
				
			||||||
                        , "-H", "50"
 | 
					                        , "-H", "50"
 | 
				
			||||||
                        , "--high"  , "red"
 | 
					                        , "--high"  , "red"
 | 
				
			||||||
                        , "--normal", "green"
 | 
					                        ] 10
 | 
				
			||||||
 | 
					                    , Run Battery [
 | 
				
			||||||
 | 
					                        "-t", "<acstatus>: <left>% - <timeleft>",
 | 
				
			||||||
 | 
					                        "--",
 | 
				
			||||||
 | 
					                        --"-c", "charge_full",
 | 
				
			||||||
 | 
					                        "-O", "AC",
 | 
				
			||||||
 | 
					                        "-o", "Bat",
 | 
				
			||||||
 | 
					                        "-h", "green",
 | 
				
			||||||
 | 
					                        "-l", "red"
 | 
				
			||||||
                        ] 10
 | 
					                        ] 10
 | 
				
			||||||
                    , Run Alsa "default" "Master"
 | 
					                    , Run Alsa "default" "Master"
 | 
				
			||||||
                        [ "--template", "Vol: <volumestatus>"
 | 
					                        [ "--template", "Vol: <volumestatus>"
 | 
				
			||||||
| 
						 | 
					@ -17,9 +25,12 @@ Config { overrideRedirect = False
 | 
				
			||||||
                        ]
 | 
					                        ]
 | 
				
			||||||
                    , Run Memory ["--template", "Mem: <usedratio>%"] 10
 | 
					                    , Run Memory ["--template", "Mem: <usedratio>%"] 10
 | 
				
			||||||
                    , Run Date "%a %Y-%m-%d %H:%M" "date" 10
 | 
					                    , Run Date "%a %Y-%m-%d %H:%M" "date" 10
 | 
				
			||||||
 | 
					                    , Run Com "sb-pomo" [] "pomo" 10
 | 
				
			||||||
 | 
					                    , Run Com "sb-anki" [] "anki" 10
 | 
				
			||||||
 | 
					                    , Run Com "sb-tasks" [] "tasks" 10
 | 
				
			||||||
                    , Run XMonadLog
 | 
					                    , Run XMonadLog
 | 
				
			||||||
                    ]
 | 
					                    ]
 | 
				
			||||||
       , sepChar  = "%"
 | 
					       , sepChar  = "%"
 | 
				
			||||||
       , alignSep = "}{"
 | 
					       , alignSep = "}{"
 | 
				
			||||||
       , template = "%XMonadLog% }{ %alsa:default:Master% | %cpu% | %memory% | %date% "
 | 
					       , template = "%XMonadLog%%anki%%pomo%%tasks% }{ %alsa:default:Master% | %battery% | %date%"
 | 
				
			||||||
       }
 | 
					       }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,45 +1,99 @@
 | 
				
			||||||
import XMonad
 | 
					import XMonad
 | 
				
			||||||
import XMonad.Hooks.DynamicLog
 | 
					import XMonad.Hooks.DynamicLog
 | 
				
			||||||
 | 
					import XMonad.Hooks.EwmhDesktops
 | 
				
			||||||
import XMonad.Hooks.ManageDocks
 | 
					import XMonad.Hooks.ManageDocks
 | 
				
			||||||
import           XMonad.Layout.NoBorders      (smartBorders)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import           XMonad.Layout.Magnifier
 | 
					 | 
				
			||||||
import qualified XMonad.Layout.Magnifier      as Mag (MagnifyMsg (..))
 | 
					 | 
				
			||||||
import           XMonad.Layout.Spacing
 | 
					 | 
				
			||||||
import           XMonad.Layout.Tabbed         (Theme (..), shrinkText,
 | 
					 | 
				
			||||||
                                               tabbedAlways)
 | 
					 | 
				
			||||||
import           XMonad.Layout.ThreeColumns
 | 
					 | 
				
			||||||
import           XMonad.Layout.ToggleLayouts  (ToggleLayout (..), toggleLayouts)
 | 
					 | 
				
			||||||
import           XMonad.Layout.WindowArranger
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import           XMonad.Util.EZConfig
 | 
					 | 
				
			||||||
import           XMonad.Util.Loggers
 | 
					 | 
				
			||||||
import           XMonad.Util.Paste
 | 
					 | 
				
			||||||
import           XMonad.Util.Run              (spawnPipe)
 | 
					 | 
				
			||||||
import           XMonad.Util.Ungrab
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import           XMonad.Actions.CycleWS
 | 
					 | 
				
			||||||
import           XMonad.Actions.WindowGo
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import XMonad.Hooks.ManageHelpers
 | 
					import XMonad.Hooks.ManageHelpers
 | 
				
			||||||
import           XMonad.Hooks.ScreenCorners
 | 
					 | 
				
			||||||
import XMonad.Hooks.StatusBar
 | 
					import XMonad.Hooks.StatusBar
 | 
				
			||||||
import XMonad.Hooks.StatusBar.PP
 | 
					import XMonad.Hooks.StatusBar.PP
 | 
				
			||||||
 | 
					import XMonad.Layout.Magnifier
 | 
				
			||||||
import qualified XMonad.Util.Hacks            as Hacks
 | 
					import qualified XMonad.Layout.Magnifier as Mag (MagnifyMsg (..))
 | 
				
			||||||
 | 
					import XMonad.Layout.NoBorders (hasBorder, smartBorders)
 | 
				
			||||||
-- EWMH compliance
 | 
					import XMonad.Layout.PerScreen
 | 
				
			||||||
import           XMonad.Hooks.EwmhDesktops
 | 
					import XMonad.Layout.ResizableTile
 | 
				
			||||||
 | 
					import XMonad.Layout.Spacing
 | 
				
			||||||
import qualified Data.Map.Strict              as M
 | 
					import XMonad.Layout.ThreeColumns
 | 
				
			||||||
 | 
					import XMonad.Layout.ToggleLayouts
 | 
				
			||||||
 | 
					  ( ToggleLayout (..),
 | 
				
			||||||
 | 
					    toggleLayouts,
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					import XMonad.Layout.WindowNavigation
 | 
				
			||||||
import qualified XMonad.StackSet as W
 | 
					import qualified XMonad.StackSet as W
 | 
				
			||||||
 | 
					import XMonad.Util.EZConfig
 | 
				
			||||||
 | 
					import qualified XMonad.Util.Hacks as Hacks
 | 
				
			||||||
 | 
					import XMonad.Util.Loggers
 | 
				
			||||||
 | 
					import XMonad.Util.Paste
 | 
				
			||||||
 | 
					import XMonad.Util.Run
 | 
				
			||||||
 | 
					  ( spawnExternalProcess,
 | 
				
			||||||
 | 
					    spawnPipe,
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					import XMonad.Util.Ungrab
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Magnifier is off by default (can be controlled using arrow keys)
 | 
					-- Statusbar
 | 
				
			||||||
myLayout = smartBorders $
 | 
					myXmobarPP :: PP
 | 
				
			||||||
             threeColMid |||
 | 
					myXmobarPP =
 | 
				
			||||||
             magnifiercz magnificationFactorH tiled |||
 | 
					  def
 | 
				
			||||||
             magnifiercz magnificationFactorV (Mirror tiled) |||
 | 
					    { ppSep = tertiaryColor " | ",
 | 
				
			||||||
             Full
 | 
					      ppCurrent = brackitify,
 | 
				
			||||||
 | 
					      ppHidden = secondaryColor,
 | 
				
			||||||
 | 
					      ppHiddenNoWindows = tertiaryColor,
 | 
				
			||||||
 | 
					      ppUrgent = red . wrap (yellow "!") (yellow "!"),
 | 
				
			||||||
 | 
					      ppLayout = \l -> case l of
 | 
				
			||||||
 | 
					        "Tall" -> "[]="
 | 
				
			||||||
 | 
					        "Magnifier Tall" -> "[]+"
 | 
				
			||||||
 | 
					        "Magnifier (off) Tall" -> "[]="
 | 
				
			||||||
 | 
					        "Magnifier Mirror Tall" -> "+[]"
 | 
				
			||||||
 | 
					        "Magnifier (off) Mirror Tall" -> "=[]"
 | 
				
			||||||
 | 
					        "Full" -> "[ ]"
 | 
				
			||||||
 | 
					        "ThreeCol" -> "|||"
 | 
				
			||||||
 | 
					        _ -> l,
 | 
				
			||||||
 | 
					      ppTitle = shorten 80,
 | 
				
			||||||
 | 
					      ppTitleSanitize = xmobarStrip,
 | 
				
			||||||
 | 
					      ppOrder = \[ws, l, _, wins] -> [ws, l, wins],
 | 
				
			||||||
 | 
					      ppExtras = [logTitles formatFocused formatUnfocused]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  where
 | 
				
			||||||
 | 
					    brackitify = wrap "[" "]"
 | 
				
			||||||
 | 
					    formatFocused = secondaryColor . brackitify . ppWindow
 | 
				
			||||||
 | 
					    formatUnfocused = tertiaryColor . ppWindow
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ppWindow = xmobarRaw . (\w -> if null w then "Untitled" else w) . shorten 16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    primaryColor = xmobarColor "#000000" ""
 | 
				
			||||||
 | 
					    secondaryColor = xmobarColor "#333333" ""
 | 
				
			||||||
 | 
					    tertiaryColor = xmobarColor "#555555" ""
 | 
				
			||||||
 | 
					    yellow = xmobarColor "#ff0" ""
 | 
				
			||||||
 | 
					    red = xmobarColor "#ff5555" ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Shift to workspace and view workspace
 | 
				
			||||||
 | 
					shiftAndView id = doF (W.view id) <> doF (W.shift id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- manageHook
 | 
				
			||||||
 | 
					myManageHook =
 | 
				
			||||||
 | 
					  composeAll
 | 
				
			||||||
 | 
					    [ className =? "Zathura" --> doShift "pdf",
 | 
				
			||||||
 | 
					      className =? "firefox" --> shiftAndView "www",
 | 
				
			||||||
 | 
					      className =? "Anki" --> shiftAndView "etc",
 | 
				
			||||||
 | 
					      className =? "Obsidian" --> shiftAndView "etc",
 | 
				
			||||||
 | 
					      className =? "Launcher" --> doRectFloat (W.RationalRect 0.05 0.4 0.9 0.5),
 | 
				
			||||||
 | 
					      className =? "Calculator" --> doCenterFloat,
 | 
				
			||||||
 | 
					      className =? "feh" --> doCenterFloat,
 | 
				
			||||||
 | 
					      className =? "albert" --> hasBorder False,
 | 
				
			||||||
 | 
					      className =? "Xournalpp" --> doRectFloat (W.RationalRect 0.5 0.5 0.5 0.5)
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- layoutHook
 | 
				
			||||||
 | 
					myLayoutHook =
 | 
				
			||||||
 | 
					  smartBorders $
 | 
				
			||||||
 | 
					    -- Column layouts
 | 
				
			||||||
 | 
					    threeCol
 | 
				
			||||||
 | 
					      ||| threeColMid
 | 
				
			||||||
 | 
					      -- Tiled layouts
 | 
				
			||||||
 | 
					      --   Note: magnifier is off by default
 | 
				
			||||||
 | 
					      --   (controllable usingarrow keys)
 | 
				
			||||||
 | 
					      ||| magnifiercz magnificationFactorH tiled
 | 
				
			||||||
 | 
					      ||| magnifiercz magnificationFactorV (Mirror tiled)
 | 
				
			||||||
 | 
					      -- Single window / monocle layout
 | 
				
			||||||
 | 
					      ||| Full
 | 
				
			||||||
  where
 | 
					  where
 | 
				
			||||||
    magnificationFactorV = 1.384
 | 
					    magnificationFactorV = 1.384
 | 
				
			||||||
    magnificationFactorH = 1.621
 | 
					    magnificationFactorH = 1.621
 | 
				
			||||||
| 
						 | 
					@ -47,124 +101,103 @@ myLayout = smartBorders $
 | 
				
			||||||
    threeCol = ThreeCol nmaster delta ratio
 | 
					    threeCol = ThreeCol nmaster delta ratio
 | 
				
			||||||
    threeColMid = ThreeColMid nmaster delta ratio
 | 
					    threeColMid = ThreeColMid nmaster delta ratio
 | 
				
			||||||
    nmaster = 1
 | 
					    nmaster = 1
 | 
				
			||||||
    ratio   = 1/2
 | 
					    ratio = 1 / 2
 | 
				
			||||||
    delta   = 4/100
 | 
					    delta = 4 / 100
 | 
				
			||||||
 | 
					 | 
				
			||||||
myStartupHook = do
 | 
					 | 
				
			||||||
  addScreenCorners [ (SCUpperRight, nextWS)
 | 
					 | 
				
			||||||
                   , (SCUpperLeft, prevWS)
 | 
					 | 
				
			||||||
                   ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
myManageHook = composeAll
 | 
					 | 
				
			||||||
                 [ className =? "Zathura" --> doShift "ε"
 | 
					 | 
				
			||||||
                 , className =? "Launcher" --> doRectFloat (W.RationalRect 0.05 0.4 0.9 0.5)
 | 
					 | 
				
			||||||
                 ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
myConfig = def
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    terminal = "alacritty"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					myConfig =
 | 
				
			||||||
 | 
					  def
 | 
				
			||||||
 | 
					    { terminal = "alacritty",
 | 
				
			||||||
      -- Use Win key instead of Alt
 | 
					      -- Use Win key instead of Alt
 | 
				
			||||||
  , modMask = mod4Mask
 | 
					      modMask = mod4Mask,
 | 
				
			||||||
  , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"]
 | 
					      -- , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η"]
 | 
				
			||||||
 | 
					      workspaces =
 | 
				
			||||||
 | 
					        [ "sh",
 | 
				
			||||||
 | 
					          "www",
 | 
				
			||||||
 | 
					          "dev",
 | 
				
			||||||
 | 
					          -- "nix",
 | 
				
			||||||
 | 
					          "pdf",
 | 
				
			||||||
 | 
					          "etc"
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
      -- Styling
 | 
					      -- Styling
 | 
				
			||||||
  , focusedBorderColor = "#888"
 | 
					      focusedBorderColor = "#888",
 | 
				
			||||||
  , normalBorderColor = "#000"
 | 
					      normalBorderColor = "#000",
 | 
				
			||||||
  , borderWidth = 2
 | 
					      borderWidth = 2,
 | 
				
			||||||
 | 
					 | 
				
			||||||
      -- Hooks
 | 
					      -- Hooks
 | 
				
			||||||
  , startupHook = myStartupHook
 | 
					      manageHook = myManageHook <+> manageHook def,
 | 
				
			||||||
  , manageHook = myManageHook <+> manageHook def
 | 
					      layoutHook = avoidStruts myLayoutHook,
 | 
				
			||||||
  , layoutHook = screenCornerLayoutHook $ avoidStruts myLayout
 | 
					      handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook
 | 
				
			||||||
  , handleEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook <+> screenCornerEventHook
 | 
					    }
 | 
				
			||||||
  } `additionalKeysP` myKeysP
 | 
					    `additionalKeysP` myKeysP
 | 
				
			||||||
    `removeKeysP` myRemoveKeysP
 | 
					    `removeKeysP` myRemoveKeysP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Keybindings to be added/overridden
 | 
					-- Keybindings to be added/overridden
 | 
				
			||||||
myKeysP = [
 | 
					myKeysP =
 | 
				
			||||||
  -- Fit floating windows back to layout
 | 
					  [ -- Fit floating windows back to layout
 | 
				
			||||||
    ("M-S-<Space>", withFocused $ windows . W.sink)
 | 
					    ("M-S-<Space>", withFocused $ windows . W.sink),
 | 
				
			||||||
 | 
					    -- Launchers
 | 
				
			||||||
  -- Use rofi to launch programs
 | 
					    ("M-S-p", spawn "alacritty --class Launcher,Launcher"),
 | 
				
			||||||
  , ("M-p", spawn "launcher")
 | 
					    ("M-p", spawn "albert toggle"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Map insert key to paste from clipboard
 | 
					    -- Map insert key to paste from clipboard
 | 
				
			||||||
  , ("<Insert>", pasteSelection)
 | 
					    ("<Insert>", pasteSelection),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Map print screen to take a screenshot with flameshot
 | 
					    -- Map print screen to take a screenshot with flameshot
 | 
				
			||||||
  , ("<Print>", spawn "flameshot gui")
 | 
					    ("<Print>", spawn "flameshot gui"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Map audio keys to control volume
 | 
					    -- Map audio keys to control volume
 | 
				
			||||||
  , ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%")
 | 
					    ("<XF86AudioRaiseVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%"),
 | 
				
			||||||
  , ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%")
 | 
					    ("<XF86AudioLowerVolume>", spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%"),
 | 
				
			||||||
  , ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle")
 | 
					    ("<XF86AudioMute>", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Map brightness keys to control brightness with brightnessctl
 | 
					    -- Map brightness keys to control brightness with brightnessctl
 | 
				
			||||||
  , ("<XF86MonBrightnessUp>", spawn "brightnessctl set 20+")
 | 
					    ("<XF86MonBrightnessUp>", spawn "brightnessctl set 20+"),
 | 
				
			||||||
  , ("<XF86MonBrightnessDown>", spawn "brightnessctl set 20-")
 | 
					    ("<XF86MonBrightnessDown>", spawn "brightnessctl set 20-"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Map brightness keys + shift to adjust redshift temperature
 | 
					    -- Map brightness keys + shift to adjust redshift temperature
 | 
				
			||||||
  , ("S-<XF86MonBrightnessUp>", spawn "echo $(($(cat /tmp/temperature) + 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything")
 | 
					    ("S-<XF86MonBrightnessUp>", spawn "echo $(($(cat /tmp/temperature) + 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything"),
 | 
				
			||||||
  , ("S-<XF86MonBrightnessDown>", spawn "echo $(($(cat /tmp/temperature) - 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything")
 | 
					    ("S-<XF86MonBrightnessDown>", spawn "echo $(($(cat /tmp/temperature) - 50)) > /tmp/temperature && redshift -O $(cat /tmp/temperature) -P && notify < /tmp/temperature -h string:x-canonical-private-synchronous:anything"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Reset redshift temperature
 | 
					    -- Reset redshift temperature
 | 
				
			||||||
  , ("M-S-<XF86MonBrightnessUp>", spawn "echo 3000 > /tmp/temperature && redshift -x")
 | 
					    ("M-S-<XF86MonBrightnessUp>", spawn "echo 3000 > /tmp/temperature && redshift -x"),
 | 
				
			||||||
  , ("M-S-<XF86MonBrightnessDown>", spawn "echo 3000 > /tmp/temperature && redshift -x")
 | 
					    ("M-S-<XF86MonBrightnessDown>", spawn "echo 3000 > /tmp/temperature && redshift -x"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Use power down key to suspend
 | 
					    -- Use power down key to suspend
 | 
				
			||||||
  , ("<XF86PowerOff>", spawn "systemctl suspend")
 | 
					    ("<XF86PowerOff>", spawn "systemctl suspend"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- FIXME: Spawn firefox in fullscreen, but not in kiosk mode
 | 
					    -- FIXME: Spawn firefox in fullscreen, but not in kiosk mode
 | 
				
			||||||
  , ("M-S-b", spawn "firefox --fullscreen")
 | 
					    ("M-S-b", spawn "firefox --fullscreen"),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    -- Magnify window using arrow keys
 | 
					    -- Magnify window using arrow keys
 | 
				
			||||||
  , ("M-=", sendMessage MagnifyMore >> sendMessage Mag.ToggleOn)
 | 
					    ("M-=", sendMessage MagnifyMore >> sendMessage Mag.ToggleOn),
 | 
				
			||||||
  , ("M--", sendMessage MagnifyLess >> sendMessage Mag.ToggleOn)
 | 
					    ("M--", sendMessage MagnifyLess >> sendMessage Mag.ToggleOn),
 | 
				
			||||||
    -- Reset magnification
 | 
					    -- Reset magnification
 | 
				
			||||||
  , ("M-S-=", sendMessage Mag.ToggleOff)
 | 
					    ("M-S-=", sendMessage Mag.ToggleOff),
 | 
				
			||||||
 | 
					    ("<XF86Calculator>", spawn "alacritty --class 'Calculator' -e ipython -i /home/h/.bin/calc.py"),
 | 
				
			||||||
  , ("M-t", sendMessage $ JumpToLayout "Tall")
 | 
					    -- playerctl ncspot using arrow keys
 | 
				
			||||||
  , ("M-f", sendMessage $ JumpToLayout "Full")
 | 
					    ("M-<Right>", spawn "playerctl next"),
 | 
				
			||||||
  , ("M-S-\\", sendMessage $ JumpToLayout "ThreeCol")
 | 
					    ("M-<Left>", spawn "playerctl previous"),
 | 
				
			||||||
 | 
					    ("M-<Up>", spawn "playerctl play"),
 | 
				
			||||||
 | 
					    ("M-<Down>", spawn "playerctl pause"),
 | 
				
			||||||
 | 
					    -- Use a,s,d,f,g to switch to workspaces
 | 
				
			||||||
 | 
					    ("M-a", windows $ W.greedyView "sh"),
 | 
				
			||||||
 | 
					    ("M-s", windows $ W.greedyView "www"),
 | 
				
			||||||
 | 
					    ("M-d", windows $ W.greedyView "dev"),
 | 
				
			||||||
 | 
					    ("M-f", windows $ W.greedyView "pdf"),
 | 
				
			||||||
 | 
					    ("M-g", windows $ W.greedyView "etc"),
 | 
				
			||||||
 | 
					    -- Use shift + a,s,d,f,g to move window to workspace
 | 
				
			||||||
 | 
					    ("M-S-a", windows $ W.shift "sh"),
 | 
				
			||||||
 | 
					    ("M-S-s", windows $ W.shift "www"),
 | 
				
			||||||
 | 
					    ("M-S-d", windows $ W.shift "dev"),
 | 
				
			||||||
 | 
					    ("M-S-f", windows $ W.shift "pdf"),
 | 
				
			||||||
 | 
					    ("M-S-g", windows $ W.shift "etc")
 | 
				
			||||||
  ]
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Keybindings to be removed
 | 
					-- Keybindings to be removed
 | 
				
			||||||
myRemoveKeysP = [ "M-t" ]
 | 
					myRemoveKeysP =
 | 
				
			||||||
 | 
					  [ -- Remove 1,2,3,4,5 bindings for workspaces
 | 
				
			||||||
myXmobarPP :: PP
 | 
					    "M-1",
 | 
				
			||||||
myXmobarPP = def
 | 
					    "M-2",
 | 
				
			||||||
    { ppSep             = tertiaryColor " | "
 | 
					    "M-3",
 | 
				
			||||||
    , ppTitleSanitize   = xmobarStrip
 | 
					    "M-4",
 | 
				
			||||||
    , ppCurrent         = brackitify
 | 
					    "M-5",
 | 
				
			||||||
    , ppHidden          = secondaryColor . wrap " " ""
 | 
					    -- Remove shift + 1,2,3,4,5 bindings for workspaces
 | 
				
			||||||
    , ppHiddenNoWindows = secondaryColor . wrap " " ""
 | 
					    "M-S-1",
 | 
				
			||||||
    , ppUrgent          = red . wrap (yellow "!") (yellow "!")
 | 
					    "M-S-2",
 | 
				
			||||||
    , ppLayout  = \l -> case l of "Tall"                  -> "[]="
 | 
					    "M-S-3",
 | 
				
			||||||
                                  "Magnifier Tall"        -> "[]+"
 | 
					    "M-S-4",
 | 
				
			||||||
                                  "Magnifier Mirror Tall" -> "+[]"
 | 
					    "M-S-5"
 | 
				
			||||||
                                  "Full"                  -> "[ ]"
 | 
					  ]
 | 
				
			||||||
                                  "ThreeCol"              -> "|||"
 | 
					 | 
				
			||||||
                                  _                       -> l
 | 
					 | 
				
			||||||
    , ppTitle   = shorten 80
 | 
					 | 
				
			||||||
    , ppOrder           = \[ws, l, _, wins] -> [ws, l, wins]
 | 
					 | 
				
			||||||
    , ppExtras          = [logTitles formatFocused formatUnfocused]
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  where
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    brackitify = wrap "[" "]"
 | 
					 | 
				
			||||||
    formatFocused   = primaryColor . brackitify . ppWindow
 | 
					 | 
				
			||||||
    formatUnfocused = secondaryColor . brackitify . ppWindow
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ppWindow = xmobarRaw . (\w -> if null w then "Untitled" else w) . shorten 30
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    primaryColor = xmobarColor "#eeeeee" ""
 | 
					 | 
				
			||||||
    secondaryColor = xmobarColor "#888888" ""
 | 
					 | 
				
			||||||
    tertiaryColor = xmobarColor "#555555" ""
 | 
					 | 
				
			||||||
    white    = xmobarColor "#ffffff" ""
 | 
					 | 
				
			||||||
    yellow   = xmobarColor "#ff0" ""
 | 
					 | 
				
			||||||
    red      = xmobarColor "#ff5555" ""
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
main :: IO ()
 | 
					main :: IO ()
 | 
				
			||||||
main = do xmonad $ docks $ ewmh $ withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey myConfig
 | 
					main = do xmonad $ docks $ ewmh $ withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey myConfig
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue