Commit graph

82 commits

Author SHA1 Message Date
7eeeb9e85d
sh: Add clear and rerun function
Added simple function to clear the screen but additionally re-run the
last executed command.

Mirroring my clear screen alias `cl`, this one is executed with `cll`
(clear-and-last) currently.

It comes in useful for me every now and again because I sometimes just
need a quick way to get rid of 'clutter' on my terminal (e.g. running
multiple rg invocations after each other, or diffs, or anything that
spews a bunch of stuff on screen and I want to find specific things
afterwards).
I am very used to running `cl` and then the second to last history item.
This makes those additional keystrokes unnecessary.
2024-06-05 12:10:26 +02:00
54f553f75c
sh: Prefer vimiv as image viewer for iv alias
Simply prefer vimiv over other potential image viewers installed.
2024-05-28 21:34:00 +02:00
22b70a0639
nvim: Enter notes dir when calling zettel index
When switching the current buffer to the Zettelkasten index page
(`<leader>ni`), we now also switch the working directory to the
corresponding notes directory.
2024-02-05 15:07:22 +01:00
c487da69a8
nvim: Add molten and image.nvim plugins
Image nvim works mostly well (slow on wezterm but that will always be the case
with kitty protocol for now as far as I know).
Would love to be able to toggle images on/off dynamically but I don't see a
way to accomplish that now. (or really, get to any option of the plugin).

Molten itself also works well - the output is displayed more nicely than for
the Magma plugins and everything continues working mostly well (or rather,
just as wonky as I had it set up on my older magma install :)

For now, the molten - image.nvim integration seems to not work at all -
it simply errors out when it would produce an image as output. No clue why
and it also complains about the wrong image provider (which I have taken from
the molten readme). No time to bugfix now but maybe at some point.

To do - find a much better way of installing the image.nvim required
luarock magick - done manually with hardcoded path in setup now

Also extended the old `py` alias to a full-blown script which will in
addition to detecting the python repl also find any running molten
session for the current directory (i.e. any running jupy kernel) and let
the user choose the right one if there is multiple. Will then default to
starting a kernel-aware repl environment (euporia or jupyter-console).

Added a very simple `-c` option which lets you choose python command to
run manually.
2023-12-12 12:07:41 +01:00
4cc03a611a
sh: Add default open script
Simple wrapper for xdg-open functionality. Simply refers
to xdg-open except if there exists mimeo on the system
which it will refer to instead.

So, a simple preference modificator for mimeo over
xdg-open since that is my preference too.

Also gave it a short name so I can do open whenever I
want and don't have to tax my left hand with tying xdg.
2023-12-04 08:26:59 +01:00
558b0fa479
sh: Enable FRX options for less by default
Since we generally want color in our less output, and
no paging if there is only one page we can should be
able to enable these regardless of situation.
2023-10-05 18:25:57 +02:00
0a5d62909b
sh: Switch timg qr function to use viu
Since we switched to viu, we should also have qr
make use of it. Renamed the function to
qrurl to make its purpose clearer (sending
a simple file location/string/url via qr code)
and to distinguish it from programs like qrcp
which actually start a server and send a file
through qr.
2023-10-03 13:03:05 +02:00
7ccd7e4757
vifm: Fancy markdown display with glow or bat
For anything markdown or that gets displayed as markdown
(e.g. docx files) in the vifm preview, we now use glow
or bat to display a nicely styled and colored version.

For glow I added a script which tries to detect the
current terminal background between dark/light to
correctly set the color scheme.
2023-10-03 13:01:29 +02:00
102cdbca1c
writing: Replace zathura with sioyek
Replaced or extended all default references to zathura with
sioyek so it will automatically take on any tasks meant
for pdf reading. With the current configuration, hardly a
change should be noticed.
2023-10-02 14:08:04 +02:00
334f3032e8
terminal: Exchange fasd for zoxide
fasd is unmaintained and slower than zoxide. The transferral
was painless. I imported my old database and can continue as
before. It does not care about files but that is completely
fine for me. Same `z` invocation as before. Has the
'interactive' mode on `zi` which is also completely fine.
2023-09-28 14:41:33 +02:00
dd133aa85b
sh: Change PATH local binary order
Prepend local binary directory to path instead of appending.
In effect makes user-local binaries overwrite system-wide
binaries.
2023-08-31 12:25:01 +02:00
112d6d8fa9
sh: Remove auto-creation of xdg directories
Removed the test-if-it-exists create-if-not cycle of manual xdg
intervention on every shell startup since it created mostly nothing but
problems so far.

It especially gets in the way of creating network filesystem mappings in
the home folder with hangups, freezes, and blocking automounts whenever
a new shell session is opened.
2023-08-07 10:48:52 +02:00
9669b061a3
sh: Add alias for vim notes
Added alias that directly opens my vim notes index.
Will only work with my own zettelkasten plugin,
however.
2023-07-23 19:25:43 +02:00
c8eb9fdb4c
sh: Fix quoting 2023-07-23 19:24:42 +02:00
88ab8c10a6
sh: Simple pseudo-fix for missing xdg symlink
HACK - it does not reconnect the symlink correctly if its target indeed
returns to the system.
2023-03-03 12:55:08 +01:00
e5b3f029b2
sh: Add tidy-viewer alias tv
Added alias tv which displays a csv(/tsv..) file piped into the pager so
it can have any dimensions and be scrolled through.
2023-02-11 17:29:59 +01:00
beb2c7531a
sh: Move main library bibfile to library root
With the switch from jabref/zotero/pubs to papis for library management,
We can now also have nested libraries. This allows me to have 'themed'
libraries in different sub-folders (e.g. one for my academic study, one
for my old university readings, one for computer science, and so on) and
still keep referring to their containing folder as a 'main'
comprehensive library.

As such I moved the library bibtex file into the main library folder and
let it be created from all sub-libraries.
2023-02-11 17:29:49 +01:00
9f5bca4a62
sh: Move gopath to cache
Moved the location of the gopath environment variable to point to the
user's cache to it can be cleaned more easily when cleaning cache and
also does not litter the project directory.
2023-01-31 10:15:10 +01:00
d4bbf7b573
sh: Greatly simplify ssh agent configuration
Whereas before there was a giant script (which worked well enough)
looking for and activating necessary ssh agents, all of it has been
replaced with a single invocation of the gpg-agent - which I have turned
into an ssh-enabled agent through its configuration file.

That means, first: I can massively simplify the looking for ssh agents
and since I am using fixed credentials (private keys supplied through
ssh host configurations) for most servers anyway it should not disrupt
my workflow and, second: I can use my private gpg key to log in to
servers if I set it up correctly.
2023-01-31 10:02:44 +01:00
9cd5fe3f99
sh: Add simple sc-im alias
Added `sc` as alias for sc-im since typing the dash every time is
cumbersome.
2023-01-16 22:01:07 +01:00
274cc8026a
sh: Add distrobox alias and enable displaying host
Add a simple alias to quickly use distrobox with `db` alias, and modify
pure prompt initialization slightly so that it displays a hostname when
in a distrobox container (akin to operating from ssh or normal container
usage).

HACKY implementation makes use of both an internal pure prompt api
(see here https://github.com/sindresorhus/pure/issues/585)
and a distrobox env var that I am not sure how exposed it is either.
Powerlevel10k uses a similar method though, so maybe it is fine
(see here 33916e91a7/internal/p10k.zsh (L8336)).
2023-01-10 16:55:25 +01:00
8912a09a39
scripts: Change nxsiv-rifle to uoeia
I rewrote and extended the nsxiv-rifle script recently, and this change
now: removes the old script, adds the new one as a submodule into the
repository and links a working binary into the path.

The new script is essentially still just an image grabber-and-opener,
but supports more image viewers, is a little more advanced and can for
example replace arbitrary parts of urls (and is documented a little more
nicely).

Make qutebrowser use new script and remove leftover references to
nsxiv-rifle. Qutebrowser also gets a third option of viewing images, now
there are:

,i -> open selected link in imageviewer
,I -> open current page in imageviewer
,<C-i> -> open selected image in imageviewer
2023-01-08 21:05:16 +01:00
4f75888dfe
sh: Remove docker xdg configuration
Podman rebels if it finds an explicitly set DOCKER_CONFIG file pointing
to a non-existent (due to using podman) configuration file. Since we are
not using docker anyway, this removes the env var.
2023-01-07 14:56:09 +01:00
5d2ed8174c
sh: Add hidden file inclusive ls tree view 2023-01-07 14:54:55 +01:00
3ece309f67
sh: Add imv to iv image alias 2023-01-07 14:54:32 +01:00
2e6c1026fb
sh: Ensure environment editor is available
When setting the environment variable EDITOR in the shell, ensure that
the editor being set is actually available: It first tries nvim, then
falls back to micro, then nano (one of which really every distribution
should have).
2022-12-20 23:05:20 +01:00
c6f243c2c1
sh: Fix missing python configuration
Python complains if you point it to a different configuration file (as
we do with the changes to XDG directories) but it doesn't exist. So, we
simply check for its existence and create it if necessary when setting
up an environment.
2022-12-08 21:34:40 +01:00
cf7d890787
sh: Add timg aliases
Added shell aliases for 'image listings' which aims to mimic the `ls`
command in a very simple way.

Invoke it via `il` to display a grid of all images residing in current
directory. Images are being detected not by their extension but by
running a `file` operation on, so in very large directories this might
take a little (though, your terminal will probably buckle under the
weight of displaying thousands of images anyway, so use with care).

`IL` provides the same functionality but recurses into an arbitrary
amount of subdirectories. Very useful to get an overview of a certain
directory and its children but, again, think for a second before using
since this could easily spew thousands of pictures into your term.
2022-11-25 17:02:48 +01:00
fdc85e5569
sh: Replace kitty invocations with wezterm 2022-11-25 17:02:48 +01:00
179840e4c0
sh: Add vim personal knowledge base alias
Added alias `vw` to open the index page of my PKB (essentially the start
page of my wiki) using my zettelkasten.nvim plugin.
2022-08-10 09:01:09 +02:00
aa47068fd0
scripts: Add nsxiv-rifle script
Opens basically any path, local or remote in nsxiv.
Can take multiple paths to open all of them.

Additionally, alias whichever version of the image viewer is available
on the system as `iv`, using `nsxiv-rifle`, `nsxiv`, `sxiv` in order of
preference.
2022-08-06 22:12:00 +02:00
03ec445076
sh: Fix XDG directory use for an array of apps 2022-06-28 11:30:46 +02:00
e25ce19719
sh: Add new XDG_STATE_HOME env var from spec
The XDG BASE DIRECTORY spec now includes a provision for 'state' stuff,
that does not quite fit into either the permanent nature of
XDG_DATA_HOME, nor into the impermanence and deletable nature of
XDG_CACHE_HOME - i.e. longer running logs or history files. Things you
don't necessarily need backed up at all times, but things that should
also not change every time the tmpfs is flushed, should you run your
.cache directory under one.

More here: https://teddit.net/r/linux/comments/ny34vs/new_xdg_state_home_in_xdg_base_directory_spec/
and here: https://wiki.debian.org/XDGBaseDirectorySpecification#state
2022-06-28 10:21:14 +02:00
6c20ac04b1
sh: Group directories first in ls views
Switch ls (exa) views to group any folders in current view and display
them before any files (works for l, L, ll, LL).
2022-06-13 17:50:36 +02:00
95e2fea951
nvim: Disable uninstalled python language servers
Had to manually disable python lsps that are not on my system since
neovim otherwise complains about it whenever I enter a new python
filetype file.
2022-04-30 21:00:05 +02:00
72c0a5d5f2
sh: Add short py alias for repl
Added `py` alias for any of `ptipython`, `ipython`, `python` found in
that order.
If python is not installed, will not create the alias.
2022-04-11 12:52:19 +02:00
94cd954df9
sh: Reintegrate clip script
Brought back an old universal clipping script and updated it to work
better - well, at all. Can now decide between wl-copy, xclip and xsel
and will do so in that order.
Can take clipping material from the following arguments (will clip any
and all following arguments) or from stdin. Stdin has precedence.
Not much more to say really, but makes writing other applications a bit
more universal when they rely on this universal little tool.
2022-02-11 21:32:16 +01:00
3cee46358e
sh: Add serve alias to create a quick file server
Quickly put up a file server in the current directory by typing `serve`
and the rest is figured out automatically.

Makes use of `sfz`, `gossa`, `rossa` in that order to set up the file
server.
2022-01-30 11:41:00 +01:00
a27d86942b
sh: Use exist program
Fix sh module packages to make more extensive use of the exist program
that also ships with the sh module.
Simplifies intent of the code and makes it much easier to read.
2022-01-30 11:37:18 +01:00
5ee71ae705
sh: Fix graphical session start for ssh sessions
The autostart function would accidentally start multiple new graphical
sessions in one terminal when connected to the machine over sshd.

This should fix multiple starts while keeping the old functionality and
speed of checking intact.
2022-01-28 10:15:47 +01:00
6fabac6cd8
kitty: Switch to kitty terminal emulator
Finally made the switch from alacritty to kitty. I have been thinking
about this for a while. Both, fundamentally, serve my purposes just
fine. Both are fast, customizable, gpu accelerated, and so on.
Kitty feels a little faster on the input, but this should not provide
major differences.

One big difference, however, is now very apparent and I can feel it:
Alacritty, on wayland, does not support any picture preview. It does not
support sixel, and things like w3mimg or ueberzug are based on and
require X11 to run.
Kitty brings its own graphics display library and it seems both pretty
stable and fast.
I have not done much more with it than use it in things like vifm image
previews but it should be much more stable than things like ueberzug,
much faster than things like sixel. Time will tell.

Switched other modules to make use of kitty instead of alacritty:
vifm uses kitty previews,
river spawns kitty instances,
systemd units use kitty instances,
waybar presents extra mouse-click interactions through kitty,
and styler contains a processor to style kitty permanently.

I would love to converge this all a bit more on the `$TERMINAL` env var,
but this is unfortunately difficult for things like systemd and waybar.
For waybar I currently see no real way except for a custom
`ideal-terminal` script which just goes down the list of terminal
emulators I want to run, depending on which is installed,
since it does not read env vars,
while for systemd it might be feasible to import user environment
variables,
but also connected to additional complexity and overhead which it does
not seem worth for the currently two simple service units it affects.

Also removed some obsolete sxhkd and sh settings from the move to
wayland.
2022-01-16 15:18:07 +01:00
0d40c1bf67
sh: Add missing vim aliases
Added some simple aliases that were missing from the vi → vim → neovim
chain.
Can be useful for the odd moment when one does not know which exact vim
is installed.
2022-01-11 17:27:28 +01:00
6ac552d3d5
Switch to wayland
Added a simple wayland configuration.
Currently set up simple wayland configuration based on river window
manager and waybar.
Rivercarro is the layout manager, being the same in principle as rivertile,
the default layout manager for river, only it comes with smart gaps
(gaps turn off if there is only one window open)
and monocle mode (give one window all space).

Runs `keyd` in the background to replace the old `xcape` capslock switching
(capslock is escape and if held control).
Uses `swaybg` to set a wallpaper.

Added powermenu and lockscreen scripts.
Improved lockscreen script to detect and work for wayland.
Moved old rofi mode 'powermenu' to more general powermenu script,
which works with any rofi-like selector (dmenu, bemenu, wofi, etc.)
Loses some of its design quality but since it was wonky anyway,
and I rarely see the menu,
we could repurpose its functionality for a more general powermenu
concept.
Currently hardcoded for `bemenu` but can be easily swapped and possibly
even extended back to rofi.
Fixed file upload link sharing to clipboard.

Updated rofi-pass to pass-pick.
Made rofi-pass universal and less integrated to rofi - that's also the
reason for the name change.
`pass-pick` works with rofi (default), bemenu or dmenu. In theory it
should also work with any other picker that contains a stdin listing
function similar to dmenu.
It has been definitely tested both on rofi and bemenu.
The best user experience still reigns on rofi, where available keys are
displayed on the picker and the keys themselves make the most sense.
But all functions can be reached from bemenu as well, though the key
mappings are more arbitrary and can not be changed as in rofi.
The autofilling tool works with both xdotool and ydotool, so should work
both on X11 and on Wayland. Ydotool ideally requires its daemon to be
running, otherwise some of the typing may get gut off. Otherwise no
change should be necessary.

Updated qutebrowser open_download for bemenu.
Updated download opening script to work with both rofi and bemenu.
Prefers original rofi implementation but works with both, and can be set
to use a custom dmenu-like file picker as well.

Add brightnessctl and removed custom audio / brightness scripts since they
became unnecessary.

Updated bootstrap script to include system files:
With `keyd` taking its configuration from the `/etc` directory and not
home, a second stow stage was necessary. These stow files are in a
module called `system-packages` inside the top-level `bootstrap` stow
package.
They will not be installed by the default dotfile stow invocation but
have been integrated as an extra step into the install script.
Installing this module requires sudo privileges!

Switched vifm überzug to sixel graphics rendering.
überzug relies on X11 functionality to work, while sixel does not.
Unfortunately, alacritty does not work with sixel graphics yet, only
foot does (somewhat).

Waybar currently runs the gruvbox dark soft color scheme.
Added the old polybar archupdates script to waybar and extended it to
output json format with additional metadata that waybar can read.
Can still output the old plaintext format that polybar expects.
Added a wireguard connection to waybar,shows if currently
connected to either a wireguard or tun VPN service.
If so, shows an icon in the waybar - that can be hovered over to show
the full assigned IP address.
Added an upcoming event display to waybar,
a simple event indicator to show upcoming events on the calendar, on
hovering over it the tooltip lists all upcoming events.

Added `screenshot` script to take simple screenshots and
rectangle region shots of the current output.
Can be invoked through the river shortcut PrintScr:
`PrintScr` - Fullscreen screenshot
`Mod+PrintScr` - Region screenshot
`Shift+PrintScr` - Fullscreen screenshot and file upload
`Mod+Shift+PrintScr` - Region screenshot and file upload

Extended `sharefile` to take paths through stdin and make
use of `fd` if it is found on the system.
2021-11-30 22:30:07 +01:00
cf85357f5c
sh: Add minimum version checker
Added another building block program. This program will be required
going forward in other modules. `version_at_least` takes two version
numbers and returns true if the second is higher than the first.

That means primarily it is useful to check if a program fulfills a
minimum required version, e.g.: `version_at_least 2.1 $(my_program -v)`.
Will be primarily useful for git version checking in the near future.

It has a second possibility of checking for ordered version numbers
passed in but this is of less use. Check source for more information.
2021-11-23 10:30:57 +01:00
e617d4ae1e
xdg: Reorder xdg home directories slightly
Moved pictures and videos back to home directory since they are, first,
not part of a 'media' collection and, second, on a different share to
my personal media assortment.
2021-11-16 12:09:46 +01:00
3bf5becbe2
sh: Add internet-check base script
Added script to sh base package to allow checking for internet
connectivity. Checks both through system virtual filesystem and, as a
fallback, through pinging google dns.

Added a simple readme to sh module.
2021-09-24 11:16:29 +02:00
31a2c283df
fasd: Fix directory display to work on all shells
Fixed printing of ingested directories to use printf which works on all
shells instead of zsh specific print.
2021-07-07 10:28:15 +02:00
0b2c6c9b4b
bibtex: Fix default pandoc compilation target
Moved previous default (paper) compilation target for pandoc to its own
file (paper.latex) and saved the current default as a backup file.

This should fix some issues with compilation to PDF, especially with
vertical spacing and quotes which would fail intermittently otherwise.
2021-06-02 23:23:16 +02:00
c9c0490cbf
xdg: Move xdg media directories
Moved all directories with media contents (pictures, videos, music) to a
single coherent media directory.
2021-04-18 13:04:59 +02:00
0d978f7673
sh: Update xdg directory auto creation
Improved the automatic directory creation somewhat:
It now looks for either a file existing there (could be a directory,
could be an actual file), or a symbolic link pointing somewhere else.

Only if none of those things are at the xdg location will it try to
create a new directory there.

Additionally, it will set the correct permissions for the whole folder
chain being created, NOT just for the last folder in the chain.

vifm: Switch to new xdg directory structure
2021-04-18 13:04:01 +02:00