From cc0cdd2a6cac77f500b14ee21ab6510eed3410ba Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 29 Jul 2020 09:35:23 +0200 Subject: [PATCH] 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. --- .../user/default.target.wants/dropdown-todo.service | 1 + services/.config/systemd/user/dropdown-todo.service | 11 +++++++++++ services/README.md | 13 ++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 120000 services/.config/systemd/user/default.target.wants/dropdown-todo.service create mode 100644 services/.config/systemd/user/dropdown-todo.service diff --git a/services/.config/systemd/user/default.target.wants/dropdown-todo.service b/services/.config/systemd/user/default.target.wants/dropdown-todo.service new file mode 120000 index 0000000..9044c18 --- /dev/null +++ b/services/.config/systemd/user/default.target.wants/dropdown-todo.service @@ -0,0 +1 @@ +../dropdown-todo.service \ No newline at end of file diff --git a/services/.config/systemd/user/dropdown-todo.service b/services/.config/systemd/user/dropdown-todo.service new file mode 100644 index 0000000..26a9cdf --- /dev/null +++ b/services/.config/systemd/user/dropdown-todo.service @@ -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 diff --git a/services/README.md b/services/README.md index 6dd695f..ab91af6 100644 --- a/services/README.md +++ b/services/README.md @@ -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`.