Compare commits

...

11 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
10 changed files with 85 additions and 83 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

@@ -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,7 +34,8 @@
"urgent": "", "urgent": "",
"focused": "", "focused": "",
"default": "" "default": ""
} },
"on-click": ":"
}, },
"sway/mode": { "sway/mode": {
"tooltip": false, "tooltip": false,
@@ -103,7 +104,7 @@
"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"
}, },
"privacy": { "privacy": {
"icon-spacing": 4, "icon-spacing": 4,
@@ -130,20 +131,19 @@
"ignore": [ "ignore": [
{ "type": "audio-out", "name": "spotify" }, { "type": "audio-out", "name": "spotify" },
{ "type": "audio-out", "name": "Firefox" }, { "type": "audio-out", "name": "Firefox" },
{ "type": "audio-in", "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",
@@ -151,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}% ",
@@ -190,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,
@@ -209,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,14 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
main() { main() {
data=""
updates=$(checkupdates --nocolor 2>/dev/null) updates=$(checkupdates --nocolor 2>/dev/null)
if [[ $? -ne 0 || -z "$updates" ]]; then if [[ $? -ne 0 || -z "$updates" ]]; then
echo '{"text": "", "tooltip": ""}' | jq --unbuffered --compact-output data='{"text": "", "tooltip": ""}'
else else
numberOfUpdates=$(echo "$updates" | wc -l) numberOfUpdates=$(echo "$updates" | wc -l)
tooltip=$(echo "$updates" | sed 's/\n/\r/g' | jq -sR .) tooltip=$(echo "$updates" | sed 's/\n/\r/g' | jq -sR .)
echo "{\"text\": \"$numberOfUpdates\", \"tooltip\": $tooltip}" | jq --unbuffered --compact-output data="{\"text\": \"$numberOfUpdates\", \"tooltip\": $tooltip}"
fi 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

@@ -128,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)"