aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakob.stendahl <jakob.stendahl@infomedia.dk>2024-07-14 10:59:59 +0200
committerjakob.stendahl <jakob.stendahl@infomedia.dk>2024-07-14 10:59:59 +0200
commit7116bc4e91c209f738ca5276a7e08bc19c3b737c (patch)
tree6df99977ad4720605ac93e23459333527fe155a7
parent36d8ff00dd1d0f60d0a2afca519de979c67f1dce (diff)
downloadsimple-notification-daemon-7116bc4e91c209f738ca5276a7e08bc19c3b737c.tar.gz
simple-notification-daemon-7116bc4e91c209f738ca5276a7e08bc19c3b737c.zip
Add some documentation
-rw-r--r--Makefile7
-rw-r--r--README134
-rw-r--r--snotifc.175
-rw-r--r--snotifd.150
4 files changed, 265 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0bd95f3..9c705b5 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ DEST =
.PHONY: install clean
-all: snotifd snotifc
+all: snotifd snotifc README
o_files := $(patsubst %.c,%.o,$(wildcard *.c))
%: %.c
@@ -20,6 +20,10 @@ snotifc: ${o_files}
${GCC} -o $@ $@.o snotif.o ${CFLAGS} -lncursesw
strip snotifc
+README: snotifd.1 snotifc.1
+ groff -Tutf8 -mandoc snotifd.1 | sed -e 's/\x1b\[[0-9;]*m//g' > $@
+ groff -Tutf8 -mandoc snotifc.1 | sed -e 's/\x1b\[[0-9;]*m//g' >> $@
+
install: snotifc snotifd
install snotifd ${HOME}/bin/snotifd
install snotifc ${HOME}/bin/snotifc
@@ -31,3 +35,4 @@ clean:
rm -f *.o
rm -f snotifc
rm -f snotifd
+ rm -f README
diff --git a/README b/README
new file mode 100644
index 0000000..cbbd905
--- /dev/null
+++ b/README
@@ -0,0 +1,134 @@
+SNOTIFD(1) General Commands Manual SNOTIFD(1)
+
+name
+ Simple notification daemon
+
+SYNOPSIS
+ snotifd
+
+
+DESCRIPTION
+ snotifd is a simple daemon meant to run per user, which can receive and
+ store notifications via DBus in memory. All notifications will be
+ cleared on restart of the daemon.
+
+ It is a quite straight forward program, you start it, and it will be
+ listening to the DBus, the intended way to interact with it is to use
+ snotifc(1) which implements the nesecarry functions to connect via the
+ snotifd.Notifications DBus-interface.
+
+ It can be built with
+
+ make
+
+ after which you can install it to your user with
+
+ make
+
+ Then you can run
+
+ systemctl --user enable --now snotifd
+
+ to start it if you are on a systemd-system. If not, you can start it
+ with ~/bin/snotifd. snotifc is installed to ~/bin/snotifc. Make sure
+ that is in your path to be able to execute it.
+
+
+SEE ALSO
+ snotifc(1)
+
+ 2024-07-14 SNOTIFD(1)
+SNOTIFC(1) General Commands Manual SNOTIFC(1)
+
+name
+ Simple notification client
+
+
+SYNOPSIS
+ snotifc [subcommand]
+
+
+DESCRIPTION
+ snotifc
+
+
+OPTIONS
+ If no subcommand is specified, a curses TUI will be opened, which can
+ live-refresh, and let's you browse notifications.
+
+
+ Subcommand: ls
+ Print all notifications to console.
+
+
+ Subcommand: unread <return_string>
+ return_string
+ The string that will be printed to standard out if there are un‐
+ read notifications. If there are no unread notifications, noth‐
+ ing will be printed.
+
+
+ Subcommand: unread-count
+ Print the current number of unread notifications to stdout.
+
+
+INTERACTIVE COMMANDS
+ The following commands are supported while in snotic TUI:
+
+
+ j, Down
+ Select (highlight) next notification.
+
+
+ k, Up
+ Select (highlight) previous notification.
+
+
+ PgUp, PgDn
+ Scroll the notification list up or down one window.
+
+
+ CTRL-d, CTRL-u
+ Scroll the notification list up or down one half window.
+
+
+ g
+ Scroll to the top of the notification list.
+
+
+ G
+ Scroll to the end of the notification list.
+
+
+ Enter/Return, F2
+ Show details for selected (highlighted) notification.
+
+
+ F7
+ Toggle the seen status of the curently selected (highlighted) notifica‐
+ tion.
+
+
+ F8
+ Mark all notifications as seen.
+
+
+ F9
+ Clear the notification list, this is not a reversible action, snotifd
+ will delete everything from memory.
+
+
+ F10, q
+ Exit the tui application.
+
+
+EXAMPLES
+ To show a red dot in the tmux status bar if there are unread notifica‐
+ tions, something like this can be added to .tmux.conf
+
+ set -g status-right "%d/%m/%y %H:%M:%S#(snotifc unread \"#[fg=red]⬤#[default]\")"
+
+SEE ALSO
+ snotifd(1)
+
+ 2024-07-14 SNOTIFC(1)
diff --git a/snotifc.1 b/snotifc.1
new file mode 100644
index 0000000..811ed89
--- /dev/null
+++ b/snotifc.1
@@ -0,0 +1,75 @@
+.TH SNOTIFC 1 2024-07-14
+.SH name
+Simple notification client
+
+.SH SYNOPSIS
+.B snotifc [subcommand]
+
+.SH DESCRIPTION
+.B snotifc
+
+.SH OPTIONS
+If no subcommand is specified, a curses TUI will be opened, which can live-refresh, and let's you browse notifications.
+
+.SS "Subcommand: ls"
+Print all notifications to console.
+
+.SS "Subcommand: unread \fI<return_string>\fR"
+
+.IP "\fBreturn_string\fR"
+The string that will be printed to standard out if there are unread notifications.
+If there are no unread notifications, nothing will be printed.
+
+.SS "Subcommand: unread-count"
+Print the current number of unread notifications to stdout.
+
+.SH INTERACTIVE COMMANDS
+The following commands are supported while in snotic TUI:
+
+.SS "j, Down"
+Select (highlight) next notification.
+
+.SS "k, Up"
+Select (highlight) previous notification.
+
+.SS "PgUp, PgDn"
+Scroll the notification list up or down one window.
+
+.SS "CTRL-d, CTRL-u"
+Scroll the notification list up or down one half window.
+
+.SS "g"
+Scroll to the top of the notification list.
+
+.SS "G"
+Scroll to the end of the notification list.
+
+.SS "Enter/Return, F2"
+Show details for selected (highlighted) notification.
+
+.SS "F7"
+Toggle the seen status of the curently selected (highlighted) notification.
+
+.SS "F8"
+Mark all notifications as seen.
+
+.SS "F9"
+Clear the notification list, this is not a reversible action, snotifd will delete everything from memory.
+
+.SS "F10, q"
+Exit the tui application.
+
+.SH EXAMPLES
+
+To show a red dot in the tmux status bar if there are unread notifications, something like this can be added to
+.BR .tmux.conf
+.PP
+.nf
+.RS
+set -g status-right "%d/%m/%y %H:%M:%S#(snotifc unread \\"#[fg=red]⬤#[default]\\")"
+.RE
+.fi
+.PP
+
+.SH SEE ALSO
+snotifd(1)
diff --git a/snotifd.1 b/snotifd.1
new file mode 100644
index 0000000..5262bfc
--- /dev/null
+++ b/snotifd.1
@@ -0,0 +1,50 @@
+.TH SNOTIFD 1 2024-07-14
+.SH name
+Simple notification daemon
+.SH SYNOPSIS
+.B snotifd
+
+.SH DESCRIPTION
+.B snotifd
+is a simple daemon meant to run per user, which can receive and store notifications via DBus in memory.
+All notifications will be cleared on restart of the daemon.
+
+It is a quite straight forward program, you start it, and it will be listening to the DBus,
+the intended way to interact with it is to use
+.BR snotifc (1)
+which implements the nesecarry functions to connect via the
+.BR snotifd.Notifications
+DBus-interface.
+
+It can be built with
+.PP
+.nf
+.RS
+make
+.RE
+.fi
+.PP
+after which you can install it to your user with
+.PP
+.nf
+.RS
+make
+.RE
+.fi
+.PP
+Then you can run
+.PP
+.nf
+.RS
+systemctl --user enable --now snotifd
+.RE
+.fi
+.PP
+to start it if you are on a systemd-system.
+If not, you can start it with ~/bin/snotifd.
+.BR snotifc
+is installed to ~/bin/snotifc.
+Make sure that is in your path to be able to execute it.
+
+.SH SEE ALSO
+snotifc(1)