From 497d3d4b57056fd866783caeaeb618504ce2f9c4 Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sun, 20 Dec 2020 00:23:52 -0500 Subject: [PATCH] Deadd Notification Center - Add orange dracula color to Xresources - Add notification pause/unpause toggle script for Deadd Notifications - Add notification center open script for Deadd Notifications - Add example deadd.conf and deadd.css - Whitespace changes to xinitrc - Add keybindings, autostart, and dwmc patch for deadd to dwm - Add module to polybar to control deadd notifications - Fix powermenu commands in polybar module --- .Xresources | 2 + .config/deadd/deadd-notification-toggle.sh | 17 +++ .config/deadd/deadd.conf | 153 +++++++++++++++++++++ .config/deadd/deadd.css | 35 +++++ .config/deadd/open-notification-center.sh | 3 + .config/dwm | 2 +- .config/polybar | 2 +- .xinitrc | 12 +- 8 files changed, 218 insertions(+), 8 deletions(-) create mode 100755 .config/deadd/deadd-notification-toggle.sh create mode 100644 .config/deadd/deadd.conf create mode 100644 .config/deadd/deadd.css create mode 100755 .config/deadd/open-notification-center.sh diff --git a/.Xresources b/.Xresources index 4ef6c85..9e2cfbe 100644 --- a/.Xresources +++ b/.Xresources @@ -17,6 +17,7 @@ #define PINK2 #FF92D0 #define CYAN1 #8BE9FD #define CYAN2 #9AEDFE +#define ORANGE #FFB86C ! Regular DPI Parameters #define DPI 96 @@ -59,6 +60,7 @@ *.color14: CYAN2 *.color7: WHITE2 *.color15: WHITE1 +*.color16: ORANGE ! DWM Parameters dwm.normbgcolor: BACKGROUND diff --git a/.config/deadd/deadd-notification-toggle.sh b/.config/deadd/deadd-notification-toggle.sh new file mode 100755 index 0000000..7065394 --- /dev/null +++ b/.config/deadd/deadd-notification-toggle.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +STATUS_FILE=~/.config/deadd/status + +if [[ ! -f $STATUS_FILE ]]; then + echo 1 >$STATUS_FILE +fi + +status=$(cat $STATUS_FILE) + +if [[ $status == 1 ]]; then + # Set status to off + echo 0 >$STATUS_FILE +elif [[ $status == 0 ]]; then + # Set status to on + echo 1 >$STATUS_FILE +fi diff --git a/.config/deadd/deadd.conf b/.config/deadd/deadd.conf new file mode 100644 index 0000000..ca27600 --- /dev/null +++ b/.config/deadd/deadd.conf @@ -0,0 +1,153 @@ +[notification-center] + +# Margin at the top of the notification center in pixels. This can be +# used to avoid overlap between the notification center and bars such +# as polybar or i3blocks. +marginTop = 0 + +# Margin at the bottom of the notification center in pixels. +marginBottom = 0 + +# Margin to the right of the notification center in pixels. +marginRight = 0 + +# Width of the notification center in pixels. +width = 500 + +# Monitor on which the notification center will be printed. +monitor = 0 + +# If true, the notification center will open on the screen, on which the +# mouse is +followMouse = false + +# (Optional) Command to run at startup. This can be used to setup +# button states. +# startupCommand = "deadd-notification-center-startup" + +# If newFirst is set to true, newest notifications appear on the top +# of the notification center. Else, notifications stack, from top to +# bottom. +newFirst = true + +# If true, the transient field in notifications will be ignored and +# the notification will be persisted in the notification center anyways +ignoreTransient = false + +# If true, markup (, , , ) will be displayed properly +useMarkup = true + +# If true, html entities (& for &, % for %, etc) will be parsed +# properly. This is useful for chromium-based apps, which tend to send +# these in notifications. +parseHtmlEntities = true + +# If set to true, the parameter noClosedMsg can be set on +# notifications. If noClosedMsg is set to true on a notification, +# DBUS NotificationClosed messages will not be send for this +# notification. +configSendNotiClosedDbusMessage = false + +# If set to true: If no icon is passed by the app_icon parameter +# and no application "desktop-entry"-hint is present, the notification +# center will try to guess the icon from the application name (if present). +# Default is true. +guessIconFromAppname = true + +# Truncates notification bodies with '...' at the specified number of +# lines. If -1 is specified, the body text will not be truncated. +# Applies only to notifications within the notification center. +shortenBody = -1 + +# See section "Notification based scripting" for an explanation +#match = "title=Abc;body=abc":"app=notify-send" +#modify = "transient=false" +#run = "":"killall notify-send" + +[notification-center-notification-popup] + +# Default timeout used for notifications in milli-seconds. This can +# be overwritten with the "-t" option (or "--expire-time") of the +# notify-send command. +notiDefaultTimeout = 10000 + +# Margin above notifications (in pixels). This can be used to avoid +# overlap between notifications and a bar such as polybar or i3blocks. +distanceTop = 50 + +# Margin on the right of the notification (in pixels). +distanceRight = 50 + +# Vertical distance between 2 notifications (in pixels). +distanceBetween = 20 + +# Width of the notifications. +width = 300 + +# Monitor on which the notification will be printed. +monitor = 0 + +# If true, the notifications will open on the screen, on which the +# mouse is +followMouse = false + +# The display size of the application icons in the notification +# pop-ups and in the notification center +iconSize = 20 + +# The maximal display size of images that are part of notifications +# for notification pop-ups and in the notification center +maxImageSize = 100 + +# The margin around the top, bottom, left, and right of notification +# images. Applies to popup notifications and in-center notifications. +imageMarginTop = 15 +imageMarginBottom = 15 +imageMarginLeft = 15 +imageMarginRight = 0 + +# Truncates notification bodies with '...' at the specified number of +# lines. If -1 is specified, the body text will not be truncated. +# Applies only to popup notifications +shortenBody = 5 + +# The mouse button for closing a popup. Must be either "mouse1", +# "mouse2", "mouse3", "mouse4", or "mouse5" +dismissButton = mouse1 + +# The mouse button for opening a popup with the default action. +# Must be either "mouse1", "mouse2", "mouse3", "mouse4", or "mouse5" +defaultActionButton = mouse3 + +[buttons] +### This section describes the configurable buttons within the +### notification center and NOT the buttons that appear in the +### notifications + +# Note: If you want your buttons in the notification center to be +# squares you should verify that the following equality holds: +# [notification-center]::width +# == [buttons]::buttonsPerRow * [buttons]::buttonHeight +# + ([buttons]::buttonsPerRow + 1) * [buttons]::buttonMargin + +# Numbers of buttons that can be drawn on a row of the notification +# center. +buttonsPerRow = 5 + +# Height of buttons in the notification center (in pixels). +buttonHeight = 60 + +# Horizontal and vertical margin between each button in the +# notification center (in pixels). +buttonMargin = 2 + +# Labels written on the buttons in the notification center. Labels +# should be written between quotes and separated by a colon. For +# example: +# labels = "VPN":"Bluetooth":"Wifi":"Screensaver" + +# Each label is represented as a clickable button in the notification +# center. The commands variable below define the commands that should +# be launched when the user clicks on the associated button. There +# should be the same number of entries in `commands` and in `labels` +# commands = "sudo vpnToggle":"bluetoothToggle":"wifiToggle":"screensaverToggle" diff --git a/.config/deadd/deadd.css b/.config/deadd/deadd.css new file mode 100644 index 0000000..c6ac895 --- /dev/null +++ b/.config/deadd/deadd.css @@ -0,0 +1,35 @@ +/* Notifications + * - Appname: label.deadd-noti-center.notification.appname + * - Textbody: label.deadd-noti-center.notification.body + * - Notification title: label.deadd-noti-center.notification.title + * - Image of a notification: image.deadd-noti-center.notification.image + * - Appicon: image.deadd-noti-center.notification.icon + */ + +/* Notifications in the notification center + * - Appname: label.deadd-noti-center.in-center.appname + * - Textbody: label.deadd-noti-center.in-center.body + * - Notification title: label.deadd-noti-center.in-center.title + * - Notification time: label.deadd-noti-center.in-center.time + * - Image of a notification: image.deadd-noti-center.in-center.image + * - Appicon: image.deadd-noti-center.in-center.icon + * - Close button on notification: button.deadd-noti-center.in-center.button-close + */ + +/* Notification-center + * - The big time at the top: label.deadd-noti-center.noti-center.time + * - The date text: label.deadd-noti-center.noti-center.date + * - “Delete all” Button: label.deadd-noti-center.noti-center.delete-all + */ + +/* Examples + * image.deadd-noti-center.notification.icon, + * label.deadd-noti-center.notification.appname, + * image.deadd-noti-center.in-center.icon, + * label.deadd-noti-center.in-center.appname { + * opacity: 0 + * } + * .deadd-noti-center { + * font-family: monospace; + * } + */ diff --git a/.config/deadd/open-notification-center.sh b/.config/deadd/open-notification-center.sh new file mode 100755 index 0000000..400c416 --- /dev/null +++ b/.config/deadd/open-notification-center.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Toggle between hidden and shown state of the notification center +kill -s USR1 $(pidof deadd-notification-center) diff --git a/.config/dwm b/.config/dwm index 23e8ff3..f48e747 160000 --- a/.config/dwm +++ b/.config/dwm @@ -1 +1 @@ -Subproject commit 23e8ff343e220cf3d5e9384339274ef3d394b901 +Subproject commit f48e7473ff2cb689a84c5c65f4620de3f0d9aa0c diff --git a/.config/polybar b/.config/polybar index 87b723a..792968e 160000 --- a/.config/polybar +++ b/.config/polybar @@ -1 +1 @@ -Subproject commit 87b723aecee66a340d50775c8cba988b55a5ab73 +Subproject commit 792968ef342eb7401311577f28988469cbb44a80 diff --git a/.xinitrc b/.xinitrc index 20f4b72..cc1bf21 100755 --- a/.xinitrc +++ b/.xinitrc @@ -1,12 +1,12 @@ ######################### # ENVIRONMENT VARIABLES # ######################### -export TERM=xterm-256color # Sets the terminal type -export SHELL=/usr/bin/fish # Preferred shell -export EDITOR="code -w" # Default editor -export BROWSER=brave # Web Browser -export XDG_CONFIG_HOME=$HOME/.config # Set Config directory -export QT_QPA_PLATFORMTHEME=gtk2 # QGtkStyle +export TERM=xterm-256color # Sets the terminal type +export SHELL=/usr/bin/fish # Preferred shell +export EDITOR="code -w" # Default editor +export BROWSER=brave # Web Browser +export XDG_CONFIG_HOME=$HOME/.config # Set Config directory +export QT_QPA_PLATFORMTHEME=gtk2 # QGtkStyle ########### # STARTUP #