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
export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot daily
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
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
/usr/bin/notify-send -u critical 'rsync' 'Daily backup failed'
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Daily backup failed.'
fi
else
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

View file

@ -3,17 +3,16 @@
USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot hourly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
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
/usr/bin/notify-send -u critical 'rsync' 'Hourly backup failed'
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Hourly backup failed.'
fi
else
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

View file

@ -3,17 +3,16 @@
USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot monthly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
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
/usr/bin/notify-send -u critical 'rsync' 'Monthly backup failed'
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Monthly backup failed.'
fi
else
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

View file

@ -4,16 +4,16 @@ USER=thomas
export XDG_RUNTIME_DIR=/run/user/1000
source /home/thomas/.env
if mountpoint -q /media/backups; then
sudo /usr/bin/rsnapshot weekly
# sudo chown -R thomas:thomas /media/backups
# Check the exit status of the rsnapshot command
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
/usr/bin/notify-send -u critical 'rsync' 'Weekly backup failed'
/home/thomas/repos/slack-notifier/src/index.js 'backups' '⛔ Weekly backup failed.'
fi
else
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

View file

@ -1,35 +1,35 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=HDMI-A-1,preferred,0x1440,1 # Dell
monitor=DP-2,preferred,0x0,1 # AOC
monitor=eDP-1,preferred,3440x1648,1 # ThinkPad
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
exec-once = hyprlock
exec-once = clipse -listen
# exec-once = hyprlock
exec-once = /home/thomas/dotfiles/scripts/startup_sound.sh
exec-once = waybar & hyprpaper & swaync
exec-once = hyperctl setcursor Breeze 24
exec-once = hyprctl dispatch exec "sleep 10s && slack"
#gsettings set org.gnome.desktop.interface cursor-theme Breeze
#gsettings set org.gnome.desktop.interface cursor-size 24
workspace = 1, monitor:eDP-1
workspace = 2, monitor:eDP-1
workspace = 3, monitor:eDP-1
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
workspace = 4, monitor:HDMI-A-1
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
$menu = rofi -show drun
$windowSwitcher = rofi -show window
# Some default env vars.
env = XCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt5ct # change to qt6ct if you have that
@ -56,44 +56,34 @@ general {
gaps_in = 3
gaps_out = 6
border_size = 2
# col.inactive_border = rgba(595959aa)
#col.active_border = rgb(458588)
col.active_border = rgb(076678)
col.inactive_border = rgb(a89984)
border_size = 1
col.active_border = rgb(ebdbb2)
col.inactive_border = rgb(3c3836)
layout = dwindle
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 0
blur {
enabled = true
size = 3
passes = 1
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
# dim_inactive = true
# dim_strength = 0.2
#inactive_opacity = 0.8
dim_inactive = false
dim_strength = 0.3
#inactive_opacity = 0.7
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
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
$mainMod = SUPER
@ -149,23 +128,30 @@ bind = $mainMod, R, killactive,
bind = $mainMod, M, togglegroup,
bind = $mainMod, E, exec, $fileManager
bind = ALT, SPACE , exec, $menu
bind = ALT, TAB , exec, $windowSwitcher
# bind = ALT, TAB , exec, $windowSwitcher
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, T, togglesplit, # dwindle
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
bind = $mainMod, Left, movefocus, l
bind = $mainMod, Left, alterzorder, top
bind = $mainMod, Right, movefocus, r
bind = $mainMod, Right, alterzorder, top
bind = $mainMod, Up, movefocus, u
bind = $mainMod, Up, alterzorder, top
bind = $mainMod, Down, movefocus, d
bind = $mainMod, Down, alterzorder, top
# Resize windows
@ -211,19 +197,3 @@ bind = $mainMod, LEFT, workspace, m-1
bindm = $mainMod, mouse:272, movewindow
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
font_family PragmataPro Mono Liga
bold_font PragmataPro Mono Liga Bold
italic_font PragmataPro Mono Liga Italic
bold_italic_font PragmataPro Mono Liga Bold Italic
font_size 12
#font_family PragmataPro Mono Liga
#bold_font PragmataPro Mono Liga Bold
#italic_font PragmataPro Mono Liga Italic
#bold_italic_font PragmataPro Mono Liga Bold Italic
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
window_padding_width 5
remember_window_size no
copy_on_select yes
background_opacity 1
bell_path /home/thomas/dotfiles/gruvbox-95/sounds/st-terminal-beep.wav
confirm_os_window_close 0
# hide_window_decorations no
# wayland_titlebar_color background

View file

@ -12,8 +12,8 @@ local function update_hl(group, tbl)
end
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("markdownH2", { bold = true })
update_hl("markdownH3", { bold = true })

View file

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

View file

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

View file

@ -17,7 +17,7 @@
selected-urgent-background: var(red);
alternate-active-background: var(lightbg);
spacing: 2;
blue: rgba (69, 133, 136, 80 % );
blue: rgba (69, 133, 136, 100 % );
alternate-normal-foreground: var(foreground);
urgent-background: var(background);
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;
color: #282828;
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-top: 2px solid #ebdbb2; */
/* border-right: 2px solid #665c54; */
/* border-bottom: 2px solid #665c54; */
padding: 2px 0;
padding: 6px;
transition: background 0.15s ease-in-out;
}

View file

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