From b768d53ab8826d4137dc9eccc7b3881736a83392 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 11 Mar 2026 11:42:24 +0100 Subject: [PATCH] Bunch of changes, fuzzy document finder --- X11/.xinitrc | 3 +++ etc/i3blocks.conf | 7 ++++++- i3/config | 18 +++++++++++++----- i3/scripts/mem_usage.sh | 2 +- local-bin/docpic | 9 +++++++++ local-bin/docpic-rofi | 8 ++++++++ zsh/.zshrc | 3 +++ 7 files changed, 43 insertions(+), 7 deletions(-) create mode 100755 local-bin/docpic create mode 100755 local-bin/docpic-rofi diff --git a/X11/.xinitrc b/X11/.xinitrc index 4b857d3..1dc2159 100644 --- a/X11/.xinitrc +++ b/X11/.xinitrc @@ -1,3 +1,6 @@ +systemctl --user import-environment DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS +dbus-update-activation-environment --systemd DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS + i3 export GTK_THEME=Adwaita-dark export QT_QPA_PLATFORMTHEME=gtk2 diff --git a/etc/i3blocks.conf b/etc/i3blocks.conf index 14da6fb..0eb111e 100644 --- a/etc/i3blocks.conf +++ b/etc/i3blocks.conf @@ -7,6 +7,11 @@ color=#00b894 command=echo "[$USER@$HOSTNAME ~]" interval=once +[uptime] +command=awk '{t=int($1); d=t/86400; h=(t%86400)/3600; m=(t%3600)/60; if(d>0) printf "%dd %02d:%02dh\n", d,h,m; else printf "%02d:%02dh\n", h,m}' /proc/uptime +interval=60 +label=UPT: + [homelab] command=/home/agres/.config/i3/scripts/lab.sh interval=60 @@ -41,5 +46,5 @@ interval=10 label=MEM: [time] -command=date '+%d.%m %H:%M:%S' +command=date '+%d.%m %H:%M' interval=1 diff --git a/i3/config b/i3/config index 56bc914..17f60bc 100644 --- a/i3/config +++ b/i3/config @@ -6,7 +6,7 @@ font pango:MesloLGL Nerd Font Mono 8 # Start basic functionality apps exec --no-startup-id dex --autostart --environment i3 exec --no-startup-id nm-applet -exec --no-startup-id xautolock -time 30 -locker "/home/agres/.config/i3/scripts/lock.sh" +exec --no-startup-id xautolock -time 120 -locker "/home/agres/.config/i3/scripts/lock.sh" # Keyboard quick buttons set $refresh_i3status killall -SIGUSR1 i3status @@ -25,6 +25,8 @@ bindsym $mod+Return exec alacritty bindsym $mod+Shift+q kill bindsym $mod+d exec --no-startup-id rofi -show run -theme solarized +bindsym $mod+s exec --no-startup-id ~/.local/bin/docpic-rofi + # change focus bindsym $mod+j focus down @@ -72,6 +74,9 @@ bindsym $mod+space focus mode_toggle # focus the child container #bindsym $mod+d focus child +#Stop focus from wrapping around edges (stay on last window in that direction) +focus_wrapping no + # Define names for default workspaces for which we configure key bindings later on. # We use variables to avoid repeating the names in multiple places. set $ws1 "1:Code" @@ -207,8 +212,10 @@ exec --no-startup-id xset dpms 7200 7200 7200 exec --no-startup-id picom # Start notification tool exec --no-startup-id dunst +# Start librepods +#exec --no-startup-id /home/agres/other/build/librepods-main/linux/build/librepods --hide -default_border pixel 1 +default_border pixel 4 default_floating_border normal 0 # Window overlay theme @@ -220,12 +227,13 @@ set $g4 #4A4A4A set $g5 #BFBFBF set $g6 #E6E6E6 set $accent #808080 +set $ws_accent #00675a # --- Window decoration colors --- # Format: client. -client.focused $g2 $g2 $g6 $accent $g2 -client.focused_inactive $g1 $g1 $g5 $g3 $g1 -client.unfocused $g0 $g0 $g5 $g3 $g0 +client.focused $ws_accent $ws_accent $g6 $accent $ws_accent +client.focused_inactive $g3 $g3 $g5 $g3 $g3 +client.unfocused $g3 $g3 $g5 $g3 $g3 client.urgent #5F1F1F #5F1F1F $g6 #B35C5C #5F1F1F client.placeholder $g0 $g0 $g5 $g3 $g0 client.background $g0 diff --git a/i3/scripts/mem_usage.sh b/i3/scripts/mem_usage.sh index 742dbc9..f4e029c 100755 --- a/i3/scripts/mem_usage.sh +++ b/i3/scripts/mem_usage.sh @@ -1,7 +1,7 @@ #!/bin/sh used=$(free -h --si | awk '/^Mem/ {print $3}') -total=$(free -h --si | awk '/^Mem/ {print $2}') +total="32G" text="${used}/${total}" diff --git a/local-bin/docpic b/local-bin/docpic new file mode 100755 index 0000000..7b74008 --- /dev/null +++ b/local-bin/docpic @@ -0,0 +1,9 @@ +#!/bin/sh +cd "$HOME/documents" || exit 1 + +fd --type f . | + fzf \ + --scheme=path \ + --prompt='documents> ' \ + --preview 'bat --style=numbers --color=always --line-range :300 {}' \ + --bind 'enter:become(nvim {})' diff --git a/local-bin/docpic-rofi b/local-bin/docpic-rofi new file mode 100755 index 0000000..a3779f6 --- /dev/null +++ b/local-bin/docpic-rofi @@ -0,0 +1,8 @@ +#!/bin/sh +file=$( + cd "$HOME/documents" || exit 1 + fd --type f . | rofi -dmenu -i -p "documents" +) || exit 0 + +[ -n "$file" ] || exit 0 +exec alacritty -e nvim "$HOME/documents/$file" diff --git a/zsh/.zshrc b/zsh/.zshrc index 4607268..cddc8a5 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -55,6 +55,9 @@ alias tn='tmux new -s' alias tl='tmux ls' alias tk='tmux kill-session -t' +# Pdf alias +alias pdf='zathura' + export GPG_TTY=$(tty) # Fix unreadable color pallete for ExFat File systems