From 0b9647b407d54455eee0d2f78fa6c8bb6ddc2701 Mon Sep 17 00:00:00 2001 From: Karl Goecking Date: Sun, 15 Feb 2026 06:05:55 +0100 Subject: [PATCH] Modernize i3 setup: alacritty, dunst, rofi, i3blocks, blurlock, picom updates --- files/configs/alacritty/alacritty.toml | 33 ++++++++++++++++++++++++ files/configs/i3/config/dunst/dunstrc | 29 ++++----------------- files/configs/i3/config/i3blocks/config | 14 +++++++--- files/configs/i3/config/picom.conf | 4 --- files/configs/i3/config/rofi/config.rasi | 10 ++++--- files/configs/i3/i3/config | 13 +++++++--- files/configs/i3/myi3blocks/myi3date | 5 ---- files/configs/i3/myi3blocks/myi3iface | 16 ++++++++++++ files/configs/i3/myi3blocks/myi3load | 2 +- files/configs/i3/myi3blocks/myi3memory | 6 +++-- files/configs/i3/myi3blocks/myi3volume | 25 ++++++++++++++++++ files/configs/i3/myi3blocks/myi3weather | 16 ++++++------ files/configs/misc-scripts/blurlock | 21 +++++---------- tasks/configure-i3.yaml | 12 +++++++++ tasks/configure-software-fedora.yaml | 2 +- tasks/configure-software-manjaro.yaml | 2 +- tasks/configure-software-ubuntu.yaml | 2 +- 17 files changed, 139 insertions(+), 73 deletions(-) create mode 100644 files/configs/alacritty/alacritty.toml create mode 100644 files/configs/i3/myi3blocks/myi3iface create mode 100644 files/configs/i3/myi3blocks/myi3volume diff --git a/files/configs/alacritty/alacritty.toml b/files/configs/alacritty/alacritty.toml new file mode 100644 index 0000000..ae83f8d --- /dev/null +++ b/files/configs/alacritty/alacritty.toml @@ -0,0 +1,33 @@ +[window] +opacity = 0.8 +padding = { x = 5, y = 5 } + +[font] +size = 11.0 + +[font.normal] +family = "monospace" + +[colors.primary] +background = "#222D31" +foreground = "#F9FAF9" + +[colors.normal] +black = "#2F3D44" +red = "#CB4B16" +green = "#1ABC9C" +yellow = "#FFBF00" +blue = "#268BD2" +magenta = "#D33682" +cyan = "#16a085" +white = "#EEE8D5" + +[colors.bright] +black = "#556064" +red = "#FF6666" +green = "#33CC33" +yellow = "#FDF6E3" +blue = "#839496" +magenta = "#6C71C4" +cyan = "#93A1A1" +white = "#F9FAF9" diff --git a/files/configs/i3/config/dunst/dunstrc b/files/configs/i3/config/dunst/dunstrc index 2d221e4..871840b 100644 --- a/files/configs/i3/config/dunst/dunstrc +++ b/files/configs/i3/config/dunst/dunstrc @@ -14,7 +14,7 @@ # . # If markup is not allowed, those tags will be stripped out of the # message. - markup = yes + markup = full # The format of the message. Possible variables are: # %a appname @@ -116,11 +116,10 @@ # Align icons left/right/off icon_position = left - # Paths to default icons. - icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/ - - # Limit icons size. - max_icon_size = 64 + # Icon lookup + enable_recursive_icon_lookup = true + icon_theme = Adwaita + icon_size = 64 # Note: [shortcuts] section was removed in dunst 1.7+ # Use dunstctl for keyboard control instead: @@ -144,22 +143,4 @@ foreground = "#F9FAF9" timeout = 8 -[irc] - appname = weechat - timeout = 0 - background = "#0033bb" - foreground = "#dddddd" - -[weechat hl] - appname = weechat - category = weechat.HL - background = "#FF5C47" - foreground = "#FFFFFF" - -[weechat pn] - appname = weechat - category = weechat.PM - background = "#D53B84" - foreground = "#FFFFFF" - # vim: ft=cfg diff --git a/files/configs/i3/config/i3blocks/config b/files/configs/i3/config/i3blocks/config index 41948f0..8ae0dc1 100644 --- a/files/configs/i3/config/i3blocks/config +++ b/files/configs/i3/config/i3blocks/config @@ -24,15 +24,21 @@ label= instance=0 interval=10 -[iface] +[myi3volume] +command=$HOME/opt/scripts/myi3blocks/myi3volume +label= +interval=5 +signal=1 + +[myi3iface] +command=$HOME/opt/scripts/myi3blocks/myi3iface label= -color=#33CCFF interval=30 -[myi3weather-cam] +[myi3weather] command=$HOME/opt/scripts/myi3blocks/myi3weather label=ℂ -instance=2653941 +instance=2867543 interval=600 [time] diff --git a/files/configs/i3/config/picom.conf b/files/configs/i3/config/picom.conf index fc996ac..b5113ce 100644 --- a/files/configs/i3/config/picom.conf +++ b/files/configs/i3/config/picom.conf @@ -37,12 +37,8 @@ invert-color-include = [ ]; glx-copy-from-front = false; opacity-rule = [ -"80:class_g = 'Gnome-terminal'", "80:class_g = 'Rofi'", "80:class_g = 'Mousepad'", -"80:class_g = 'Evolution'", -"80:class_g = 'Pcmanfm'", -"80:class_g = 'Virt-manager'", "80:class_g = 'i3bar'" ]; diff --git a/files/configs/i3/config/rofi/config.rasi b/files/configs/i3/config/rofi/config.rasi index a1a723e..f6508a2 100644 --- a/files/configs/i3/config/rofi/config.rasi +++ b/files/configs/i3/config/rofi/config.rasi @@ -1,6 +1,8 @@ configuration { - theme: "android_notification"; - terminal: "gnome-terminal"; - ssh-client: "ssh"; - ssh-command: "{terminal} -- {ssh-client} {host}"; + theme: "gruvbox-dark-hard"; + terminal: "alacritty"; + font: "Noto Sans 12"; + show-icons: true; + lines: 10; + drun-display-format: "{name}"; } diff --git a/files/configs/i3/i3/config b/files/configs/i3/i3/config index 08244f7..eb90a98 100644 --- a/files/configs/i3/i3/config +++ b/files/configs/i3/i3/config @@ -28,19 +28,24 @@ bindsym $mod+d layout toggle split # Enable touchpad natural scrolling exec_always --no-startup-id xinput set-prop "bcm5974" "libinput Natural Scrolling Enabled" 1 -bindsym $mod+Shift+Return exec gnome-terminal +bindsym $mod+Shift+Return exec alacritty bindsym $mod+Shift+w exec vivaldi-stable -bindsym $mod+Shift+f exec gnome-terminal -- ranger +bindsym $mod+Shift+f exec alacritty -e ranger bindsym $mod+Shift+e exec mousepad bindsym $mod+Shift+p exec keepassxc -bindsym $mod+space --release exec "rofi -combi-modi drun,window,ssh -show combi -modi combi" +bindsym $mod+space --release exec "rofi -combi-modi drun,window -show combi -modi combi" bindsym $mod+q kill bindsym $mod+Ctrl+p exec pavucontrol -bindsym $mod+Ctrl+b exec gnome-terminal -- bmenu +bindsym $mod+Ctrl+b exec alacritty -e bmenu bindsym $mod+Print --release exec --no-startup-id flameshot gui +# Dunst notification control +bindsym $mod+n exec dunstctl close +bindsym $mod+Shift+n exec dunstctl close-all +bindsym $mod+grave exec dunstctl history-pop + # Autostart applications exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec --no-startup-id nitrogen --restore; sleep 1; picom -b diff --git a/files/configs/i3/myi3blocks/myi3date b/files/configs/i3/myi3blocks/myi3date index 11dfe97..8f44663 100755 --- a/files/configs/i3/myi3blocks/myi3date +++ b/files/configs/i3/myi3blocks/myi3date @@ -1,8 +1,3 @@ #!/bin/bash echo $(date '+%a, %b %d %I:%M %p') - -case $BLOCK_BUTTON in - 1) gsimplecal ;; - *) ;; -esac diff --git a/files/configs/i3/myi3blocks/myi3iface b/files/configs/i3/myi3blocks/myi3iface new file mode 100644 index 0000000..09bea75 --- /dev/null +++ b/files/configs/i3/myi3blocks/myi3iface @@ -0,0 +1,16 @@ +#!/bin/bash + +IFACE=$(ip route | grep default | awk '{print $5}' | head -1) + +if [[ -z "${IFACE}" ]]; then + echo "No connection" + echo "No connection" + echo "#FF6666" + exit 0 +fi + +IP=$(ip addr show "${IFACE}" | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) + +echo "${IFACE}: ${IP}" +echo "${IP}" +echo "#33CCFF" diff --git a/files/configs/i3/myi3blocks/myi3load b/files/configs/i3/myi3blocks/myi3load index 355aead..c7e689c 100755 --- a/files/configs/i3/myi3blocks/myi3load +++ b/files/configs/i3/myi3blocks/myi3load @@ -17,6 +17,6 @@ else fi case $BLOCK_BUTTON in - 1) gnome-terminal -- htop ;; + 1) alacritty -e htop ;; *) ;; esac diff --git a/files/configs/i3/myi3blocks/myi3memory b/files/configs/i3/myi3blocks/myi3memory index ecc4668..23aafe5 100755 --- a/files/configs/i3/myi3blocks/myi3memory +++ b/files/configs/i3/myi3blocks/myi3memory @@ -1,6 +1,8 @@ #!/bin/bash MEM_STAT=$(free -m | grep Mem | awk '{print $2,$3}') +MEM_TOTAL_MB=${MEM_STAT%% *} MEM_USED_MB=${MEM_STAT##* } -MEM_USED_GB=$(echo "scale=2;$MEM_USED_MB/1024" | bc -l) -echo "$MEM_USED_GB GB" +MEM_TOTAL_GB=$(echo "scale=1;$MEM_TOTAL_MB/1024" | bc -l) +MEM_USED_GB=$(echo "scale=1;$MEM_USED_MB/1024" | bc -l) +echo "${MEM_USED_GB}/${MEM_TOTAL_GB} GB" diff --git a/files/configs/i3/myi3blocks/myi3volume b/files/configs/i3/myi3blocks/myi3volume new file mode 100644 index 0000000..c17705e --- /dev/null +++ b/files/configs/i3/myi3blocks/myi3volume @@ -0,0 +1,25 @@ +#!/bin/bash + +VOLUME=$(pactl get-sink-volume @DEFAULT_SINK@ | grep -o '[0-9]*%' | head -1) +MUTE=$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') + +if [[ "${MUTE}" == "yes" ]]; then + echo " MUTE" + echo " MUTE" + echo "#FF6666" +else + VOL_NUM=${VOLUME%\%} + echo " ${VOLUME}" + echo " ${VOLUME}" + if (( VOL_NUM > 80 )); then + echo "#FFBF00" + else + echo "#33CC33" + fi +fi + +case $BLOCK_BUTTON in + 3) pactl set-sink-mute @DEFAULT_SINK@ toggle ;; + 4) pactl set-sink-volume @DEFAULT_SINK@ +5% ;; + 5) pactl set-sink-volume @DEFAULT_SINK@ -5% ;; +esac diff --git a/files/configs/i3/myi3blocks/myi3weather b/files/configs/i3/myi3blocks/myi3weather index f66a3cc..b9f49c2 100755 --- a/files/configs/i3/myi3blocks/myi3weather +++ b/files/configs/i3/myi3blocks/myi3weather @@ -9,18 +9,18 @@ CITY_ID="${BLOCK_INSTANCE}" URGENT_LOWER=0 URGENT_HIGHER=30 -ICON_SUNNY="" -ICON_CLOUDY="" -ICON_RAINY="" -ICON_STORM="" -ICON_SNOW="" -ICON_FOG="" +ICON_SUNNY="" +ICON_CLOUDY="" +ICON_RAINY="" +ICON_STORM="" +ICON_SNOW="" +ICON_FOG="" SYMBOL_CELSIUS="℃" WEATHER_URL="http://api.openweathermap.org/data/2.5/weather?id=${CITY_ID}&appid=${API_KEY}&units=metric" -WEATHER_INFO=$(wget -qO- "${WEATHER_URL}") +WEATHER_INFO=$(curl -s "${WEATHER_URL}") WEATHER_MAIN=$(echo "${WEATHER_INFO}" | grep -o -e '\"main\":\"[a-Z]*\"' | awk -F ':' '{print $2}' | tr -d '"') WEATHER_TEMP=$(echo "${WEATHER_INFO}" | grep -o -e '\"temp\":\-\?[0-9]*' | awk -F ':' '{print $2}' | tr -d '"') @@ -34,7 +34,7 @@ elif [[ "${WEATHER_MAIN}" = *Rain* ]] || [[ "${WEATHER_MAIN}" = *Drizzle* ]]; th echo "" elif [[ "${WEATHER_MAIN}" = *Thunderstorm* ]]; then echo "${ICON_STORM} ${WEATHER_TEMP}${SYMBOL_CELSIUS}" - echo "${ICON_STORM} ${WEATHER_TEMP}${SYMBOL_CELSIUS}" + echo "${ICON_STORM} ${WEATHER_TEMP}${SYMBOL_CELSIUS}" echo "" elif [[ "${WEATHER_MAIN}" = *Cloud* ]]; then echo "${ICON_CLOUDY} ${WEATHER_TEMP}${SYMBOL_CELSIUS}" diff --git a/files/configs/misc-scripts/blurlock b/files/configs/misc-scripts/blurlock index 3677623..427e6d0 100755 --- a/files/configs/misc-scripts/blurlock +++ b/files/configs/misc-scripts/blurlock @@ -1,19 +1,12 @@ #!/bin/bash # /usr/bin/blurlock -# take screenshot -scrot /tmp/screenshot.png - -# blur it -convert /tmp/screenshot.png -blur 0x12 /tmp/screenshotblur.png -rm /tmp/screenshot.png - -# lock the screen -i3lock -i /tmp/screenshotblur.png - -# sleep 1 adds a small delay to prevent possible race conditions with suspend -sleep 1 - -xset dpms force off +i3lock --blur 12 --clock --indicator \ + --inside-color=00000080 \ + --ring-color=16a08580 \ + --keyhl-color=F9FAF9FF \ + --bshl-color=D62929FF \ + --time-color=F9FAF9FF \ + --date-color=F9FAF9FF exit 0 diff --git a/tasks/configure-i3.yaml b/tasks/configure-i3.yaml index 732e9fc..fa7cac0 100644 --- a/tasks/configure-i3.yaml +++ b/tasks/configure-i3.yaml @@ -10,6 +10,18 @@ src: "files/configs/i3/i3/config" dest: "{{ userhome }}/.i3/config" +- name: i3 Configuration - Create alacritty directory + become_user: "{{ username }}" + file: + path: "{{ userhome }}/.config/alacritty" + state: directory + +- name: i3 Configuration - Copy "{{ userhome }}/.config/alacritty/alacritty.toml" + become_user: "{{ username }}" + copy: + src: "files/configs/alacritty/alacritty.toml" + dest: "{{ userhome }}/.config/alacritty/alacritty.toml" + - name: i3 Configuration - Copy "{{ userhome }}/.config/picom.conf" become_user: "{{ username }}" copy: diff --git a/tasks/configure-software-fedora.yaml b/tasks/configure-software-fedora.yaml index 7379fe3..3d147ea 100644 --- a/tasks/configure-software-fedora.yaml +++ b/tasks/configure-software-fedora.yaml @@ -1,6 +1,6 @@ - name: Package Installation - Productivity Tools package: - name: ["gnome-terminal", "ranger", "mousepad"] + name: ["alacritty", "ranger", "mousepad"] state: present - name: Package Installation - Development Tools diff --git a/tasks/configure-software-manjaro.yaml b/tasks/configure-software-manjaro.yaml index ab425d7..a996892 100644 --- a/tasks/configure-software-manjaro.yaml +++ b/tasks/configure-software-manjaro.yaml @@ -5,7 +5,7 @@ - name: Package Installation - Productivity Tools package: - name: ["gnome-terminal", "ranger", "mousepad"] + name: ["alacritty", "ranger", "mousepad"] state: present - name: Package Installation - Development Tools diff --git a/tasks/configure-software-ubuntu.yaml b/tasks/configure-software-ubuntu.yaml index 7eb1744..3f5059e 100644 --- a/tasks/configure-software-ubuntu.yaml +++ b/tasks/configure-software-ubuntu.yaml @@ -5,7 +5,7 @@ - name: Package Installation - Productivity Tools package: - name: ["gnome-terminal", "ranger", "mousepad"] + name: ["alacritty", "ranger", "mousepad"] state: present - name: Package Installation - Development Tools