services: Add autostarting dropdown todo list

Added systemd-controlled automatic restart to existing i3 todo list
overlay (super+t). Contains a lot of hard-coded paths and applications.
This commit is contained in:
Marty Oehme 2020-07-29 09:35:23 +02:00
parent 1c45202f18
commit cc0cdd2a6c
No known key found for this signature in database
GPG Key ID: 0CCB0526EFB9611A
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1 @@
../dropdown-todo.service

View File

@ -0,0 +1,11 @@
[Unit]
Description=Todo.md floating vim instance
[Service]
Type=simple
# workaround to allow relative executable invocation (i.e. current users' home dir)
ExecStart=/bin/bash -c 'alacritty --title "dropdown-todo" --class "Alacritty,scratchpad" -e nvim -c ":set nonumber norelativenumber noshowmode noruler laststatus=0 noshowcmd shortmess=F" %h/documents/records/todo.md'
Restart=always
[Install]
WantedBy=default.target

View File

@ -11,6 +11,13 @@ If they are not found, their service will fail silently (well, with a systemd er
Lastly, the directory `~/documents/notes/uni` will begin to be synced with `git`, so will need a) `git` installed, b) the directory to exist as a `git` directory, c) to be disabled if you do not want this directory to be continually synced.
Look into the sections below to see what else is assumed (e.g. a rigid notes and records directory structure).
Some of this may change over time -- ideally I would prefer flexible variables instead of hard-coded paths,
but it is what it is for now.
In other words:
you will **very likely** not just want to install and activate this module in general but be picky about what to do with it,
since it conforms to a highly opinionated set of installed applications and directory structures.
## Why systemd
There are two reasons for the service module making use of `systemd` to manage its services:
@ -53,10 +60,14 @@ In effect this means, using the default values, the service will commit any chan
The two cycles can be changed independently from each other via the environment variables mentioned above so that, for example, the repository can be pushed every single time a commit takes place, or commits can be checked for on faster or shorter intervals.
As another example, if you want to check for changes every 30 seconds but still push every hour, you would do `GS_TIME_TO_COMMIT=30` and `GS_UNCHANGED_RUNS_TO_PUSH=120`.
## Dropdown Terminal service
## Dropdown services
The `dropdown-terminal.service` is very simple, and always keeps a (`alacritty`) terminal window running.
The program is started with a `scratchpad` class, which is picked up by [`i3`](i3) and automatically hidden.
You can then show/hide the terminal as a floating overlay as you need, mimicking a floating terminal
(by default with `super + shift + return`, though this may change).
When you close the window in any way, systemd automatically restarts it in the background.
The `dropdown-todo.service` is similar but instead of an empty (`alacritty`) terminal window,
it starts up a `nvim` instance which hides most of its interface and shows a to-do list.
The list, by default, is situated in `~/documents/records/todo.md` and can be displayed with `super + t`.