├── .config ├── X │ ├── Xmodmap │ ├── Xresources │ └── xinitrc ├── backup.config ├── bash │ ├── bashrc │ └── profile ├── bspwm-polybar │ ├── config.ini │ ├── config.ini.bak │ ├── launch.sh │ └── scripts │ │ ├── battery-text.sh │ │ ├── hidden.sh │ │ ├── layout.sh │ │ ├── tasks.sh │ │ ├── text-indicator.sh │ │ ├── volbar-text.sh │ │ └── volbar.sh ├── bspwm │ ├── bspwmrc │ ├── external_rules.sh │ └── scripts │ │ ├── bsp-layout-ratio │ │ ├── bspc-balance │ │ ├── bspc-config-menu │ │ ├── bspc-desktop-setup │ │ ├── bspc-desktop-swap │ │ ├── bspc-layout-menu │ │ ├── bspc-main-toggle │ │ ├── bspc-notify │ │ ├── bspc-padding │ │ ├── bspc-resize │ │ ├── bspc-retile │ │ ├── bspc-toggle-visibility │ │ ├── focus-mode │ │ ├── nf │ │ ├── sxhkd-help │ │ └── waitfor ├── colors │ ├── bluu │ │ ├── bluu.Xresources │ │ └── bluu.colors │ └── wires │ │ ├── wires.Xresources │ │ └── wires.colors ├── dots.config ├── dunst │ ├── dunstrc │ ├── dunstrc.in │ └── reload.sh ├── jrnl │ └── jrnl.yaml ├── newsboat │ ├── config │ └── urls ├── nvim │ ├── .netrwhist │ ├── colors │ │ ├── alduin.vim │ │ ├── alduin.vim.bak │ │ ├── badwolf.vim │ │ ├── badwolf_mod.vim │ │ ├── bliss.vim │ │ ├── breve.vim │ │ ├── distinguished.vim │ │ ├── gunmetal-grey.vim │ │ ├── gunmetal.vim │ │ ├── inkpot.vim │ │ ├── jellybeans.vim │ │ ├── jellybeans_dark.vim │ │ ├── mountaineer-grey.vim │ │ ├── mountaineer-light.vim │ │ ├── mountaineer.vim │ │ ├── simple-dark.vim │ │ ├── tender.vim │ │ ├── twilight.vim │ │ └── zenburn.vim │ ├── init.vim │ └── init.vim.bak ├── openbox │ ├── autostart │ ├── environment │ ├── menu.xml │ └── rc.xml ├── picom.conf ├── ranger │ ├── rc.conf │ └── rifle.conf ├── rofi │ ├── colors.rasi │ ├── colors.rasi.in │ ├── config.rasi │ └── launcher.sh ├── shortcuts.config ├── sxhkd │ ├── openbox-sxhkdrc │ └── sxhkdrc ├── task │ └── config ├── user-dirs.dirs ├── vit │ └── config.ini ├── wall │ ├── calm1.jpg │ ├── clouds-edit1.jpg │ ├── lock.png │ ├── sunsea1.png │ ├── tree.jpg │ └── wall.config ├── xrdb-replace │ └── files └── zathura │ ├── zathurarc │ └── zathurarc.in ├── .github ├── README.md ├── bspwm4.png └── foliage.png ├── .local ├── bin │ ├── abspath │ ├── bat │ ├── batbar │ ├── battery-notify │ ├── bookmark │ ├── bri │ ├── bribar │ ├── cl-ghosts │ ├── cl-panes │ ├── colorbars │ ├── disk_backup │ ├── dmenu │ ├── dmount │ ├── dots-edit-menu │ ├── dropbox-wrapper │ ├── dswitcher │ ├── dumount │ ├── duplicate │ ├── dwm-notify │ ├── edit-menu │ ├── indicator_bar │ ├── launcher │ ├── local_backup │ ├── lock │ ├── log │ ├── lrofi │ ├── mpvplay │ ├── play │ ├── remember │ ├── remindme │ ├── setwp │ ├── shortcut-menu │ ├── shutdownmenu │ ├── space │ ├── startbarbspwm │ ├── sysinfo-menu │ ├── sysinfo-notify │ ├── tasks │ ├── togglebarbspwm │ ├── vol │ ├── volbar │ ├── window-ctrl │ ├── wp │ ├── xrdbvar │ └── youtube-rss └── scripts │ └── spotify_status.py └── LICENSE /.config/X/Xmodmap: -------------------------------------------------------------------------------- 1 | ! Bind super (windows key) to mode switch (ctrl) 2 | keycode 133 = Mode_switch 3 | keysym h = h H Left 4 | keysym l = l L Right 5 | keysym k = k K Up 6 | keysym j = j J Down 7 | 8 | ! Bind caps to escape (for external keyboards) 9 | clear Lock 10 | keycode 66 = Escape Escape Escape 11 | ! keycode 56 = b B 12 | -------------------------------------------------------------------------------- /.config/X/Xresources: -------------------------------------------------------------------------------- 1 | !!!!!!!!!!!!! 2 | !! Defines !! 3 | !!!!!!!!!!!!! 4 | #define FOREGROUND #afa492 5 | #define FOREGROUND_ALT #afa492 6 | #define BACKGROUND #191215 7 | #define CURSORCOLOR #afa492 8 | #define BLACK1 #211e27 9 | #define BLACK2 #2c2e39 10 | #define RED1 #651f36 11 | #define RED2 #651f36 12 | #define GREEN1 #414b3d 13 | #define GREEN2 #414b3d 14 | #define YELLOW1 #6f6638 15 | #define YELLOW2 #6f6638 16 | #define BLUE1 #3e4158 17 | #define BLUE2 #3e4158 18 | #define MAGENTA1 #553b4d 19 | #define MAGENTA2 #553b4d 20 | #define CYAN1 #385258 21 | #define CYAN2 #385258 22 | #define WHITE1 #e9e7e5 23 | #define WHITE2 #afa492 24 | 25 | #define TRANSPARENT #77e9e7e5 26 | 27 | !!!!!!!!!!!! 28 | !! Colors !! 29 | !!!!!!!!!!!! 30 | ! special 31 | *.foreground: FOREGROUND 32 | *.background: BACKGROUND 33 | *.cursorColor: CURSORCOLOR 34 | 35 | ! black 36 | *.color0: BLACK1 37 | *.color8: BLACK2 38 | 39 | ! red 40 | *.color1: RED1 41 | *.color9: RED2 42 | 43 | ! green 44 | *.color2: GREEN1 45 | *.color10: GREEN2 46 | 47 | ! yellow 48 | *.color3: YELLOW1 49 | *.color11: YELLOW2 50 | 51 | ! blue 52 | *.color4: BLUE1 53 | *.color12: BLUE2 54 | 55 | ! magenta 56 | *.color5: MAGENTA1 57 | *.color13: MAGENTA2 58 | 59 | ! cyan 60 | *.color6: CYAN1 61 | *.color14: CYAN2 62 | 63 | ! white 64 | *.color7: WHITE1 65 | *.color15: WHITE2 66 | 67 | !!!!!!!!!!!!!!!!!!!!!! 68 | !! General settings !! 69 | !!!!!!!!!!!!!!!!!!!!!! 70 | #define BORDERPX 2 71 | #define FLOATBORDERPX 0 72 | #define GAPS 20 73 | #define OUTERGAPS 28 74 | 75 | !!!!!!!!! 76 | !! bar !! 77 | !!!!!!!!! 78 | 79 | bar.bottom: false 80 | 81 | bar.background: TRANSPARENT 82 | bar.background-alt: BACKGROUND 83 | bar.foreground: BLACK2 84 | bar.foreground-alt: BLACK1 85 | bar.transparent: TRANSPARENT 86 | 87 | bar.background-module: BACKGROUND 88 | 89 | bar.ws-focused: RED1 90 | bar.ws-occupied: BLUE1 91 | bar.ws-unoccupied: BLACK2 92 | 93 | bar.line-size: 3 94 | bar.line-color: WHITE1 95 | 96 | bar.alert: MAGENTA1 97 | bar.primary: RED1 98 | bar.secondary: GREEN1 99 | bar.extra: CYAN1 100 | 101 | bar.radius: 0 102 | bar.border: 2 103 | bar.border-color: TRANSPARENT 104 | 105 | bar.x: 30% 106 | bar.y: 6 107 | bar.width: 40% 108 | bar.height: 30 109 | 110 | !!!!!!!!!!! 111 | !! dunst !! 112 | !!!!!!!!!!! 113 | 114 | dunst.borderpx: 3 115 | dunst.border-color: BLUE1 116 | 117 | dunst.background-low: CYAN1 118 | dunst.foreground-low: FOREGROUND 119 | dunst.border-color-low: CYAN1 120 | 121 | dunst.background-normal: GREEN1 122 | dunst.foreground-normal: FOREGROUND 123 | dunst.border-color-normal: GREEN1 124 | 125 | dunst.background-critical: RED1 126 | dunst.foreground-critical: FOREGROUND 127 | dunst.border-color-critical: RED1 128 | 129 | dunst.background-reminder: BLUE1 130 | dunst.foreground-reminder: FOREGROUND 131 | dunst.border-color-reminder: BLUE1 132 | 133 | !!!!!!!!!! 134 | !! Rofi !! 135 | !!!!!!!!!! 136 | rofi.background: BACKGROUND 137 | rofi.foreground: FOREGROUND 138 | rofi.select: BACKGROUND 139 | rofi.accent: CYAN1 140 | 141 | rofi.text-select: BACKGROUND 142 | 143 | !!!!!!!!!!! 144 | !! URxvt !! 145 | !!!!!!!!!!! 146 | Xft.antialias: true 147 | Xft.rgba: rgb 148 | Xft.hinting: true 149 | Xft.hintstyle: hintfull 150 | 151 | !URxvt.font:xft:scientifica:pixelsize=17:antialias=true:hinting=true 152 | URxvt.font:xft:Fantasque Sans Mono:pixelsize=15:antialias=true:hinting=true 153 | !URxvt.font:xft:cursed:pixelsize=15 154 | 155 | URxvt.internalBorder: 30 156 | URxvt.scrollBar: false 157 | URxvt.letterSpace: -0 158 | !URxvt.letterSpace: -8 159 | URxvt.iso14755: false 160 | URxvt.geometry: 85x40 161 | 162 | ! Change copy-paste keybindds 163 | URxvt.keysym.Shift-Control-V: eval:paste_clipboard 164 | URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard 165 | URxvt.keysym.Control-Meta-c: builtin-string: 166 | URxvt.keysym.Control-Meta-v: builtin-string: 167 | 168 | ! Create keybind for scrolling up and down using j and k 169 | URxvt.keysym.Shift-Control-K: command:\033]720;1\007 170 | URxvt.keysym.Shift-Control-J: command:\033]721;1\007 171 | 172 | URxvt.perl-ext-common: default,resize-font 173 | URxvt.url-launcher: /usr/bin/xdg-open 174 | 175 | !!!!!!!!!!! 176 | !! bspwm !! 177 | !!!!!!!!!!! 178 | bspwm.presel_color: YELLOW1 179 | bspwm.gaps: GAPS 180 | bspwm.outergaps: OUTERGAPS 181 | bspwm.borderpx: 5 182 | 183 | bspwm.outerborderfocused: BACKGROUND 184 | bspwm.outerbordernormal: BACKGROUND 185 | bspwm.innerborderfocused: RED1 186 | bspwm.innerbordernormal: BACKGROUND 187 | 188 | !!!!!!!!!!!!! 189 | !! zathura !! 190 | !!!!!!!!!!!!! 191 | zathura.background: BACKGROUND 192 | zathura.foreground: FOREGROUND 193 | zathura.foreground-alt: BLACK2 194 | zathura.accent: BLUE1 195 | zathura.alert: CYAN1 196 | -------------------------------------------------------------------------------- /.config/X/xinitrc: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | userresources=$XDG_CONFIG_HOME/X/Xresources 3 | usermodmap=$XDG_CONFIG_HOME/X/Xmodmap 4 | sysresources=/etc/X11/xinit/.Xresources 5 | sysmodmap=/etc/X11/xinit/.Xmodmap 6 | 7 | # merge in defaults and keymaps 8 | if [ -f $sysresources ]; then 9 | xrdb -merge $sysresources 10 | fi 11 | 12 | if [ -f $sysmodmap ]; then 13 | xmodmap $sysmodmap 14 | fi 15 | 16 | if [ -f "$userresources" ]; then 17 | xrdb -merge "$userresources" 18 | fi 19 | 20 | # if [ -f "$usermodmap" ]; then 21 | # xmodmap "$usermodmap" 22 | # fi 23 | 24 | if [ -d /etc/X11/xinit/xinitrc.d ] ; then 25 | for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do 26 | [ -x "$f" ] && . "$f" 27 | done 28 | unset f 29 | fi 30 | 31 | # Font 32 | #xset +fp /home/xan/.local/share/fonts/ 33 | #xset fp rehash 34 | 35 | # Increase key repeat rate 36 | xset r rate 300 50 & 37 | 38 | # Turn off system beep 39 | xset b off & 40 | xset b 0 0 0 & 41 | 42 | # Swap caps and escape 43 | # setxkbmap -option caps:swapescape 44 | 45 | # Make sure cursor is not an X when hovering over root window 46 | xsetroot -cursor_name left_ptr & 47 | 48 | # Startup 49 | nvidia-settings -l --config=$XDG_CONFIG_HOME/nvidia-settings/nvidia-settings-rc & 50 | picom & 51 | unclutter --timeout 1 & 52 | redshift -l 57.7089:11.9746 & 53 | #flashfocus & 54 | setwp & 55 | dropbox-wrapper start & 56 | 57 | spotify & 58 | $BROWSER & 59 | 60 | # Send notifications regarding battery usage 61 | battery-notify & 62 | 63 | # Remind me about things I want to be reminded of 64 | remember remind 3600s & 65 | 66 | # Start window manager 67 | exec bspwm 68 | #exec openbox-session 69 | -------------------------------------------------------------------------------- /.config/backup.config: -------------------------------------------------------------------------------- 1 | usr/.dropbox/Dropbox/documents 2 | usr/.dropbox/Dropbox/notes 3 | usr/.dropbox/Dropbox/bookmarks 4 | 5 | usr/.dropbox/Dropbox/writing/2021 6 | usr/.dropbox/Dropbox/writing/notes.md 7 | usr/.dropbox/Dropbox/writing/todo.txt 8 | 9 | usr/studies/DV/current 10 | 11 | .local/bin 12 | .local/log 13 | .local/scripts 14 | -------------------------------------------------------------------------------- /.config/bash/bashrc: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.bashrc 3 | # 4 | 5 | HISTSIZE= HISTFILESIZE=1000 6 | 7 | # SHOPT 8 | shopt -s autocd # change to named directory 9 | shopt -s cdspell # autocorrects cd misspellings 10 | shopt -s cmdhist # save multi-line commands in history as single line 11 | shopt -s dotglob 12 | shopt -s histappend # do not overwrite history 13 | shopt -s expand_aliases # expand aliases 14 | 15 | #ignore upper and lowercase when TAB completion 16 | bind "set completion-ignore-case on" 17 | 18 | # ARCHIVE EXTRACTION 19 | # usage: ex 20 | ex () 21 | { 22 | if [ -f $1 ] ; then 23 | case $1 in 24 | *.tar.bz2) tar xjf $1 ;; 25 | *.tar.gz) tar xzf $1 ;; 26 | *.bz2) bunzip2 $1 ;; 27 | *.rar) unrar x $1 ;; 28 | *.gz) gunzip $1 ;; 29 | *.tar) tar xf $1 ;; 30 | *.tbz2) tar xjf $1 ;; 31 | *.tgz) tar xzf $1 ;; 32 | *.zip) unzip $1 ;; 33 | *.Z) uncompress $1;; 34 | *.7z) 7z x $1 ;; 35 | *.deb) ar x $1 ;; 36 | *.tar.xz) tar xf $1 ;; 37 | *.tar.zst) unzstd $1 ;; 38 | *) echo "'$1' cannot be extracted via ex()" ;; 39 | esac 40 | else 41 | echo "'$1' is not a valid file" 42 | fi 43 | } 44 | 45 | # ALIASES 46 | alias startx="startx $XDG_CONFIG_HOME/X/xinitrc" 47 | 48 | # Navigation 49 | alias ..="cd .." 50 | alias ...="cd ../.." 51 | alias .3="cd ../../.." 52 | alias .4="cd ../../../.." 53 | alias .5="cd ../../../.." 54 | 55 | alias r="ranger" 56 | 57 | alias ls='ls -1 --color=auto --group-directories-first' 58 | alias ll='ls -alh' 59 | alias l='ls -CF' 60 | 61 | alias ls='exa -1 --group-directories-first' 62 | alias la='exa -1a --group-directories-first' 63 | alias ll='exa -alhg --group-directories-first' 64 | 65 | alias grep='grep --color=auto' 66 | alias fgrep='fgrep --color=auto' 67 | alias egrep='egrep --color=auto' 68 | 69 | # Files and dirs 70 | alias mkdir="mkdir -pv" 71 | alias df='df -h' # human-readable sizes 72 | alias free='free -h' # show sizes in human-readable format 73 | 74 | # Editing 75 | alias v="nvim" 76 | alias sv="sudoedit" 77 | 78 | # Term 79 | alias u="(urxvt &)" 80 | 81 | # Updates 82 | alias update="yay -Syu --noconfirm && notify-send 'Update complete'" # update standard pkgs and AUR pkgs 83 | alias mirror="sudo reflector --verbose --latest 30 --sort rate --save /etc/pacman.d/mirrorlist" 84 | alias orpclean="sudo pacman -Rns $(pacman -Qtdq)" 85 | alias depclean="yay -Yc" 86 | alias cacheclean="yay -Sc" 87 | 88 | # System information 89 | alias nvidia-settings="nvidia-settings --config=$XDG_CONFIG_HOME/nvidia-settings/nvidia-settings-rc" 90 | alias services='systemctl list-units --type=service --state=running' 91 | 92 | # System 93 | alias shutdown="sudo shutdown now" 94 | alias reboot="sudo reboot" 95 | 96 | # Make 97 | alias install="sudo make clean install" 98 | 99 | # Misc 100 | alias sxiv="sxiv -a" 101 | alias tty-clock="tty-clock -cD" 102 | 103 | # Config management 104 | alias cgit='/usr/bin/git --git-dir=$XDG_CONFIG_HOME/dots.git.d --work-tree=$HOME' 105 | alias cacommit="cgit add -u; cgit commit -m" 106 | 107 | # Settings 108 | set -o vi 109 | #stty erase '^H' 110 | 111 | # nvm 112 | # source /usr/share/nvm/init-nvm.sh 113 | 114 | # Completion 115 | 116 | if [ -d /etc/bash_completion ]; then 117 | for file in /etc/bash_completion.d/* ; do 118 | source "$file" 119 | done 120 | fi 121 | 122 | # PROMPT 123 | parse_git_branch() { 124 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' 125 | } 126 | 127 | PROMPT_DIRTRIM=1 128 | PS1="\[\e[30m\]\w\[\e[00m\] \[\e[31m\]\$(parse_git_branch)\[\e[00m\] " 129 | 130 | #trap 'printf "\033]0;%s\007" "${PWD//[^[:print:]]/} | $TERM"' DEBUG 131 | 132 | # Pidswallow stuff 133 | #[ -n "$DISPLAY" ] && command -v xdo >/dev/null 2>&1 && xdo id > /tmp/term-wid-"$$" 134 | #trap "( rm -f /tmp/term-wid-"$$" )" EXIT HUP 135 | 136 | # FUNCTIONS 137 | bak() { cp -r "$1" "$1.bak"; } 138 | copycode() { echo -e "\u$1" | xclip -selection clipboard; } 139 | ftext () { grep -iIHrn --color=always "$1" . | less -R -r; } 140 | generateqr () { printf "$@" | curl -F-=\<- qrenco.de; } 141 | 142 | cbase () { 143 | git add .; 144 | git commit -m "temp"; 145 | git rebase -i HEAD~$1 146 | } 147 | 148 | minimize() { 149 | jq -c . < "$1" > "$1.bak"; 150 | rm "$1"; 151 | mv "$1.bak" "$1"; 152 | } 153 | 154 | minimizeAll() { 155 | IFS="$(printf '\n\t')" 156 | for file in ./* ; do 157 | if [ -e "$file" ]; then 158 | minimize "$file" 159 | fi 160 | done 161 | } 162 | 163 | # SHORTCUTS 164 | if [ -f $XDG_CONFIG_HOME/bash/aliases_private ]; then 165 | source $XDG_CONFIG_HOME/bash/aliases_private 166 | fi 167 | 168 | alias z="zathura" 169 | alias x="sxiv -a" 170 | 171 | alias vim="nvim" 172 | alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf" 173 | alias killtmux="tmux kill-server" 174 | alias wp="xwallpaper --zoom" 175 | alias rc="killall picom; sleep 0.1; picom -b" 176 | alias copy="xclip -r -selection clipboard" 177 | alias paste="xclip -selection clipboard -o" 178 | alias cc="grabc 2> /dev/null | copy" 179 | alias bin="cd /home/xan/.local/bin/" 180 | alias config="cd $XDG_CONFIG_HOME" 181 | alias png-compress="pngquant --force --quality=40-100 --strip --skip-if-larger --verbose" 182 | alias ka="killall" 183 | alias push="git push" 184 | alias branches="git branch -a" 185 | alias delbranch="git branch -d" 186 | alias makebranch="git checkout -b" 187 | alias stat="git status" 188 | alias acommit="git add .; git commit -m" 189 | alias quote="nvim /home/xan/usr/notes/quotes.txt" 190 | alias cleancache="yay -Sc" 191 | alias bin="cd /home/xan/.local/bin/" 192 | alias pull="git pull" 193 | alias graphics="cd /home/xan/studies/computer-graphics-DIT224/" 194 | alias software="cd /home/xan/studies/software-development-methodologies-DIT347/" 195 | alias passpush="pass git add . && pass git commit -m 'new password' && pass git push" 196 | alias chx="chmod +x" 197 | -------------------------------------------------------------------------------- /.config/bash/profile: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.bash_profile 3 | # 4 | 5 | # DEFAULT PROGRAMS 6 | export TERMINAL=urxvt 7 | export PAGER=less 8 | export EDITOR=nvim 9 | export VISUAL=nvim 10 | export BROWSER=firefox 11 | export SUDO_EDITOR=nvim 12 | export READER=zathura 13 | 14 | #export TERM=xterm-256color 15 | 16 | # Environment variables 17 | export LESSHISTFILE="-" 18 | export HISTFILE=$XDG_CONFIG_HOME/bash/history 19 | 20 | export NOTES_DIR=$HOME/usr/notes 21 | export TASKRC=$XDG_CONFIG_HOME/task/config 22 | export VIT_DIR=$XDG_CONFIG_HOME/vit 23 | export BACKUP_DIR=$HOME/.local/backup 24 | export PASSWORD_STORE_DIR=$XDG_DATA_HOME/password-store 25 | 26 | export WALLPAPERS=$XDG_CONFIG_HOME/wall 27 | export BOOKMARKS_DIR=$HOME/usr/bookmarks 28 | 29 | # Java fix 30 | export _JAVA_AWT_WM_NONREPARENTING=1 31 | export AWT_TOOLKIT=MToolkit 32 | 33 | # Path 34 | [[ -d $HOME/.local/bin ]] && export PATH=$HOME/.local/bin:$PATH 35 | 36 | [[ -d $XDG_CONFIG_HOME/bspwm/scripts ]] && export PATH=$XDG_CONFIG_HOME/bspwm/scripts:$PATH 37 | 38 | [[ -d $XDG_CONFIG_HOME/sxhkd/scripts ]] && export PATH=$XDG_CONFIG_HOME/sxhkd/scripts:$PATH 39 | 40 | [[ -f ~/.bashrc ]] && . ~/.bashrc 41 | [[ -f $XDG_CONFIG_HOME/bash/bashrc ]] && . $XDG_CONFIG_HOME/bash/bashrc 42 | 43 | # If not running interactively, don't do anything 44 | [[ $- != *i* ]] && return 45 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kill all current polybar instances 4 | killall -q polybar 5 | 6 | # Wait for all polybar instances to terminate 7 | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 8 | 9 | # Launch main and secondary bar 10 | polybar -c ~/.config/bspwm-polybar/config.ini main & 11 | #polybar -c ~/.config/bspwm-polybar/config.ini secondary & 12 | 13 | #polybar -c ~/.config/bspwm-polybar/config.ini notify1 & 14 | #polybar -c ~/.config/bspwm-polybar/config.ini notify2 & 15 | #polybar -c ~/.config/bspwm-polybar/config.ini extra & 16 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/battery-text.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | text=$1 3 | 4 | # Get battery level 5 | v=$(bat) 6 | 7 | # background 8 | bg=$(xrdbvar bar.background) 9 | 10 | # Color for empty step 11 | blank=$(xrdbvar bar.foreground-alt) 12 | 13 | # Color if battery somehow is above 100% 14 | high=$(xrdbvar bar.ws-focused) 15 | 16 | # Volume step color 17 | #step=$(xrdbvar bar.ramp3) 18 | if [ $v -le "20" ]; then 19 | step=$(xrdbvar bar.ws-focused) 20 | elif [ $v -le "50" ]; then 21 | step=$(xrdbvar bar.alert) 22 | else 23 | step=$(xrdbvar bar.background) 24 | fi 25 | 26 | if [ $v -gt "90" ]; then 27 | v=100 28 | echo "" 29 | else 30 | $XDG_CONFIG_HOME/bspwm-polybar/scripts/text-indicator.sh "$text" $v 100 $bg $blank $step $high 31 | fi 32 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/hidden.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #number=$(bspc query -N -n .hidden.local.window | wc -l) 3 | number=$(bspc-ordered-hide count) 4 | 5 | if [ "$number" -ne 0 ]; then 6 | [ "$1" = "-i" ] && { 7 | info=$(bspc-ordered-hide peek) 8 | echo " $info $number" 9 | } || { 10 | post="window" 11 | if [ "$number" -gt 1 ]; then 12 | post="windows" 13 | fi 14 | echo " $(number-to-letters $number) hidden $post" 15 | } 16 | else 17 | echo "" 18 | fi 19 | 20 | 21 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/layout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | layout=$(bsp-layout get $(bspc query -D -d --names)) 3 | 4 | #case $layout in 5 | # -|tiled) 6 | # symbol= 7 | # ;; 8 | # monocle) 9 | # symbol= 10 | # ;; 11 | # even) 12 | # symbol=E 13 | # ;; 14 | # grid) 15 | # symbol= 16 | # ;; 17 | # rgrid) 18 | # symbol= 19 | # ;; 20 | # rtall) 21 | # symbol=! 22 | # ;; 23 | # rwide) 24 | # symbol=! 25 | # ;; 26 | # tall) 27 | # symbol= 28 | # ;; 29 | # wide) 30 | # symbol= 31 | # ;; 32 | # *) 33 | # symbol="" 34 | # ;; 35 | #esac 36 | 37 | if [ "$layout" = "-" ] || [ "$layout" = "tiled" ]; then 38 | #cl=$(xrdbvar bar.background) 39 | #layout="tiled" 40 | echo "" 41 | else 42 | cl=$(xrdbvar bar.ws-focused) 43 | echo "%{u$cl} %{+u} $layout %{u-}" 44 | fi 45 | 46 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/tasks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | today=$(tasks today) 3 | overdue=$(tasks overdue) 4 | 5 | if [ $today -eq "1" ]; then 6 | text="task" 7 | else 8 | text="tasks" 9 | fi 10 | 11 | if [ $overdue -ne "0" ]; then 12 | color=$(xrdbvar bar.ws-focused) 13 | else 14 | color=$(xrdbvar bar.extra) 15 | fi 16 | 17 | msg="%{F$color}$(number-to-letters $today) $text%{F-}" 18 | 19 | echo "$msg" 20 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/text-indicator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | text=$1 3 | 4 | v=$2 5 | max=$3 6 | 7 | bg=$4 8 | blank=$5 9 | step=$6 10 | high=$7 11 | 12 | count=${#text} 13 | 14 | steps=$(echo "$count * $v / $max" | bc) 15 | if [ $v -ne "0" -a $steps -eq 0 ]; then 16 | steps=1 17 | fi 18 | 19 | if (( $v > $max )); then 20 | [ ! -z $high ] && step=$high 21 | fi 22 | 23 | first=${text:0:steps} 24 | last=${text:steps} 25 | 26 | echo -e "%{B$bg}%{F$step}$first%{B-}%{F-}%{B$bg}%{F$blank}$last%{B-}%{F-}" 27 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/volbar-text.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | volumeText=$1 3 | muteText=$2 4 | 5 | text=$volumeText 6 | 7 | # Get volume level 8 | v=$(vol print) 9 | 10 | # background 11 | bg=$(xrdbvar bar.background) 12 | 13 | # Color for empty step 14 | blank=$(xrdbvar bar.secondary) 15 | 16 | # Mute color 17 | mute=$(xrdbvar bar.extra) 18 | 19 | # Color if volume is above 100% 20 | high=$(xrdbvar bar.ws-focused) 21 | 22 | # Volume step color 23 | step=$(xrdbvar bar.primary) 24 | 25 | # If muted, replace step with mute color 26 | if [ "$(vol muted)" = "true" ]; then 27 | step=$mute 28 | text=$muteText 29 | fi 30 | 31 | $XDG_CONFIG_HOME/bspwm-polybar/scripts/text-indicator.sh "$text" $v 100 $bg $blank $step $high 32 | -------------------------------------------------------------------------------- /.config/bspwm-polybar/scripts/volbar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get volume level 4 | v=$(vol print) 5 | 6 | # background 7 | bg=$(xrdbvar bar.background-alt) 8 | 9 | # Color for empty step 10 | blank=$(xrdbvar bar.extra) 11 | # Mute color 12 | mute=$(xrdbvar bar.background-alt) 13 | # Color if volume is above 100% 14 | high=$(xrdbvar bar.ws-focused) 15 | # Volume step color 16 | step=$(xrdbvar bar.ramp3) 17 | 18 | # If muted, replace step with mute color 19 | if [ "$(vol muted)" = "true" ]; then 20 | step=$mute 21 | elif (( $v > 100 )); then 22 | step=$high 23 | fi 24 | 25 | # Define variables 26 | fs=$(( $v/10 )) 27 | if (( $fs > 10 )); then 28 | fs=10 29 | fi 30 | 31 | es=$(( 10 - fs )) 32 | 33 | filled_steps=$(printf "%${fs}s" | sed 's/ /|/g') 34 | empty_steps=$(printf "%${es}s" | sed 's/ /|/g') 35 | 36 | echo -e "%{B$bg}%{F$step} $filled_steps%{B-F-}%{B$bg}%{F$blank}$empty_steps %{B-F-}" 37 | -------------------------------------------------------------------------------- /.config/bspwm/bspwmrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | _() { bspc config "$@"; } 3 | R() { bspc rule -a "$@"; } 4 | s() { pkill -x "$1"; { sleep 0.1; "$@" & }; } 5 | 6 | ######### 7 | # SXHKD # 8 | ######### 9 | pgrep -x sxhkd > /dev/null || sxhkd & 10 | 11 | ############ 12 | # MONITORS # 13 | ############ 14 | external_monitor=$(xrandr --query | grep 'HDMI-0') 15 | if [[ $external_monitor = *" connected "* ]]; then 16 | xrandr \ 17 | --output DP-2 --primary --mode 1920x1080 --rotate normal \ 18 | --output HDMI-0 --mode 1920x1080 --rotate normal --right-of DP-2 19 | 20 | bspc monitor DP-2 -d 1 2 3 4 5 21 | bspc monitor HDMI-0 -d 6 7 8 9 10 22 | else 23 | xrandr \ 24 | --output DP-2 --primary --mode 1920x1080 --rotate normal 25 | 26 | bspc monitor -d 1 2 3 4 5 6 7 8 9 10 27 | fi 28 | 29 | ########### 30 | # GENERAL # 31 | ########### 32 | gaps=$(xrdbvar bspwm.gaps) 33 | padding=$(( $(xrdbvar bspwm.outergaps) - $gaps )) 34 | bargaps=$(( $(xrdbvar bar.height) + $(xrdbvar bar.y) + 2 * $(xrdbvar bar.border) - ($gaps / 2) )) 35 | bottombar=$(xrdbvar bar.bottom) 36 | 37 | _ border_width $(xrdbvar bspwm.borderpx) 38 | _ window_gap $gaps 39 | _ left_padding $padding 40 | _ right_padding $padding 41 | 42 | if [ "$bottombar" = "true" ]; then 43 | _ top_padding $padding 44 | _ bottom_padding $bargaps 45 | else 46 | _ top_padding $bargaps 47 | _ bottom_padding $padding 48 | fi 49 | 50 | _ ignore_ewmh_focus true 51 | _ focus_follows_pointer true 52 | _ pointer_modifier mod1 53 | _ pointer_action1 move 54 | _ pointer_action2 resize_side 55 | 56 | _ split_ratio 0.55 57 | _ single_monocle true 58 | _ borderless_monocle true 59 | _ gapless_monocle false 60 | _ automatic_scheme alternate 61 | 62 | _ normal_border_color "$(xrdbvar bspwm.innerbordernormal)" 63 | _ active_border_color "$(xrdbvar bspwm.innerbordernormal)" 64 | _ focused_border_color "$(xrdbvar bspwm.innerborderfocused)" 65 | _ presel_feedback_color "$(xrdbvar bspwm.presel_color)" 66 | 67 | _ external_rules_command $XDG_CONFIG_HOME/bspwm/external_rules.sh 68 | 69 | ################### 70 | # Window settings # 71 | ################### 72 | R '*:eterm8' state=floating 73 | R '*:floating' state=floating 74 | R 'floating:*' state=floating 75 | R '*:scratch1' state=floating sticky=on 76 | R '*:scratch2' state=floating sticky=on 77 | R '*:scratch3' state=floating sticky=on 78 | R Zathura state=tiled 79 | 80 | ############# 81 | # Autostart # 82 | ############# 83 | 84 | # has to run this here since setxbmap overrides modmap 85 | # if put in xinitrc 86 | xmodmap $XDG_CONFIG_HOME/X/Xmodmap 87 | 88 | bspc-auto-unhide & 89 | startbarbspwm & 90 | -------------------------------------------------------------------------------- /.config/bspwm/external_rules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wid=$1 4 | class=$2 5 | instance=$3 6 | consequences=$4 7 | 8 | main() { 9 | case "$class" in 10 | firefox) 11 | if [ "$instance" = "Toolkit" ]; then 12 | echo "state=floating sticky=on" 13 | fi 14 | ;; 15 | Spotify|spotify) 16 | echo "desktop=^10" 17 | ;; 18 | "") 19 | sleep 0.5 20 | 21 | wm_class=($(xprop -id $wid | grep "WM_CLASS" | grep -Po '"\K[^,"]+')) 22 | class=${wm_class[-1]} 23 | 24 | [[ ${#wm_class[@]} == "2" ]] && instance=${wm_class[0]} 25 | 26 | [[ -n "$class" ]] && main 27 | ;; 28 | esac 29 | } 30 | 31 | main 32 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bsp-layout-ratio: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | FILE="$XDG_CONFIG_HOME/bsp-layout/layoutrc" 3 | 4 | line=$(grep "TALL_RATIO" $FILE) 5 | value=${line#*=} 6 | value=${value%;*} 7 | 8 | min=0.1 9 | max=0.9 10 | 11 | value=$(echo "$value $1" | bc) 12 | 13 | if [[ -z $value ]]; then 14 | echo "Invalid argument" 15 | exit 1 16 | fi 17 | 18 | 19 | if (( $(echo "$value < $min" | bc -l) )); then 20 | value=$min 21 | elif (( $(echo "$value > $max" | bc -l) )); then 22 | value=$max 23 | fi 24 | 25 | echo "TALL_RATIO=$value;" > $FILE 26 | echo "WIDE_RATIO=$value;" >> $FILE 27 | 28 | #desktop=$(bspc query -D -d --names) 29 | #current=$(bsp-layout get $desktop) 30 | #if [[ "( tall wide rtall rwide )" =~ "$current" ]]; then 31 | #notify-send "Test $current" 32 | #bsp-layout remove $desktop && 33 | #bsp-layout set $current 34 | #exit 0 35 | #fi 36 | 37 | #bsp-layout reload 38 | 39 | #exit 1 40 | 41 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-balance: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for wid in $(bspc query -N -d -n .window); do 4 | bspc node "${wid}#@$1" -B 5 | done 6 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-config-menu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | constrain () { 4 | if [ "$1" -lt "$2" ]; then 5 | echo "$2" 6 | elif [ "$1" -gt "$3" ]; then 7 | echo "$3" 8 | else 9 | echo "$1" 10 | fi 11 | } 12 | 13 | choices=( gaps outer_gaps restart quit) 14 | 15 | choice=$(printf "%s\n" "${choices[@]}" | dmenu -i -F -p "Settings") 16 | 17 | [[ -z "$choice" ]] && exit 0 18 | 19 | case $choice in 20 | gaps) 21 | current=$(bspc config window_gap) 22 | new_gaps=$(echo "Reset" | dmenu -i -F -p "Set_gaps_($current)") 23 | if [ "$new_gaps" = "Reset" ]; then 24 | new_gaps=$(xrdbvar bspwm.gaps) 25 | else 26 | new_gaps=$(constrain $new_gaps 0 300) 27 | fi 28 | bspc config window_gap $new_gaps 29 | ;; 30 | outer_gaps) 31 | current=$(bspc-padding print) 32 | new_gaps=$(echo "Reset" | dmenu -i -F -p "Set_outer_gaps_($current)") 33 | if [ "$new_gaps" = "Reset" ]; then 34 | new_gaps=$(xrdbvar bspwm.outergaps) 35 | else 36 | new_gaps=$(constrain $new_gaps 0 300) 37 | fi 38 | bspc-padding set $new_gaps 39 | ;; 40 | restart) 41 | bspc wm -r 42 | notify-send "Bspwm reloaded" 43 | ;; 44 | quit) 45 | bspc quit 46 | ;; 47 | *) 48 | notify-send "Config menu: invalid option." 49 | ;; 50 | esac 51 | 52 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-desktop-setup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | FILE=$1 3 | 4 | DIR=$XDG_CONFIG_HOME/bspwm/desktop-setups 5 | 6 | if [ "$1" = "--menu" ]; then 7 | choice=$(/usr/bin/ls $DIR | dmenu -i -F -p "Desktops") 8 | bspc-desktop-setup "$DIR/$choice" 9 | exit 0 10 | fi 11 | 12 | 13 | 14 | [ ! -f "$FILE" ] && { 15 | echo "No such file." 16 | exit 1 17 | } 18 | 19 | desktop="" 20 | desktop_name="" 21 | layout="tiled" 22 | clear_occupied=false 23 | commands=() 24 | i=0 25 | 26 | scan_line() { 27 | case $1 in 28 | desktop) 29 | desktop="$2" 30 | ;; 31 | layout) 32 | layout="$2" 33 | ;; 34 | clear) 35 | clear_occupied="$2" 36 | ;; 37 | run) 38 | shift 39 | commands[$i]="$@" 40 | i=$((i + 1)) 41 | ;; 42 | *) 43 | echo "\"$1\" is an invalid setup option." 44 | ;; 45 | esac 46 | } 47 | 48 | scan() { 49 | while read -r line 50 | do 51 | scan_line $line 52 | done < "$FILE" 53 | 54 | } 55 | 56 | validate() { 57 | [ -z "$desktop" ] && abort "No desktop specified." || { 58 | desktop_name=$(bspc query -D -d "^$desktop" --names) 59 | } 60 | [[ "( $(bsp-layout layouts) )" =~ "$layout" ]] || abort "$layout is not a valid layout" 61 | [[ "( true false )" =~ "$focus" ]] || abort "$focus is not a valid focus option" 62 | [[ "( true false )" =~ "$clear_occupied" ]] || abort "$clear_occupied is not a valid clear option" 63 | } 64 | 65 | abort() { 66 | echo "$1" 67 | exit 1 68 | } 69 | 70 | previous="" 71 | 72 | run() { 73 | #ratio=0.0 74 | #dir="" 75 | #case $1 in 76 | # --) 77 | # shift 78 | # [ ! -z "$previous" ] && { 79 | # waitfor 5 "$previous" > /dev/null 2>&1 80 | # } 81 | # ;; 82 | # --west|--east|--north|--south) 83 | # dir=${1#--} 84 | # amount=$2 85 | # 86 | # shift; shift 87 | # 88 | # [ ! -z "$previous" ] && { 89 | # waitfor 5 --presel $dir "$previous" > /dev/null 2>&1 90 | # 91 | # } 92 | # ;; 93 | # *) 94 | # abort "$1 is an invalid presel direction" 95 | # ;; 96 | #esac 97 | eval $(echo "$@") & 98 | } 99 | 100 | setup() { 101 | bspc desktop -f "^$desktop" 102 | bsp-layout set $layout $desktop_name > /dev/null 2>&1 103 | 104 | if [ "$clear_occupied" = "true" ]; then 105 | next_unoccupied="$(bspc query -D -d 'next.!occupied' --names)" 106 | [ $(bspc query -N -d "$desktop_name" | wc -l) -ne 0 ] && notify-send "Sending nodes on desktop $desktop_name to $next_unoccupied" 107 | 108 | bspc node 'any.local' -d "$next_unoccupied" 109 | fi 110 | 111 | for cmd in "${commands[@]}" 112 | do 113 | run $cmd 114 | done 115 | } 116 | 117 | scan 118 | validate 119 | setup 120 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-desktop-swap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | src_desktop_name="$(bspc query -D -d ^$1 --names)" || exit 1 4 | dst_desktop_name="$(bspc query -D -d ^$2 --names)" || exit 1 5 | bspc desktop ^$1 -n "$dst_desktop_name" -s ^$2 6 | bspc desktop ^$1 -n "$src_desktop_name" 7 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-layout-menu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get current layout (to be displayed in prompt) 4 | current=$(bsp-layout get $(bspc query -D -d --names)) 5 | # (no layout equals default tiled layout) 6 | [[ $current = "-" ]] && current="tiled" 7 | 8 | case "$1" in 9 | # if --remove is passed, set layout to default (tiled) 10 | --remove) 11 | bsp-layout set tiled 12 | exit 0 13 | ;; 14 | # if --remove-all is passed, set all desktop layouts to default 15 | --remove-all) 16 | for desktop in $(bspc query -D --names); do 17 | bsp-layout set tiled $desktop 18 | done 19 | exit 0 20 | ;; 21 | *) ;; 22 | esac 23 | 24 | # Get available layouts 25 | options=$(bsp-layout layouts) 26 | 27 | # Get user choice (and display current layout in prompt) 28 | choice=$(echo "${options[@]}" | dmenu -i -F -p "Layout_($current)") 29 | 30 | # If no choice, exit 31 | [[ -z $choice ]] && exit 0 32 | 33 | # If choice is not a valid layout, exit 34 | [[ "( ${options[@]} )" =~ "$choice" ]] || exit 0 35 | 36 | # If --once is passed, apply only once 37 | if [ "$1" = "--once" ]; 38 | then 39 | bsp-layout once $choice 40 | else 41 | # Else, set layout 42 | bsp-layout set $choice 43 | fi 44 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-main-toggle: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # found in this thread: https://www.reddit.com/r/bspwm/comments/jngc5i/press_to_swap_to_biggest_press_again_to_swap_back/ 4 | 5 | f="${1:-$(bspc query -N -n)}" 6 | b="$(bspc query -N -n biggest.local)" 7 | m="$(bspc query -N -n last.marked.local)" || 8 | m="$(bspc query -N -n any.marked.local)" 9 | [ "$f" = "$b" ] && { 10 | set -- "${m:-$(bspc query -N -n last.local)}" "$f" 11 | } || { 12 | [ -n "$m" ] && bspc node "$m" -g marked=off 13 | set -- "$f" "$b" 14 | } 15 | bspc node "$1" -s "$2" -g marked=off -f && 16 | bspc node "$2" -g marked=on 17 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-notify: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bspc subscribe node_flag | while read event mid did nid flag state; do 4 | if [ "$flag" = "urgent" -a "$state" = "on" ]; then 5 | notify-send "urgent window!" 6 | fi 7 | done & 8 | 9 | bspc subscribe node_add | while read event m_id d_id ip_id n_id; do 10 | focused_desktop=$(bspc query -D -d focused) 11 | if [ "$d_id" != "$focused_desktop" ]; then 12 | notify-send "!!!" 13 | fi 14 | done & 15 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-padding: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # If reset, return padding to standard values 4 | if [ "$1" = "reset" ]; then 5 | gaps=$(xrdbvar bspwm.gaps) 6 | outergaps=$(xrdbvar bspwm.outergaps) 7 | padding=$(( $outergaps - $gaps )) 8 | # If set, set padding (subtract gaps, to make more intuitive) 9 | elif [ "$1" = "set" ]; then 10 | gaps=$(bspc config window_gap) 11 | padding=$(( $2 - $gaps )) 12 | # If print, output current padding 13 | elif [ "$1" = "print" ]; then 14 | gaps=$(bspc config window_gap) 15 | padding=$(bspc config left_padding) 16 | echo "$(( $padding + $gaps ))" 17 | exit 1 18 | # Else, increase or decrease padding 19 | else 20 | padding=$(( `bspc config left_padding` $1)) 21 | padding=$(( padding > 0 ? padding : 0 )) 22 | fi 23 | 24 | # Set padding 25 | for p in top bottom left right; do 26 | bspc config "${p}_padding" "$padding" 27 | done 28 | 29 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-resize: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Partly stolen from unknow source on reddit.... 4 | direction="$1" 5 | sense="$2" 6 | amount="$3" 7 | 8 | if [ "$sense" = "+" ]; then 9 | countersense="-" 10 | else 11 | countersense="+" 12 | fi 13 | 14 | # If floating, resize around center 15 | if [ $(bspc query -T -n | jq -r '.client.state') = "floating" ]; then 16 | amount=$(( $amount / 2 )) 17 | case $direction in 18 | x) 19 | bspc node -z left $countersense$amount 0 20 | bspc node -z right $sense$amount 0 21 | ;; 22 | y) 23 | bspc node -z top 0 $countersense$amount 24 | bspc node -z bottom 0 $sense$amount 25 | esac 26 | # Otherwise, do it the tiled way 27 | else 28 | # fetch screen dimension to calculate relationship between "amount" and change in layout ratio 29 | # TODO actually check for the biggest window and calculate full ratio using screen dimensions instead 30 | w=$(xwininfo -root|sed '/Width/!d;s/.* //') 31 | h=$(xwininfo -root|sed '/Height/!d;s/.* //') 32 | 33 | layout=$(bsp-layout get $(bspc query -D -d --names)) 34 | 35 | # If change in X direction 36 | if [ "$direction" = "x" ]; then 37 | # Resize node 38 | bspc node --resize "right" "${sense}$amount" "0" || 39 | bspc node --resize "left" "${countersense}$amount" "0" 40 | 41 | # If applicable layout is set, change ratio 42 | if [[ "( tall rtall )" =~ "$layout" ]]; then 43 | # calculate new ratio based on amount and screen width 44 | dr=$(echo "$amount / $w" | bc -l) 45 | bsp-layout-ratio "${countersense}$dr" 46 | fi 47 | else 48 | # Resize node 49 | bspc node --resize "bottom" "0" "${sense}$amount" || 50 | bspc node --resize "top" "0" "${countersense}$amount" 51 | 52 | # If applicable layout is set, change ratio 53 | if [[ "( wide rwide )" =~ "$layout" ]]; then 54 | # calculate new ratio based on amount and screen height 55 | dr=$(echo "$amount / $h" | bc -l) 56 | bsp-layout-ratio "${countersense}$dr" 57 | fi 58 | fi 59 | fi 60 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-retile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | D=$(bspc query -D -d focused --names) 4 | 5 | #bspc desktop --rename $D\' 6 | bspc monitor --add-desktops temp 7 | 8 | #for i in $(bspc query -N -n .window -d $D); do 9 | # bspc node -d temp 10 | #done 11 | bspc node 'any.local' -d temp 12 | 13 | for i in $(bspc query -N -n .window -d temp); do 14 | bspc node -d $D 15 | done 16 | 17 | sleep 0.5 18 | 19 | #bspc desktop -f $D 20 | bspc desktop temp --remove 21 | 22 | -------------------------------------------------------------------------------- /.config/bspwm/scripts/bspc-toggle-visibility: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # stolen from here: https://my-take-on.tech/2020/07/03/some-tricks-for-sxhkd-and-bspwm/ 4 | 5 | if [ $# = 0 ]; then 6 | cat <