Compare commits

...

14 Commits

Author SHA1 Message Date
d424fc0852 chore(waybar): improve network format 2025-08-11 19:17:15 +02:00
a27b458435 chore: improve screen recorder script 2025-08-07 17:08:38 +02:00
da689d2d0a refactor(waybar): refactor check updates scripts 2025-08-07 17:08:21 +02:00
507ba45188 chore(waybar): update workspace button
GTK does not allow the `cursor: pointer;` property, so we use the
`on-click` handler for the workspaces button.
2025-08-05 08:29:12 +02:00
3a8c43cfc5 chore(waybar): add onclick handler on cpu module 2025-08-05 08:20:05 +02:00
23ac865092 chore: update zsh config and add aliases 2025-08-03 11:51:03 +02:00
e567351d7c chore(waybar): ignore telegram in privacy module 2025-07-29 10:17:31 +02:00
c48f2b462b chore(sway): increment/decrement sinks by 1% instead of 5% 2025-07-28 09:28:44 +02:00
78bcc74ed9 chore(waybar): update pulseaudio modules 2025-07-22 09:13:27 +02:00
31b787f60d chore(waybar): use only default icons for pulseaudio 2025-07-22 09:04:48 +02:00
ce3967e154 chore(waybar): add cpu module 2025-07-22 08:39:29 +02:00
09770263fb chore(waybar): update modules 2025-07-19 11:48:20 +02:00
a91a9f34bf chore(waybar): improve custom pacman module 2025-07-19 11:47:12 +02:00
079779a52a chore(waybar): a bit of colors please 2025-07-19 11:46:32 +02:00
10 changed files with 163 additions and 99 deletions

7
.aliases Normal file
View File

@@ -0,0 +1,7 @@
alias ll="ls -l"
alias la="ls -A"
alias l="ls -CF"
alias vsc="vscodium ."
alias r="./bin/rails"
alias todo="todo.sh"
alias cat="bat"

View File

@@ -8,7 +8,7 @@ set $right l
# wf-recorder # wf-recorder
set $screenrecorder `bash $HOME/.config/sway/scripts/open-screen-recorder.sh` set $screenrecorder `bash $HOME/.config/sway/scripts/screen-recorder.sh`
bindsym --to-code $mod+Shift+R exec $screenrecorder bindsym --to-code $mod+Shift+R exec $screenrecorder
# background # background
@@ -191,8 +191,8 @@ bindsym $mod+a focus parent
bindsym --locked XF86MonBrightnessDown exec "$HOME/.config/sway/scripts/screen-brightness-control.sh --decrement" bindsym --locked XF86MonBrightnessDown exec "$HOME/.config/sway/scripts/screen-brightness-control.sh --decrement"
bindsym --locked XF86MonBrightnessUp exec "$HOME/.config/sway/scripts/screen-brightness-control.sh --increment" bindsym --locked XF86MonBrightnessUp exec "$HOME/.config/sway/scripts/screen-brightness-control.sh --increment"
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1% && pactl get-sink-volume @DEFAULT_SINK@ | head -n 1 | awk '{print substr($5, 1, length($5)-1)}' > $WOBSOCK
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle

View File

@@ -1,14 +0,0 @@
#!/bin/bash
main() {
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
status=$?
if [[ $status != 0 ]]; then
GEO="$(slurp)" && wf-recorder -g "$GEO" -f "$HOME/Videos/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
else
pkill --signal SIGINT wf-recorder
fi
}
main $@

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
increment() { increment() {
brightnessctl set 5%+ brightnessctl set 1%+
} }
decrement() { decrement() {
@@ -14,7 +14,7 @@ decrement() {
if [[ "$current_value" == "6000" ]]; then if [[ "$current_value" == "6000" ]]; then
brightnessctl set 4 brightnessctl set 4
else else
brightnessctl set 5%- brightnessctl set 1%-
fi fi
} }

View File

@@ -0,0 +1,27 @@
#! /usr/bin/env bash
main() {
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
status=$?
if [[ $status != 0 ]]; then
if [[ -f ~/.config/user-dirs.dirs ]]; then
source ~/.config/user-dirs.dirs
fi
output_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}"
if [[ ! -d "$output_dir" ]]; then
notify-send "Screen recording output directory does not exist: $output_dir" -u critical -t 3000
exit 1
fi
filename="$output_dir/$(date +'recording_%Y-%m-%d-%H%M%S.mp4')"
region="$(slurp)" && wf-recorder -g "$region" -f "$filename"
else
pkill --signal SIGINT wf-recorder
fi
}
main $@

View File

@@ -5,7 +5,7 @@
"layer": "top", "layer": "top",
"position": "bottom", "position": "bottom",
"margin": "5 5 5 5", "margin": "5 5 5 5",
"modules-left": ["sway/workspaces", "sway/mode"], "modules-left": ["sway/workspaces", "sway/mode", "mpris"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": [ "modules-right": [
"custom/pacman", "custom/pacman",
@@ -17,7 +17,7 @@
], ],
"group/system": { "group/system": {
"orientation": "inherit", "orientation": "inherit",
"modules": ["memory", "disk"] "modules": ["memory", "disk", "cpu"]
}, },
"group/misc": { "group/misc": {
"orientation": "inherit", "orientation": "inherit",
@@ -34,13 +34,19 @@
"urgent": "", "urgent": "",
"focused": "", "focused": "",
"default": "" "default": ""
} },
"on-click": ":"
}, },
"sway/mode": { "sway/mode": {
"tooltip": false, "tooltip": false,
"format": "{}", "format": "{}",
"on-click": "sway mode default" "on-click": "sway mode default"
}, },
"mpris": {
"interval": 1,
"tooltip-format": "{title} - {artist} [{position}/{length}]",
"format": "{title}"
},
"hyprland/workspaces": { "hyprland/workspaces": {
"format": "{name} {icon}", "format": "{name} {icon}",
"disable-scroll": true, "disable-scroll": true,
@@ -86,28 +92,25 @@
"interval": 60, "interval": 60,
"tooltip": true, "tooltip": true,
"format": "{} ", "format": "{} ",
"return-type": "json",
"exec": "$HOME/.config/waybar/scripts/check-updates.sh", "exec": "$HOME/.config/waybar/scripts/check-updates.sh",
"exec-if": "[[ `$HOME/.config/waybar/scripts/check-updates.sh` != 0 ]]", "exec-if": "[[ `checkupdates | wc -l` != 0 ]]",
"signal": 1 "signal": 1
}, },
"custom/recorder": { "custom/recorder": {
"interval": 1, "interval": 1,
"tooltip": true, "tooltip": true,
"format": "Rec 󱣴", "format": "",
"return-type": "json", "return-type": "json",
"exec": "echo '{\"class\": \"recording\"}'", "exec": "echo '{\"class\": \"recording\"}'",
"exec-if": "pgrep wf-recorder", "exec-if": "pgrep wf-recorder",
"on-click": "$HOME/.config/waybar/scripts/close-screen-recorder.sh" "on-click": "$HOME/.config/sway/scripts/screen-recorder.sh"
},
"custom/power": {
"tooltip": false,
"format": "⏻",
"on-click": "wlogout -b 5 -s -T 400 -B 400 -L 400 -R 400 -c 20"
}, },
"privacy": { "privacy": {
"icon-spacing": 4, "icon-spacing": 4,
"icon-size": 18, "icon-size": 18,
"transition-duration": 250, "transition-duration": 0,
"expand": true,
"modules": [ "modules": [
{ {
"tooltip": true, "tooltip": true,
@@ -124,19 +127,23 @@
"type": "audio-in", "type": "audio-in",
"tooltip-icon-size": 24 "tooltip-icon-size": 24
} }
],
"ignore": [
{ "type": "audio-out", "name": "spotify" },
{ "type": "audio-out", "name": "Firefox" },
{ "type": "audio-in", "name": "Firefox" },
{ "type": "audio-out", "name": "Telegram" },
{ "type": "audio-in", "name": "Telegram" }
] ]
}, },
"pulseaudio": { "pulseaudio": {
"tooltip": true, "tooltip": true,
"tooltip-format": "Playing at {volume}%", "tooltip-format": "Playing at {volume}% on {desc}",
"format": "{volume}% {icon}", "format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}", "format-bluetooth": "{volume}% {icon}",
"format-bluetooth-muted": "{volume}% 󰂲", "format-bluetooth-muted": "{volume}% 󰂲",
"format-muted": "{volume}% ", "format-muted": "{volume}% ",
"format-icons": { "format-icons": {
"headphone": "",
"hands-free": "󰋎",
"headset": "󰋎",
"default": ["", "", ""] "default": ["", "", ""]
}, },
"on-click": "pavucontrol -t 3", "on-click": "pavucontrol -t 3",
@@ -144,6 +151,7 @@
}, },
"pulseaudio#microphone": { "pulseaudio#microphone": {
"tooltip": true, "tooltip": true,
"tooltip-format": "{format_source}",
"format": "{format_source}", "format": "{format_source}",
"format-source": "{volume}% ", "format-source": "{volume}% ",
"format-source-muted": "{volume}% ", "format-source-muted": "{volume}% ",
@@ -156,7 +164,7 @@
"tooltip": true, "tooltip": true,
"device": "intel_backlight", "device": "intel_backlight",
"format": "{percent}% {icon}", "format": "{percent}% {icon}",
"format-icons": ["󰃚", "󰃛", "󰃜", "󰃝", "󰃞", "󰃟", "󰃠"] "format-icons": ["", "", "", "", "", "󰃟", "󰃝", "󰃠"]
}, },
"battery": { "battery": {
"interval": 1, "interval": 1,
@@ -183,6 +191,11 @@
"unit": "GiB", "unit": "GiB",
"path": "/" "path": "/"
}, },
"cpu": {
"interval": 1,
"format": "{}% ",
"on-click": "alacritty -e btop"
},
"memory": { "memory": {
"interval": 3, "interval": 3,
"tooltip": true, "tooltip": true,
@@ -202,9 +215,9 @@
"network": { "network": {
"interval": 3, "interval": 3,
"tooltip": true, "tooltip": true,
"tooltip-format": "{ifname} via {gwaddr} 󰈀", "tooltip-format": "{ifname} via {gwaddr}",
"tooltip-format-wifi": "{ipaddr} ({ifname}) via {essid}", "tooltip-format-wifi": "{ipaddr} ({ifname}) via {essid}\n\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
"tooltip-format-ethernet": "{ipaddr} ({ifname}) via {essid} 󰈀", "tooltip-format-ethernet": "{ipaddr} ({ifname}) via {essid}\n\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
"tooltip-format-disconnected": "Disconnected", "tooltip-format-disconnected": "Disconnected",
"format": "{ifname}", "format": "{ifname}",
"format-icons": ["󰤯", "󰤟", "󰤢", "󰤥", "󰤨"], "format-icons": ["󰤯", "󰤟", "󰤢", "󰤥", "󰤨"],

View File

@@ -1,7 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
main() { main() {
checkupdates | wc -l data=""
updates=$(checkupdates --nocolor 2>/dev/null)
if [[ $? -ne 0 || -z "$updates" ]]; then
data='{"text": "", "tooltip": ""}'
else
numberOfUpdates=$(echo "$updates" | wc -l)
tooltip=$(echo "$updates" | sed 's/\n/\r/g' | jq -sR .)
data="{\"text\": \"$numberOfUpdates\", \"tooltip\": $tooltip}"
fi
echo $data | jq --unbuffered --compact-output
} }
main $@ main "$@"

View File

@@ -1,12 +0,0 @@
#! /usr/bin/env bash
main() {
pid="$(pgrep "wf-recorder" || pgrep "slurp")"
status=$?
if [[ $status == 0 ]]; then
pkill --signal SIGINT wf-recorder
fi
}
main $@

View File

@@ -1,9 +1,8 @@
* { * {
all: initial; all: initial;
border: none;
border-radius: 0;
min-height: 20px; min-height: 20px;
font-family: "Symbols Nerd Font", monospace; font-family: "Symbols Nerd Font", monospace;
background-color: transparent;
} }
tooltip label { tooltip label {
@@ -20,7 +19,7 @@ tooltip label {
border-radius: 10px; border-radius: 10px;
background-color: #383c4a; background-color: #383c4a;
color: #ffffff; color: #ffffff;
margin-left: 8px; margin-left: 4px;
padding-left: 8px; padding-left: 8px;
padding-right: 8px; padding-right: 8px;
} }
@@ -29,7 +28,7 @@ tooltip label {
border-radius: 10px; border-radius: 10px;
background-color: #383c4a; background-color: #383c4a;
color: #ffffff; color: #ffffff;
margin-left: 8px; margin-left: 4px;
padding-left: 8px; padding-left: 8px;
padding-right: 8px; padding-right: 8px;
} }
@@ -38,30 +37,78 @@ tooltip label {
border-radius: 10px; border-radius: 10px;
background-color: #383c4a; background-color: #383c4a;
color: #ffffff; color: #ffffff;
margin-left: 8px; margin-left: 4px;
padding-left: 8px; padding-left: 8px;
padding-right: 8px; padding-right: 8px;
} }
#custom-pacman, #custom-pacman,
#custom-recorder,
#mode, #mode,
#clock, #clock,
#workspaces, #workspaces,
#custom-recorder, #custom-recorder,
#custom-power, #custom-power,
#mpris,
#mpris.paused,
#privacy { #privacy {
border-radius: 10px; border-radius: 10px;
background-color: #383c4a; background-color: #383c4a;
color: #ffffff; color: #ffffff;
} }
#custom-recorder, #custom-pacman {
background-color: #32e47c;
color: #383c4a;
}
#privacy {
background-color: #e63946;
}
#mode {
background-color: #8ecae6;
color: #000000;
}
#mpris:not(.paused) {
background: linear-gradient(90deg,
#e66465,
#f6b73c,
#6dd5ed,
#c084f1,
#ff9a9e,
#a1ffce,
#fbc2eb,
#fad0c4,
#8fd3f4,
#84fab0,
#dcb0ed,
#f5576c
);
background-size: 1000% 1000%;
animation: gradientShift 30s ease-in-out infinite;
color: #000;
}
@keyframes gradientShift {
0% { background-position: 0% 50%; }
12.5% { background-position: 20% 50%; }
25% { background-position: 45% 50%; }
37.5% { background-position: 70% 50%; }
50% { background-position: 100% 50%; }
62.5% { background-position: 70% 50%; }
75% { background-position: 45% 50%; }
87.5% { background-position: 20% 50%; }
100% { background-position: 0% 50%; }
}
#custom-pacman, #custom-pacman,
#custom-recorder, #custom-recorder,
#mode, #mode,
#mpris,
#custom-power, #custom-power,
#privacy { #privacy {
margin-left: 8px; margin-left: 4px;
} }
#custom-pacman, #custom-pacman,
@@ -69,6 +116,7 @@ tooltip label {
#mode, #mode,
#clock, #clock,
#privacy, #privacy,
#mpris,
#custom-power, #custom-power,
#workspaces button { #workspaces button {
padding-top: 4px; padding-top: 4px;
@@ -80,6 +128,7 @@ tooltip label {
#pulseaudio:not(.microphone), #pulseaudio:not(.microphone),
#pulseaudio.microphone, #pulseaudio.microphone,
#memory, #memory,
#disk,
#backlight, #backlight,
#bluetooth { #bluetooth {
padding-right: 8px; padding-right: 8px;

59
.zshrc
View File

@@ -1,6 +1,6 @@
# ~/.zshrc file for zsh interactive shells. # ~/.zshrc file for zsh interactive shells.
eval "$(starship init zsh)" eval "$(rbenv init - zsh)"
# set -o vi # set -o vi
@@ -33,8 +33,8 @@ bindkey '^[[F' end-of-line # end
bindkey '^[[Z' undo # shift + tab undo last action bindkey '^[[Z' undo # shift + tab undo last action
# enable completion features # enable completion features
autoload -Uz compinit # autoload -Uz compinit
compinit -d ~/.cache/zcompdump # compinit -d ~/.cache/zcompdump
zstyle ':completion:*:*:*:*:*' menu select zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' auto-description 'specify: %d' zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate zstyle ':completion:*' completer _expand _complete _correct _approximate
@@ -51,8 +51,8 @@ zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
# History configurations # History configurations
HISTFILE=~/.zsh_history HISTFILE=~/.zsh_history
HISTSIZE=1000 HISTSIZE=10000
SAVEHIST=1000 SAVEHIST=10000
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space setopt hist_ignore_space # ignore commands that start with space
@@ -91,46 +91,29 @@ if [ -x /usr/bin/dircolors ]; then
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
fi fi
# enable auto-suggestions based on the history
if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
. /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# change suggestion color
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#999'
fi
# enable command-not-found if installed
if [ -f /etc/zsh_command_not_found ]; then
. /etc/zsh_command_not_found
fi
# Alias definitions. # Alias definitions.
if [ -f ~/.zsh_aliases ]; then [ -f ~/.aliases ] && . ~/.aliases
. ~/.zsh_aliases
fi
if [ -f ~/.zsh_exports ]; then [ -f ~/.exports ] && . ~/.exports
. ~/.zsh_exports
fi
if [ -f ~/.zsh_include ]; then [ -f ~/.include ] && . ~/.include
. ~/.zsh_include
fi
if [ -f ~/.zsh_profile ]; then [ -f ~/.profile ] && . ~/.profile
. ~/.zsh_profile
fi
# The following lines were added by compinstall
zstyle :compinstall filename '/home/andrea/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# plugins # plugins
plugins=(vi-mode) # plugins=(vi-mode)
eval "$(rbenv init - zsh)" # Bun and bun completitions
[ -s "$HOME/.bun/_bun" ] && . "$HOME/.bun/_bun"
# Fnm
FNM_PATH="/home/andrea/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
export PATH="/home/andrea/.local/share/fnm:$PATH"
eval "`fnm env`"
fi
eval "$(starship init zsh)"