├── .bashrc ├── .profile ├── .xinitrc ├── .zshrc ├── README.md ├── cava └── config ├── dunst ├── critical.png ├── dunstrc ├── normal.png ├── notify-send.sh └── volume.sh ├── i3 └── config ├── kitty └── kitty.conf ├── mpd └── mpd.conf ├── ncmpcpp ├── config └── ncmpcpp-ueberzug │ ├── ncmpcpp-ueberzug │ └── ncmpcpp_cover_art.sh ├── neofetch ├── config.conf └── tentaclecol.png ├── picom └── picom.conf ├── polybar ├── config └── launch.sh ├── ranger ├── commands.py ├── commands_full.py ├── plugins │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.opt-1.pyc │ │ ├── __init__.cpython-37.opt-1.pyc │ │ ├── __init__.cpython-38.opt-1.pyc │ │ ├── __init__.cpython-39.opt-1.pyc │ │ ├── __init__.cpython-39.pyc │ │ ├── devicons.cpython-310.opt-1.pyc │ │ ├── devicons.cpython-37.opt-1.pyc │ │ ├── devicons.cpython-38.opt-1.pyc │ │ ├── devicons.cpython-39.opt-1.pyc │ │ ├── devicons.cpython-39.pyc │ │ ├── devicons_linemode.cpython-310.opt-1.pyc │ │ ├── devicons_linemode.cpython-37.opt-1.pyc │ │ ├── devicons_linemode.cpython-38.opt-1.pyc │ │ ├── devicons_linemode.cpython-39.opt-1.pyc │ │ └── devicons_linemode.cpython-39.pyc │ ├── devicons.py │ └── devicons_linemode.py ├── rc.conf ├── rifle.conf └── scope.sh ├── rofi ├── applets │ ├── bin │ │ ├── appasroot.sh │ │ ├── apps.sh │ │ ├── battery.sh │ │ ├── brightness.sh │ │ ├── mpd.sh │ │ ├── powermenu.sh │ │ ├── quicklinks.sh │ │ ├── screenshot.sh │ │ └── volume.sh │ ├── shared │ │ ├── colors.rasi │ │ ├── fonts.rasi │ │ └── theme.bash │ └── type-2 │ │ ├── style-1.rasi │ │ ├── style-2.rasi │ │ └── style-3.rasi ├── colors │ ├── adapta.rasi │ ├── arc.rasi │ ├── black.rasi │ ├── catppuccin.rasi │ ├── cyberpunk.rasi │ ├── dracula.rasi │ ├── everforest.rasi │ ├── gruvbox.rasi │ ├── lovelace.rasi │ ├── navy.rasi │ ├── nord.rasi │ ├── onedark.rasi │ ├── paper.rasi │ ├── solarized.rasi │ ├── tokyonight.rasi │ └── yousai.rasi ├── config.rasi ├── launchers │ └── type-3 │ │ ├── filebrowser.sh │ │ ├── launcher.sh │ │ ├── shared │ │ ├── colors.rasi │ │ └── fonts.rasi │ │ ├── style-10.rasi │ │ ├── style-11.rasi │ │ ├── style-12.rasi │ │ └── windows.sh └── powermenu │ └── type-2 │ ├── powermenu.sh │ ├── shared │ ├── colors.rasi │ └── fonts.rasi │ ├── style-1.rasi │ ├── style-10.rasi │ ├── style-2.rasi │ ├── style-3.rasi │ ├── style-4.rasi │ ├── style-5.rasi │ ├── style-6.rasi │ ├── style-7.rasi │ ├── style-8.rasi │ └── style-9.rasi ├── screenshot.png ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png ├── screenshot4.png └── screentshot2.png /.bashrc: -------------------------------------------------------------------------------- 1 | # ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ 2 | # ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔════╝ 3 | # ██████╔╝███████║███████╗███████║██████╔╝██║ 4 | # ██╔══██╗██╔══██║╚════██║██╔══██║██╔══██╗██║ 5 | # ██████╔╝██║ ██║███████║██║ ██║██║ ██║╚██████╗ 6 | # ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ 7 | # 8 | # Bashrc Config 2020-08-04 9 | # 10 | 11 | # If not running interactively, don't do anything 12 | 13 | [[ $- != *i* ]] && return 14 | 15 | alias grep='grep --color=auto' 16 | alias clock='tty-clock -c -B -D' 17 | alias youtube='mpsyt' 18 | alias musik='ncmpcpp' 19 | alias tui='s-tui' 20 | alias neo='neofetch --w3m ~/.config/term.png --xoffset 10 --yoffset 10 --size 200px 200px --loop' 21 | alias trim='sudo fstrim / -v' 22 | alias kube='ckube -H 4.0 -m 0,1' 23 | alias orphans='sudo pacman -Rns $(pacman -Qtdq)' 24 | 25 | PS1="\n\[\e[0;34m\]┌─[\[\e[1;36m\u\e[0;34m\]]──[\e[1;37m\w\e[0;34m]──[\[\e[1;36m\]${HOSTNAME%%.*}\[\e[0;34m\]]\[\e[1;35m\]: \$\[\e[0;34m\]\n\[\e[0;34m\]└────╼ \[\e[1;35m\]>> \[\e[00;00m\]" 26 | 27 | 28 | trap 'echo -ne "\e[0m"' DEBUG 29 | 30 | [ -e "/etc/DIR_COLORS" ] && DIR_COLORS="/etc/DIR_COLORS" 31 | [ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors" 32 | [ -e "$DIR_COLORS" ] || DIR_COLORS="" 33 | eval "`dircolors -b $DIR_COLORS`" 34 | 35 | extract () { 36 | if [ -f $1 ] ; then 37 | case $1 in 38 | *.tar.bz2) tar xjf $1 ;; 39 | *.tar.gz) tar xzf $1 ;; 40 | *.bz2) bunzip2 $1 ;; 41 | *.rar) unrar e $1 ;; 42 | *.gz) gunzip $1 ;; 43 | *.tar) tar xf $1 ;; 44 | *.tbz2) tar xjf $1 ;; 45 | *.tgz) tar xzf $1 ;; 46 | *.zip) unzip $1 ;; 47 | *.Z) uncompress $1 ;; 48 | *.7z) 7z x $1 ;; 49 | *) echo "'$1' cannot be extracted via extract()" ;; 50 | esac 51 | else 52 | echo "'$1' is not a valid file" 53 | fi 54 | } 55 | 56 | export PATH="$HOME/.scripts:$PATH" 57 | export PATH="/home/magnus/.local/bin:$PATH" 58 | export EDITOR='vim' 59 | export VISUAL='vim' 60 | export TERM='kitty' 61 | 62 | if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then 63 | exec startx 64 | fi 65 | 66 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash 67 | 68 | eval "$(starship init bash)" 69 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | export TERM=kitty 2 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | exec i3 2 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # ███████╗███████╗██╗ ██╗██████╗ ██████╗ 2 | # ╚══███╔╝██╔════╝██║ ██║██╔══██╗██╔════╝ 3 | # ███╔╝ ███████╗███████║██████╔╝██║ 4 | # ███╔╝ ╚════██║██╔══██║██╔══██╗██║ 5 | # ███████╗███████║██║ ██║██║ ██║╚██████╗ 6 | # ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ 7 | # 8 | # Zshrc Config 2022-01-16 9 | # 10 | 11 | ### Set/unset ZSH options 12 | ######################### 13 | # setopt NOHUP 14 | # setopt NOTIFY 15 | # setopt NO_FLOW_CONTROL 16 | setopt INC_APPEND_HISTORY SHARE_HISTORY 17 | setopt APPEND_HISTORY 18 | # setopt AUTO_LIST 19 | # setopt AUTO_REMOVE_SLASH 20 | # setopt AUTO_RESUME 21 | unsetopt BG_NICE 22 | setopt CORRECT 23 | setopt EXTENDED_HISTORY 24 | # setopt HASH_CMDS 25 | setopt MENUCOMPLETE 26 | setopt ALL_EXPORT 27 | 28 | ### Set/unset shell options 29 | ############################ 30 | setopt notify globdots correct pushdtohome cdablevars autolist 31 | setopt correctall autocd recexact longlistjobs 32 | setopt autoresume histignoredups pushdsilent 33 | setopt autopushd pushdminus extendedglob rcquotes mailwarning 34 | unsetopt bgnice autoparamslash 35 | 36 | ### Autoload zsh modules when they are referenced 37 | ################################################# 38 | autoload -U history-search-end 39 | zmodload -a zsh/stat stat 40 | zmodload -a zsh/zpty zpty 41 | zmodload -a zsh/zprof zprof 42 | #zmodload -ap zsh/mapfile mapfile 43 | zle -N history-beginning-search-backward-end history-search-end 44 | zle -N history-beginning-search-forward-end history-search-end 45 | 46 | ### Set variables 47 | ################# 48 | PATH="/usr/local/bin:/usr/local/sbin/:/home/magnus/.local/bin/:$PATH" 49 | HISTFILE=$HOME/.zhistory 50 | HISTSIZE=1000 51 | SAVEHIST=1000 52 | LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:'; 53 | 54 | ### Load colors 55 | ############### 56 | autoload colors zsh/terminfo 57 | if [[ "$terminfo[colors]" -ge 8 ]]; then 58 | colors 59 | fi 60 | for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do 61 | eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' 62 | eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' 63 | (( count = $count + 1 )) 64 | done 65 | 66 | ### Set Colors to use in in the script 67 | ############# 68 | # Normal Colors 69 | Black='\e[0;30m' # Black 70 | Red='\e[0;31m' # Red 71 | Green='\e[0;32m' # Green 72 | Yellow='\e[0;33m' # Yellow 73 | Blue='\e[0;34m' # Blue 74 | Purple='\e[0;35m' # Purple 75 | Cyan='\e[0;36m' # Cyan 76 | White='\e[0;37m' # White 77 | 78 | # Bold 79 | BBlack='\e[1;30m' # Black 80 | BRed='\e[1;31m' # Red 81 | BGreen='\e[1;32m' # Green 82 | BYellow='\e[1;33m' # Yellow 83 | BBlue='\e[1;34m' # Blue 84 | BPurple='\e[1;35m' # Purple 85 | BCyan='\e[1;36m' # Cyan 86 | BWhite='\e[1;37m' # White 87 | 88 | # Background 89 | On_Black='\e[40m' # Black 90 | On_Red='\e[41m' # Red 91 | On_Green='\e[42m' # Green 92 | On_Yellow='\e[43m' # Yellow 93 | On_Blue='\e[44m' # Blue 94 | On_Purple='\e[45m' # Purple 95 | On_Cyan='\e[46m' # Cyan 96 | On_White='\e[47m' # White 97 | 98 | NC="\e[m" # Color Reset 99 | 100 | ### Set prompt 101 | ############## 102 | PR_NO_COLOR="%{$terminfo[sgr0]%}" 103 | PS1="[%(!.${PR_RED}%n.$PR_LIGHT_YELLOW%n)%(!.${PR_LIGHT_YELLOW}@.$PR_RED@)$PR_NO_COLOR%(!.${PR_LIGHT_RED}%U%m%u.${PR_LIGHT_GREEN}%U%m%u)$PR_NO_COLOR:%(!.${PR_RED}%2c.${PR_BLUE}%2c)$PR_NO_COLOR]%(?..[${PR_LIGHT_RED}%?$PR_NO_COLOR])%(!.${PR_LIGHT_RED}#.${PR_LIGHT_GREEN}$) " 104 | RPS1="$PR_LIGHT_YELLOW(%D{%m-%d %H:%M})$PR_NO_COLOR" 105 | unsetopt ALL_EXPORT 106 | 107 | ### set common functions 108 | ############# 109 | 110 | function my_ip() # Get IP adress. 111 | { 112 | curl ifconfig.co 113 | } 114 | 115 | # Find a file with a pattern in name: 116 | function ff() 117 | { 118 | find . -type f -iname '*'"$*"'*' -ls ; 119 | } 120 | 121 | 122 | 123 | function sysinfo() # Get current host related info. 124 | { 125 | echo -e "\n${BRed}System Informations:$NC " ; uname -a 126 | echo -e "\n${BRed}Online User:$NC " ; w -hs | 127 | cut -d " " -f1 | sort | uniq 128 | echo -e "\n${BRed}Date :$NC " ; date 129 | echo -e "\n${BRed}Server stats :$NC " ; uptime 130 | echo -e "\n${BRed}Memory stats :$NC " ; free 131 | echo -e "\n${BRed}Public IP Address :$NC " ; my_ip 132 | echo -e "\n${BRed}Open connections :$NC "; netstat -pan --inet; 133 | echo -e "\n${BRed}CPU info :$NC "; cat /proc/cpuinfo ; 134 | echo -e "\n" 135 | } 136 | 137 | function extract { 138 | if [ -z "$1" ]; then 139 | # display usage if no parameters given 140 | echo "Usage: extract ." 141 | elseexport PATH="/home/magnus/.local/bin:$PATH" 142 | if [ -f $1 ] ; then 143 | # NAME=${1%.*} 144 | # mkdir $NAME && cd $NAME 145 | case $1 in 146 | *.tar.bz2) tar xvjf ../$1 ;; 147 | *.tar.gz) tar xvzf ../$1 ;; 148 | *.tar.xz) tar xvJf ../$1 ;; 149 | *.lzma) unlzma ../$1 ;; 150 | *.bz2) bunzip2 ../$1 ;; 151 | *.rar) unrar x -ad ../$1 ;; 152 | *.gz) gunzip ../$1 ;; 153 | *.tar) tar xvf ../$1 ;; 154 | *.tbz2) tar xvjf ../$1 ;; 155 | *.tgz) tar xvzf ../$1 ;; 156 | *.zip) unzip ../$1 ;; 157 | *.Z) uncompress ../$1 ;; 158 | *.7z) 7z x ../$1 ;; 159 | *.xz) unxz ../$1 ;; 160 | *.exe) cabextract ../$1 ;; 161 | *) echo "extract: '$1' - unknown archive method" ;; 162 | esac 163 | else 164 | echo "$1 - file does not exist" 165 | fi 166 | fi 167 | } 168 | 169 | 170 | # Creates an archive (*.tar.gz) from given directory. 171 | function maketar() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; } 172 | 173 | # Create a ZIP archive of a file or folder. 174 | function makezip() { zip -r "${1%%/}.zip" "$1" ; } 175 | 176 | 177 | function my_ps() { ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ; } 178 | 179 | mcd () { 180 | mkdir -p $1 181 | cd $1 182 | } 183 | 184 | ### Set alias 185 | ############# 186 | alias cls="clear" 187 | alias ..="cd .." 188 | alias cd..="cd .." 189 | alias ll="ls -lisa --color=auto" 190 | alias home="cd ~" 191 | alias df="df -ahiT --total" 192 | alias mkdir="mkdir -pv" 193 | alias mkfile="touch" 194 | alias rm="rm -rfi" 195 | alias userlist="cut -d: -f1 /etc/passwd" 196 | alias ls="ls -CF --color=auto" 197 | alias lsl="ls -lhFA | less" 198 | alias free="free -mt" 199 | alias du="du -ach | sort -h" 200 | alias ps="ps auxf" 201 | alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" 202 | alias wget="wget -c" 203 | alias histg="history | grep" 204 | alias myip="curl http://ipecho.net/plain; echo" 205 | alias logs="find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f" 206 | alias folders='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn' 207 | alias grep='grep --color=auto' 208 | alias orphans='sudo pacman -Rns $(pacman -Qtdq)' 209 | alias trim='sudo fstrim / -v' 210 | alias kube='ckube -H 4.0 -m 0,1' 211 | alias clock='tty-clock -c -B -D' 212 | alias youtube='yt' 213 | alias musik='ncmpcpp' 214 | alias tui='s-tui' 215 | alias vim='nvim' 216 | 217 | ### Bind keys 218 | ############# 219 | autoload -U compinit 220 | compinit 221 | bindkey "^?" backward-delete-char 222 | bindkey '^[OH' beginning-of-line 223 | bindkey '^[OF' end-of-line 224 | bindkey '^[[5~' up-line-or-history 225 | bindkey '^[[6~' down-line-or-history 226 | bindkey "^[[A" history-beginning-search-backward-end 227 | bindkey "^[[B" history-beginning-search-forward-end 228 | bindkey "^r" history-incremental-search-backward 229 | bindkey ' ' magic-space # also do history expansion on space 230 | bindkey '^I' complete-word # complete on tab, leave expansion to _expand 231 | zstyle ':completion::complete:*' use-cache on 232 | zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST 233 | 234 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 235 | zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s' 236 | zstyle ':completion:*' menu select=1 _complete _ignored _approximate 237 | zstyle -e ':completion:*:approximate:*' max-errors \ 238 | 'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )' 239 | zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' 240 | 241 | # Completion Styles 242 | 243 | # list of completers to use 244 | zstyle ':completion:*::::' completer _expand _complete _ignored _approximate 245 | 246 | # allow one error for every three characters typed in approximate completer 247 | zstyle -e ':completion:*:approximate:*' max-errors \ 248 | 'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )' 249 | 250 | # insert all expansions for expand completer 251 | zstyle ':completion:*:expand:*' tag-order all-expansions 252 | 253 | # formatting and messages 254 | zstyle ':completion:*' verbose yes 255 | zstyle ':completion:*:descriptions' format '%B%d%b' 256 | zstyle ':completion:*:messages' format '%d' 257 | zstyle ':completion:*:warnings' format 'No matches for: %d' 258 | zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' 259 | zstyle ':completion:*' group-name '' 260 | 261 | # match uppercase from lowercase 262 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 263 | 264 | # offer indexes before parameters in subscripts 265 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 266 | 267 | # command for process lists, the local web server details and host completion 268 | # on processes completion complete all user processes 269 | zstyle ':completion:*:processes' command 'ps -au$USER' 270 | 271 | ## add colors to processes for kill completion 272 | zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' 273 | 274 | #zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args' 275 | #zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html' 276 | # 277 | #NEW completion: 278 | # 1. All /etc/hosts hostnames are in autocomplete 279 | # 2. If you have a comment in /etc/hosts like #%foobar.domain, 280 | # then foobar.domain will show up in autocomplete! 281 | zstyle ':completion:*' hosts $(awk '/^[^#]/ {print $2 $3" "$4" "$5}' /etc/hosts | grep -v ip6- && grep "^#%" /etc/hosts | awk -F% '{print $2}') 282 | # Filename suffixes to ignore during completion (except after rm command) 283 | zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \ 284 | '*?.old' '*?.pro' 285 | # the same for old style completion 286 | #fignore=(.o .c~ .old .pro) 287 | 288 | # ignore completion functions (until the _ignored completer) 289 | zstyle ':completion:*:functions' ignored-patterns '_*' 290 | zstyle ':completion:*:*:*:users' ignored-patterns \ 291 | adm apache bin daemon games gdm halt ident junkbust lp mail mailnull \ 292 | named news nfsnobody nobody nscd ntp operator pcap postgres radvd \ 293 | rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs avahi-autoipd\ 294 | avahi backup messagebus beagleindex debian-tor dhcp dnsmasq fetchmail\ 295 | firebird gnats haldaemon hplip irc klog list man cupsys postfix\ 296 | proxy syslog www-data mldonkey sys snort 297 | # SSH Completion 298 | zstyle ':completion:*:scp:*' tag-order \ 299 | files users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *' 300 | zstyle ':completion:*:scp:*' group-order \ 301 | files all-files users hosts-domain hosts-host hosts-ipaddr 302 | zstyle ':completion:*:ssh:*' tag-order \ 303 | users 'hosts:-host hosts:-domain:domain hosts:-ipaddr"IP\ Address *' 304 | zstyle ':completion:*:ssh:*' group-order \ 305 | hosts-domain hosts-host users hosts-ipaddr 306 | zstyle '*' single-ignored show 307 | 308 | ### Source plugins 309 | ################## 310 | source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 311 | 312 | eval "$(starship init zsh)" 313 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles_i3 2 | 3 | ![screenshot](https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/master/screenshot.png) 4 | ![screenshot](https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/master/screenshot1.png) 5 | ![screenshot](https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/master/screenshot2.png) 6 | ![screenshot](https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/master/screenshot3.png) 7 | 8 | ## Essential stuff used in this config 9 | 10 | - [i3-gaps](https://github.com/Airblader/i3) (window manager) 11 | - [Polybar](https://github.com/polybar/polybar) (status bar) 12 | - [Autotiling](https://github.com/nwg-piotr/autotiling) (Autotiler for i3) 13 | - [Kitty](https://github.com/kovidgoyal/kitty) (Terminal) 14 | - [Nerd Fonts](https://github.com/ryanoasis/nerd-fonts) (FontAwesome Icons in Polybar) + (Hack Nerd Font) 15 | - [Betterlockscreen](https://github.com/betterlockscreen/betterlockscreen) (Lockscreen) 16 | - [Rofi](https://github.com/davatorium/rofi) (window switcher, launcher etc use rofi-git) 17 | - [Dunst](https://github.com/dunst-project/dunst) (notification daemon) 18 | - [Papirus Icon Theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme) (Icon theme used in Rofi) 19 | - [Catppuccin Theme](https://github.com/catppuccin/catppuccin) (Colour Theme used everywhere) 20 | - [Picom](https://github.com/yshui/picom) (Compositor) 21 | - [Feh](https://github.com/derf/feh) (Needed to use script to set wallpaper from Ranger) 22 | - [Starship](https://starship.rs/) (Cross-Shell Prompt) 23 | 24 | 25 | Optional 26 | 27 | - [NvVhad](https://github.com/NvChad/NvChad) (neovim config) 28 | 29 | 30 | Other 31 | 32 | - [Video](https://www.youtube.com/watch?v=tVu0QezFRUs) (Short video of dotfiles) 33 | 34 | All applications used in this config should be available in most major distros standard repos. 35 | -------------------------------------------------------------------------------- /cava/config: -------------------------------------------------------------------------------- 1 | [general] 2 | ;bars = 8 3 | bar_width = 8 4 | bar_spacing = 1 5 | 6 | [output] 7 | method = ncurses 8 | 9 | [color] 10 | 11 | gradient = 1 12 | 13 | gradient_color_1 = '#B5E8E0' 14 | gradient_color_2 = '#89DCEB' 15 | gradient_color_3 = '#96CDFB' 16 | gradient_color_4 = '#DDB6F2' 17 | gradient_color_5 = '#F5C2E7' 18 | gradient_color_6 = '#E8A2AF' 19 | gradient_color_7 = '#F2CDCD' 20 | gradient_color_8 = '#F5E0DC' 21 | 22 | 23 | -------------------------------------------------------------------------------- /dunst/critical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/7e54fbb45a562ed936a14be0d4ec820923d833d9/dunst/critical.png -------------------------------------------------------------------------------- /dunst/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/7e54fbb45a562ed936a14be0d4ec820923d833d9/dunst/normal.png -------------------------------------------------------------------------------- /dunst/notify-send.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # notify-send.sh - drop-in replacement for notify-send with more features 4 | # Copyright (C) 2015-2021 notify-send.sh authors (see AUTHORS file) 5 | 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | # Desktop Notifications Specification 20 | # https://developer.gnome.org/notification-spec/ 21 | 22 | VERSION=1.2 23 | NOTIFY_ARGS=(--session 24 | --dest org.freedesktop.Notifications 25 | --object-path /org/freedesktop/Notifications) 26 | EXPIRE_TIME=-1 27 | APP_NAME="${0##*/}" 28 | REPLACE_ID=0 29 | URGENCY=1 30 | HINTS=() 31 | SUMMARY_SET=n 32 | 33 | help() { 34 | cat < [BODY] - create a notification 37 | Help Options: 38 | -?|--help Show help options 39 | Application Options: 40 | -u, --urgency=LEVEL Specifies the urgency level (low, normal, critical). 41 | -t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification. 42 | -f, --force-expire Forcefully closes the notification when the notification has expired. 43 | -a, --app-name=APP_NAME Specifies the app name for the icon. 44 | -i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display. 45 | -c, --category=TYPE[,TYPE...] Specifies the notification category. 46 | -h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte. 47 | -o, --action=LABEL:COMMAND Specifies an action. Can be passed multiple times. LABEL is usually a button's label. COMMAND is a shell command executed when action is invoked. 48 | -d, --default-action=COMMAND Specifies the default action which is usually invoked by clicking the notification. 49 | -l, --close-action=COMMAND Specifies the action invoked when notification is closed. 50 | -p, --print-id Print the notification ID to the standard output. 51 | -r, --replace=ID Replace existing notification. 52 | -R, --replace-file=FILE Store and load notification replace ID to/from this file. 53 | -s, --close=ID Close notification. 54 | -v, --version Version of the package. 55 | EOF 56 | } 57 | 58 | convert_type() { 59 | case "$1" in 60 | int) echo int32 ;; 61 | double|string|byte) echo "$1" ;; 62 | *) echo error; return 1 ;; 63 | esac 64 | } 65 | 66 | make_action_key() { 67 | echo "$(tr -dc _A-Z-a-z-0-9 <<< \"$1\")${RANDOM}" 68 | } 69 | 70 | make_action() { 71 | local action_key="$1" 72 | printf -v text "%q" "$2" 73 | echo "\"$action_key\", \"$text\"" 74 | } 75 | 76 | make_hint() { 77 | type=$(convert_type "$1") 78 | [[ ! $? = 0 ]] && return 1 79 | name="$2" 80 | [[ "$type" = string ]] && command="\"$3\"" || command="$3" 81 | echo "\"$name\": <$type $command>" 82 | } 83 | 84 | concat_actions() { 85 | local result="$1" 86 | shift 87 | for s in "$@"; do 88 | result="$result, $s" 89 | done 90 | echo "[$result]" 91 | } 92 | 93 | concat_hints() { 94 | local result="$1" 95 | shift 96 | for s in "$@"; do 97 | result="$result, $s" 98 | done 99 | echo "{$result}" 100 | } 101 | 102 | parse_notification_id(){ 103 | sed 's/(uint32 \([0-9]\+\),)/\1/g' 104 | } 105 | 106 | notify() { 107 | local actions="$(concat_actions "${ACTIONS[@]}")" 108 | local hints="$(concat_hints "${HINTS[@]}")" 109 | 110 | NOTIFICATION_ID=$(gdbus call "${NOTIFY_ARGS[@]}" \ 111 | --method org.freedesktop.Notifications.Notify \ 112 | -- \ 113 | "$APP_NAME" "$REPLACE_ID" "$ICON" "$SUMMARY" "$BODY" \ 114 | "${actions}" "${hints}" "int32 $EXPIRE_TIME" \ 115 | | parse_notification_id) 116 | 117 | if [[ -n "$STORE_ID" ]] ; then 118 | echo "$NOTIFICATION_ID" > "$STORE_ID" 119 | fi 120 | if [[ -n "$PRINT_ID" ]] ; then 121 | echo "$NOTIFICATION_ID" 122 | fi 123 | 124 | if [[ -n "$FORCE_EXPIRE" ]] ; then 125 | SLEEP_TIME="$( LC_NUMERIC=C printf %f "${EXPIRE_TIME}e-3" )" 126 | ( sleep "$SLEEP_TIME" ; notify_close "$NOTIFICATION_ID" ) & 127 | fi 128 | 129 | maybe_run_action_handler 130 | } 131 | 132 | notify_close () { 133 | gdbus call "${NOTIFY_ARGS[@]}" --method org.freedesktop.Notifications.CloseNotification "$1" >/dev/null 134 | } 135 | 136 | process_urgency() { 137 | case "$1" in 138 | low) URGENCY=0 ;; 139 | normal) URGENCY=1 ;; 140 | critical) URGENCY=2 ;; 141 | *) echo "Unknown urgency $URGENCY specified. Known urgency levels: low, normal, critical." 142 | exit 1 143 | ;; 144 | esac 145 | } 146 | 147 | process_category() { 148 | IFS=, read -a categories <<< "$1" 149 | for category in "${categories[@]}"; do 150 | hint="$(make_hint string category "$category")" 151 | HINTS=("${HINTS[@]}" "$hint") 152 | done 153 | } 154 | 155 | process_hint() { 156 | IFS=: read type name command <<< "$1" 157 | if [[ -z "$name" ]] || [[ -z "$command" ]] ; then 158 | echo "Invalid hint syntax specified. Use TYPE:NAME:VALUE." 159 | exit 1 160 | fi 161 | hint="$(make_hint "$type" "$name" "$command")" 162 | if [[ ! $? = 0 ]] ; then 163 | echo "Invalid hint type \"$type\". Valid types are int, double, string and byte." 164 | exit 1 165 | fi 166 | HINTS=("${HINTS[@]}" "$hint") 167 | } 168 | 169 | maybe_run_action_handler() { 170 | if [[ -n "$NOTIFICATION_ID" ]] && [[ -n "$ACTION_COMMANDS" ]]; then 171 | local notify_action="$(dirname ${BASH_SOURCE[0]})/notify-action.sh" 172 | if [[ -x "$notify_action" ]] ; then 173 | "$notify_action" "$NOTIFICATION_ID" "${ACTION_COMMANDS[@]}" & 174 | exit 0 175 | else 176 | echo "executable file not found: $notify_action" 177 | exit 1 178 | fi 179 | fi 180 | } 181 | 182 | process_action() { 183 | IFS=: read name command <<<"$1" 184 | if [[ -z "$name" ]] || [[ -z "$command" ]]; then 185 | echo "Invalid action syntax specified. Use NAME:COMMAND." 186 | exit 1 187 | fi 188 | 189 | local action_key="$(make_action_key "$name")" 190 | ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") 191 | 192 | local action="$(make_action "$action_key" "$name")" 193 | ACTIONS=("${ACTIONS[@]}" "$action") 194 | } 195 | 196 | process_special_action() { 197 | action_key="$1" 198 | command="$2" 199 | 200 | if [[ -z "$action_key" ]] || [[ -z "$command" ]]; then 201 | echo "Command must not be empty" 202 | exit 1 203 | fi 204 | 205 | ACTION_COMMANDS=("${ACTION_COMMANDS[@]}" "$action_key" "$command") 206 | 207 | if [[ "$action_key" != close ]]; then 208 | local action="$(make_action "$action_key" "$name")" 209 | ACTIONS=("${ACTIONS[@]}" "$action") 210 | fi 211 | } 212 | 213 | process_posargs() { 214 | if [[ "$1" = -* ]] && ! [[ "$positional" = yes ]] ; then 215 | echo "Unknown option $1" 216 | exit 1 217 | else 218 | if [[ "$SUMMARY_SET" = n ]]; then 219 | SUMMARY="$1" 220 | SUMMARY_SET=y 221 | else 222 | BODY="$1" 223 | fi 224 | fi 225 | } 226 | 227 | while (( $# > 0 )) ; do 228 | case "$1" in 229 | -\?|--help) 230 | help 231 | exit 0 232 | ;; 233 | -v|--version) 234 | echo "${0##*/} $VERSION" 235 | exit 0 236 | ;; 237 | -u|--urgency|--urgency=*) 238 | [[ "$1" = --urgency=* ]] && urgency="${1#*=}" || { shift; urgency="$1"; } 239 | process_urgency "$urgency" 240 | ;; 241 | -t|--expire-time|--expire-time=*) 242 | [[ "$1" = --expire-time=* ]] && EXPIRE_TIME="${1#*=}" || { shift; EXPIRE_TIME="$1"; } 243 | if ! [[ "$EXPIRE_TIME" =~ ^-?[0-9]+$ ]]; then 244 | echo "Invalid expire time: ${EXPIRE_TIME}" 245 | exit 1; 246 | fi 247 | ;; 248 | -f|--force-expire) 249 | FORCE_EXPIRE=yes 250 | ;; 251 | -a|--app-name|--app-name=*) 252 | [[ "$1" = --app-name=* ]] && APP_NAME="${1#*=}" || { shift; APP_NAME="$1"; } 253 | ;; 254 | -i|--icon|--icon=*) 255 | [[ "$1" = --icon=* ]] && ICON="${1#*=}" || { shift; ICON="$1"; } 256 | ;; 257 | -c|--category|--category=*) 258 | [[ "$1" = --category=* ]] && category="${1#*=}" || { shift; category="$1"; } 259 | process_category "$category" 260 | ;; 261 | -h|--hint|--hint=*) 262 | [[ "$1" = --hint=* ]] && hint="${1#*=}" || { shift; hint="$1"; } 263 | process_hint "$hint" 264 | ;; 265 | -o | --action | --action=*) 266 | [[ "$1" == --action=* ]] && action="${1#*=}" || { shift; action="$1"; } 267 | process_action "$action" 268 | ;; 269 | -d | --default-action | --default-action=*) 270 | [[ "$1" == --default-action=* ]] && default_action="${1#*=}" || { shift; default_action="$1"; } 271 | process_special_action default "$default_action" 272 | ;; 273 | -l | --close-action | --close-action=*) 274 | [[ "$1" == --close-action=* ]] && close_action="${1#*=}" || { shift; close_action="$1"; } 275 | process_special_action close "$close_action" 276 | ;; 277 | -p|--print-id) 278 | PRINT_ID=yes 279 | ;; 280 | -r|--replace|--replace=*) 281 | [[ "$1" = --replace=* ]] && REPLACE_ID="${1#*=}" || { shift; REPLACE_ID="$1"; } 282 | ;; 283 | -R|--replace-file|--replace-file=*) 284 | [[ "$1" = --replace-file=* ]] && filename="${1#*=}" || { shift; filename="$1"; } 285 | if [[ -s "$filename" ]]; then 286 | REPLACE_ID="$(< "$filename")" 287 | fi 288 | STORE_ID="$filename" 289 | ;; 290 | -s|--close|--close=*) 291 | [[ "$1" = --close=* ]] && close_id="${1#*=}" || { shift; close_id="$1"; } 292 | # always check that --close provides a numeric value 293 | if [[ -z "$close_id" || ! "$close_id" =~ ^[0-9]+$ ]]; then 294 | echo "Invalid close id: '$close_id'" 295 | exit 1 296 | fi 297 | notify_close "$close_id" 298 | exit $? 299 | ;; 300 | --) 301 | positional=yes 302 | ;; 303 | *) 304 | process_posargs "$1" 305 | ;; 306 | esac 307 | shift 308 | done 309 | 310 | # always force --replace and --replace-file to provide a numeric value; 0 means no id provided 311 | if [[ -z "$REPLACE_ID" || ! "$REPLACE_ID" =~ ^[0-9]+$ ]]; then 312 | REPLACE_ID=0 313 | fi 314 | 315 | # urgency is always set 316 | HINTS=("$(make_hint byte urgency "$URGENCY")" "${HINTS[@]}") 317 | 318 | if [[ "$SUMMARY_SET" = n ]] ; then 319 | help 320 | exit 1 321 | else 322 | notify 323 | fi 324 | -------------------------------------------------------------------------------- /dunst/volume.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/bash 3 | 4 | # You can call this script like this: 5 | # $./volume.sh up 6 | # $./volume.sh down 7 | # $./volume.sh mute 8 | 9 | function get_volume { 10 | amixer -D pulse get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1 11 | } 12 | 13 | function is_mute { 14 | amixer -D pulse get Master | grep '%' | grep -oE '[^ ]+$' | grep off > /dev/null 15 | } 16 | 17 | function send_notification { 18 | DIR=`dirname "$0"` 19 | volume=`get_volume` 20 | # Make the bar with the special character ─ (it's not dash -) 21 | # https://en.wikipedia.org/wiki/Box-drawing_character 22 | #bar=$(seq -s "─" $(($volume/5)) | sed 's/[0-9]//g') 23 | if [ "$volume" = "0" ]; then 24 | icon_name="/usr/share/icons/nya/48x48/status/notification-audio-volume-muted.svg" 25 | $DIR/notify-send.sh "$volume"" " -i "$icon_name" -t 2000 -h int:value:"$volume" -h string:synchronous:"─" --replace=555 26 | else 27 | if [ "$volume" -lt "10" ]; then 28 | icon_name="/usr/share/icons/nya/48x48/status/notification-audio-volume-low.svg" 29 | $DIR/notify-send.sh "$volume"" " -i "$icon_name" --replace=555 -t 2000 30 | else 31 | if [ "$volume" -lt "30" ]; then 32 | icon_name="/usr/share/icons/nya/48x48/status/notification-audio-volume-low.svg" 33 | else 34 | if [ "$volume" -lt "70" ]; then 35 | icon_name="/usr/share/icons/nya/48x48/status/notification-audio-volume-medium.svg" 36 | else 37 | icon_name="/usr/share/icons/nya/48x48/status/notification-audio-volume-high.svg" 38 | fi 39 | fi 40 | fi 41 | fi 42 | bar=$(seq -s "─" $(($volume/5)) | sed 's/[0-9]//g') 43 | # Send the notification 44 | $DIR/notify-send.sh "$volume" -i "$icon_name" -t 2000 -h int:value:"$volume" -h string:synchronous:"$bar" --replace=555 45 | 46 | } 47 | 48 | case $1 in 49 | up) 50 | # Set the volume on (if it was muted) 51 | amixer -D pulse set Master on > /dev/null 52 | # Up the volume (+ 5%) 53 | amixer -D pulse sset Master 5%+ > /dev/null 54 | send_notification 55 | ;; 56 | down) 57 | amixer -D pulse set Master on > /dev/null 58 | amixer -D pulse sset Master 5%- > /dev/null 59 | send_notification 60 | ;; 61 | mute) 62 | # Toggle mute 63 | amixer -D pulse set Master 1+ toggle > /dev/null 64 | if is_mute ; then 65 | DIR=`dirname "$0"` 66 | $DIR/notify-send.sh -i "/usr/share/icons/nya/48x48/status/notification-audio-volume-muted.svg" --replace=555 -u normal "Mute" -t 2000 67 | else 68 | send_notification 69 | fi 70 | ;; 71 | esac 72 | -------------------------------------------------------------------------------- /mpd/mpd.conf: -------------------------------------------------------------------------------- 1 | # 2 | #███╗ ███╗██████╗ ██████╗ 3 | #████╗ ████║██╔══██╗██╔══██╗ 4 | #██╔████╔██║██████╔╝██║ ██║ 5 | #██║╚██╔╝██║██╔═══╝ ██║ ██║ 6 | #██║ ╚═╝ ██║██║ ██████╔╝ 7 | #╚═╝ ╚═╝╚═╝ ╚═════╝ 8 | # 9 | #2021-08-14 10 | # 11 | 12 | # Required files 13 | db_file "~/.config/mpd/database" 14 | log_file "~/.config/mpd/log" 15 | 16 | # Optional 17 | music_directory "/home/magnus/Musik" 18 | playlist_directory "~/.config/mpd/playlists" 19 | pid_file "~/.config/mpd/pid" 20 | state_file "~/.config/mpd/state" 21 | sticker_file "~/.config/mpd/sticker.sql" 22 | 23 | audio_output { 24 | type "pulse" 25 | name "mpd pulse-output" 26 | mixer_type "software" 27 | } 28 | 29 | audio_output { 30 | type "fifo" 31 | name "toggle_visualizer" 32 | path "/tmp/mpd.fifo" 33 | format "44100:16:2" 34 | } 35 | 36 | ####### END MPD CONFIG ####### 37 | 38 | -------------------------------------------------------------------------------- /ncmpcpp/config: -------------------------------------------------------------------------------- 1 | 2 | #███╗ ██╗ ██████╗███╗ ███╗██████╗ ██████╗██████╗ ██████╗ 3 | #████╗ ██║██╔════╝████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗ 4 | #██╔██╗ ██║██║ ██╔████╔██║██████╔╝██║ ██████╔╝██████╔╝ 5 | #██║╚██╗██║██║ ██║╚██╔╝██║██╔═══╝ ██║ ██╔═══╝ ██╔═══╝ 6 | #██║ ╚████║╚██████╗██║ ╚═╝ ██║██║ ╚██████╗██║ ██║ 7 | #╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝ 8 | # 9 | #2021-08-14 10 | # 11 | 12 | 13 | mpd_music_dir = "~/Musik" 14 | #song_list_format = " $5%l $1║{$7 %a $1│$2 %t$1 $R $3%b$1 }|{$6 %f $1}" 15 | #tag_editor_album_format = "{$4(%y)$9 }$7%b$9" 16 | #browser_playlist_prefix = "$8playlist$9" 17 | selected_item_prefix = "$0" 18 | selected_item_suffix = "$9" 19 | user_interface = "alternative" 20 | mpd_host = "127.0.0.1" 21 | mpd_port = "6600" 22 | system_encoding = "utf-8" 23 | 24 | ####visualizer settings#### 25 | visualizer_data_source = "/tmp/mpd.fifo" 26 | visualizer_output_name = "visualizer" 27 | #visualizer_sync_interval = "20" 28 | visualizer_type = "spectrum" 29 | visualizer_color ="yellow" 30 | visualizer_look = "º|" 31 | 32 | ####songs#### 33 | #([cyan,date],[cyan, length], [cyan,title] | [cyan,date],[blue,title],[cyan]) 34 | song_list_format = "{$7%a $7%l $7%t}|{$7%a $5%t $7}" 35 | #([red,artist],[magenta],[red,length]) 36 | song_status_format = "$2%a $7• $4%t $7• $3%b {}$7• $5%y$7" 37 | #([cyan,length],[blue,title],[end current color]) 38 | song_library_format = "$7%l $5%t$9" 39 | #([magenta,blue,magenta]|[blue] 40 | now_playing_prefix = "$b$8» " 41 | now_playing_suffix = "$/b" 42 | #([blue],[cyan,artist],[blue,title],[yellow,album],[magenta,length] 43 | song_columns_list_format = "(4)[]{} (15)[cyan]{a} (30)[blue]{t} (46)[white]{b} (5)[magenta]{l}" 44 | 45 | ####misc#### 46 | playlist_separate_albums = "no" 47 | playlist_display_mode = "columns" (classic/columns) 48 | browser_display_mode = "columns" 49 | volume_change_step = "2" 50 | #progressbar_look = "─╼─" 51 | #progressbar_look = "─⊙ " 52 | progressbar_look = "▃▃▃" 53 | #user_interface = "alternative" 54 | data_fetching_delay = "yes" 55 | media_library_primary_tag = "artist" 56 | default_find_mode = "wrapped" 57 | header_visibility = "no" 58 | statusbar_visibility = "yes" 59 | titles_visibility = "no" 60 | header_text_scrolling = "yes" 61 | cyclic_scrolling = "yes" 62 | #startup_screen = "media_library" 63 | ask_before_clearing_playlists = "yes" 64 | clock_display_seconds = "yes" 65 | display_volume_level = "yes" 66 | display_bitrate = "yes" 67 | display_remaining_time = "yes" 68 | ignore_leading_the = "no" 69 | mouse_support = "yes" 70 | #use_console_editor = "yes" 71 | autocenter_mode = "yes" 72 | 73 | #execute_on_song_change = notify-send "Now Playing ♫" "$(mpc current)" 74 | execute_on_song_change="~/.config/ncmpcpp/ncmpcpp-ueberzug/ncmpcpp_cover_art.sh" 75 | 76 | -------------------------------------------------------------------------------- /ncmpcpp/ncmpcpp-ueberzug/ncmpcpp-ueberzug: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export FIFO_UEBERZUG="/tmp/mpd-ueberzug-${PPID}" 3 | 4 | cleanup() { 5 | rm "$FIFO_UEBERZUG" 2>/dev/null 6 | rm /tmp/mpd_cover.jpg 2>/dev/null 7 | pkill -P $$ 2>/dev/null 8 | pkill ncmpcpp_cover_art.sh 9 | } 10 | 11 | pkill -P $$ 2>/dev/null 12 | rm "$FIFO_UEBERZUG" 2>/dev/null 13 | mkfifo "$FIFO_UEBERZUG" >/dev/null 14 | trap cleanup EXIT 2>/dev/null 15 | tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser simple >/dev/null 2>&1 & 16 | 17 | ncmpcpp 18 | cleanup 19 | -------------------------------------------------------------------------------- /ncmpcpp/ncmpcpp-ueberzug/ncmpcpp_cover_art.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #!/bin/sh 3 | 4 | # SETTINGS 5 | music_library="/home/magnus/Musik" 6 | fallback_image="$HOME/.config/ncmpcpp/fallback.png" 7 | padding_top=0 8 | padding_bottom=0 9 | padding_right=0 10 | max_width=36 11 | reserved_playlist_cols=0 12 | reserved_cols_in_percent="false" 13 | force_square="true" 14 | square_alignment="top" 15 | 16 | left_aligned="true" 17 | padding_left=0 18 | 19 | 20 | # Only set this if the geometries are wrong or ncmpcpp shouts at you to do it. 21 | # Visually select/highlight a character on your terminal, zoom in an image 22 | # editor and count how many pixels a character's width and height are. 23 | font_height= 24 | font_width= 25 | 26 | main() { 27 | # kill_previous_instances >/dev/null 2>&1 28 | find_cover_image >/dev/null 2>&1 29 | display_cover_image 2>/dev/null 30 | detect_window_resizes >/dev/null 2>&1 31 | display_notifications >/dev/null 2>&1 32 | } 33 | 34 | # ==== Main functions ========================================================= 35 | 36 | kill_previous_instances() { 37 | script_name=$(basename "$0") 38 | for pid in $(pidof -x "$script_name"); do 39 | if [ "$pid" != $$ ]; then 40 | kill -15 "$pid" 41 | fi 42 | done 43 | } 44 | 45 | find_cover_image() { 46 | 47 | # First we check if the audio file has an embedded album art 48 | ext="$(mpc --format %file% current | sed 's/^.*\.//')" 49 | if [ "$ext" = "flac" ]; then 50 | # since FFMPEG cannot export embedded FLAC art we use metaflac 51 | metaflac --export-picture-to=/tmp/mpd_cover.jpg \ 52 | "$(mpc --format "$music_library"/%file% current)" && 53 | cover_path="/tmp/mpd_cover.jpg" && return 54 | else 55 | ffmpeg -y -i "$(mpc --format "$music_library"/%file% | head -n 1)" \ 56 | /tmp/mpd_cover.jpg && 57 | cover_path="/tmp/mpd_cover.jpg" && return 58 | fi 59 | 60 | # If no embedded art was found we look inside the music file's directory 61 | album="$(mpc --format %album% current)" 62 | file="$(mpc --format %file% current)" 63 | album_dir="${file%/*}" 64 | album_dir="$music_library/$album_dir" 65 | found_covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f \ 66 | -iregex ".*/.*\(${album}\|cover\|folder\|artwork\|front\).*[.]\\(jpe?g\|png\|gif\|bmp\)" \; )" 67 | cover_path="$(echo "$found_covers" | head -n1)" 68 | if [ -n "$cover_path" ]; then 69 | return 70 | fi 71 | 72 | # If we still failed to find a cover image, we use the fallback 73 | if [ -z "$cover_path" ]; then 74 | cover_path=$fallback_image 75 | fi 76 | } 77 | 78 | display_cover_image() { 79 | compute_geometry 80 | 81 | send_to_ueberzug \ 82 | action "add" \ 83 | identifier "mpd_cover" \ 84 | path "$cover_path" \ 85 | x "$ueber_left" \ 86 | y "$padding_top" \ 87 | height "$ueber_height" \ 88 | width "$ueber_width" \ 89 | synchronously_draw "True" \ 90 | scaler "fit_contain" \ 91 | scaling_position_x "0.5" 92 | } 93 | 94 | detect_window_resizes() { 95 | { 96 | trap 'display_cover_image' WINCH 97 | while :; do sleep .1; done 98 | } & 99 | } 100 | 101 | # ==== Dunst notification functions ========================================================= 102 | display_notifications() 103 | { 104 | 105 | notify-send -i "$cover_path" "$b Now Playing ♫" "$(mpc --format '%title%' current)" 106 | } 107 | 108 | 109 | # ==== Helper functions ========================================================= 110 | 111 | compute_geometry() { 112 | unset LINES COLUMNS # Required in order for tput to work in a script 113 | term_lines=$(tput lines) 114 | term_cols=$(tput cols) 115 | if [ -z "$font_height" ] || [ -z "$font_height" ]; then 116 | guess_font_size 117 | fi 118 | 119 | ueber_height=$(( term_lines - padding_top - padding_bottom )) 120 | # Because Ueberzug uses characters as a unit we must multiply 121 | # the line count (height) by the font size ratio in order to 122 | # obtain an equivalent width in column count 123 | ueber_width=$(( ueber_height * font_height / font_width )) 124 | ueber_left=$(( term_cols - ueber_width - padding_right )) 125 | 126 | if [ "$left_aligned" = "true" ]; then 127 | compute_geometry_left_aligned 128 | else 129 | compute_geometry_right_aligned 130 | fi 131 | 132 | apply_force_square_setting 133 | } 134 | 135 | compute_geometry_left_aligned() { 136 | ueber_left=$padding_left 137 | max_width_chars=$(( term_cols * max_width / 100 )) 138 | if [ "$max_width" != 0 ] && 139 | [ $(( ueber_width + padding_right + padding_left )) -gt "$max_width_chars" ]; then 140 | ueber_width=$(( max_width_chars - padding_left - padding_right )) 141 | fi 142 | } 143 | 144 | compute_geometry_right_aligned() { 145 | if [ "$reserved_cols_in_percent" = "true" ]; then 146 | ueber_left_percent=$(printf "%.0f\n" $(calc "$ueber_left" / "$term_cols" '*' 100)) 147 | if [ "$ueber_left_percent" -lt "$reserved_playlist_cols" ]; then 148 | ueber_left=$(( term_cols * reserved_playlist_cols / 100 )) 149 | ueber_width=$(( term_cols - ueber_left - padding_right )) 150 | fi 151 | else 152 | if [ "$ueber_left" -lt "$reserved_playlist_cols" ]; then 153 | ueber_left=$reserved_playlist_cols 154 | ueber_width=$(( term_cols - ueber_left - padding_right )) 155 | fi 156 | 157 | fi 158 | 159 | if [ "$max_width" != 0 ] && [ "$ueber_width" -gt "$max_width" ]; then 160 | ueber_width=$max_width 161 | ueber_left=$(( term_cols - ueber_width - padding_right )) 162 | fi 163 | } 164 | 165 | apply_force_square_setting() { 166 | if [ $force_square = "true" ]; then 167 | ueber_height=$(( ueber_width * font_width / font_height )) 168 | case "$square_alignment" in 169 | center) 170 | area=$(( term_lines - padding_top - padding_bottom )) 171 | padding_top=$(( padding_top + area / 2 - ueber_height / 2 )) 172 | ;; 173 | bottom) 174 | padding_top=$(( term_lines - padding_bottom - ueber_height )) 175 | ;; 176 | *) ;; 177 | esac 178 | fi 179 | } 180 | 181 | guess_font_size() { 182 | # A font width and height estimate is required to 183 | # properly compute the cover width (in columns). 184 | # We are reproducing the arithmetic used by Ueberzug 185 | # to guess font size. 186 | # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L24 187 | 188 | guess_terminal_pixelsize 189 | 190 | approx_font_width=$(( term_width / term_cols )) 191 | approx_font_height=$(( term_height / term_lines )) 192 | 193 | term_xpadding=$(( ( - approx_font_width * term_cols + term_width ) / 2 )) 194 | term_ypadding=$(( ( - approx_font_height * term_lines + term_height ) / 2 )) 195 | 196 | font_width=$(( (term_width - 2 * term_xpadding) / term_cols )) 197 | font_height=$(( (term_height - 2 * term_ypadding) / term_lines )) 198 | } 199 | 200 | guess_terminal_pixelsize() { 201 | # We are re-using the same Python snippet that 202 | # Ueberzug utilizes to retrieve terminal window size. 203 | # https://github.com/seebye/ueberzug/blob/master/ueberzug/terminal.py#L10 204 | 205 | python < "$FIFO_UEBERZUG" 248 | 249 | IFS=${old_IFS} 250 | } 251 | 252 | main 253 | -------------------------------------------------------------------------------- /neofetch/tentaclecol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Algorithm79/Dotfiles_i3/7e54fbb45a562ed936a14be0d4ec820923d833d9/neofetch/tentaclecol.png -------------------------------------------------------------------------------- /polybar/config: -------------------------------------------------------------------------------- 1 | ;========================================================== 2 | ; 3 | ; 4 | ; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ 5 | ; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ 6 | ; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ 7 | ; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ 8 | ; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ 9 | ; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ 10 | ; 11 | ; 12 | ; To learn more about how to configure Polybar 13 | ; go to https://github.com/polybar/polybar 14 | ; 15 | ; The README contains a lot of information 16 | ; 17 | ;========================================================== 18 | 19 | [colors] 20 | bg = #11E1E2E 21 | no-bg = #1E1E2E 22 | ;bg = #af03121c 23 | ;no-bg = #00000000 24 | ; pywal generated, manually modified 25 | black = #03121c 26 | black-alt = #a19c9f 27 | red = #386685 28 | green = #ABE9B3 29 | yellow = #FAE3B0 30 | blue = #7aa2f7 31 | magenta = #c38ac3 32 | cyan = #8ee8c4 33 | white = #D9E0EE 34 | pink = #F5C2E7 35 | 36 | [constants/background] 37 | override-redirect = false 38 | height = 30 39 | fixed-center = true 40 | padding = 4 41 | 42 | 43 | font-0 = Jet Brains Mono Nerd Font:style=Bold:pixelsize=12;1 44 | font-1 = Iosevka Custom:fontformat=truetype:size=9 45 | font-2 = siji:pixelsize=10;1 46 | font-3 = unifont:fontformat=truetype:size=8:antialias=false;0 47 | font-4 = "Font Awesome 5 Free:style=Regular:pixelsize=10;1" 48 | font-5 = "Font Awesome 5 Free:style=Solid:pixelsize=10;1" 49 | font-6 = "Font Awesome 5 Free:pixelsize=10;1" 50 | font-7 = "SourceHanSansJP-Normal:pixelsize=10;1" 51 | 52 | wm-restack = i3 53 | 54 | [bar/top] 55 | locale = sv_SE.UTF-8 56 | inherit = constants/background 57 | width = 100% 58 | module-margin-left = 1 59 | module-margin-right = 0 60 | padding-left = 2 61 | padding-right = 2 62 | enable-ipc = true 63 | 64 | ;tray-position = right 65 | ;tray-maxsize = 15 66 | ;tray-scale = 1.0 67 | ;tray-transparent = true 68 | ;tray-background = #00000000 69 | 70 | background = #001E1D2F 71 | foreground = ${colors.white} 72 | 73 | modules-left = appsmenu firefox steam discord spotify files email xwindow 74 | modules-center = i3 75 | modules-right = cpu memory filesystem wlan pulseaudio separator date powermenu 76 | 77 | [module/xwindow] 78 | format-foreground = ${colors.blue} 79 | format-padding = 2 80 | type = internal/xwindow 81 | label = %title:0:30:...% 82 | 83 | [module/i3] 84 | type = internal/i3 85 | pin-workspaces = true 86 | strip-wsnumbers = true 87 | index-sort = true 88 | enable-click = true 89 | enable-scroll = true 90 | wrapping-scroll = true 91 | reverse-scroll = false 92 | fuzzy-match = true 93 | 94 | ws-icon-default =  95 | 96 | format = 97 | 98 | label-mode = %mode% 99 | label-mode-padding = 2 100 | label-mode-background = #e85d00 101 | 102 | label-focused =  103 | label-focused-foreground = ${colors.blue} 104 | label-focused-background = ${colors.background} 105 | label-focused-padding = 2 106 | 107 | label-unfocused =  108 | label-unfocused-padding = 2 109 | label-unfocused-foreground = ${colors.blue} 110 | label-unfocused-background = ${colors.background} 111 | 112 | label-visible = %icon% 113 | label-visible-underline = #555555 114 | label-visible-padding = 2 115 | 116 | label-urgent =  117 | label-urgent-foreground = ${colors.red} 118 | label-urgent-background = ${colors.background} 119 | label-urgent-padding = 2 120 | 121 | [module/date] 122 | date = %D 123 | 124 | format =