From c604b913be8394a683fbda8c021ed49993c50d70 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 6 Nov 2020 20:59:03 +0300 Subject: pause notifications with mod+shift+y --- .config/i3/config##c.desktop,h.maus | 3 +++ .config/polybar/config##c.desktop,h.maus | 8 +++++++- .config/polybar/notification_pause.sh | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 .config/polybar/notification_pause.sh diff --git a/.config/i3/config##c.desktop,h.maus b/.config/i3/config##c.desktop,h.maus index 78d847c..4a18908 100644 --- a/.config/i3/config##c.desktop,h.maus +++ b/.config/i3/config##c.desktop,h.maus @@ -91,6 +91,9 @@ bindsym $mod+Shift+minus move scratchpad # Show the first scratchpad window bindsym $mod+minus scratchpad show +# Pause notifications for a while +bindcode $mod+Shift+32 exec /home/yigit/.local/bin/toggle_notifications.sh + # shortcuts for frequent programs bindsym $mod+Shift+z exec zotero bindcode $mod+Shift+41 exec thunar # t on colemak f on turkish diff --git a/.config/polybar/config##c.desktop,h.maus b/.config/polybar/config##c.desktop,h.maus index a489840..e78d49d 100644 --- a/.config/polybar/config##c.desktop,h.maus +++ b/.config/polybar/config##c.desktop,h.maus @@ -52,10 +52,11 @@ font-0 = scientifica:antialias=false;1 font-1 = Lato:size=10;1 font-2 = Raleway:size=10;1 font-3 = FuraCode Nerd Font:size=12;2 +font-4 = Noto Color Emoji:scale=10;2 modules-left = i3 pulseaudio-control spotify mpd modules-center = xwindow -modules-right = cpu focus date time xkeyboard +modules-right = notification_pause cpu focus date time xkeyboard tray-position = right @@ -68,6 +69,11 @@ exec = ~/.config/polybar/focus double-click-left = exec ~/.config/polybar/stop & interval = 10 +[module/notification_pause] +type = custom/script +exec = ~/.config/polybar/notification_pause.sh +interval = 10 + [module/newyork] type = custom/script exec = ~/.config/polybar/new_york.sh diff --git a/.config/polybar/notification_pause.sh b/.config/polybar/notification_pause.sh new file mode 100755 index 0000000..7e59453 --- /dev/null +++ b/.config/polybar/notification_pause.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +TOGGLE=$HOME/.local/share/.pause_notifications + +if [ ! -e $TOGGLE ]; then + echo +else + printf "🔕" +fi -- cgit v1.2.3-70-g09d2