Commit graph

1634 commits

Author SHA1 Message Date
a57e9ab7da
disks: Add removable media automounting
`udiskie` is kept running in the background and automatically
mounting any inserted media, which will then also show its
tray icon so that it can be quickly unmounted as well.

Additional ideas would be to allow mounting / unmounting through
keyboard sequences instead of gui (via rofi for example).
2020-10-21 16:46:59 +02:00
2ad1389329
nvim: Extend lsp for nvim lua development
Added new functionality to lsp: hovering, go-to definition, referencing,
implementations, etc accessible through the usual hotkeys.

Added commands to invoke LspHover and temporarily disable lsp for the
current buffer (is re-enabled on re-entering the buffer, e.g. with
:e<cr>)

Added tjdevries extended lua lsp implementation containing functionality
for the nvim api itself (especially useful for `vim.api`, `vim.fn`).
2020-10-09 22:11:06 +02:00
4dd80b7fe1
nvim: Change default foldlevel to 3
Previously, the foldlevel of 2 would still display second level markdown
headlines (`##`) but fold `###`.

However, most of my text analyses are taking place within 3rd level
headlines nowadays, and if vim-pandoc is allowed to have folds enabled,
it will always fold everything beyond the foldlevel *each* time you
enter a buffer of pandoc filetype.

So, simply up the foldlevel one.
2020-10-09 22:07:30 +02:00
65df0fb91f
nvim: Remove pencil to fix relative cursor movement
Cursor movement works better for soft-wrapped prose files now:
When just using j/k to move vertically, the cursor will jump between the
different parts of a single wrapped line. That means you can easily move
anywhere you want on your lines, exactly as it's shown to you.

If, however, prefixing your j/k move with a number to move a relative
number of lines, it will no longer take wrapping into account. That
means you can not jump instantly to *any* part of a wrapped lines,
however on the other hand the relative line numbers on the side never
lie now: You will jump exactly as many lines as are shown on the side.
This is a tradeoff I am happily willing to make.

Additionally had to remove vim-pencil to get the movement to work, but
since it did not provide any visible pros anymore, this should not be a
big issue.
2020-10-08 20:38:50 +02:00
ca692d30d0
sh: Add default fzf options and binds
tab and shift-tab will select up and down,
ctrl-g moves to the first entry,
ctrl-t toggles the preview window on and off,
ctrl-d/ctrl-u scroll through the preview window.

By default, a preview window of the contents of whatever file is
currently selected will be displayed.

I would rather have the preview hidden by default, but it is hidden in
the default options it becomes hard to show it automatically again for
individual commands, so this seems a better compromise.
2020-10-08 11:09:13 +02:00
cd52e47e22
nvim: Add workaround for completion-nvim bug
completion-nvim chaining seems to not allow multiple `triggered_only`
definitions in the same linked chain of various completion options. In
other words, when in pandoc files there is no possibility to have
completion for lsp and buffer words by default and for paths on pressing
`/`, as well as bib-citekeys on pressing `@`.

Doing so requires automatically switching sources, which in turn is of
little use when writing pandoc normally and it hangs every couple of
seconds to recompile the bibtex list as soon as it runs out of buffer
words to complete.

Ideally, the completion-nvim bug should be looked at, but also the
bibtex completion possibly completely turned into a lua parsed
completer, so it does not depend on `vim-pandoc` and its (presumably)
slower vimscript implementation.
2020-10-08 10:34:45 +02:00
5dde9db2e4
zsh: Update fzf-tab
Make use of colorful action groups and query input option.

By default, will group the different completion actions (if they have
been set up for the respective zsh completion) as different color sets.

When entering an input and nothing fits (or something else than
intended), it is now possible to simply hit alt+enter instead of just
enter to add whatever you typed into the zle instead of whatever fzf
provided you with (or nothing at all, if it didn't).
2020-10-08 10:28:56 +02:00
92ad105483
vifm: Add tree color preview for directories
Use exa as initial program to display directory previews, fall back to
tree otherwise.
2020-10-06 09:20:01 +02:00
270edf13b1
nvim: Fix completion sourcing for pandoc files
Fixed source completion, so it automatically changes to turn source
switching *off* for pandoc files (to not automatically invoke bibcite
generation), and *on* for the rest of files.

This was accidentally switched the wrong way round before.
2020-10-05 09:31:27 +02:00
eaec90379d
nvim: Improve lsp source chaining
Lsp will by default invoke most of its sources simultaneously (one after
the other if no completions are found for the first), but this is
disabled for pandoc.

In pandoc, only the buffer and lsp sources are invoked (the first
chain), since bibcite will take a while to compile the cite keys.
To invoke bibcite in pandoc, use c-j/c-k when in the completion menu,
and they will be calculated.

This may be removed if a faster compilation for bibtex citekeys is
found.
2020-10-02 11:56:31 +02:00
a79bef6c4d
nvim: Switch to nvim-lsp
Enabled lsp within nvim and switched completion engine from deoplete to
completion-nvim.

The completion will be somewhat more barebones for some filetypes until
the language servers are set up, but should then (theoretically) carry a
lot more features than before.

Additionally, we can, over time, add additional code inspection
functionality.

One change concerns the calling of bibtex cite key completion in pandoc
files: Where before the completion would automatically begin after
typing an '@', it will now only start on manual completion invocation
(c-p/c-n) -- since the completion from my current bibtex file takes a
while to load.
2020-10-01 19:20:07 +02:00
28f7f304c1
nvim: Fix zettelkasten links
Fixed links in zk which do not follow the exact pattern of anchor space
title, allowing for wiki-style links and so on.
2020-10-01 09:17:44 +02:00
1311c30e84
mail: Fix mail filtering
Fixed correct filtering of inbox stuff in afew (moving archived mails
out of inbox, moving trash into GMail Trash).
2020-10-01 09:04:24 +02:00
41d460284e
nvim: Fix updated wiki.vim link function
Changed function to accomodate internal change in wiki.vim naming for
the link parsing function.

See wiki.vim commit d085c138fd4cd33abeb93f1c1afaff1210c7c33b.
2020-09-28 19:17:40 +02:00
a85a39fc40
sh: Fix fzfhistory alias
Alias previously would only search the x last history entries (~20),
this fixes it to search through the complete shell history.
2020-09-25 11:26:57 +02:00
3c84d6ae1a
mail: Improve inbox display in aerc and notmuch
Added filtering by dump tag *or* folder to afew so that incoming mail
should automatically be filed exclusively in inbox or the dump for
notmuch.

Additionally changed the exception for inbox display from list to dump
tags in aerc, so that -- should there be a legitimate mailing list mail,
such as gitlab's pipeline reports -- they are still visible in inbox.
2020-09-25 11:25:18 +02:00
94673ea507
services: Fix shellcheck error 2020-09-25 11:24:10 +02:00
facaa3e185
nvim: Improve completino menu, add cursor context
Improved completion menu by allowing c-p,c-n scrolling through it.

Removed automatically resizing buffers, use c-w= if you need it.

Added scrolloff, controlling the amount of lines that are always
under/above the cursor. This fixes the cursor being at the very bottom
of the page, after doing e.g. zb or zt and will allow seeing a bit more
information around it at all times.
2020-09-24 21:59:38 +02:00
b29570327b
polybar: Add simple mail display script module
The module will pick up the current state of the systemd mbsync.timer
and display an according icon (sleepy bell if auto-sync is off, mail
icon if auto-sync is on).

It will use notmuch counters to show only unread mails in the inbox,
which generally constitute the 'new' mails one wants to know about.

It will not display anything if it did not find 'new' mails.

Lastly, right-clicking allows starting the auto-sync timer and left
clicking allows to stop it.

FIXME: The icon will only update on the next update interval of the
module itself (which is set at 300 seconds). That means, after clicking
the icon to start or stop the auto-sync, the actual state will not be
reflected by the icon for a couple of minutes.
2020-09-24 21:07:46 +02:00
7bee413323
services: Reorganize services, detect X
Detect X autostart a bit better with a separate service. The service
relies on a shell script which searches for a socket which X creates on
startup and only finishes when it finds the socket succesfully.

This makes services which need X to start successfully a bit more
robust, and while it can still break if X takes too long, it should be
more stable now.

Finally, services can restart more quickly when ended since they don't
require the 2+ `RestartSec` option to be present anymore to successfully
start.
2020-09-24 16:24:42 +02:00
3fa7f8a6db
mail: HACK mailcheck update
Update `mail-check` script to notify the user both of newly arrived
mail, and in case he has to enter his password to sync the mail.

HACK the paths and ways of finding out if passwords can be decrypted are
static and only applicable to my set up. This needs to be completely
revised and newly approached.
2020-09-24 16:24:34 +02:00
c5cd2b6a8d
mail: Enable direct pgp decryption
When called over systemd, pass will not display a pin-entry field to
decrypt the necessary passwords for email synching.

This prepares automatic background synching.
2020-09-24 14:22:03 +02:00
407ad0473f
mail: Fix mail-check hooks
Fixed running the hooks for `mail-check`. Command (or variable?)
substition prevented the hooks from running completely beforehand, so I
moved them to a separate function with the option remaining to call a
custom script for them through environment variables.

Ideally the env vars (`MBSYNC_PRE` and `MBSYNC_POST`) should only point
to a single script each, as more involved commands will presumably fail
to execute correctly when whitespace substition is involved.

See more explanation here:
https://unix.stackexchange.com/a/444949
2020-09-24 10:00:47 +02:00
b176b61b52
mail: Move rollup data to XDG data dir
Moved the file containing sender addresses to filter to the
XDG_DATA_HOME directory (usually `~/.local/share/imapfilter/`) where it
will look for a `rollup.txt` file.

This is to separate the configuration values (the filters themselves)
somewhat from the data they act on (values to filter and searches to
accomplish).
2020-09-23 17:55:08 +02:00
2b289a953b
mail: Add IDLE mode watching
Added option to imapfilter to continuously run in the background and
watch for new incoming mail through the Imap IDLE mode.

By default it will run as one-shot and just sort mail according to
currently active filters. But if enabling the `CONTINUOUS` mode in
config file, it will instead keep running and continuously check for
arriving mail to filter.

This could, in the future, be useful to run on a separate server which
watches remote imap folders and pulls them down to its own storage.

For local usage, a systemd service and timer unit are probably more
suitable than the daemonization of imapfilter.
2020-09-23 17:55:07 +02:00
85c68fc676
mail: Add local folder and tag alignment
afew will locally add notmuch tags to mails, as well as move them to
specific folders according to the notmuch tags they already contain.

This sets mails residing in the `Dump` folder to be tagged
correspondingly with `dump`.
(imapfilter automatically puts all filtered
adverts and mailing lists into the dump folder beforehand.)

On the other hand, it makes sure that email tagged with `dump` also
resides in the `Dump` folder (if tagged manually with notmuch), and same
thing for `Inbox`.
2020-09-23 17:55:07 +02:00
e5414cbadf
services: Fix flashfocus startup
Flashfocus did not start up correctly since it was not required for the
`default.target` which is the only (?) valid target when systemd
operates in user-mode.

Instead of overwriting just part of the flashfocus service file, and
subsequently having it enabled for default.target and a non-existent
graphical.target user environment, we overwrite the whole file and set
it to `default.target`.

Additionally, the service should be restarted when it fails and slow
down on its restart attempts (I kept 5 seconds for this one, since it is
not as time critical as others -- no one cares if windows only flash
5 seconds after starting the machine.)

Added (wishful) After components to many service units, in case I figure
out one day how to make a useful target for the systemd user mode.
2020-09-23 17:55:07 +02:00
bf80c9ecf3
mail: Read mails to roll up from external file
Changed rollup filter to read the files to be rolled up from 'rollup.txt'
file in the imapfilter configuration directory. (by default in XDG
basedir-compliant directory such as '~/.config/imapfilter/rollup.txt')

The file consists of sender addresses with a single address on each
line.
2020-09-23 17:55:07 +02:00
698e8a63ee
mail: Refactor imapfilter configuration
Make imapfilter configuraiton more flexible to prepare for different
filters being added.

The program will expect its configuration and filter files to be located
in XDG directory structure, within the sub-folder 'filters'.
E.g.: `/home/user/.config/imapfilter/filters`

A global `configDir` variable is available for any filters, which
describes the path to the current configuration directory.
The path to the filter directory can also be accessed through
`getFilterDir()`.

The configuration runs `accounts.lua` and expects it to return a table
with the individual imap boxes as top level entries, so that filters can
then loop through each account as needed.

Lastly, the config will automatically apply all filters found in the
filters sub-folder. A filter is a '.lua' file within the directory.
Other files can exist in the dir and will not be touched.
2020-09-23 17:55:07 +02:00
0d00953f30
mail: Add afew automatic tagging
Added hook for afew tagging for local mail.

Mail will now arrive tagged only as 'new' by notmuch.
afew will then tag the mail accordingly as inbox unread when it is
personal mail.

It will additionally filter out anything marked as spam, or e-mail
containing a List-Id header, which will be tagged as 'list' and not
arrive in the inbox. This filters out anything arriving from a mailing
list from the inbox.

Removed the archive tag -- anything not in the inbox, and not marked as
list is instead used as an automatic archive.

Mail sent by myself will be automatically tagged as 'sent' and also not
show up in the mailbox.
2020-09-23 17:55:06 +02:00
be688572f5
mail: Add contacts lookup script
Added `mail-searchcontacts` script, which uses notmuch to search for all
contacts of the mail database.

Can be invoked without any arguments to list *all* contacts of the
dataase in descending order of message count.
Otherwise, it will filter known contacts, first by prioritizing the
'from:' field, and otherwise by searching through the whole database for
the keywords passed in.

It will also re-format the results so that the list consists of
tab-delineated 'mail name' rows. If there is no name, the row will only
contain the bare e-mail address. This format is best accepted by aerc,
for which the script is written.

aerc uses the contacts script for its address completion in editing
e-mail headers.

Renamed `checkmail` to `mail-check` to fit the naming scheme of
`mail-[action]` for mail scripts, to better be able to group them in the
shell.
2020-09-23 17:55:06 +02:00
5a256186c2
mail: Add basic filtering system
imapfilter now looks for account information in an accounts.lua file in
its configuration directory -- the file should return account
information as a table with each account being a top-level entry in the
table.

A sample spam-moving script has been supplied:
For now, it will take a list of sender addresses and put everything in
the list from the inbox into the dump directory.

An example list of senders has been supplied for testing purposes, but
this should eventually be read from a file containing an extensible list
of senders (and perhaps even different properties such as subject, etc.)

The imapfilter xdg alias has been fixed.

Coherence between the imap folder structure and notmuch tagging system
still has to be achieved -- either by aerc using the folder structure as
a query map, or notmuch tags automatically being applied for specific
imap filtering options.
2020-09-23 17:55:06 +02:00
1564aa8176
mail: Add fzfmail script
`fzfmail` allows searching, previewing, displaying and tagging mail
through the fzf interface.
2020-09-23 17:55:06 +02:00
3bbb7d0360
mail: Add checkmail routine
Added script to call for checking mail. Will run individual pre- and
post-hooks. (By default, imapfilter and notmuch update.)

Simple options can be changed through environment variables:

Hooks can be set to different scripts with MBSYNC_PRE and
MBSYNC_POST, respectively.

Will also run mbsync repeatedly, until it exits without error. By
default it will try running it 3 times before giving up, this can be set
with MBSYNC_MAX_TRIES.

No functional imapfilters have been added yet.

mbsync and imapfilter both adhere to the XDG base directory layout
(somewhat), checking for their option files in .config/{isync,imapfilter}
respectively.

Everything still pending changes, the mail eco-system is hard to
wrap one's head around.
2020-09-23 17:55:05 +02:00
674b1cfeac
mail: Add aerc notmuch configuration 2020-09-23 17:55:05 +02:00
7871442bcd
mail: Initial commit 2020-09-23 17:55:05 +02:00
27728b07db
nvim: Update spellchecker 2020-09-23 17:54:13 +02:00
e5a48f1712
zathura: Add simple zathura configuration
Sets zathura to open itself with the recolored version of the pdf
instead of the usual (mostly white background/black lettering).
This works in concert with styler which will automatically set the
correct coloring in 'zathurarc' for the currently applied desktop theme.

Changes the copy mode to send anything copied to the clipboard instead
of primary selection, since I never use primary selection.

Adds a simple keymap to print a file (p) and makes it slightly harder to
accidentally rotate a file by moving rotate from r to s-r.
2020-09-23 17:14:08 +02:00
51e0d82ce9
i3: Remove i3 autostart package
The application autostart takes too long and is more intrusive than
anticipated. If I want to use qutebrowser, I can just start qutebrowser
on my and don't need to wait for i3 to do it for me --- especially since
the starting procedure takes a while and the application starts on the
wrong workspace anyways when it autostarts while I change desktops.

Spotify is not installed currently and throws an error each time, so
that is also not very useful.

An option for this to make a return might be as automatically starting
systemd services, which quickly switch to the correct workspace when the
application actually starts up -- but it is probably not worth the
hassle.

Lastly, this let's me get rid of a script in the i3 configuration
directory, which did not really belong there anyways with the XDG
distinction of 'configuration' and 'data'.
2020-09-23 16:51:02 +02:00
e015c4b5f1
Tiny fixes
Clarified naming scheme in sxhkd-chain-labels documentation.

Updated year for vim copyright shortcut.

Enabled automatic copying to clipboard by neovim for every yank action.
2020-09-22 22:34:50 +02:00
98cb2ba48c
git: Add basic git rebase quick-alias
Every so often, when doing rebases, you need quick access to the git
rebase command to do something like '--edit-todo' or similar.

Every time, I tried to do `grb` since I already use these quick
shortcuts for `grbm` rebasing onto master, and `grbi`, `grbc` to rebase
interactively or continue one in progress. The base version is thus a
natural extension of the more detailed implementations of rebasing.
2020-09-18 17:17:48 +02:00
df12199fdb
git: Add git pushall alias
`git pushall` (aliased to gpa) will push the current branch to each
connected remote of the repository.

So, if you have gitlab, github and keybase connected as remotes, it will
push to each one in return. As with the normal push command, you can
specify which branch to push ('master', 'develop', ..) after the
command, or use `--all` to push all branches at once.
2020-09-18 17:12:21 +02:00
b83929bcbd
services: Move flashfocus to systemd service
Removed manual initialization of flashfocus from xinitrc, enabled the
service in systemd.

Changed the restart timer to 5 seconds, to mirror other X-dependent user
services to circumvent systemd being too eager to start the service
before X is ready on booting.
2020-09-18 13:16:09 +02:00
441cd2ba36
qutebrowser: Fix ytdl link downloading
Fixed the download media (`<leader>dm`) option in qutebrowser to
download the link that is hinted and not the current page.

To download the current page, the keymapping remains the same as before
(`<leader>dM`).
2020-09-18 13:10:37 +02:00
1e3ce1dec7
an2linux: Enable both bluetooth and wifi server
Enabling both servers will allow more messages to get through, and it
does not really constrain the server resources too much.

an2linux should be clever enough to use *either* wifi or bluetooth in
mirroring the messages, depending on which one it finds connected to the
server/client.
2020-09-15 11:15:13 +02:00
bb892486e3
alacritty: Remove tmux integration
Removed autostarting of new tmux sessions for each new alacritty window.
The auto-closing and deluge of unnamed sessions did not help keep any
kind of organizational scheme, and lead to actual named sessions (like
notes, and dot) to perish under the mountain of sessions.
2020-09-15 11:13:32 +02:00
def968aefd
sxhkd: Switch to rofi-pass and pavolume invocation
Switched sxhkd shortcut from rofi-gopass to new rofi-pass
implementation.

Additionally switched from pulsemixer to pavolume for media key volume
control. Pulsemixer works well as a tui application, but its cli
implementation is unbearably slow (on my setup at the very least).

After pressing the volume up/down/mute key it could take up to 3 seconds
to take effect. With pavolume this change happens almost
instantaneously, and it displays a libnotify message on top (can be
disabled).
2020-09-12 17:54:19 +02:00
268f8543a2
qutebrowser: Add search engines, download open map
Switched default search engine for my personal searx engine.
Added search engine bangs for duckduckgo (ddg), man-pages (man),
alternativeto.net (alt).

Added key mapping to quickly open last downloaded file, especially
useful for downloaded pdf documents or similar files.
<leader>o will open the last file.
2020-09-12 17:51:37 +02:00
377ab6ea56
rofi: Format rofi-surfraw with shellcheck 2020-09-12 17:41:39 +02:00
34fca7670f
services: Lower restart time to 2 seconds
Main issue the restart delay fixes is that services don't wait for X to
be ready on startup (which is bad if the application being started
requires X being ready to actually work.)

I have still not found a way to work around waiting for X being ready
other then the ugly delay hack (for systemd --user modules at least).

However, the delay can be --- in most cases --- smaller than 5 seconds.
All my machines start reasonably fast and have X up and running from
pressing login to staring at the wallpaper in a couple seconds at most.

If services don't start correctly and the error is X not being ready,
increase the startup delay once again.
2020-09-12 17:37:43 +02:00