diff --git a/.config/X11/xprofile b/.config/X11/xprofile index 8046c45..d27da83 100644 --- a/.config/X11/xprofile +++ b/.config/X11/xprofile @@ -1,7 +1,7 @@ #!/bin/sh # Graphical-specific environment variables -export TERMINAL="termite" +export TERMINAL="alacritty" export BROWSER="chromium" export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" export QT_QPA_PLATFORMTHEME=gtk2 diff --git a/.config/i3/alt-tab.sh b/.config/i3/alt-tab.sh deleted file mode 100755 index 5f17ed6..0000000 --- a/.config/i3/alt-tab.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# ================================================================================== # -# Focus the next window on the current workspace in i3, e.g. for binding to Alt+Tab # -# Depends: jq, awk, i3wm (obviously) # -# Author: Nervengift # -# License: Don't think this deserves a license, Public Domain # -# Known bugs: doesn't work with non-window container focused # -# ================================================================================== # - -ws=$(i3-msg -t get_workspaces|jq "map(select(.focused))[]|.name") -echo $ws -windows=$(i3-msg -t get_tree|jq ".nodes|map(.nodes[])|map(.nodes[])|map(select(.type==\"workspace\" and .name==$ws))[0].nodes|map(recurse(.nodes[]))|map(.window)|.[]|values") -echo $windows -current=$(i3-msg -t get_tree|jq "recurse(.nodes[])|select(.focused)|.window") -echo $current -if [ "x$current" != "xnull" ]; then - next=$(echo $windows | awk "BEGIN {RS=\" \";FS=\" \"};NR == 1 {w=\$1};{if (f == 1){w=\$1;f=0}else if (\$1 == \"$current\") f=1};END {print w}") - i3-msg [id=$next] focus > /dev/null -fi diff --git a/.config/i3/config b/.config/i3/config index e57ff0e..bb65afb 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -6,6 +6,8 @@ set $mod Mod4 set $alt Mod1 floating_modifier $mod +bindsym $mod+Shift+l debuglog toggle; shmlog on + font pango:sans 9 # kill focused window @@ -114,10 +116,9 @@ exec_always --no-startup-id feh --no-fehbg --no-xinerama --bg-fill $DOTFILES/lak for_window [class="Pinentry"] floating enable for_window [class="Pavucontrol"] floating enable for_window [class="Blueman-manager"] floating enable +for_window [class="floating-term" instance="termite"] floating enable +for_window [class="Alacritty" instance="floating-term"] floating enable for_window [window_role="floating-term"] floating enable -for_window [window_role="pop-up"] floating enable -for_window [window_role="i3blocks-update-term"] floating enable -for_window [window_role="i3blocks-clock-term"] floating enable for_window [title="^rofi$"] floating enable new_window none @@ -126,18 +127,19 @@ new_float none gaps inner 20 gaps outer 4 +mouse_warping none focus_follows_mouse yes +popup_during_fullscreen smart # keybindings bindsym $mod+Shift+j reload bindsym $mod+c exec chromium -bindsym $mod+v exec "i3-sensible-terminal -e \\"$SHELL -c vim;$SHELL\\" -bindsym $mod+Ctrl+v exec "i3-sensible-terminal -r floating-term -e \\"$SHELL -c vim;$SHELL\\" -bindsym Mod1+Tab exec ~/.config/i3/alt-tab.sh +bindsym $mod+v exec "i3-sensible-terminal -e sh -c \\"($SHELL -c $EDITOR || :) && $SHELL\\" +bindsym $mod+Ctrl+v exec "i3-sensible-terminal --class floating-term -e sh -c \\"($SHELL -c $EDITOR || : ) && $SHELL\\" bindsym $mod+Return exec i3-sensible-terminal -bindsym $mod+Ctrl+Return exec i3-sensible-terminal -r floating-term -bindsym $mod+Shift+Return exec i3-sensible-terminal -d "`xcwd`" -bindsym $mod+Ctrl+Shift+Return exec i3-sensible-terminal -r floating-term -d "`xcwd`" +bindsym $mod+Ctrl+Return exec i3-sensible-terminal --class floating-term +bindsym $mod+Shift+Return exec i3-sensible-terminal --working-directory "$(xcwd)" +bindsym $mod+Ctrl+Shift+Return exec i3-sensible-terminal --class floating-term --working-directory "$(xcwd)" bindsym $mod+l exec dm-tool switch-to-greeter bindsym $mod+space exec "pkill rofi; rofi -show run -sidebar-mode -terminal i3-sensible-terminal -normal-window" bindsym $mod+Shift+p exec rofi-pass --root $(grep path ~/.config/gopass/config.yml | sed -E 's|^.*fs\+file://||g' | tr '\n' ':') | sed 's/:$//g' @@ -179,9 +181,5 @@ exec --no-startup-id pullover exec --no-startup-id mailnag exec --no-startup-id picom -b --experimental-backends exec --no-startup-id chromium --no-startup-window -exec --no-startup-id thunderbird - -exec i3-msg 'workspace 1; exec sleep 2 && chromium' -exec i3-msg 'workspace 2; exec i3-sensible-terminal' # vim:ft=i3 diff --git a/.config/mailnag/mailnag.cfg b/.config/mailnag/mailnag.cfg index 4bdd759..a887a07 100644 --- a/.config/mailnag/mailnag.cfg +++ b/.config/mailnag/mailnag.cfg @@ -27,3 +27,7 @@ ssl = 1 imap = 1 idle = 0 folder = INBOX, Spam + +[userscriptplugin] +script_file = + diff --git a/.config/polybar/config b/.config/polybar/config index e44cf6d..8075806 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -67,13 +67,13 @@ exec = $XDG_CONFIG_HOME/polybar/update.sh tail = true format-prefix = " " format-prefix-foreground = ${colours.icon} -click-left = i3-msg exec -- i3-sensible-terminal -r i3blocks-update-term -e "yay && kill -USR1 %pid% || kill --USR1 %pid%" +click-left = i3-msg exec "i3-sensible-terminal --class floating-term -e sh -c \"(yay || :) && kill -USR1 %pid%\"" [module/weather] type = custom/script exec = $XDG_CONFIG_HOME/polybar/weather.sh interval = 120 -click-left = i3-msg exec "i3-sensible-terminal -r floating-term -e 'sh -c \"xdotool getactivewindow windowsize 910 680 && curl wttr.in && sleep infinity\"'" +click-left = i3-msg exec "i3-sensible-terminal --class floating-term -d 125 40 -e sh -c \"(curl wttr.in || :) && stty -echo && read\"" [module/xkeyboard] type = internal/xkeyboard @@ -184,7 +184,7 @@ type = internal/network interface = eth0 interval = 3.0 -label-connected = %local_ip% +label-connected = %local_ip% & %local_ip6% format-connected-prefix = " " format-connected-prefix-foreground = ${colours.icon} format-connected-underline = ${colours.background} @@ -200,7 +200,7 @@ label-disconnected-foreground = ${colours.critical} type = internal/date interval = 1 -label = %{A3:i3-sensible-terminal -r i3blocks-clock-term -e "sh -c \"xdotool getactivewindow windowsize 500 600; cal -y $(date +%Y); stty -echo; exec sleep infinity\"" &:}%date% %time%%{A} +label = %{A3:i3-msg exec "i3-sensible-terminal --class floating-term -d 66 35 -qq -e sh -c \"cal -y $(date +%Y) && read\"":}%date% %time%%{A} time = %H:%M time-alt = %a %e %b %Y %H:%M:%S @@ -213,8 +213,8 @@ format-prefix-foreground = ${colours.icon} type = internal/pulseaudio label-volume = %percentage% -format-volume = %{A3:pavucontrol:} %{A} -format-muted = %{A3:pavucontrol:}%{A} +format-volume = %{A3:i3-msg exec pavucontrol:} %{A +format-muted = %{A3:i3-msg exec pavucontrol:}%{A} label-volume-foreground = ${root.foreground} format-muted-foreground = ${colours.icon} diff --git a/.config/polybar/interface.sh b/.config/polybar/interface.sh new file mode 100755 index 0000000..d5ed978 --- /dev/null +++ b/.config/polybar/interface.sh @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +# Use the provided interface, otherwise the device used for the default route. +if [[ -n $BLOCK_INSTANCE ]]; then + IF=$BLOCK_INSTANCE +else + IF=$(ip route | awk '/^default/ { print $5 ; exit }') +fi + +[ -e /sys/class/net/${IF} ] || exit + +if [ -z "$IF" ] || [ "$(cat /sys/class/net/$IF/operstate)" = 'down' ]; then + echo down + echo \#FF0000 # color + exit +fi + +case $1 in + -4) AF=inet ;; + -6) AF=inet6 ;; + *) AF=inet6? ;; +esac + +# if no interface is found, use the first device with a global scope +ip addr show $IF | sed -nE "s/.*$AF ([^\\/]+).* scope global.*/\\1/p" + + +# case $BLOCK_BUTTON in +# 1) curl -s https://api.ipify.org; +# break;; +# 2) curl -s https://api.ipify.org | tee >(xclip -i); +# break;; +# 0|3) echo "$LOCIP" | tee >(xclip -i); +# break;; +# esac + diff --git a/.config/vim/vimrc b/.config/vim/vimrc index ab2fa91..0435fa7 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -108,6 +108,7 @@ Plug 'vim-airline/vim-airline-themes' Plug 'lervag/vimtex' Plug 'JamshedVesuna/vim-markdown-preview' Plug 'junegunn/fzf.vim' +Plug 'junegunn/vim-easy-align' Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } " Syntax Highlighting diff --git a/aliases b/aliases index 9ac2c88..a80480e 100644 --- a/aliases +++ b/aliases @@ -60,6 +60,7 @@ alias open=xdg-open alias rm='rm -i' alias mv='mv -i' alias cp='cp -ir' +alias scp='scp -r' alias dd='dd status=progress' alias ssh="ssh -tt" alias wget="wget --hsts-file=$XDG_DATA_HOME/wget/hsts-file" @@ -114,6 +115,7 @@ alias chx='chmod +x' # Git Aliases alias g=git +alias ginit='git init' alias gignore='$EDITOR .gitignore' alias gitc='$EDITOR $XDG_CONFIG_HOME/git/config' alias ggignore='$EDITOR $XDG_CONFIG_HOME/git/gitignore' @@ -288,7 +290,7 @@ alias xresources="$EDITOR $XDG_CONFIG_HOME/X11/xresources ; xrdb merge $XDG_CONF alias sshc="$EDITOR ~/.ssh/config" alias dotfiles="cd $DOTFILES" alias i3c="$EDITOR $XDG_CONFIG_HOME/i3/config ; i3-msg restart" -alias polybarc="$EDITOR $XDG_CONFIG_HOME/polybar/config; killall -q polybar; while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done; exec polybar -r i3bar" +alias polybarc="$EDITOR $XDG_CONFIG_HOME/polybar/config; killall -q polybar; while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done; nohup polybar -r i3bar <&- 2>&1 1>/dev/null & disown" alias sf=screenfetch alias nf=neofetch diff --git a/scripts/3screens b/scripts/3screens new file mode 100755 index 0000000..5584d82 --- /dev/null +++ b/scripts/3screens @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +TOP_LEFT="DP-0.1" +TOP_RIGHT="DP-0.2.1" +BOTTOM_LEFT="HDMI-0" +BOTTOM_RIGHT="DP-0.2.2.1" + + #--output $BOTTOM_LEFT --primary --mode 1920x1080 --pos 0x1080 --rotate normal \ +xrandr \ + --output $BOTTOM_LEFT --off \ + --output $TOP_LEFT --mode 1920x1080 --pos 0x0 --rotate inverted \ + --output $TOP_RIGHT --mode 1920x1080 --pos 1920x0 --rotate inverted \ + --output $BOTTOM_RIGHT --mode 1920x1080 --pos 1920x1080 --rotate normal --primary + +[ -e ~/.fehbg ] && ~/.fehbg diff --git a/scripts/dpi b/scripts/dpi index 44868b6..fbea390 100755 --- a/scripts/dpi +++ b/scripts/dpi @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -ex # Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup @@ -15,6 +15,8 @@ mkdir -p "$CONF_DIR" # Build xsettingsd.local { + # echo Gdk/WindowScalingFactor $(echo "$dpi/96" | bc -l | xargs printf '%.f') + # echo Gdk/UnscaledDPI $(echo "($dpi*1024)/($dpi/96)" | bc -l | xargs printf '%.f') cat $CONF_DIR/xsettingsd.conf 2>/dev/null || true echo Xft/DPI $(( $dpi*1024 )) echo Gdk/WindowScalingFactor $(( $dpi/96 )) diff --git a/scripts/gtav b/scripts/gtav new file mode 100755 index 0000000..ed38c81 --- /dev/null +++ b/scripts/gtav @@ -0,0 +1,2 @@ +#!/bin/sh +exec xdg-open steam://rungameid/271590 diff --git a/scripts/rofi-fontawesome b/scripts/rofi-fontawesome index cddc20c..180053b 100755 --- a/scripts/rofi-fontawesome +++ b/scripts/rofi-fontawesome @@ -57,9 +57,8 @@ function notify() { } function display() { - fontawesome=$(cat "$FONTAWESOME_FILE" | grep -v '#' | grep -v '^[[:space:]]*$') - update=""$'\t'"Update Font Awesome cache" - fontawesome=$(printf "$fontawesome\n$update") + update=$'\tUpdate Font Awesome cache' + fontawesome=$(grep -v '#\|^[[:space:]]*$' "$FONTAWESOME_FILE"; printf "$update\n") line=$(echo "$fontawesome" | rofi -dmenu -i -p fontawesome -normal-window -kb-custom-1 Ctrl+c -kb-row-tab '' -kb-row-select Tab $@) exit_code=$? @@ -69,7 +68,6 @@ function display() { return fi - #IFS=$'\t' line=($line) last=${line[${#line[@]}-1]} diff --git a/scripts/screenshot b/scripts/screenshot index 275efa6..832e342 100755 --- a/scripts/screenshot +++ b/scripts/screenshot @@ -9,7 +9,7 @@ FILENAME="$(date '+%s%N' | sha256sum | head -c7).png" DIRECTORY="$HOME/pictures/screenshots" SCP_HOST=frebib@Poseidon.nerdhouse.io -SCP_PATH=/dave/www/frebib.net/s +SCP_PATH=/services/www/files/frebib.net/s URL_PATH=https://frebib.net/s # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~