This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dotfiles-inist/rofi.custom/notifications/notification.sh
2023-10-09 14:35:10 +02:00

41 lines
930 B
Bash
Executable File

#!/usr/bin/env bash
## Author : Aditya Shakya (adi1090x)
## Github : @adi1090x
#
## Rofi : Launcher (Modi Drun, Run, File Browser, Window)
#
## Available Styles
#
## style-1 style-2 style-3 style-4 style-5
## style-6 style-7 style-8 style-9 style-10
dir="$HOME/.config/rofi.custom/notifications"
theme='style-4'
dunstctl close-all
## Run
while
selected=$(~/.config/rofi.custom/notifications/dunst-json.sh | rofi \
-dmenu \
-sep '|' \
-p '' \
-kb-delete-entry "" \
-kb-remove-char-forward "" \
-kb-custom-1 "Delete" \
-kb-custom-2 "Shift+Delete" \
-theme ${dir}/${theme}.rasi)
status=$?
# echo "Status: $status"
# echo "Selected: $selected"
if [[ "$status" == 10 && "$selected" != "" ]]; then
dunstctl history-rm $(echo $selected | sed -r 's/^([0-9]+): .*/\1/')
elif [[ "$status" == 11 ]]; then
dunstctl history-clear
fi
[[ "$status" == 10 ]]
do :; done