From eaa26b029abaa4ef9bca414d25e5e94bfea89d67 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 15 Apr 2024 16:25:16 +0100 Subject: [PATCH] theming: use Slack as notification manager --- backups/cron/daily.sh | 11 ++- backups/cron/hourly.sh | 11 ++- backups/cron/monthly.sh | 9 +- backups/cron/weekly.sh | 10 +-- hypr/hyprland.conf | 104 ++++++++-------------- kitty/kitty.conf | 20 +++-- nvim/lua/thomas/core/colourscheme.lua | 4 +- nvim/lua/thomas/core/options.lua | 2 +- nvim/lua/thomas/plugins/lualine.lua | 2 +- rofi/gruvbox_95_rofi/gruvbox_95_rofi.rasi | 2 +- scripts/notify_slack_waybar_wrapper.sh | 6 ++ scripts/reboot_sound.sh | 4 + scripts/shutdown_sound.sh | 3 + scripts/startup_sound.sh | 2 + swaync/style.css | 8 +- waybar/config | 16 ++-- 16 files changed, 104 insertions(+), 110 deletions(-) create mode 100755 scripts/notify_slack_waybar_wrapper.sh create mode 100755 scripts/reboot_sound.sh create mode 100755 scripts/shutdown_sound.sh create mode 100755 scripts/startup_sound.sh diff --git a/backups/cron/daily.sh b/backups/cron/daily.sh index f51c4c5..dd5873a 100755 --- a/backups/cron/daily.sh +++ b/backups/cron/daily.sh @@ -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' - else - /usr/bin/notify-send -u critical 'rsync' 'Daily backup failed' + /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Daily backup completed successfully.' + else + /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 diff --git a/backups/cron/hourly.sh b/backups/cron/hourly.sh index c4f9754..6b86715 100755 --- a/backups/cron/hourly.sh +++ b/backups/cron/hourly.sh @@ -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' - else - /usr/bin/notify-send -u critical 'rsync' 'Hourly backup failed' + /home/thomas/repos/slack-notifier/src/index.js 'backups' '✅ Hourly backup completed successfully' + else + /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 diff --git a/backups/cron/monthly.sh b/backups/cron/monthly.sh index fb728d6..3bc362f 100755 --- a/backups/cron/monthly.sh +++ b/backups/cron/monthly.sh @@ -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 diff --git a/backups/cron/weekly.sh b/backups/cron/weekly.sh index 2596679..2d34f80 100755 --- a/backups/cron/weekly.sh +++ b/backups/cron/weekly.sh @@ -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 diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index 31b453f..1e53712 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -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 = 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 @@ -124,22 +114,11 @@ binds { misc { -force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers -disable_hyprland_logo = true + force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers + 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 - } -} - diff --git a/kitty/kitty.conf b/kitty/kitty.conf index 214116d..f591cba 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -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 diff --git a/nvim/lua/thomas/core/colourscheme.lua b/nvim/lua/thomas/core/colourscheme.lua index c9a39ab..6c96d70 100644 --- a/nvim/lua/thomas/core/colourscheme.lua +++ b/nvim/lua/thomas/core/colourscheme.lua @@ -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 }) diff --git a/nvim/lua/thomas/core/options.lua b/nvim/lua/thomas/core/options.lua index fc63838..2792839 100644 --- a/nvim/lua/thomas/core/options.lua +++ b/nvim/lua/thomas/core/options.lua @@ -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" diff --git a/nvim/lua/thomas/plugins/lualine.lua b/nvim/lua/thomas/plugins/lualine.lua index fdd3102..8f1ced6 100644 --- a/nvim/lua/thomas/plugins/lualine.lua +++ b/nvim/lua/thomas/plugins/lualine.lua @@ -9,7 +9,7 @@ end lualine.setup({ options = { - theme = "gruvbox", + theme = "gruvbox-material", component_separators = { left = "|", right = "|" }, section_separators = { left = " ", right = " " }, }, diff --git a/rofi/gruvbox_95_rofi/gruvbox_95_rofi.rasi b/rofi/gruvbox_95_rofi/gruvbox_95_rofi.rasi index c0c0fef..86f8caf 100644 --- a/rofi/gruvbox_95_rofi/gruvbox_95_rofi.rasi +++ b/rofi/gruvbox_95_rofi/gruvbox_95_rofi.rasi @@ -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); diff --git a/scripts/notify_slack_waybar_wrapper.sh b/scripts/notify_slack_waybar_wrapper.sh new file mode 100755 index 0000000..ac61f2a --- /dev/null +++ b/scripts/notify_slack_waybar_wrapper.sh @@ -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 "$@" diff --git a/scripts/reboot_sound.sh b/scripts/reboot_sound.sh new file mode 100755 index 0000000..18cce05 --- /dev/null +++ b/scripts/reboot_sound.sh @@ -0,0 +1,4 @@ + #!/bin/bash +mpv --volume=90 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-off.mp3 +systemctl reboot + diff --git a/scripts/shutdown_sound.sh b/scripts/shutdown_sound.sh new file mode 100755 index 0000000..eafd385 --- /dev/null +++ b/scripts/shutdown_sound.sh @@ -0,0 +1,3 @@ + #!/bin/bash +mpv --volume=90 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-off.mp3 +systemctl poweroff diff --git a/scripts/startup_sound.sh b/scripts/startup_sound.sh new file mode 100755 index 0000000..5f8b72a --- /dev/null +++ b/scripts/startup_sound.sh @@ -0,0 +1,2 @@ + #!/bin/bash +mpv --volume=130 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3 diff --git a/swaync/style.css b/swaync/style.css index 2250165..981b004 100644 --- a/swaync/style.css +++ b/swaync/style.css @@ -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; } diff --git a/waybar/config b/waybar/config index 9476c3b..a30bc89 100644 --- a/waybar/config +++ b/waybar/config @@ -73,7 +73,6 @@ "orientation": "horizontal", "modules": [ "image#timewarrior", - "image#notification", "image#keys", "image#restart", "image#shutdown", @@ -90,7 +89,8 @@ "3": "Workspace 3", "4": "Workspace 4", "5": "Workspace 5", - }, + "6": "Workspace 6", +}, }, "image#code": { @@ -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": {