theming: use Slack as notification manager

This commit is contained in:
thomasabishop 2024-04-15 16:25:16 +01:00
parent 29d91ea3e1
commit eaa26b029a
16 changed files with 104 additions and 110 deletions

View file

@ -3,17 +3,16 @@
USER=thomas USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000 export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot daily sudo /usr/bin/rsnapshot daily
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
/usr/bin/notify-send 'rsync' 'Daily backup completed successfully' /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Daily backup completed successfully.'
else else
/usr/bin/notify-send -u critical 'rsync' 'Daily backup failed' /home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Daily backup failed.'
fi fi
else else
echo "Backup drive not mounted" echo "Backup drive not mounted"
/usr/bin/notify-send -u critical 'Backup' 'Error: backup drive not mounted' /home/thomas/repos/slack-notifier/src/index.js 'backups' '💾 Error: backup drive not mounted.'
fi fi

View file

@ -3,17 +3,16 @@
USER=thomas USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000 export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot hourly sudo /usr/bin/rsnapshot hourly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
/usr/bin/notify-send 'rsync' 'Hourly backup completed successfully' /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Hourly backup completed successfully'
else else
/usr/bin/notify-send -u critical 'rsync' 'Hourly backup failed' /home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Hourly backup failed.'
fi fi
else else
echo "Backup drive not mounted" echo "Backup drive not mounted"
/usr/bin/notify-send -u critical 'Backup' 'Error: backup drive not mounted' /home/thomas/repos/slack-notifier/src/index.js 'backups' '💾 Error: backup drive not mounted.'
fi fi

View file

@ -3,17 +3,16 @@
USER=thomas USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000 export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot monthly sudo /usr/bin/rsnapshot monthly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
/usr/bin/notify-send 'rsync' 'Monthly backup completed successfully' /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Monthly backup completed successfully.'
else else
/usr/bin/notify-send -u critical 'rsync' 'Monthly backup failed' /home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Monthly backup failed.'
fi fi
else else
echo "Backup drive not mounted" echo "Backup drive not mounted"
/usr/bin/notify-send -u critical 'Backup' 'Error: backup drive not mounted' /home/thomas/repos/slack-notifier/src/index.js 'backups' '💾 Error: backup drive not mounted.'
fi fi

View file

@ -4,16 +4,16 @@ USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000 export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot weekly sudo /usr/bin/rsnapshot weekly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
/usr/bin/notify-send 'rsync' 'Weekly backup completed successfully' /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Weekly backup completed successfully.'
else else
/usr/bin/notify-send -u critical 'rsync' 'Weekly backup failed' /home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Weekly backup failed.'
fi fi
else else
echo "Backup drive not mounted" echo "Backup drive not mounted"
/usr/bin/notify-send -u critical 'Backup' 'Error: backup drive not mounted' /home/thomas/repos/slack-notifier/src/index.js 'backups' '💾 Error: backup drive not mounted.'
fi fi

View file

@ -1,35 +1,35 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=HDMI-A-1,preferred,0x1440,1 # Dell monitor=HDMI-A-1,preferred,0x1440,1 # Dell
monitor=DP-2,preferred,0x0,1 # AOC monitor=DP-2,preferred,0x0,1 # AOC
monitor=eDP-1,preferred,3440x1648,1 # ThinkPad monitor=eDP-1,preferred,3440x1648,1 # ThinkPad
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # exec-once = hyprlock
exec-once = /home/thomas/dotfiles/scripts/startup_sound.sh
# Execute your favorite apps at launch
exec-once = hyprlock
exec-once = clipse -listen
exec-once = waybar & hyprpaper & swaync exec-once = waybar & hyprpaper & swaync
exec-once = hyperctl setcursor Breeze 24 exec-once = hyperctl setcursor Breeze 24
exec-once = hyprctl dispatch exec "sleep 10s && slack"
#gsettings set org.gnome.desktop.interface cursor-theme Breeze workspace = 1, monitor:eDP-1
#gsettings set org.gnome.desktop.interface cursor-size 24 workspace = 2, monitor:eDP-1
workspace = 3, monitor:eDP-1
# Source a file (multi-file configs) workspace = 4, monitor:HDMI-A-1
# source = ~/.config/hypr/myColors.conf workspace = 5, monitor:HDMI-A-1
workspace = 6, monitor:DP-2
workspace = 7, monitor:DP-2
windowrulev2 = float, workspace:4
windowrulev2 = float, workspace:5
windowrulev2 = float, workspace:6
windowrulev2 = float, workspace:7
windowrulev2 = float,class:(floating) # ensure you have defined a floating window class
# Set programs that you use $terminal = kitty -e tmux
# $terminal = kitty
#$terminal = kitty -e tmux
$terminal = kitty
$fileManager = nemo $fileManager = nemo
$menu = rofi -show drun $menu = rofi -show drun
$windowSwitcher = rofi -show window $windowSwitcher = rofi -show window
# Some default env vars. # Some default env vars.
env = XCURSOR_SIZE,24 env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
@ -56,44 +56,34 @@ general {
gaps_in = 3 gaps_in = 3
gaps_out = 6 gaps_out = 6
border_size = 2 border_size = 1
# col.inactive_border = rgba(595959aa) col.active_border = rgb(ebdbb2)
#col.active_border = rgb(458588) col.inactive_border = rgb(3c3836)
col.active_border = rgb(076678)
col.inactive_border = rgb(a89984)
layout = dwindle layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false allow_tearing = false
} }
decoration { decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 0 rounding = 0
blur { blur {
enabled = true enabled = true
size = 3 size = 3
passes = 1 passes = 1
} }
drop_shadow = yes drop_shadow = yes
shadow_range = 4 shadow_range = 4
shadow_render_power = 3 shadow_render_power = 3
col.shadow = rgba(1a1a1aee) col.shadow = rgba(1a1a1aee)
# dim_inactive = true dim_inactive = false
# dim_strength = 0.2 dim_strength = 0.3
#inactive_opacity = 0.8 #inactive_opacity = 0.7
} }
animations { animations {
enabled = yes enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80% animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default animation = border, 1, 10, default
@ -129,17 +119,6 @@ disable_hyprland_logo = true
} }
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.
windowrulev2 = float, class:.*
# See https://wiki.hyprland.org/Configuring/Keywords/ for more # See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER $mainMod = SUPER
@ -149,23 +128,30 @@ bind = $mainMod, R, killactive,
bind = $mainMod, M, togglegroup, bind = $mainMod, M, togglegroup,
bind = $mainMod, E, exec, $fileManager bind = $mainMod, E, exec, $fileManager
bind = ALT, SPACE , exec, $menu bind = ALT, SPACE , exec, $menu
bind = ALT, TAB , exec, $windowSwitcher # bind = ALT, TAB , exec, $windowSwitcher
bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, T, togglesplit, # dwindle bind = $mainMod, T, togglesplit, # dwindle
bind = $mainMod, F, fullscreen, 1 bind = $mainMod, F, fullscreen, 1
bind = $mainMod, V, exec, kitty --class floating -e zsh -c 'clipse $PPID' # bind the open clipboard operation to a nice key.
bind = Control, Tab, workspace, m+1
bind = ALT, Tab, cyclenext
bind = ALT, Tab, bringactivetotop,
bind=SUPER,TAB,workspace,previous
# Move focus with mainMod + arrow keys # Move focus with mainMod + arrow keys
bind = $mainMod, Left, movefocus, l bind = $mainMod, Left, movefocus, l
bind = $mainMod, Left, alterzorder, top
bind = $mainMod, Right, movefocus, r bind = $mainMod, Right, movefocus, r
bind = $mainMod, Right, alterzorder, top
bind = $mainMod, Up, movefocus, u bind = $mainMod, Up, movefocus, u
bind = $mainMod, Up, alterzorder, top
bind = $mainMod, Down, movefocus, d bind = $mainMod, Down, movefocus, d
bind = $mainMod, Down, alterzorder, top
# Resize windows # Resize windows
@ -211,19 +197,3 @@ bind = $mainMod, LEFT, workspace, m-1
bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow bindm = $mainMod, mouse:273, resizewindow
plugin {
hyprbars {
# example config
bar_text_size = 11
bar_text_font = Sys TT Bold
bar_height = 25
bar_title_enabled = true
bar_color = rgb(7, 102, 120)
bar_text_align = left
bar_part_of_window = true
bar_precedence_over_border = false
hyprbars-button = rgb(00ffffff), 10, 󰖭, hyprctl dispatch killactive
hyprbars-button = rgb(00ffffff), 10, , hyprctl dispatch fullscreen 1
}
}

View file

@ -1,16 +1,26 @@
include ./theme.conf include ./theme.conf
font_family PragmataPro Mono Liga #font_family PragmataPro Mono Liga
bold_font PragmataPro Mono Liga Bold #bold_font PragmataPro Mono Liga Bold
italic_font PragmataPro Mono Liga Italic #italic_font PragmataPro Mono Liga Italic
bold_italic_font PragmataPro Mono Liga Bold Italic #bold_italic_font PragmataPro Mono Liga Bold Italic
font_size 12
font_family Liberation Mono
bold_font Liberation Mono Bold
italic_font Liberation Mono Italic
bold_italic_font Liberation Mono Bold
font_size 10
clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask
window_padding_width 5 window_padding_width 5
remember_window_size no remember_window_size no
copy_on_select yes copy_on_select yes
background_opacity 1 background_opacity 1
bell_path /home/thomas/dotfiles/gruvbox-95/sounds/st-terminal-beep.wav
confirm_os_window_close 0 confirm_os_window_close 0
# hide_window_decorations no # hide_window_decorations no
# wayland_titlebar_color background # wayland_titlebar_color background

View file

@ -12,8 +12,8 @@ local function update_hl(group, tbl)
end end
update_hl("Function", { bold = false }) update_hl("Function", { bold = false })
update_hl("Comment", { italic = true }) update_hl("Comment", { italic = false })
update_hl("String", { italic = false })
update_hl("markdownH1", { bold = true }) update_hl("markdownH1", { bold = true })
update_hl("markdownH2", { bold = true }) update_hl("markdownH2", { bold = true })
update_hl("markdownH3", { bold = true }) update_hl("markdownH3", { bold = true })

View file

@ -7,7 +7,7 @@ opt.hlsearch = true
opt.incsearch = true opt.incsearch = true
opt.tabstop = 2 opt.tabstop = 2
opt.softtabstop = 4 opt.softtabstop = 4
opt.shiftwidth = 4 opt.shiftwidth = 2
opt.colorcolumn = "80" opt.colorcolumn = "80"
opt.textwidth = 80 opt.textwidth = 80
opt.clipboard = "unnamedplus" opt.clipboard = "unnamedplus"

View file

@ -9,7 +9,7 @@ end
lualine.setup({ lualine.setup({
options = { options = {
theme = "gruvbox", theme = "gruvbox-material",
component_separators = { left = "|", right = "|" }, component_separators = { left = "|", right = "|" },
section_separators = { left = " ", right = " " }, section_separators = { left = " ", right = " " },
}, },

View file

@ -17,7 +17,7 @@
selected-urgent-background: var(red); selected-urgent-background: var(red);
alternate-active-background: var(lightbg); alternate-active-background: var(lightbg);
spacing: 2; spacing: 2;
blue: rgba (69, 133, 136, 80 % ); blue: rgba (69, 133, 136, 100 % );
alternate-normal-foreground: var(foreground); alternate-normal-foreground: var(foreground);
urgent-background: var(background); urgent-background: var(background);
selected-normal-foreground: var(foreground); selected-normal-foreground: var(foreground);

View file

@ -0,0 +1,6 @@
#!/bin/bash
source /home/thomas/.env
# Execute the Slack notifier script with arguments passed to this wrapper
/home/thomas/repos/slack-notifier/src/index.js "$@"

4
scripts/reboot_sound.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
mpv --volume=90 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-off.mp3
systemctl reboot

3
scripts/shutdown_sound.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
mpv --volume=90 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-off.mp3
systemctl poweroff

2
scripts/startup_sound.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/bash
mpv --volume=130 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3

View file

@ -53,14 +53,16 @@
border-radius: 0; border-radius: 0;
color: #282828; color: #282828;
background-color: #bdae93; background-color: #bdae93;
border: 2px solid #ebdbb2; border-left: 6px solid #504945;
border-bottom: 2px solid #504945;
border-top: 2px solid #504945;
border-right: 2px solid #504945;
/* border-left: 2px solid #ebdbb2; */ /* border-left: 2px solid #ebdbb2; */
/* border-top: 2px solid #ebdbb2; */ /* border-top: 2px solid #ebdbb2; */
/* border-right: 2px solid #665c54; */ /* border-right: 2px solid #665c54; */
/* border-bottom: 2px solid #665c54; */ /* border-bottom: 2px solid #665c54; */
padding: 2px 0; padding: 6px;
transition: background 0.15s ease-in-out; transition: background 0.15s ease-in-out;
} }

View file

@ -73,7 +73,6 @@
"orientation": "horizontal", "orientation": "horizontal",
"modules": [ "modules": [
"image#timewarrior", "image#timewarrior",
"image#notification",
"image#keys", "image#keys",
"image#restart", "image#restart",
"image#shutdown", "image#shutdown",
@ -90,6 +89,7 @@
"3": "Workspace 3", "3": "Workspace 3",
"4": "Workspace 4", "4": "Workspace 4",
"5": "Workspace 5", "5": "Workspace 5",
"6": "Workspace 6",
}, },
}, },
@ -171,29 +171,29 @@
"path": "/home/thomas/dotfiles/gruvbox-95/icons/restart-98.png", "path": "/home/thomas/dotfiles/gruvbox-95/icons/restart-98.png",
"size": 26, "size": 26,
"interval": 5, "interval": 5,
"on-click": "sleep 0.1 && systemctl reboot", "on-click": "/home/thomas/dotfiles/scripts/reboot_sound.sh",
}, },
"image#shutdown": { "image#shutdown": {
"path": "/home/thomas/dotfiles/gruvbox-95/icons/poweroff-98.png", "path": "/home/thomas/dotfiles/gruvbox-95/icons/poweroff-98.png",
"size": 26, "size": 26,
"interval": 5, "interval": 5,
"on-click": "sleep 0.1 && systemctl poweroff", "on-click": "/home/thomas/dotfiles/scripts/shutdown_sound.sh",
}, },
"image#notification": { "image#notification": {
"path": "/home/thomas/dotfiles/gruvbox-95/icons/notification-98.png", "path": "/home/thomas/dotfiles/gruvbox-95/icons/notification-98.png",
"size": 26, "size": 26,
"interval": 5, "interval": 5,
"on-click": "sleep 0.2 && swaync-client -t -sw", "on-click": "sleep 0.2 && slack",
}, },
"image#timewarrior": { "image#timewarrior": {
"path": "/home/thomas/dotfiles/gruvbox-95/icons/timewarrior-98.png", "path": "/home/thomas/dotfiles/gruvbox-95/icons/timewarrior-98.png",
"size": 26, "size": 26,
"interval": 5, "interval": 2,
"on-click": "sleep 0.15 && timew stop && notify-send 'Time Warrior' 'Timer stopped'", "on-click": "sleep 0.1 && timew stop && /home/thomas/dotfiles/scripts/notify_slack_waybar_wrapper.sh 'time_tracking' 'Time Warrior: timer stopped.'",
"on-click-right": "sleep 0.1 && timew continue && notify-send 'Time Warrior' 'Timer resumed'", "on-click-right": "sleep 0.1 && timew continue && /home/thomas/dotfiles/scripts/notify_slack_waybar_wrapper.sh 'time_tracking' 'Time Warrior: timer resumed.'",
}, },
"wlr/taskbar": { "wlr/taskbar": {