Commit Graph

50 Commits

Author SHA1 Message Date
Marty Oehme 4dadcd5f9f
scripts: Refactor py script
Made detection and setup a little more stable, will still have its kinks since
it is rather hastily put together but should work for detecting kernels,
invoking the right python repl and letting you set it manually with `py -c`.
2023-12-12 12:23:21 +01:00
Marty Oehme 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
Marty Oehme c4809c78f7
vidl: Use new default video location 2023-10-02 19:14:50 +02:00
Marty Oehme 1efe13cb94
office: Update displayed symbols 2023-07-21 20:16:17 +02:00
Marty Oehme 72af217e8c
vidl: Enable automatic chapter embedding 2023-05-23 15:52:48 +02:00
Marty Oehme bf8d6fb8a3
scripts: Update README
Updated readme a little for the new, changed and remaining scripts in
the module.
2023-01-13 00:05:40 +01:00
Marty Oehme d09584e690
scripts: Remove compile script
Never used the compile script for years now, and I neither see that
changing nor the files being of any use anymore. They were something I
whipped up when I first started getting into Linux and bash scripting
(and as such a little nostalgic I suppose) but nothing that has actual
purpose anymore.
2023-01-13 00:04:21 +01:00
Marty Oehme 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
Marty Oehme 01445aa3ed
lockscreen: Update script for new waylock version 2023-01-07 16:46:09 +01:00
Marty Oehme cb0605971d
scripts: Add wallcrop.sh
Added hacky script to quickly cut apart dual-screen wallpapers.
I run two 1920x1080 screens side-by-side, so I just cut double wide
wallpapers in two and display one on each screen.

Script is very inflexible on probably not too useful for the future but
it works for its purposes now.
2023-01-07 14:50:34 +01:00
Marty Oehme 6bc582f67a
scripts: Add hibernation to powermenu
Powermenu now correctly sets pc to suspend on the suspend action, and
adds a new option hibernate which takes over the hibernation action.

Additionally, suspend action sets the pc to 'suspend-then-hibernate'
mode which means on low battery laptops will automatically switch to
hibernation. (For now, pending additional PR we can also hibernate after
certain time, see https://github.com/systemd/systemd/pull/25374 and
https://teddit.net/r/archlinux/comments/zczdnq/systemctl_suspendthenhibernate_not_working_anymore/
for longer explanation)
2022-12-19 16:57:46 +01:00
Marty Oehme 4c540496dd
scripts: Fix vidl temporary directory
Lets vidl download to a temporary directory first (by default
~/downloads can be changed through "$TEMP_FOLDER") before moving
downloaded files to target directory as last step.

Massively increases download speed if final directory is on a slow HDD
or a network drive (since otherwise ffmpeg is computing on these slow
devices themselves).
2022-12-19 16:55:22 +01:00
Marty Oehme cb698090c6
scripts: Fix nsxiv-rifle to work with symlinks 2022-10-08 17:54:24 +02:00
Marty Oehme 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
Marty Oehme a08f2daafe
river: Add translation widget mapping
Added quick way to translate from anywhere with the Mod+Shift+T mapping.
Will open a bemenu window into which text to be translated can be input
(as well as any translation options) and will return in another bemenu
window. From there, selected text can be put on the clipboard for easy
pasting.

Internally uses a simple wrapper script for translate-shell on which the
translation is based.

Closes #12.
2022-05-02 16:08:30 +02:00
Marty Oehme 50a5b23aab
scripts: Add queue to vidl
Added queuing to vidl downloader - will collect newly added files to
download to a queue.
(by default in ($XDG_DATA_HOME/ or ~/.local/share)/vidl/vidl_queue)

The queue of links can be interacted with like any other file.

When vidl is already running it keeps a lock-file active in .cache
directory so only one instance of vidl can ever be running
simultaneously.
2022-04-11 12:48:21 +02:00
Marty Oehme 3e00e84319
scripts: Add queue functionality to vidl
When adding new links to vidl, it will now put them in a queue (file)
from which it then begins downloading links one after the other. Only
one downloading instance of vidl will ever be running, but you can still
add more links by invoking it again while it is.

Added one new command line option `-c` to quickly empty the queue and
start over.

Fixes #8.
2022-03-15 11:54:32 +01:00
Marty Oehme 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
Marty Oehme 60ae405790
scripts: Add custom ytdl options for vidl
Allow setting custom ytdl options for the vidl video downloader.
Can be set through $YT_DL_OPTS environment option.
2021-12-11 11:17:58 +01:00
Marty Oehme 9f1fe95662
scripts: Added vidl and archive scripts
Added script for downloading videos with ytdl or any of its derivatives.
The script is adapted from one in my rapberry pi setup which serves
videos remotely, and makes some hardcoded assumptions that might not be
the best for all situations.

Added archive script which takes a file and puts a hardlink to it into
an arbitrary archival folder. This means even if the original file is
deleted its data stays on disk because of its hardlinked archive
version.
2021-12-06 10:47:17 +01:00
Marty Oehme 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
Marty Oehme 496522605f
X: Improve lockscreen handling
Added lockscreen trapping and media pausing for lockscreen.
When it is invoked `lockscreen`, all media will be attempted to be pause
and the system will be muted.
Then the lockscreen is engaged.
This should happen automatically when the screen shuts off or the system
suspends or hibernates and can be invoked manually, as before, with
super+x shortcut.
2021-07-28 14:41:02 +02:00
Marty Oehme 226c4b5f0d
scripts: Remove bar animations from vol/brightness
Removed the ascii-art bar animations calculated for e.g. dunst
notifications for the controls of brightness and volume.

The dunst notifications finally have a working bar slider built into
them when invoked with the correct stack option.
2021-06-02 23:30:47 +02:00
Marty Oehme 4a203cf657
vifm: Fix vifmrun script argument parsing
Fixed invocations of vifm only passing through the first commandline
option, now passes through everything correctly.
Also fixed silencing of the stderr, stdout redirection.
2021-04-21 11:09:33 +02:00
Marty Oehme 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
Marty Oehme 864ec3d03b
scripts: Fix nomie static analysis linting
Fixed linting in nomie environmental variable key command
2021-04-04 12:22:34 +02:00
Marty Oehme 8fd025653a
scripts: Improve nomie credentials options
Added option to input nomie api key either directly as an environment
variable, or to pass a command (also through env var) to nomie which it
will call to get the api key.

So, if you have e.g. pass as password manager running, you can just do
`NOMIE_API_KEY_CMD="pass show path/to/key/file"` and it will use the
returned credentials.
2021-03-30 22:21:42 +02:00
Marty Oehme 59a2d5084a
scripts: Fix unmuting in control-volume amixer
amixer mutes all individual output streams when it mutes (master,
speaker, headphone) but only unmutes master by default.
This is a simple fix to unmute everything when we do.
2021-03-19 09:12:15 +01:00
Marty Oehme 5ce6111f51
scripts: Add unified volume bars to control scripts
`control-brightness` and `control-volume` both now have the exact same
progress bar indicator.
Additionally, by using the same dunst 'stack' they replace each other if
invoked in quick succession, which I really like.
2021-03-17 15:06:02 +01:00
Marty Oehme bab92816d0
scripts: Switch to own volume script
`pavolume` was nice, but my own volume script is just more flexible. No
real changes yet, but includes notification through dunst and works the
same way as `control-brightness` script does, just invoked through
`control-volume`.
2021-03-17 14:19:28 +01:00
Marty Oehme 3763c7e581
wallr: Add direct article selection option
Added `-a` option which can be supplied with an article id that wallr
will open directly.

Article ids can take the absolute form of e.g. `-a 1048` opening article
with id 1048.
They can also take the relative form of e.g. `-a +2` which will open the
third-to-last entry in wallabag, i.e. count backwards from newest.
That means you can use `-a +0` for example to always directly open the
newest entry.
2021-03-16 10:25:05 +01:00
Marty Oehme c12eed218f
scripts: Rename reader, Fix listing, Add sxhkd bind
Renamed general reader script to `wallr`, indicating wallabag as the
underlying reader input.
Fixed listing of unread articles which showed read articles before.

Added shortcuts to sxhkd's academia mode:
the existing `r` invokes wallr with unread article display;
newly added `shift+r` invokes wallr with all articles displayed.
2021-03-08 09:14:33 +01:00
Marty Oehme 5ca27e5fd5
scripts: Add script to read wallabag articles
Added script to easily read wallabag articles on the command line (or
open them in browser), using the wallabag-cli python program in the
background.

Once invoked, will fetch a list of articles (optionally restricted to
read/unread/starred), and allow a choice through fzf.

Will then display the article in the user's preferred pager, editor, or
browser.

Can be invoked through the shell via `reader`, or through sxhkd shortcut
`r` from 'academia' mode (`alt + a`).
2021-03-05 17:07:11 +01:00
Marty Oehme a69cc0a517
scripts: Add file upload script
Uses 0x0.st as a file host for quick uploading and sharing from the
commandline.

Use `sharefile` and select a file with `fzf`.
2021-03-05 13:57:25 +01:00
Marty Oehme 8cb3252cf1
sh: Switch yay to paru
Removed outdated `syu` symlink which just hooks into topgrade.
Replaced it with simple function that tries for topgrade, paru, yay,
pacman, in that order. Can still be invoked with simple `syu` command,
but *only* through interactive terminal use.

Switched git pre-commit hook to default to paru instead of yay when
compiling installed package lists for dotfile commits.
2020-12-22 19:54:38 +01:00
Marty Oehme d2e44d330d
dunst: Add brightness level notifications
Added notifications on changing brightness, will stack by default to
show the current level before disappearing.

The script to change and notify can be run through the command
`control-brightness`, and is bound to the sxhkd media key shortcuts for
brightness changes.

Removed the brightness indicator from polybar since it should be easy
enough to check current brightness by doing a quick higher-lower and
that's it.

Kept the module in polybar configuration script since I might reconsider
its removal if it turns out to have been useful.
2020-12-21 22:55:52 +01:00
Marty Oehme a0bb818643
scripts: Add simple readme
Added readme file explaining the ethereal nature of this module.
2020-10-28 21:23:26 +01:00
Marty Oehme c2f3e38e82
scripts: Add nomie script
nomie script allows me to quickly journal to my habit tracking app from
the commandline.
2020-10-28 21:23:14 +01:00
Marty Oehme 0c8ea5275b [mpv] Add quality limit to browser streams
Sending links to mpv limits the quality to 1080p, to be able to stream
it with my connection, and since I can not display more.

Fixed mpv taking ages to open for ytdl streams. (or anything else which
takes a while to load)
Mpv had to wait until it had enough buffer to begin playing and only
then would open its main window. With this fix it immediately opens the
window, and starts playing whenever it is ready.
2020-05-13 06:02:49 +00:00
Marty Oehme a110acbdbf
[script] Add simple benchmark script
`benchmark` can be invoked with an executable file after it. It will
output the running time in milliseconds. Depends on gnu date being
installed on the system.
2020-05-08 11:39:06 +02:00
Marty Oehme 3f1443c546
[sh] Remove dimswitch tests
Removed dimswitch, kept its tests. That will work well.
2020-02-23 23:02:36 +01:00
Marty Oehme 393dd4e042
[sh] Remove dimswitch,clean homedir,improve exist
Removed dimswitch script. I liked it but it has been utterly superseded
by styler; if wanting to switch light and dark I can just switch to
light or dark base16 theme and do not have to rely on alacritty config
file hacking through dimswitch (well, now just through styler, yay.)

exist script will print message to stdout even if it prints to notify,
this makes more sense since now passing a loudness factor just adds it
to the message, instead of replacing printed message with libnotify.

Added stow ignores to top-level files. Not entirely sure if it is
needed, but they were linked on my system and the change shouldn't hurt.
2020-02-23 22:39:51 +01:00
Marty Oehme b76b3ca4ca
Fix compile script
Fixed compile script to not use ifinstalled anymore.

HACK Fixed compile script to correctly pass through output targets to
RMarkdown, through the implementation is very rough currently.
It will look for additional arguments passed through and run RMarkdown
rendering once for each target. It would presumably be faster (and at
the very least more elegant) to pass all arguments through at once, but
I am not sure how to pass arguments through shell surrounded with
quotes.
2020-02-08 20:26:31 +01:00
Marty Oehme 145548c01a
Change ifinstalled script to exist
Renamed ifinstalled to exist, moved it into base shell module. It can be
called with just a command name to check for, or with an additional
libnotify urgency level (low, normal, critical).

If called with an urgency as the second argument, the user will be
notified of the missing command with the corresponding urgency.
2020-02-08 20:23:30 +01:00
Marty Oehme 97f7fcbbd6
Move scripts into respective directories
Having a general script folder makes little sense if the scripts are
targeted to specific applications. This commit moved every script that
solely, or mainly (like ueberzug), targets a single application into
that respective stow module.
2020-02-08 20:17:44 +01:00
Marty Oehme f5eddfdab2 Fix tmux_attach_start unit tests 2020-02-04 15:23:47 +01:00
Marty Oehme 6b79eeef5d Refactor vim compile functions 2020-02-03 22:15:01 +01:00
Marty Oehme 92376839a4 Add tmux fzf session chooser
Added tmux session chooser. Aliased to `tm`, calling `tmux_attach_start`
(the original tm script).

When called without arguments displays a fzf list of currently running
tmux sessions, with a preview to their respective open panes. A session
can be chosen in fzf which tmux will attach itself to. When creating a
query in fzf which does not have a valid target and confirming, tmux
will automatically create that session and attach itself to it.

When called with an argument, tmux will attach itself or create a
session of the same name. If called with the name of a session file, as
before, tmux will automatically execute that session file and attach
itself to it.
2020-02-02 23:44:23 +01:00
Marty Oehme e791340b19 Flatten script file hierarchy
Scripts would not be added to path otherwise
2020-01-04 12:19:39 +01:00
Marty Oehme d34cecb27e Switch to GNU stow 2019-12-29 23:12:13 +01:00