Compare commits

..

17 Commits

Author SHA1 Message Date
Marty Oehme bcb59b93de
[bibtex] Fix README
Adding ever so important information and admonishments to the readme.
2020-05-16 19:02:39 +02:00
Marty Oehme 113dc50b32
[bibtex] Update README
Updated readme to reflect new filtering options, and highlight the
script's brittle nature again.
2020-05-16 18:52:06 +02:00
Marty Oehme e55f3a067d
[bibtex] Add priority filtering to bib-due
Can filter by priority using `-p` option, script will then go down the
list and display only paper of this priority or higher.

For example priority 3 will display 3,2,1 but not those without;
priority 1 will only display 1
2020-05-16 18:39:06 +02:00
Marty Oehme b4c8030ce8
[polybar] Use bib-due date filter
Utilize the date filter option to display upcoming readings until the
end of the week and no further. Needs gnu date utility.
2020-05-16 17:35:40 +02:00
Marty Oehme c0d88e338a
[bibtex] Fix rofi-bib-due display options
Fixed displaying urgent and non-urgent items. Fixed passing along of
date filters and other options. Fixed using correct library pdf
directory (still hardcoded to pdf subdirectory of $BIBFILE).
2020-05-16 17:35:40 +02:00
Marty Oehme 5ceb05bbce
[bibtex] Add bib-due script filter options
Added options to bib-due script to pass input file (-i filename.bib), to
display simple help (-h), to specify which field to filter by (-l
fieldname), to specify which values to retain (-r
'values|in|regex|groups'), until which date to show (-u 2020-05-13).

Parsing remains brittle, which makes -l and -r not very useful as of
now; the parser would just get confused with different fields being
present.
2020-05-16 17:35:40 +02:00
Marty Oehme 62f4fa2f77
[bibtex] Add README for module 2020-05-16 17:35:40 +02:00
Marty Oehme f8056ed25a
[bibtex] Add rofi theme
Added theme to rofi making use of dropdown possibility. Will create a
window spanning whole page (or less, depending on how many lines dmenu
command passes on), and dynamically resizing to number of items.
2020-05-16 17:35:40 +02:00
Marty Oehme dba4877983
[polybar] Update module README
Slight updates to readme, fixing image link, pointing main readme to the
right location, rewording bib dependencies.
2020-05-16 17:35:39 +02:00
Marty Oehme 1d80d988b7
[bibtex] Use rofi to show bib-due files 2020-05-16 17:35:39 +02:00
Marty Oehme d4774b165c
[bibtex] Refactor bib-due script
Updated script is a little more resilient, and can be used to filter by
and catch various fields, controlled with a static variable at the top
of the file for now. Still brittle, and breaks easily on bibtex file
changes.
2020-05-16 17:35:39 +02:00
Marty Oehme 9202882797
[polybar] Add module readme 2020-05-16 17:35:39 +02:00
Marty Oehme 9e5abca853
[polybar] Remove bc dependency for package module
Removed dependency on bc to do simple addition.
2020-05-16 17:35:38 +02:00
Marty Oehme f6517df5a2
[polybar] Refactor music display module
Refactored music module to use a constant tail output of the underlying
script, to enable mode-switching, and to allow playing or pausing the
current song.
2020-05-16 17:35:38 +02:00
Marty Oehme 3872eca254
[polybar] Add onclick dropdown of papers due
On clicking the papers due module will show the bibtex keys of the
papers that are due, as well as their date and priority.
2020-05-16 17:35:38 +02:00
Marty Oehme 552d120856
[polybar] Add due papers display
Added simple numerical display for papers that are upcoming and due.
Will display ALL due papers, and not distinguish between soon / at some
point yet. Can not yet be interacted with.
2020-05-16 17:35:38 +02:00
Marty Oehme 4681156a89
[script] Add simple due script for bibtex file
Scrapes a bibtex file for 'due' field, and outputs all found entries
with their priority and sorted for date.
2020-05-16 17:35:34 +02:00
430 changed files with 52882 additions and 27302 deletions

View File

@ -0,0 +1 @@
^/.* # everything

BIN
.assets/gapless.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

BIN
.assets/gaps.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

BIN
.assets/polybar/clock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
.assets/polybar/full.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
.assets/polybar/i3-mode.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
.assets/polybar/minimal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
.assets/polybar/mpris.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
.assets/polybar/network.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
.assets/polybar/system.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -1,100 +0,0 @@
[helpers]
# BASE: A base system. Sets up a nice xdg (zsh) shell environment, utility scripts and
# a development environment based on git and nvim.
[base]
depends = ["shell", "git", "nvim", "scripts", "ssh", "terminal", "bootstrap"]
[bootstrap.files]
"bootstrap/dotlink.sh" = "~/.config/sh/alias.d/dotlink.sh"
[shell.files]
"sh/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
sh = "~"
[git.files]
"git/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
git = "~"
[nvim.files]
"nvim/.config/nvim/spell/de.utf-8.add.spl" = { target = "~/.config/nvim/spell/de.utf-8.add.spl", type = "symbolic" }
"nvim/.config/nvim/spell/en.utf-8.add.spl" = { target = "~/.config/nvim/spell/en.utf-8.add.spl", type = "symbolic" }
nvim = "~"
[scripts.files]
"scripts/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
scripts = "~"
[ssh.files]
ssh = "~"
[terminal.files]
"terminal/.config/vifm" = "~/.config/vifm"
"terminal/.config/vifm/vifmrc" = { target = "~/.config/vifm/vifmrc", type = "symbolic" }
terminal = "~"
# LINUX: A linux machine, with systemd enabled, auto-mounting set up and a nice productivity suite.
[linux]
depends = ["base", "disks", "pass", "office", "services", "social", "writing"]
[disks.files]
"disks/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
disks = "~"
[pass.files]
"pass/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
"pass/.local/share/pass-pick/assets/rofi-menu.gif" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
pass = "~"
[office.files]
"office/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
"office/.config/glow/email.json" = { target = "~/.config/glow/email.json", type = "symbolic" }
"office/.config/isync/mbsyncrc" = { target = "~/.config/isync/mbsyncrc", type = "template" }
"office/.config/msmtp/config" = { target = "~/.config/msmtp/config", type = "template" }
"office/.config/neomutt/account" = { target = "~/.config/neomutt/account", type = "template" }
"office/.config/neomutt/profile.gmail" = { target = "~/.config/neomutt/profile.gmail", type = "template" }
"office/.config/neomutt/profile.private" = { target = "~/.config/neomutt/profile.private", type = "template" }
office = "~"
[services.files]
"services/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
services = "~"
[social.files]
social = "~"
[writing.files]
"writing/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
"writing/.config/papis/papistui.yaml" = { target = "~/.config/papis/papistui.yaml", type = "symbolic" }
"writing/.config/sioyek/prefs_user.config" = { target = "~/.config/sioyek/prefs_user.config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" }
writing = "~"
# WORKSTATION: A desktop machine, with wayland environment and display attached.
[workstation]
depends = ["linux", "desktop", "multimedia", "qutebrowser"]
[desktop.files]
"desktop/.config/flavours/templates" = { target = "~/.config/flavours/templates", type = "symbolic" }
"desktop/.config/waybar/config" = { target = "~/.config/waybar/config", type = "symbolic" }
"desktop/.config/mako/config" = { target = "~/.config/mako/config", type = "template", prepend = "# TEMPLATED BY DOTTER\n" }
"desktop/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
desktop = "~"
[multimedia.files]
"multimedia/README.md" = { target = "~/NOWHERE", type = "symbolic", if = "false" }
"multimedia/.config/mpv/scripts" = { target = "~/.config/mpv/scripts", type = "symbolic" }
"multimedia/.config/ncmpcpp/config" = { target = "~/.config/ncmpcpp/config", type = "symbolic" }
"multimedia/.config/mpv/fonts/uosc_icons.otf" = { target = "~/.config/mpv/fonts/uosc_icons.otf", type = "symbolic" }
"multimedia/.config/mpv/fonts/uosc_textures.ttf" = { target = "~/.config/mpv/fonts/uosc_textures.ttf", type = "symbolic" }
multimedia = "~"
[qutebrowser.files]
"qutebrowser/config" = "~/.config/qutebrowser"
"qutebrowser/scripts" = "~/.local/bin"
"qutebrowser/data" = "~/.local/share/qutebrowser"
[system.files]
"bootstrap/system-packages" = { target = "/", type = "symbolic", owner = "root" }

View File

@ -1,13 +0,0 @@
includes = []
packages = ["workstation"]
[files]
[variables]
multimedia_beets_musicbrainz_user = ""
multimedia_beets_musicbrainz_pass = ""
multimedia_mopidy_subidy_url = ""
multimedia_mopidy_subidy_user = ""
multimedia_mopidy_subidy_pass = ""

View File

@ -1,5 +0,0 @@
packages = ["system", "workstation"]
[files]
[variables]

View File

@ -0,0 +1 @@
^/.* # everything

View File

@ -1,27 +1,59 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
COMMIT_MSG_FILE="$1"
COMMIT_SOURCE="$2"
BOOTSTRAPDIR="bootstrap"
pkg_committed="$(cat "$(git rev-parse --show-toplevel)"/$BOOTSTRAPDIR/packages*.tsv | grep -v -e '^Name Description Source Target' | cut -f1 | sort)"
pkg_onsystem=$(pacman -Qqett | sort)
pkgfileloc="$(git rev-parse --show-toplevel)/$BOOTSTRAPDIR/packages.txt"
pkgignoreloc="$(git rev-parse --show-toplevel)/$BOOTSTRAPDIR/packages_ignore.txt"
listgen="yay"
# get files only in repo, and only on machine
only_committed=$(comm -23 <(echo "$pkg_committed") <(echo "$pkg_onsystem"))
only_onsystem=$(comm -13 <(echo "$pkg_committed") <(echo "$pkg_onsystem"))
err() {
printf "\x1b[33mCAUTION:\x1b[0m %s\n" "$*"
exit 1
}
if [ ! -f "$pkgfileloc" ]; then
err "File not found - $pkgfileloc, can not determine package differences!"
fi
if ! type "$listgen" >/dev/null 2>&1; then
err "Yay not installed on machine, can not reliably determine package differences!"
fi
# get commited packages, remove empty lines
# and lines beginning with # to allow comments
pkgcommited=$(mktemp)
sed -e '/^[#$]/d' <"$pkgfileloc" | sort >"$pkgcommited"
# get packages on this machine
# q removes extraneous info
# e only lists explicitly installed
# tt removes those that are depended on, but NOT those optionally depended on
pkgcurrent=$(yay -Qqett | sort)
# remove those listed in package_ignore.txt
if [ -f "$pkgignoreloc" ]; then
pkgcurrent=$(echo "$pkgcurrent" | comm -23 - "$pkgignoreloc")
fi
# compare the lists, list differences
result=$(echo "$pkgcurrent" | comm -3 - "$pkgcommited")
# get files only in repo (field1), and only on machine (field2)
added=$(echo "$result" | cut -f1 | sed -e '/^$/d')
removed=$(echo "$result" | cut -s -f2)
# if we have no changes, do nothing
if [ -n "$only_onsystem" ] || [ -n "$only_committed" ]; then
text=$(printf "\-- PACKAGE CHANGES --\nPackages on machine but not committed:\n%s\n\nPackages committed but not on machine:\n%s\n" "$only_onsystem" "$only_committed" | sed 's/^/# /gm')
if [ -n "$added" ] || [ -n "$removed" ]; then
text=$(printf "\-- PACKAGE DIFFERENCES TO COMMITED LIST FOUND --\nPackages NOT YET in repo:\n%s\n\nPackages ONLY in repo:%s\n" "$added" "$removed" | sed 's/^/# /gm')
else
exit 0
exit 0
fi
# prepend package changes to message
case $COMMIT_SOURCE in
"" | message, | template,)
msg=$(echo "$text" | cat - "$COMMIT_MSG_FILE")
printf "%s" "$msg" >"$COMMIT_MSG_FILE"
;;
msg=$(echo "$text" | cat - "$COMMIT_MSG_FILE")
printf "%s" "$msg" >"$COMMIT_MSG_FILE"
;;
esac

31
.gitignore vendored
View File

@ -1,7 +1,3 @@
# don't move the cache into repo
/.dotter/cache/
/.dotter/cache.toml
# no idea why gopass adds this image to config path
gopass-logo-small.png
#
@ -15,35 +11,8 @@ colorscheme.rasi
# do not add massive gutenberg thesaurus to repo
nvim/.config/nvim/thesaurus
# if we have a pre-compiled plugin list don't add it
nvim/.config/nvim/plugin/packer_compiled.lua
# mpv sponsorblock api
sponsorblock.db
sponsorblock.db.tmp
sponsorblock.txt
# ignore any just-in-time settings that took place in qutebrowser
/qutebrowser/.config/qutebrowser/autoconfig.yml
/qutebrowser/.config/qutebrowser/bookmarks
/qutebrowser/.config/qutebrowser/qsettings
/qutebrowser/.config/qutebrowser/quickmarks
/qutebrowser/.config/qutebrowser/stylesheets
# ignore the generated readability file for webpages
readability.html
# ignore the adblock file generated by qutebrowser
blocked-hosts
# ignore vifm & ueberzug utility files
vifm-help.txt
vifmimgpdfpage
vifmimgpdffile
vifminfo
vifminfo.json
# styler configs
colorscheme.yml
# taskwarrior
office/.config/task/task-sync.rc
office/.config/task/contexts

37
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,37 @@
---
# install moreutils to enable ifne (if not empty)
# will only run the respective analyzers when files to test
# are acutally found
image: fnichol/check-shell:latest
analyze:
stage: test
before_script:
- apk add moreutils
- shellcheck --version
script:
- echo "--------- CHECKING POSIX SHELLSCRIPTS -------------"
- find . -type f -name '*.sh' | ifne xargs shellcheck -Calways
- echo "--------- CHECKING ZSH SHELLSCRIPTS -------------"
- find . -type f -name '*.zsh' | ifne xargs shellcheck -Calways -s bash -e SC2034
lint:
stage: test
before_script:
- apk add moreutils
- shfmt -version
script:
- echo "--------- CHECKING POSIX SHELLSCRIPTS -------------"
- find . -type f -name '*.sh' | ifne xargs shfmt -d -i 2
- echo "--------- CHECKING ZSH SHELLSCRIPTS -------------"
- find . -type f -name '*.zsh' | ifne xargs shfmt -d -i 2
test:
stage: test
image: alpine
before_script:
- apk add git bash
- git clone https://github.com/bats-core/bats-core.git /bats
- /bats/bin/bats --version
script:
- /bats/bin/bats -r .

6
.gitmodules vendored
View File

@ -1,6 +0,0 @@
[submodule "pass/.local/share/pass-pick"]
path = pass/.local/share/pass-pick
url = https://git.martyoeh.me/Marty/pass-pick.git
[submodule "scripts/.local/share/uoeia"]
path = scripts/.local/share/uoeia
url = https://git.martyoeh.me/Marty/uoeia.git

4
.stowrc Normal file
View File

@ -0,0 +1,4 @@
--target=~
--ignore='^.gitlab-ci.yml$'
--ignore='^.stowrc$'
--ignore='^.githooks$'

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Marty Oehme
Copyright (c) 2019 Marty Oehme
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,43 +1,34 @@
# `~/🌹`
Note that the below screenshots still show the X configuration from [v0.1](https://gitlab.com/marty-oehme/dotfiles/-/tags/v0.1) which is *very* old by now.
The current dotfiles are geared toward wayland for which the setup looks similar but not identical to the previews below.
# dotfiles Read-Me and Roadmap
## What's in these dotfiles
* [x] wayland setup using `riverwm` with quick access to many overlays and picking tools for styles, downloads, browsing history, passwords and more
* [x] vim configuration for simple programming tasks (especially python/bash/lua) and prose (markdown/quarto/latex)
* [x] vim configuration for simple programming tasks (especially go/typescript/python/bash) and prose
* [x] academic workflow tools, to allow quick citation, pdf compilation, and preview
* [x] simple, efficient waybar with package update notification and mpris integration
* [x] system-wide color management (terminals, vim, qutebrowser, polybar, xresources) through [`flavours`](https://github.com/Misterio77/flavours) application using [base16](http://chriskempson.com/projects/base16/) themes
* [x] quick theme switching by activating `flavours` and fuzzy-searching themes with hot-key (default `<Super>=<Shift>+S`)
* [x] quick directory jumping using `z`, with `fzf` integration
* [x] `fzf`-like integrations for bibtex citation, vim buffer management, most recently used switching, shell command history, and more
* [x] password management with `pass` and picking it with automatic typing into any window
* [x] simple, efficient polybar with package update notification, and spotify (mpris) integration
* [x] tmux session management through `tm` and `tl` tools
* [x] tmux fuzzy-searching of terminal sessions to switch to with hot-key (`<C-A><C-j>`)
* [x] system-wide color management (terminals, vim, qutebrowser, polybar, xresources) through `styler` command using [base16](http://chriskempson.com/projects/base16/) themes
* [x] quick theme switching by activating `styler` and fuzzy-searching themes with hot-key (`<Super>+F8`)
* [x] many vim color-schemes with quick light/dark switching (`F8`) and individual theme switch (`<Space>+F8`)
* [x] quick directory jumping using z, with fzf integration
* [x] fzf integrations for bibtex citation, vim buffer management, most recently used switching, shell command history, and more
[![Styler recoloring demo](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/bde87deda694590a2e08e21552e11309/styler.webp)](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/90894e53eff378db4d7f9f49e7a69fab/styler.mp4)
![Overview](.assets/gaps.png)
## Quick-Start
The dotfiles use `dotter` to link themselves in the home directory. You can clone this repository anywhere (though I have mine in `~/.dotfiles` as it seemed most logical for me).
I would recommend doing an initial `git clone --recursive` for this repository, since it contains git [submodules](https://nering.dev/2016/git-submodules-vs-subtrees/), which will then automatically get pulled in as well.
Of course, you can do it non-recursively and then just pull those modules selectively which you actually want.
The dotfiles use `GNU stow` to link themselves in the home directory. You can clone this repository anywhere (though I have mine in `~/.dotfiles` as it seemed most logical for me).
Once in the repository directory, when you then run `./install.sh` it will install many of the packages I use (though they are probably slightly out-of-date) and link the dotfiles into the home directory.
I would mostly recommend this on fresh machines or a test machine first - it *will* link my personal dotfiles and, if you allow it, *will* install quite a few packages.
By default it will ask your consent for some steps -- use `./install.sh -f` to force yes to everything.
Since it is based on `stow`, it will not overwrite anything already in the home directory (though you can force it to if you really want, using `stow --override='.*'` -- I do not recommend this).
The dotfile installation procedure is based on `dotter`, it will generally *not overwrite* anything already in the home directory, but of course be observant when doing ptentially destructive operations.
> **NOTE**
> The same non-destructive installation procedure does *not* apply to the package installation and system setting file linking, where it can potentially overwrite or remove existing files.
If you do not want to install any packages, but only link the dotfiles run `stow -S */` from the main repository directory.
After all files are linked and you open a new shell session, the `dotlink` alias will allow you to re-link all dotfiles from anywhere on the system.[^1]
[^1]: This alias only works when the dotfiles are cloned into `~/.dotfiles`, mirroring my setup.
[^1]: This alias only works when the dotfiles are cloned into `~/.dotfiles` mirroring my setup.
This is due to a hard-coded cd into this directory.
If your dotfiles lie in another directory and you want to use the dotlink alias, simply change the corresponding line in `bootstrap/.config/sh/alias.d/dotlink.sh`
If your dotfiles lie in another directory and you want to use the dotlink alias, simply change the corresponding line in `_bootstrap/.config/sh/alias.d/dotlink.sh`]
Both automatic installation paths are presumably somewhat brittle. In any case, I would suggest to manually look through the files for things you want instead of copying and activating everything.
Dotfiles are too personal to be standardized like that.
@ -46,33 +37,32 @@ Enjoy!
## Main Modules
![Overview - an older image of the dotfile desktop with gaps, showing git logs, styler logs, duckduckgo in a browser, and a vifm view of the dotfiles themselves](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/aaf0319d575dc192ea0f4bd6eaf83c08/gaps.png)
* [`wayland`](https://github.com/wayland-project/wayland) - Containing basics for fully functional tiling wayland setup:
* [`river`](https://github.com/riverwm/river) - Tiling window manager for wayland
* [`waybar`](https://github.com/Alexays/Waybar) - Easily customizable statusbar for wayland
* [`bemenu`](https://github.com/Cloudef/bemenu) - Extended dmenu replacement for wayland, X11 and ncurses
* [`fontconfig`] - System-wide font replacements and styling settings
* [`wezterm`](https://wezfurlong.org/wezterm/) - Terminal emulator (fast, understandable and lua configurable)
* [`tmux`](https://github.com/tmux/tmux/) - terminal multiplexer (slowly migrating away in favor of wezterm)
* [`nvim`](https://neovim.io/) - Neovim configuration
* [`vifm`](https://github.com/vifm/vifm) - vim-like file-manager
* [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser
* [`pass`](pass/README.md) - Password management suite
* [`bibtex`] - LateX/BibteX/pandoc plaintext writing & reference suite
* [`alacritty`](https://github.com/jwilm/alacritty) - Terminal emulator (GPU accelerated and customizable)
* [`git`](git/README.md) - distributed version control system.
* [`office`](office/README.md) - office/productivity software for writing e-mail and setting appointments
* [`gopass`](https://github.com/gopasspw/gopass) - Password management suite, building on (and largely compatible with)
`pass` for unix
* [`i3`](https://i3wm.org/) - Tiling window manager
* [`nvim`](https://neovim.io/) - Neovim configuration
* [`pandoc`](https://pandoc.org) - Pandoc plaintext transformation options (mostly latex templates)
* [`picom`](https://github.com/yshui/picom) - X11 compositor (maintained fork from compton)
* [`polybar`](polybar/README.md) - Easy to customize statusbar
* [`qutebrowser`](https://github.com/qutebrowser/qutebrowser) - vim-key enabled web browser
* [`rofi`](https://github.com/davatorium/rofi) - Application launcher, dmenu replacement
* [`sxhkd`](https://github.com/baskerville/sxhkd) - X11 hotkey manager
* [`tmux`](https://github.com/tmux/tmux/) - terminal multiplexer
* [`vifm`](https://github.com/vifm/vifm) - vim-like file-manager
## Notes
* Generally, most configuration for applications attempts to follow the XDG specifications, keeping configuration in .config directory and supplementary files in .local/share directory. Over time, I am moving more applications to this standard: it keeps the home directory clean, and the separation of configuration, binaries, and data relatively clear.
* `.config/shell` contains all the general zsh/bash/sh configuration and environment variables usually contained in `.zshrc`, `.zprofile` and similar. It is divided in login shell config (loginrc.d), general shell config (rc.d) and zsh specific (zsh.d). Over time this should be migrated to specific `stow` 'units', but for now here is where it is.
* The `zsh` directory contains all setup for the z-shell, my daily work environment. It should not be required for working with any other module but will add additional functionality to many (such as command auto-completion and so on). `sh` sets some base functionality for any shell you may wish to work in. It is, for now, the only module that is required for some other modules to work.[^shreq]
* `rofi` contains additional scripts and a simple theming framework for rofi and should probably be reorganized to put the correct files into the correct directories (per xdg) at some point.
* Whereas `sh` module scripts are requirements for other scripts, `.local/bin` in the `scripts` module contains most executable user scripts. Most of these have been migrated to other corresponding modules (e.g. if a script exclusively targets git functionality, it will live there), some useful --- or left-over --- stand-alone scripts remain however.
* `.local/share/pandoc` contains configuration for academic latex writing (pandoc, really) and is of interest if you want to use this functionality.
* `.xinitrc` is used for x initialization and program startup. At some point, some of the consistently running applications may be moved to systemd/runit as supervised services.
* Generally, top-level directories starting with a . are only meaningful for the *repository* not for the functionality of the machine that these dotfiles are deployed on. That means `.gitlab-ci.yml`, `.assets/`, `.gitignore` and similar files and directories will not show up in the final deployment in any home directory. Perhaps they should be called dotdot-files since they're the dotfiles for my dotfiles. 🙂 (Also, '[dotfiles](https://en.wikipedia.org/wiki/Semantic_satiation)'.)
* `.local/bin` in `scripts` `stow` unit contains most executable user scripts. Most of these have been migrated to their corresponding modules (e.g. if a script exclusively targets git functionality, it will live there), some stand-alone scripts remain however.
* `.local/share/pandoc` contains configuration for academic latex (pandoc, really) writing and is of interest if you want to use this functionality.
* `.xinitrc` is used for x initialization and program startup. At some point, some of the consistently running applications may be moved to runit as supervised services.
* Generally, directories starting with a . are only meaningful for the *repository* not for the functionality of the machine that these dotfiles are deployed on. That means `.gitlab-ci.yml`, `.assets/`, `.stowrc` and similar files and directories will not show up in the final deployment in any home directory. Perhaps they should be called dotdot-files since they're the dotfiles for my dotfiles. 🙂 (Also, 'dotfiles'.)
[^shreq]: I may remove this requirement in the future to make modules more self-contained. However, relying on some base utility scripts makes it easier to avoid duplicating such functionality for each individual script in other modules.
![Gapless - the same image as above, only displayed without gaps](https://gitlab.com/marty-oehme/dotfiles/-/wikis/uploads/21791f77da013cdac64f11eff61584e3/gapless.png)
![Gapless](.assets/gapless.png)

View File

@ -0,0 +1,597 @@
# Base16 Tomorrow - alacritty color config
# Chris Kempson (http://chriskempson.com)
tomorrow: &colorscheme
# Default colors
primary:
background: '0xffffff'
foreground: '0x4d4d4c'
# Colors the cursor will use if `custom_cursor_colors` is true
cursor:
text: '0xffffff'
cursor: '0x4d4d4c'
# Normal colors
normal:
black: '0xffffff'
red: '0xc82829'
green: '0x718c00'
yellow: '0xeab700'
blue: '0x4271ae'
magenta: '0x8959a8'
cyan: '0x3e999f'
white: '0x4d4d4c'
# Bright colors
bright:
black: '0x8e908c'
red: '0xf5871f'
green: '0xe0e0e0'
yellow: '0xd6d6d6'
blue: '0x969896'
magenta: '0x282a2e'
cyan: '0xa3685a'
white: '0x1d1f21'
draw_bold_text_with_bright_colors: false
# Base16End tomorrow - alacritty color config
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
#window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
#padding:
# x: 0
# y: 0
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Number of lines the viewport will move for every line scrolled when
# scrollback is enabled (history > 0).
multiplier: 3
# Font configuration
#font:
# Normal (roman) font face
#normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
#size: 11.0
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upwards.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`
#
# macOS >= 10.14.x:
#
# If the font quality on non-retina display looks bad then set
# `use_thin_strokes` to `true` and enable font smoothing by running the
# following command:
# `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO`
#
# This is a global setting and will require a log out or restart to take
# effect.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Tomorrow Night Bright)
colors: *colorscheme
# Default colors
#primary:
# background: '#000000'
# foreground: '#eaeaea'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '#9a9a9a'
#bright_foreground: '#ffffff'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor. If these are unset,
# the cursor color will be the inverse of the cell color.
#cursor:
# text: '#000000'
# cursor: '#ffffff'
# Selection colors
#
# Colors which should be used to draw the selection area. If selection
# background is unset, selection color will be the inverse of the cell colors.
# If only text is unset the cell text color will remain the same.
#selection:
# text: '#eaeaea'
# background: '#404040'
# Normal colors
#normal:
# black: '#000000'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e6c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0ba'
# white: '#eaeaea'
# Bright colors
#bright:
# black: '#666666'
# red: '#ff3334'
# green: '#9ec400'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#b77ee0'
# cyan: '#54ced6'
# white: '#ffffff'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#000000'
# red: '#8c3336'
# green: '#7a8530'
# yellow: '#97822e'
# blue: '#506d8f'
# magenta: '#80638e'
# cyan: '#497e7a'
# white: '#9a9a9a'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#
# Specifying a `duration` of `0` will disable the visual bell.
#visual_bell:
# animation: EaseOutExpo
# duration: 0
# color: '#ffffff'
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Live config reload (changes require restart)
live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty captures the mouse, the
# `Shift` modifier is automatically added as a requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ReceiveChar
# - None
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# at once.
#key_bindings:
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Add, mods: Control, action: IncreaseFontSize }
#- { key: Subtract, mods: Control, action: DecreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Add, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: K, mods: Command, action: ClearHistory }
#- { key: K, mods: Command, chars: "\x0c" }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, chars: "\x0c" }
#- { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt }
#- { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt }
#- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt }
#- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

View File

@ -26,4 +26,4 @@ key=$(echo "$choice" | sed -E 's/.*\((\w+)\)$/\1/')
library="$(dirname "$(realpath "$BIBFILE")")/pdf"
# find and open the key-associated pdf file
${FILEREADER:-open} "$(find "$library" -type f -name "$key *.pdf")"
${FILEREADER:-xdg-open} "$(find "$library" -type f -name "$key *.pdf")"

View File

@ -1,12 +1,6 @@
# Writing module
# Bibtex module
[bibtex](https://en.wikipedia.org/wiki/BibTeX) - plain-text reference management
[zathura](git.pwmt.org) - keyboard-driven PDF reading
[sioyek](http://sioyek.info/) - keyboard-driven PDF reading *and annotating*
This readme is a little out of date, as are the scripts below.
They are old, I used them during my time as a student and they are probably written terribly.
But I still think there is value in them, hence not removing them from the repo just yet.
## bib-due

View File

@ -9,7 +9,6 @@
#
# to customize this to your own needs, change the `push folder` to the
# location of your dotfiles (stow) repository
alias dotlink="pushd ~/.dotfiles;\
dotter deploy;\
popd"
stow -R */ 2> >(grep -v 'Absolute/relative mismatch between Stow dir' 1>&2) ;\
popd"

View File

@ -0,0 +1,4 @@
# TODO find a more generic way to express 'ignore any non-folder files'
^/install_packages.sh
^/packages.*.txt

View File

@ -1,22 +0,0 @@
FROM archlinux:latest
# First build then run this dockerfile with:
# `podman build -t bootstrap .`
# `podman run -it -v /path/to/my/dotfiles:/path/to/my/dotfiles:ro bootstrap`
RUN pacman-key --init
RUN pacman -Syu --noconfirm git vi base-devel sudo zsh man man-pages
RUN useradd -m -G wheel -s /usr/bin/zsh marty
RUN echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers
RUN echo "marty:password" | chpasswd
# RUN su marty
# RUN cd /home/marty
# RUN git clone "https://git.martyoeh.me/Marty/dotfiles" .dotfiles
# link it directly from dotfile development dir to experiment
USER marty
VOLUME /home/marty/.dotfiles
WORKDIR /home/marty/.dotfiles
CMD ["/usr/bin/bash"]

View File

@ -1,9 +0,0 @@
# bootstrap module
The bootstrapping module mainly concerns the setup of the repository itself -- installation of packages, setting up basic options and maintenance scripts.
* installs general list of packages, listed [here](bootstrap/packages.tsv)
* if githooks are enabled (either through install script, or manually) will compare installed packages with those on the package list on each commit and warn user about differences
* contains a simple alias `dotlink` which allows quickly re-linking dotfiles when they have been changed. This is useful to invoke when files have been removed or added and need to be sym-linked by stow again (only works for `~/.dotfiles` dot directory)
* contains an `update_package_list.sh` script which I can use to quickly repopulate the list of explicitly installed packages, noting down their source (repositories or AUR) and retaining their target, if I set any (only works for `~/.dotfiles` dot directory)

View File

@ -7,110 +7,86 @@
# DESCRIPTION: Display usage information for this script.
# PARAMETERS: see usage function
#==============================================================================
PKG_TSV_FILE=${PKG_TSV_FILE:-bootstrap/packages_stable.tsv}
packages_repo="${BOOTSTRAP_PACKAGES:-$(grep -e ' R ' "$PKG_TSV_FILE" | cut -f1 -d' ')}"
packages_aur="${BOOTSTRAP_PACKAGES_AUR:-$(grep -e ' A ' "$PKG_TSV_FILE" | cut -f1 -d' ')}"
packages_pipx="${BOOTSTRAP_PACKAGES_PIPX:-$(grep -e ' P ' "$PKG_TSV_FILE" | cut -f1,5 -d' ')}"
packages="${BOOTSTRAP_PACKAGES:-packages.txt}"
main() {
local cmd=""
local ret=0
local cmd=""
local ret=0
case "$1" in
-v | --version)
printf "Package bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.3\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
;;
-f | --force)
install true
;;
*)
install false
;;
esac
shift
case "$1" in
-v | --version)
printf "Package bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.3\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
;;
-f | --force)
install true
;;
*)
install false
;;
esac
shift
$cmd "$@"
ret=$((ret + $?))
exit $ret
$cmd "$@"
ret=$((ret + $?))
exit $ret
}
install_paru() {
# check for existing paru installation
if type paru >/dev/null 2>&1; then
echo "Existing paru installation found ..........................................."
return
fi
install_yay() {
# check for existing yay installation
if type yay >/dev/null 2>&1; then
echo "Existing yay installation found ..........................................."
return
fi
# use tmp dir to make paru
tempdir=".paru"
git clone https://aur.archlinux.org/paru.git "$tempdir"
pushd "$tempdir" || exit 1
makepkg -si
popd || exit 1
rm -rf "$tempdir"
# use tmp dir to make yay
target=$(mktemp -d)
git clone https://aur.archlinux.org/yay.git "$target"
cd "$target" || exit
makepkg -si
}
update_repos() {
unattended="$1"
if "$unattended"; then
paru -Sqyy --noconfirm
else
paru -Syy
fi
unattended="$1"
if "$unattended"; then
yay -Sqyy --noconfirm
else
yay -Syy
fi
}
install_packages() {
unattended="$1"
if "$unattended"; then
echo "$packages_repo" "$packages_aur" | paru -Squ --noconfirm --needed -
else
echo "$packages_repo" | paru -Squ --needed -
echo "$packages_aur" | paru -S --needed -
fi
unattended="$1"
if "$unattended"; then
yay -Squ --noconfirm --needed - <"$packages"
else
yay -Su --needed - <"$packages"
fi
}
install_pipx() {
if type pipx >/dev/null 2>&1; then
echo "Existing pipx installation found .........................................."
return
fi
if "$unattended"; then
paru -S --noconfirm python-pipx
else
paru -S python-pipx
fi
}
install_pipx_pkgs() {
while IFS= read -r line; do
if [ -z "$line" ]; then return; fi
prog=$(echo "$line" | cut -f1 -d' ')
pipx install "$prog"
injections=$(echo "$line" | cut -f2 -d' ')
for inject_args in ${injections//,/ }; do
pipx inject "$prog" "$inject_args"
done
done <<<"$packages_pipx"
check_consent() {
echo "This will take a while and install many packages. Proceed [y/N]?"
read -r yes
if [[ "$yes" != y* ]]; then
echo "Exiting."
exit
fi
}
install() {
unattended=$1
echo "Beginning package bootstrap ..............................................."
echo "Installing paru ............................................................"
install_paru
echo "Installing apps ..........................................................."
update_repos "$unattended"
install_packages "$unattended"
echo "Done ......................................................................"
echo "Installing pipx ..........................................................."
install_pipx
echo "Installing pipx packages .................................................."
install_pipx_pkgs
echo "Done ......................................................................"
unattended=$1
echo "Beginning package bootstrap ..............................................."
if ! "$unattended"; then
check_consent
fi
echo "Installing yay ............................................................"
install_yay
echo "Installing apps ..........................................................."
update_repos "$unattended"
install_packages "$unattended"
echo "Done ......................................................................"
}
main "$@"

135
bootstrap/packages.txt Normal file
View File

@ -0,0 +1,135 @@
alacritty
anki
asciinema
atool
bibtool
bison
chromium
dhcpcd
dialog
docker
dunst
exa
fasd
feh
flashfocus-git
flex
fzf
git-lfs
gitlint
glances
glow
gnome-keyring
go
gopass
grub
hugo
i3blocks
i3-gaps
i3lock
i3status
iputils
jabref-latest
jpdftweak
keybase-bin
libnotify
licenses
linux-firmware
linux-headers
linux-lts
linux-lts-headers
littler
logrotate
lprng
lvm2
lynx
man-db
man-pages
masterpdfeditor-free
mosh
mpv
nano
neovim
nerd-fonts-fira-code
nerd-fonts-iosevka
netctl
networkmanager
nextcloud-client
ntfs-3g
ntp
os-prober
pandoc-citeproc
pdfjs
pia-tools
picom
pkgconf
playerctl
polybar
psmisc
pulseaudio-alsa
pulsemixer
python-pdfminer.six
python-pipx
python-pybtex
python-pynvim
python-ueberzug
qutebrowser
redshift
ripgrep-all
rng-tools
rofi-calc
rofi-dmenu
rofi-greenclip
rofimoji
scrot
shellcheck-static
shfmt
spotify
sshfs
stow
surfraw
sxhkd
systemd-sysvcompat
texlive-bibtexextra
texlive-fontsextra
texlive-formatsextra
texlive-games
texlive-humanities
texlive-music
texlive-pictures
texlive-pstricks
texlive-publishers
texlive-science
tmux
tomb
topgrade
ttf-comic-neue
ttf-heuristica
ttf-signika
unclutter
unrar
usbutils
vagrant
vi
vifm
virtualbox
xcape
xclip
xdg-user-dirs
xorg-xev
xorg-xinit
xorg-xinput
yarn
yay
youtube-dl
zathura-pdf-mupdf
pacman-contrib
# zsh plugins
oh-my-zsh-git
alias-tips-git
zsh-autosuggestions
zsh-completions-git
zsh-fast-syntax-highlighting-git
zsh-theme-powerlevel10k-git
nvm

View File

@ -0,0 +1,11 @@
ansible
autoconf
automake
bash-bats
dosfstools
hplip
nvidia
powertop
qemu
virt-manager
zotero

View File

@ -1,363 +0,0 @@
Name Description Source Target Injections
aaxtomp3 Convert Audible's .aax filetype to MP3, FLAC, M4A, or OPUS A
acpid A daemon for delivering ACPI power management events with netlink support R
afew Initial tagging script for notmuch mail R
alias-tips-git An oh-my-zsh plugin to help remembering those aliases you defined once A
alsa-utils Advanced Linux Sound Architecture - Utilities R
anki-bin Helps you remember facts (like words/phrases in a foreign language) efficiently. Installed with wheel. A
ansible Official assortment of Ansible collections R
ansible-lint Checks playbooks for practices and behaviour that could potentially be improved. R
arch-wiki-lite Arch Wiki without HTML. 1/9 as big, easily searched & viewable on console R
arduino Arduino prototyping platform SDK R
arduino-avr-core Arduino AVR core with upstream avr-gcc and avrdude R
arduino-cli Arduino command line interface R
asciinema Record and share terminal sessions R
asix-ax88179-dkms A kernel module for ASIX AX88178A AX88179 USB 3.0 network adapters A
aspell-de German dictionary for aspell R
aspell-en English dictionary for aspell R
atool A script for managing file archives of various types R
atuin Magical shell history R
aubio A tool for extracting annotations from audio signals R
autofs A kernel-based automounter for Linux A
barrier Open-source KVM software based on Synergy (GUI) R
base Minimal package set to define a basic Arch Linux installation R
base-devel Basic tools to build Arch Linux packages R
bash-bats Bash Automated Testing System R
bash-completion Programmable completion for the bash shell R
bash-language-server Bash language server implementation based on Tree Sitter and its grammar for Bash R
bat Cat clone with syntax highlighting and git integration R
bc An arbitrary precision calculator language R
beancount A personal double entry accounting and budgeting software P git+https://github.com/bratekarate/beancount-categorizer.git,beancount-dkb,fava,python-magic,smart-importer
bearssl Implementation of the SSL/TLS protocol (RFC 5246) written in C R
beets Organize your music collection from the command line P beetcamp,deets-describe,beets-ydl,pyacoustid,pylast
bemoji-git Emoji picker that remembers your favorites. A
bibclean BibTeX and Scribe bibliography prettyprinter and syntax checker A
biber A Unicode-capable BibTeX replacement for biblatex users R
bibtool A tool for manipulating BibTeX files R
bind A complete, highly portable implementation of the DNS protocol R
bluetuith-bin A TUI based bluetooth manager A
bluez-utils Development and debugging utilities for the bluetooth protocol stack R
booster Fast and secure initramfs generator R
brightnessctl Lightweight brightness control tool R
btop A monitor of system resources, bpytop ported to C++ R
caddy Fast web server with automatic HTTPS R
calcurse A text-based personal organizer R
catdoc A convertor for Microsoft Word, Excel, PowerPoint and RTF Files to text R
chafa Image-to-text converter supporting a wide range of symbols and palettes, transparency, animations, etc. R
cinny-desktop-bin Matrix client focusing primarily on a simple, elegant and secure interface (binary release) A
clipman A simple clipboard manager for Wayland A
cups-pdf PDF printer for cups R
cups-pk-helper A helper that makes system-config-printer use PolicyKit R
dbus-broker Linux D-Bus Message Broker R
dcnnt Yet another tool to connect Android phone with desktop similar to KDE Connect A
dconf-editor GSettings editor for GNOME R
dell-command-configure Configure various BIOS features on Dell laptops A
dhcpcd RFC2131 compliant DHCP client daemon R
distrobox Use any linux distribution inside your terminal. A
dnsmasq Lightweight, easy to configure DNS forwarder and DHCP server R
docker Pack, ship and run any application as a lightweight container R
docker-compose Fast, isolated development environments using Docker R
docx2txt Recovers text from DOCX files, with good formatting. R
dos2unix Text file format converter R
dotter-rs-bin A dotfile manager and templater written in Rust A
duf Disk Usage/Free Utility R
dust A more intuitive version of du in rust R
efm-langserver General purpose Language Server A
enca Charset analyser and converter R
entr Run arbitrary commands when files change R
euporie View and work with ipnb Python notebooks from the cli P
exa ls replacement R
exercism-bin Command line client for exercism.io A
exfat-utils Utilities for exFAT file system R
f3 Simple tool that tests flash cards capacity and performance to see if they live up to claimed specifications A
fd Simple, fast and user-friendly alternative to find R
ffmpegthumbnailer Lightweight video thumbnailer that can be used by file managers R
firefox Standalone web browser from mozilla.org R
flavours A simple and easy cli to build and use base16 schemes A
fonts-cjk Linux 下的免费商用字体包 A
freerdp Free implementation of the Remote Desktop Protocol (RDP) R
fwupd Simple daemon to allow session software to update firmware R
fzf-tab-bin-git Replace zsh's default completion selection menu with fzf (git version). This package also compiles the optional binary module. A
gallery-dl Command-line program to download image-galleries and collections from several image hosting sites A
gamemode A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS R
gimp GNU Image Manipulation Program R
git-delta Syntax-highlighting pager for git and diff output R
git-lfs Git extension for versioning large files R
gitlint Git commit message linter A
gitui Blazing fast terminal-ui for git written in Rust R
gk6x-bin Configure keys, macros, and lighting on GK6X keyboards (GK64, GK84, GK61, etc) A
glances CLI curses-based monitoring tool R
glfw-wayland A free, open source, portable framework for graphical application development (wayland) R
glow Command-line markdown renderer R
gnu-netcat GNU rewrite of netcat, the network piping application R
gnumeric A GNOME Spreadsheet Program R
gnuplot Plotting package which outputs to X11, PostScript, PNG, GIF, and others R
go-md2man A markdown to manpage generator R
gomuks A terminal based Matrix client written in Go A
gopls Language server for Go programming language R
gotty-bin Simple command line tool that turns your CLI tools into web applications. A
grim Screenshot utility for Wayland R
grub GNU GRand Unified Bootloader (2) R
gsimplecal Simple and lightweight GTK calendar R
gst-plugins-bad Multimedia graph framework - bad plugins R
gstreamer-vaapi Multimedia graph framework - vaapi plugin R
gucharmap Gnome Unicode Charmap R
haveged Entropy harvesting daemon using CPU timings R
heimdall Tool suite used to flash firmware (ROMs) onto Samsung Galaxy S devices R
htop Interactive process viewer R
hugo Fast and Flexible Static Site Generator in Go R
iftop Display bandwidth usage on an interface R
imapfilter A mail filtering utility for processing IMAP mailboxes A
imv Image viewer for Wayland and X11 R
intel-ucode Microcode update files for Intel CPUs R
iputils Network monitoring tools, including ping R
ipython An enhanced Interactive Python shell. R
isbntools A variety of tools to work with isbn addresses P
iucode-tool Tool to manipulate Intel® IA-32/X86-64 microcode bundles R
iwd Internet Wireless Daemon R
jiq-bin Interactive JSON query tool using jq expressions A
jmtpfs FUSE and libmtp based filesystem for accessing MTP (Media Transfer Protocol) devices A
jpdftweak A Swiss Army Knife GUI application for PDF documents A
jrnl Collect your thoughts and notes without leaving the command line R
jupyter-nbclient A tool for running Jupyter Notebooks in different execution contexts. R
kanshi Dynamic output configuration for Wayland WMs R
keyd A key remapping daemon for linux. A
khal CLI calendar application build around CalDAV R
khard Console address book manager R
kubo IPFS implementation in Go R
lazygit Simple terminal UI for git commands R
lib32-gamemode A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS R
libdvdcss Portable abstraction library for DVD decryption R
libfido2 Library functionality for FIDO 2.0, including communication with a device over USB R
libqalculate Multi-purpose desktop calculator R
libreoffice-fresh LibreOffice branch which contains new features and program enhancements R
libva-intel-driver VA-API implementation for Intel G45 and HD Graphics family R
libvirt API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc) R
linux The Linux kernel and modules R
linux-firmware Firmware files for Linux R
linux-headers Headers and scripts for building modules for the Linux kernel R
linux-lts The LTS Linux kernel and modules R
littler a hash-bang and simple command line pipe front end for GNU R A
logrotate Rotates system logs automatically R
lsof Lists open files for running Unix processes R
lswt List Wayland toplevels A
lua-format LuaFormatter - Code formatter for Lua A
lua-language-server Lua Language Server coded by Lua R
lua51 Powerful lightweight programming language designed for extending applications R
luacheck A tool for linting and static analysis of Lua code R
lutris Open Gaming Platform R
ly TUI display manager A
lynx A text browser for the World Wide Web R
magic-wormhole Securely transfer data between computers R
maim Utility to take a screenshot using imlib2 R
mako Lightweight notification daemon for Wayland R
man-db A utility for reading man pages R
man-pages Linux man pages R
markdown-anki-decks Construct and modify anki decks directly with markdown P
markdownlint-cli MarkdownLint Command Line Interface A
masterpdfeditor-free A complete solution for creation and editing PDF files - Free version without watermark A
mbsync-git free (GPL) mailbox synchronization program A
mediainfo Supplies technical and tag information about a video or audio file (CLI interface) R
mermaid-cli Generation of diagram and flowchart from text in a similar manner as markdown (CLI) A
mimeo Open files by MIME-type or file name using regular expressions. A
minidlna A DLNA/UPnP-AV Media server (aka ReadyDLNA) R
minio-client Replacement for ls, cp, mkdir, diff and rsync commands for filesystems and object storage R
mopidy-bandcamp Mopidy backend for Bandcamp A
mopidy-iris A Mopidy Web client that utilizes the Spotify and EchoNest frameworks. (Formerly Spotmop) A
mopidy-local Mopidy extension for local media playback A
mopidy-mpd Mopidy extension for controlling playback from MPD clients A
mopidy-mpris Mopidy extension for controlling Mopidy through the MPRIS D-Bus interface A
mopidy-scrobbler Mopidy extension for scrobbling played tracks to Last.fm A
mopidy-somafm Mopidy extension for playing music from SomaFM A
mopidy-youtube Mopidy extension for playing music from Youtube A
moreutils A growing collection of the unix tools that nobody thought to write thirty years ago R
mosh Mobile shell, surviving disconnects with local echo and line editing R
mpv-mpris MPRIS plugin for mpv R
msmtp A mini smtp client R
mupdf-gl Lightweight PDF and XPS viewer with OpenGL backend R
mutt-ics Show calendar event details in mutt A
ncmpcpp Almost exact clone of ncmpc with some new features R
needrestart Restart daemons after library updates. A
neomutt A version of mutt with added features R
neovim Fork of Vim aiming to improve user experience, plugins, and GUIs R
net-tools Configuration tools for Linux networking R
netbird-bin WireGuard-based mesh network A
netctl Profile based systemd network management R
nethogs A net top tool which displays traffic used per process instead of per IP or interface R
network-manager-applet Applet for managing network connections R
networkmanager-openconnect NetworkManager VPN plugin for OpenConnect R
newsboat RSS/Atom feed reader for text terminals R
nextcloud-client Nextcloud desktop client R
nfs-utils Support programs for Network File Systems R
nmap Utility for network discovery and security auditing R
nodejs-pandiff Prose diffs for any document format supported by Pandoc A
noto-fonts-emoji Google Noto emoji fonts R
npm A package manager for javascript R
nss-mdns glibc plugin providing host name resolution via mDNS R
nsxiv Neo (or New or Not) Simple (or Small or Suckless) X Image Viewer A
ntfs-3g NTFS filesystem driver and utilities R
ntp Network Time Protocol reference implementation R
nushell A new type of shell R
nzbget Download from Usenet using .nzb files R
offpunk-git Fork of the command-line Gemini client AV-98 with added offline capabilities A
oh-my-zsh-git A community-driven framework for managing your zsh configuration. Includes 180+ optional plugins and over 120 themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community A
os-prober Utility to detect other OSes on a set of drives R
pacman-contrib Contributed scripts and tools for pacman systems R
papis Papis is a powerful and highly extensible command-line based document and bibliography manager. P whoosh,papis-zotero,papis-scihub,git+https://git.martyoeh.me/Marty/papis-extract.git,git+https://github.com/supersambo/papis-tui,pybtex-apa-style,git+https://git.martyoeh.me/Marty/papis-bbt-formatter.git
parallel A shell tool for executing jobs in parallel R
parsec-bin Remotely connect to a gaming pc for a low latency remote computing experience A
paru-bin Feature packed AUR helper A
pass-coffin A password store extension that hides data inside a signed and encrypted coffin A
pass-ssh A pass extension that creates ssh keys with an automatically generated passphrases stored in pass and outputs the public key using fzf or rofi A
pavucontrol PulseAudio Volume Control R
pbzip2 Parallel implementation of the bzip2 block-sorting file compressor R
pdfjs PDF reader in javascript R
pdftk Command-line tool for working with PDFs R
peek Simple screen recorder with an easy to use interface R
perf Linux kernel performance auditing tool R
perl-authen-sasl Perl/CPAN Module Authen::SASL : SASL authentication framework R
piavpn-bin Private Internet Access client A
pigz Parallel implementation of the gzip file compressor R
pipewire-alsa Low-latency audio/video router and processor - ALSA configuration R
pipewire-roc Low-latency audio/video router and processor - ROC streaming support R
playerctl mpris media player controller and lib for spotify, vlc, audacious, bmp, xmms2, and others. R
podman Tool and library for running OCI-based containers in pods R
powertop A tool to diagnose issues with power consumption and power management R
prettier An opinionated code formatter for JS, JSON, CSS, YAML and much more R
protonvpn Official ProtonVPN metapackage that installs protonvpn-gui and protonvpn-cli, maintained by the ProtonVPN team. A
ptpython Python REPL build on top of prompt_toolkit A
pulsemixer CLI and curses mixer for pulseaudio R
pv A terminal-based tool for monitoring the progress of data through a pipeline. R
pyright Type checker for the Python language R
python-adblock Brave's adblock library in Python R
python-dictcc commandline tool for dict.cc A
python-docs Set of HTML documentation for python R
python-html2text A HTML to markdown-structured text converter R
python-openpyxl A Python library to read/write Excel 2007 xlsx/xlsm files R
python-pagelabels Python library to manipulate PDF page numbers and labels. A
python-pancritic CriticMarkdup parser with optional pandoc backend A
python-pdfminer Python PDF Parser R
python-pip The PyPA recommended tool for installing Python packages R
python-pipx Install and Run Python Applications in Isolated Environments R
python-pybluez Python wrapper for the BlueZ Bluetooth stack R
python-pybtex A BibTeX-compatible bibliography processor written in Python R
python-pynvim Python client for Neovim R
python-pyqt6-3d Python bindings for Qt3D R
python-pyqt6-charts Python bindings for QtChart R
python-pyqt6-datavisualization Python bindings for QtDataVisualization R
python-pyqt6-networkauth Python bindings for QtNetworkAuth R
python-readability-lxml Fast html to text parser (article readability tool) python library R
python-slugify A Python slugify application that handles unicode R
python-tasklib Python library for interacting with taskwarrior databases R
qemu-desktop A QEMU setup for desktop environments R
qt5-wayland Provides APIs for Wayland R
qt5-xmlpatterns Support for XPath, XQuery, XSLT and XML schema validation R
qt6-svg Classes for displaying the contents of SVG files R
qt6-wayland Provides APIs for Wayland R
qtcurve-gtk2 A configurable set of widget styles for KDE and Gtk R
quarto-cli-bin An open-source scientific and technical publishing system built on Pandoc (binary from official repo) A
qutebrowser A keyboard-driven, vim-like browser based on Python and Qt R
refind An EFI boot manager R
refind-btrfs Generate rEFInd manual boot stanzas from Btrfs snapshots A
reflector A Python 3 module and script to retrieve and filter the latest Pacman mirror list. R
remind A sophisticated calendar and alarm program. R
remmina remote desktop client written in GTK+ R
restic Fast, secure, efficient backup program R
ripgrep-all rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc. R
river A dynamic tiling wayland compositor R
rivercarro A slightly modified version of rivertile layout generator for river. A
rng-tools Random number generator related utilities R
sc-im A spreadsheet program based on SC A
scc Sloc, Cloc and Code: a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go A
scrcpy Display and control your Android device R
screen Full-screen window manager that multiplexes a physical terminal R
sfz A simple static file server A
shellcheck-bin Shell script analysis tool (binary release, static) A
shfmt Format shell programs R
sioyek PDF viewer for research papers and technical books. A
slurp Select a region in a Wayland compositor R
smartmontools Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives R
snap-pac Pacman hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST R
speedtest-cli Command line interface for testing internet bandwidth using speedtest.net R
sshfs FUSE client based on the SSH File Transfer Protocol R
starship The cross-shell prompt for astronauts R
steam Valve's digital software delivery system R
sudo Give certain users the ability to run some commands as root R
surfraw Shell Users' Revolutionary Front Rage Against the Web R
swaybg Wallpaper tool for Wayland compositors R
swayidle Idle management daemon for Wayland R
swww Efficient animated wallpaper daemon for wayland, controlled at runtime. A
task-spooler Queue up tasks from the shell for batch execution A
taskopen Script for taking notes and open urls with taskwarrior A
tasksh A shell command that wraps Taskwarrior commands A
tea A command line tool to interact with Gitea servers R
tectonic Modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive R
tex-gyre-fonts Substitute PostScript fonts in OpenType format R
texlab A cross-platform implementation of the Language Server Protocol for LaTeX. R
thermald The Linux Thermal Daemon program from 01.org R
tidy-viewer CLI csv pretty printer that uses column styling A
timew Timewarrior, A command line time tracking application R
tlp Linux Advanced Power Management R
tmux Terminal multiplexer R
toilet free replacement for the FIGlet utility. A
topgrade-bin Invoke the upgrade procedure of multiple package managers A
traceroute Tracks the route taken by packets over an IP network R
translate-shell A command-line interface and interactive shell for Google Translate R
transmission-qt Fast, easy, and free BitTorrent client (Qt GUI) R
ttf-brill Brill Typeface by John Hudson for Brill Publishing House A
ttf-comic-neue Comic Neue aspires to be the casual script choice for everyone including the typographically savvy. A
ttf-heuristica A serif latin & cyrillic font, derived from the "Adobe Utopia" font by Apanov A
ttf-iosevka-nerd Patched font Iosevka from nerd fonts library R
ttf-signika Sans-serif typeface from Google by Anna Giedryś A
ttf-victor-mono-nerd Patched font Victor Mono from nerd fonts library R
tuir Browse Reddit from your terminal A
tut A TUI for Mastodon with vim inspired keys A
typescript-language-server Language Server Protocol (LSP) implementation for TypeScript using tsserver R
udiskie Removable disk automounter using udisks R
ufw Uncomplicated and easy to use CLI tool for managing a netfilter firewall R
unrar The RAR uncompression program R
unrtf Command-line program which converts RTF documents to other formats R
urlview-xdg-git A curses URL parser for text files. Git version, adds support for QUITONLAUNCH option and XDG Base Directory specification compliance. A
usql A universal command-line interface for SQL databases A
v4l2loopback-dkms v4l2-loopback device module sources R
vagrant Build and distribute virtualized development environments R
vdirsyncer Synchronize CalDAV and CardDAV. R
viddy A modern watch command A
vifm A file manager with curses interface, which provides Vi[m]-like environment R
vim-language-server VimScript language server A
virt-manager Desktop user interface for managing virtual machines R
virtualbox Powerful x86 virtualization for enterprise as well as home use R
virtualbox-guest-iso The official VirtualBox Guest Additions ISO image R
visidata Terminal spreadsheet multitool for discovering and arranging data R
viu Simple terminal image viewer R
wallabag-client Command line client for the self hosted read-it-later app Wallabag A
wavemon Ncurses-based monitoring application for wireless network devices R
waybar Highly customizable Wayland bar for Sway and Wlroots based compositors R
waylock A simple screenlocker for wayland compositors R
wdisplays GUI display configurator for wlroots compositors A
wev tool for debugging wayland events, similar to xev A
wezterm A GPU-accelerated cross-platform terminal emulator and multiplexer R
wf-recorder Screen recorder for wlroots-based compositors such as sway R
wget Network utility to retrieve files from the Web R
wireguard-tools next generation secure network tunnel - tools for configuration R
wireless_tools Tools allowing to manipulate the Wireless Extensions R
wlopm Wayland output power management. A
wlsunset Day/night gamma adjustments for Wayland compositors A
wpa_actiond Daemon that connects to wpa_supplicant and handles connect and disconnect events A
wtype xdotool type for wayland R
xdg-user-dirs Manage user directories like ~/Desktop and ~/Music R
xsv A CLI for indexing, slicing, analyzing, splitting and joining CSV files R
yaml-language-server YAML Language Server R
yarn Fast, reliable, and secure dependency management R
yt-dlp A youtube-dl fork with additional features and fixes R
ytfzf A POSIX script to find and watch youtube videos from the terminal R
yubikey-manager Python library and command line tool for configuring a YubiKey R
zathura-cb Adds comic book support to zathura R
zathura-djvu DjVu support for Zathura R
zathura-pdf-mupdf PDF support for Zathura (MuPDF backend) (Supports PDF, ePub, and OpenXPS) R
zk A command-line tool helping you to maintain a Zettelkasten or personal wiki R
zotero-bin Zotero Standalone. Is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources. A
zoxide A smarter cd command for your terminal R
zq Tooling for super-structured data A
zsh-autosuggestions Fish-like autosuggestions for zsh R
zsh-fast-syntax-highlighting Optimized and extended zsh-syntax-highlighting A
Can't render this file because it has a wrong number of fields in line 30.

View File

@ -1,16 +0,0 @@
Name Description Source Target
adbfs-rootless-git fuse filesystem over adb tool for android devices, no device root required A
arch-install-scripts Scripts to aid in installing Arch Linux R
blueberry Bluetooth configuration tool R
dotter-rs-bin A dotfile manager and templater written in Rust A
eza A modern replacement for ls (community fork of exa) R
feishin-appimage A modern self-hosted music player. A
khal CLI calendar application built around CalDAV R
m4b-tool-bin A command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b A
nodejs-markmap-cli Create markmaps (mindmaps from markdown) from CLI A
pv A terminal-based tool for monitoring the progress of data through a pipeline R
qpwgraph PipeWire Graph Qt GUI Interface R
texlive-latexextra TeX Live - LaTeX additional packages R
toilet Free replacement for the FIGlet utility R
vifm A file manager with curses interface, which provides Vi[m]-like environment R
woeusb-ng Simple tool that enable you to create your own usb stick with Windows installer. A
1 Name Description Source Target
2 adbfs-rootless-git fuse filesystem over adb tool for android devices, no device root required A
3 arch-install-scripts Scripts to aid in installing Arch Linux R
4 blueberry Bluetooth configuration tool R
5 dotter-rs-bin A dotfile manager and templater written in Rust A
6 eza A modern replacement for ls (community fork of exa) R
7 feishin-appimage A modern self-hosted music player. A
8 khal CLI calendar application built around CalDAV R
9 m4b-tool-bin A command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b A
10 nodejs-markmap-cli Create markmaps (mindmaps from markdown) from CLI A
11 pv A terminal-based tool for monitoring the progress of data through a pipeline R
12 qpwgraph PipeWire Graph Qt GUI Interface R
13 texlive-latexextra TeX Live - LaTeX additional packages R
14 toilet Free replacement for the FIGlet utility R
15 vifm A file manager with curses interface, which provides Vi[m]-like environment R
16 woeusb-ng Simple tool that enable you to create your own usb stick with Windows installer. A

View File

@ -1,39 +0,0 @@
# Makes capslock to control/escape
# insert to paste
# right alt to enable German Umlaute (äÄöÖüÜ),
# sharp s (ß), and the Euro sign (€).
# Needs compose key to be set in xkb to work correctly:
# $ setxkbmap -option "compose:menu"
[ids]
*
[main]
capslock = overload(control, esc)
insert = S-insert
rightalt = layer(dia)
shift = layer(shift)
rightshift = layer(shift)
[shift:S]
rightalt = layer(shiftedDia)
[dia]
shift = layer(shiftedDia)
rightshift = layer(shiftedDia)
a = macro(compose a ")
o = macro(compose o ")
u = macro(compose u ")
s = macro(compose s s)
e = macro(compose = e)
[shiftedDia]
a = macro(compose A ")
o = macro(compose O ")
u = macro(compose U ")

View File

@ -1,100 +0,0 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
UseSyslog
Color
#NoProgressBar
CheckSpace
VerbosePkgLists
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@ -1,3 +0,0 @@
[Sleep]
HibernateDelaySec=120min
SuspendEstimationSec=30min

View File

@ -1 +0,0 @@
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0000", ATTRS{idProduct}=="3825", ATTR{power/wakeup}="disabled"

View File

@ -1,97 +0,0 @@
#!/usr/bin/env bash
BOOTSTRAP_DIR=${BOOTSTRAP_DIR:-$(pwd)/bootstrap}
INPUTFILES=$(find "${BOOTSTRAP_DIR}" -type f -name 'packages*.tsv')
OUTPUTFILE=${BOOTSTRAP_DIR}/packages_testing.tsv
pkg_all=$(pacman -Qqett)
pkg_repo=$(pacman -Qqn)
pkg_aur=$(pacman -Qqm)
while getopts "nvhf:" opt; do
case "$opt" in
n) DRYRUN=true ;;
v) VERBOSE=true ;;
f) OUTPUTFILE="$OPTARG" ;;
h | *)
{
printf "\nUpdate the list of installed packages.\n\nWill compare packages committed to the dotfile repository\nand those currently installed (on an Arch system, using pacman).\nUpdates the list of committed packages in repository\nand prints out the differences as a diff.\n\nOptions:\n\n\t-h\tDisplay this help.\n\t-v\tShow verbose information.\n\t-n\tPrint out changes without changing anything (dry-run).\n"
exit 1
}
;;
esac
done
# get all existing written packages
if [ -n "$INPUTFILES" ]; then
INPUT=$(cat $INPUTFILES | grep -v -e '^Name Description Source Target' | sort)
else
INPUT=""
fi
print_msg() {
# shellcheck disable=2059
[ -n "$VERBOSE" ] && printf "$@"
}
# tsv file:
# packagename, description, source, target
# toot a toot manager A D
if [ -f "${OUTPUTFILE}_TEMP" ]; then
rm "${OUTPUTFILE}_TEMP"
fi
touch "${OUTPUTFILE}_TEMP"
# create new package list
for pkg in $pkg_all; do
source=""
if echo "$pkg_repo" | grep -F -q -x "$pkg"; then
source="R"
elif echo "$pkg_aur" | grep -F -q -x "$pkg"; then
source="A"
else
echo "ERROR: The package $pkg could not be found in repositories or AUR."
exit 1
fi
desc=$(pacman -Qs "$pkg" | grep -A1 --color "local/$pkg\s" | tail -n1)
#remove leading whitespace
desc="${desc#"${desc%%[![:space:]]*}"}"
target=""
found_line=$(echo "$INPUT" | grep -e "^$pkg")
if [ -n "$found_line" ]; then
target=$(echo "$found_line" | cut -f4)
print_msg "Updating pkg: %s:%s from: %s, for: %s\n" "$pkg" "$desc" "$source" "$target"
else
print_msg "Adding pkg: %s:%s from: %s, for: %s\n" "$pkg" "$desc" "$source" "$target"
fi
printf "%s\t%s\t%s\t%s\n" "$pkg" "$desc" "$source" "$target" >>"${OUTPUTFILE}_TEMP"
done
# notify on any removed packages
while read -r line; do
if ! echo "$line" | cut -f1 | xargs -I _ grep -F -q -x _ <(echo "$pkg_all"); then
printf "REMOVED: %s\n" "$line"
fi
done <<<"<(echo $INPUT | tail +2)"
# show file changes
if [ -f "$OUTPUTFILE"_TEMP ]; then
changes=$(diff --color=always -y --suppress-common-lines <(echo "$INPUT") <(sort "$OUTPUTFILE"_TEMP | tail -n+2))
printf "FILE CHANGES:\n=============\n%s" "$changes"
fi
# actually write changes to file
if [ -z "$DRYRUN" ]; then
while IFS= read -r line; do
sed -i -e "/^${line//\//\\/}$/d" "$OUTPUTFILE"_TEMP
done <<< "$INPUT"
cat <(printf "Name\tDescription\tSource\tTarget\n") "${OUTPUTFILE}_TEMP" > "$OUTPUTFILE"
fi
rm "${OUTPUTFILE}_TEMP"

View File

@ -1,92 +0,0 @@
# Configuration for flavours
# https://github.com/Misterio77/flavours
#
# This file should contain a [[items]] section for each application you want themed
# You can also set a shell (outside items) on which to run hooks
# Check flavours repository for more information and examples
# Explanation and default values for keys:
# # Through which shell command hooks will run. The command will be replaced in '{}'
shell = "bash -c '{}'"
#
# [[items]]
# # File to inject to, supports tilde and env var expansion. required
# file = "~/.config/example"
# # Template to use. required
# template = "example"
#
# # Subtemplate to use
# subtemplate = "default"
# # If not rewriting, on which line (usually a comment) to start replacing
# start = "# Start flavours"
# # If not rewriting, on which line (usually a comment) to stop replacing
# end = "# End flavours"
# # Should we rewrite the entire file, instead of using the above delimiters?
# rewrite = false
# # Command to execute after injecting (goes through shell)
# hook = ""
# # Whether this hook should be executed when flavours is ran with lightweight flag
# light = true
[[items]]
template = "waybar"
file = "~/.local/state/waybar/colorscheme.css"
rewrite = true
light = false
hook = "killall -SIGUSR2 waybar"
[[items]]
# Uses custom nvim template to work together with
# RRethy base16 neovim plugin
template = "nvim"
file = "~/.local/state/nvim/colorscheme.lua"
rewrite = true
[[items]]
# For newer wezterm versions (missing cursor= field)
# make use of my custom wezterm template
template = "wezterm"
file = "~/.local/state/wezterm/colors.toml"
rewrite = true
[[items]]
template = "zathura"
file = "~/.local/state/zathura/zathurarc"
rewrite = true
[[items]]
template = "qutebrowser"
subtemplate = "minimal"
file = "~/.local/state/qutebrowser/colorscheme.py"
rewrite = true
light = false
hook = "pgrep -x qutebrowser && qutebrowser :config-source"
# CSS Webpage styling in qutebrowser
[[item]]
file = "~/.config/qutebrowser/stylesheets/stylesheet.css"
template = "styles"
subtemplate = "css-variables"
rewrite = false
start = "/* Start flavours */"
end = "/* End flavours */"
[[items]]
# MAKO DOES NOT SUPPORT INCLUDES YET
template = "mako"
file = "~/.config/mako/config"
light = false
rewrite = false
start = "# Start flavours"
end = "# End flavours"
hook = "killall mako"
[[items]]
# SIOYEK does not support includes afaik
template = "sioyek"
file = "~/.config/sioyek/prefs_user.config"
rewrite = false
start = "# START FLAVOURS"
end = "# END FLAVOURS"

View File

@ -1,42 +0,0 @@
-- base16-nvim (https://github.com/wincent/base16-nvim)
-- by Greg Hurrell (https://github.com/wincent)
-- based on
-- base16-vim (https://github.com/chriskempson/base16-vim)
-- by Chris Kempson (https://github.com/chriskempson)
-- using nvim-base16 neovim plugin
-- by RRethy (https://github.com/RRethy/nvim-base16)
-- {{scheme-name}} scheme by {{scheme-author}}
local function exists(plugin)
local status, lib = pcall(require, plugin)
if(status) then return true end
return false
end
if exists("mini.base16") then
require('mini.base16').setup({
palette = {
base00 = '#{{base00-hex}}',
base01 = '#{{base01-hex}}',
base02 = '#{{base02-hex}}',
base03 = '#{{base03-hex}}',
base04 = '#{{base04-hex}}',
base05 = '#{{base05-hex}}',
base06 = '#{{base06-hex}}',
base07 = '#{{base07-hex}}',
base08 = '#{{base08-hex}}',
base09 = '#{{base09-hex}}',
base0A = '#{{base0A-hex}}',
base0B = '#{{base0B-hex}}',
base0C = '#{{base0C-hex}}',
base0D = '#{{base0D-hex}}',
base0E = '#{{base0E-hex}}',
base0F = '#{{base0F-hex}}'
},
})
end
if exists("lualine") then
require("lualine").setup()
end
-- vim: filetype=lua

View File

@ -1,20 +0,0 @@
# base16-sioyek (https://github.com/loiccoyle/base16-sioyek)
# by Loic Coyle
# {{scheme-name}} scheme by{{scheme-author}}
custom_background_color #{{base00-hex}}
custom_color_mode_empty_background_color #{{base00-hex}}
custom_text_color #{{base06-hex}}
page_separator_color #{{base00-hex}}
search_highlight_color #{{base0A-hex}}
status_bar_color #{{base00-hex}}
status_bar_text_color #{{base06-hex}}
ui_text_color #{{base06-hex}}
ui_selected_text_color #{{base06-hex}}
ui_background_color #{{base01-hex}}
ui_selected_background_color #{{base03-hex}}
visual_mark_color {{base03-dec-r}} {{base03-dec-g}} {{base03-dec-b}} 0.2
text_highlight_color #{{base03-hex}}
link_highlight_color #{{base0D-hex}}
synctex_highlight_color #{{base08-hex}}

View File

@ -1,44 +0,0 @@
# Base16 {{scheme-name}} - wezterm color config
# Scheme by {{scheme-author}}
[colors]
foreground = "#{{base05-hex}}"
background = "#{{base00-hex}}"
cursor_bg = "#{{base05-hex}}"
cursor_border = "#{{base05-hex}}"
selection_bg = "#{{base05-hex}}"
selection_fg = "#{{base00-hex}}"
ansi = [
"#{{base00-hex}}",
"#{{base08-hex}}",
"#{{base0B-hex}}",
"#{{base0A-hex}}",
"#{{base0D-hex}}",
"#{{base0E-hex}}",
"#{{base0C-hex}}",
"#{{base05-hex}}"
]
brights = [
"#{{base03-hex}}",
"#{{base08-hex}}",
"#{{base0B-hex}}",
"#{{base0A-hex}}",
"#{{base0D-hex}}",
"#{{base0E-hex}}",
"#{{base0C-hex}}",
"#{{base07-hex}}"
]
[colors.tab_bar]
background = "#{{base00-hex}}"
[colors.tab_bar.inactive_tab]
bg_color = "#{{base00-hex}}"
fg_color = "#{{base05-hex}}"
[colors.tab_bar.active_tab]
bg_color = "#{{base05-hex}}"
fg_color = "#{{base00-hex}}"
[colors.tab_bar.new_tab]
bg_color = "#{{base05-hex}}"
fg_color = "#{{base00-hex}}"

View File

@ -1,32 +0,0 @@
profile docked {
output "LG Electronics W2442 0x000075FD" position 1920,0
output "LG Electronics W2442 0x000075E1" position 0,0
output eDP-1 disable
exec notify-send "💻 Display changed" "Applying docked LG profile"
}
profile docked {
output "Goldstar Company Ltd W2442 0x000075FD" position 1920,0
output "Goldstar Company Ltd W2442 0x000075E1" position 0,0
output eDP-1 disable
exec notify-send "💻 Display changed" "Applying docked Goldstar profile"
}
profile dockedall {
output "LG Electronics W2442 0x000075FD" position 1920,0
output "LG Electronics W2442 0x000075E1" position 0,0
output eDP-1 enable position 960,1080
exec notify-send "💻 Display changed" "Applying docked 3-screen profile"
}
profile portable {
output "LG Electronics W2442 0x000075FD" disable
output "LG Electronics W2442 0x000075E1" disable
output eDP-1 enable position 0,0
exec notify-send "💻 Display changed" "Applying portable profile"
}
profile portable {
output eDP-1 enable position 0,0
exec notify-send "💻 Display changed" "Applying portable profile"
}

View File

@ -1,27 +0,0 @@
sort=-time
layer=overlay
width=300
height=110
border-size=2
border-radius=15
max-icon-size=64
default-timeout=5000
ignore-timeout=1
font=monospace 14
# Intentionally left empty, automatically filled by flavours
# on switching theme.
# Start flavours
# End flavours
[urgency=critical]
#on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga
default-timeout=0
[mode=do-not-disturb]
invisible=1
[category=mpd]
default-timeout=2000
group-by=category

View File

@ -1,297 +0,0 @@
#!/usr/bin/env sh
mod="Mod4"
modemod="Mod1"
term=${TERMINAL:-foot}
time_to_lockscreen=300
time_to_screendim=600
time_to_suspend=900
## OPTIONS
riverctl spawn "dbus-update-activation-environment SEATD_SOCK DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river"
riverctl focus-follows-cursor normal
riverctl set-cursor-warp on-output-change
riverctl hide-cursor when-typing enabled
riverctl attach-mode bottom
# Set background and border color
riverctl background-color 0x000000
riverctl border-width 1
riverctl border-color-focused 0xffffff
riverctl border-color-unfocused 0x586e75
# Set repeat rate
riverctl set-repeat 75 300
# Make certain views start floating
riverctl float-filter-add app-id float
# riverctl float-filter-add title "popup title with spaces"
# # Set app-ids and titles of views which should use client side decorations
# riverctl csd-filter-add app-id "gedit"
riverctl csd-filter-remove app-id "org.pwmt.zathura"
## DEBUG
# Reload river configuration
riverctl map normal $mod+Shift F12 spawn "$HOME/.config/river/init"
## HOTKEYS
# close focused view
riverctl map normal $mod+Shift C close
# Open terminal
riverctl map normal $mod Return spawn "$term"
# Open floating terminal
riverctl map normal $mod+Control Return spawn "$term -e --class float"
# Open run menu
riverctl map normal $mod Space spawn "bemenu-run"
# Toggle status bar
riverctl map normal $mod F7 spawn "killall -SIGUSR1 waybar"
# Switch to lockscreen
riverctl map normal $mod X spawn "lockscreen"
# Open logout script
riverctl map normal $mod backspace spawn "powermenu"
# Open Bookmark search
riverctl map normal None XF86Search spawn "qutedmenu"
riverctl map normal $mod+Shift O spawn "qutedmenu"
# Open clipboard history
riverctl map normal $mod+Shift Space spawn "clipman pick --tool=bemenu"
# Open floating calculator
riverctl map normal $mod+Shift R spawn "$term -e --class float qalc"
# Open emoji picker
riverctl map normal $mod+Shift E spawn "bemoji -nt"
# Open translation helper
riverctl map normal $mod+Shift T spawn "bemenu-translate"
# Open item from library
riverctl map normal $mod+Shift L spawn "papis -s picktool dmenu open"
# Desktop theming
# shellcheck disable=SC2016
riverctl map normal $mod+Shift S spawn 'flavourchoose'
# Password dropdown frontend
riverctl map normal $mod+Shift P spawn "pass-pick"
# File upload
riverctl map normal $mod+Shift U spawn "$term -e --class float sharefile | xargs notify-send"
# Open recent downloads
riverctl map normal $mod+Shift D spawn "recently-downloaded"
# # Screenshot
riverctl map normal None Print spawn "screenshot"
riverctl map normal Shift Print spawn "screenshot | sharefile -"
riverctl map normal $mod Print spawn "screenshot region"
riverctl map normal $mod+Shift Print spawn "screenshot region | sharefile -"
# control notification daemon
riverctl map normal $mod N spawn "makoctl dismiss"
riverctl map normal $mod+Shift N spawn "makoctl dismiss --all"
riverctl map normal $mod+Control N spawn "makoctl restore"
# MOVEMENT
# focus the next/previous view in the layout stack
riverctl map normal $mod J focus-view next
riverctl map normal $mod K focus-view previous
# swap the focused view with the next/previous view in the layout stack
riverctl map normal $mod+Shift J swap next
riverctl map normal $mod+Shift K swap previous
# bump the focused view to the top of the layout stack
riverctl map normal $mod+Shift Return zoom
# change layout orientation
riverctl map normal $mod Up send-layout-cmd rivercarro "main-location top"
riverctl map normal $mod Right send-layout-cmd rivercarro "main-location right"
riverctl map normal $mod Down send-layout-cmd rivercarro "main-location bottom"
riverctl map normal $mod Left send-layout-cmd rivercarro "main-location left"
# snap views to screen edges
riverctl map normal $mod+Control H snap left
riverctl map normal $mod+Control J snap down
riverctl map normal $mod+Control K snap up
riverctl map normal $mod+Control L snap right
# Mod+F to toggle fullscreen
riverctl map normal $mod F toggle-fullscreen
# shellcheck disable=SC2016
# Make all connected outputs show the desktop and no windows at all
riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl set-focused-tags $((1 << 10)); riverctl focus-output next; done; riverctl set-focused-tags $((1 << 10)); riverctl focus-output next'
riverctl map normal $mod+Shift F10 spawn 'riverctl send-layout-cmd rivercarro "gaps 0"'
riverctl map normal $mod F10 spawn 'riverctl send-layout-cmd rivercarro "gaps 6"'
# toggle float
riverctl map normal $mod+Shift v toggle-float
# Mod + Left Mouse Button to move views
riverctl map-pointer normal $mod BTN_LEFT move-view
# Mod + Right Mouse Button to resize views
riverctl map-pointer normal $mod BTN_RIGHT resize-view
### Begin resize and moving mode, for floating windows
riverctl declare-mode interact_float
riverctl map normal $modemod R enter-mode interact_float
riverctl map interact_float $modemod R enter-mode normal
# resize views on screen
riverctl map interact_float $mod H resize horizontal -100
riverctl map interact_float $mod J resize vertical 100
riverctl map interact_float $mod K resize vertical -100
riverctl map interact_float $mod L resize horizontal 100
# move views around screen
riverctl map interact_float $mod+Shift H move left 100
riverctl map interact_float $mod+Shift J move down 100
riverctl map interact_float $mod+Shift K move up 100
riverctl map interact_float $mod+Shift L move right 100
# decrease/increase the main ratio of layout
riverctl map interact_float None H send-layout-cmd rivercarro "main-ratio -0.05"
riverctl map interact_float None L send-layout-cmd rivercarro "main-ratio +0.05"
# increment/decrement the main layout
riverctl map interact_float None J send-layout-cmd rivercarro "main-count +1"
riverctl map interact_float None K send-layout-cmd rivercarro "main-count -1"
### End resize and moving mode
# focus the next/previous output
riverctl map normal $mod Period focus-output next
riverctl map normal $mod Comma focus-output previous
# send the focused view to the next/previous output
riverctl map normal $mod+Shift Period send-to-output next
riverctl map normal $mod+Shift Comma send-to-output previous
# set up 10 tags (with '0' opening the 10th one)
for i in $(seq 0 9); do
tags="$((1 << (i - 1)))"
if [ "$i" -eq 0 ]; then tags="$((1 << 9))"; fi
# Mod+[1-9] to focus tag [0-8]
riverctl map normal $mod "$i" set-focused-tags $tags
# Mod+Shift+[1-9] to tag focused view with tag [0-8]
riverctl map normal $mod+Shift "$i" set-view-tags $tags
# Mod+Ctrl+[1-9] to toggle focus of tag [0-8]
riverctl map normal $mod+Control "$i" toggle-focused-tags $tags
# Mod+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view
riverctl map normal $mod+Shift+Control "$i" toggle-view-tags $tags
done
# focus all tags
all_tags=$(((1 << 32) - 1))
riverctl map normal $mod equal set-focused-tags $all_tags
# tag focused view with all tags
riverctl map normal $mod+Shift equal set-view-tags $all_tags
# Various media key mapping examples for both normal and locked mode which do
# not have a modifier
for mode in normal locked; do
# Eject the optical drive
riverctl map $mode None XF86Eject spawn 'eject -T'
riverctl map -repeat $mode None XF86AudioRaiseVolume spawn 'pactl set-sink-volume @DEFAULT_SINK@ +5%'
riverctl map -repeat $mode None XF86AudioLowerVolume spawn 'pactl set-sink-volume @DEFAULT_SINK@ -5%'
riverctl map $mode None XF86AudioMute spawn 'pactl set-sink-mute @DEFAULT_SINK@ toggle'
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'
riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause'
riverctl map $mode None XF86AudioPrev spawn 'playerctl previous'
riverctl map $mode None XF86AudioNext spawn 'playerctl next'
# You can control screen backlight brighness with light (https://github.com/haikarainen/light); but we prefer brightnessctl
riverctl map -repeat $mode None XF86MonBrightnessUp spawn 'brightnessctl set 10%+'
riverctl map -repeat $mode None XF86MonBrightnessDown spawn 'brightnessctl set 10%-'
done
# The scratchpad will live on an unused tag. Which tags are used depends on your
# config, but rivers default uses the first 9 tags.
scratch_tag=$((1 << 20))
# Toggle the scratchpad with Super+P
riverctl map normal $mod grave toggle-focused-tags ${scratch_tag}
# Send windows to the scratchpad with Super+Shift+P
riverctl map normal $mod+Shift grave set-view-tags ${scratch_tag}
# Set spawn tagmask to ensure new windows don't have the scratchpad tag unless
# explicitly set.
all_but_scratch_tag=$((((1 << 32) - 1) ^ scratch_tag))
riverctl spawn-tagmask ${all_but_scratch_tag}
# set up scratch pad for todo and 'drop-down' terminal
# call scratchpads to current workspace -- scratchpads started on i3 starting (see end of file)
# bindsym $mod+t [class="scratchpad" title="dropdown-todo"] scratchpad show
# bindsym $mod+Shift+Return [class="scratchpad" title="dropdown-terminal"] scratchpad show
## INPUT
# device (touchscreen)
# enable touch clicking for touchpads
for pad in $(riverctl list-inputs | grep -i touchpad); do
riverctl input "$pad" events enabled
riverctl input "$pad" tap enabled
done
for pad in $(riverctl list-inputs | grep -i touchscreen); do
riverctl input "$pad" events enabled
riverctl input "$pad" tap enabled
riverctl input "$pad" drag enabled
riverctl input "$pad" pointer-accel 0.5
done
setxkbmap -option "compose:menu"
# start dynamic display configuration
[ "$(pidof kanshi)" -eq 0 ] || riverctl spawn kanshi
# set a nice wallpaper
if exist swww; then
riverctl spawn "swww init"
outputs=$(swww query | cut -d':' -f1)
if [ "$(echo "$outputs" | grep -c -e '^DP')" -eq 2 ] && [ -e "$HOME/pictures/wall_r.jpg" ]; then
swww img -o "$(echo "$outputs" | head -n1)" "$HOME/pictures/wall_l.jpg"
swww img -o "$(echo "$outputs" | tail -n1)" "$HOME/pictures/wall_r.jpg"
elif [ -e "$HOME/pictures/wall.jpg" ]; then
swww img "$HOME/pictures/wall.jpg"
fi
fi
# start status bar
killall waybar
riverctl spawn waybar
# start redshift-like sundown warming using current location or standard values
killall wlsunset
loc=$(curl ipinfo.io | grep -e '"loc": ' | sed -e 's/^.*"loc": "\(.*\)",$/\1/')
if [ -n "$loc" ]; then
riverctl spawn "wlsunset -l \"$(echo "$loc" | cut -d, -f1)\" -L \"$(echo "$loc" | cut -d, -f2)\""
else
riverctl spawn "wlsunset -S \"09:00\" -s \"21:00\" -d \"3600\""
fi
unset loc
# start screen idle locking/dimming/sleep tool
killall swayidle
riverctl spawn "swayidle \
timeout ${time_to_suspend} \"[ $(cat /sys/class/power_supply/AC/online) -eq 0 ] && systemctl suspend-then-hibernate\"
timeout ${time_to_screendim} \"wlopm --off '*'\" \
resume \"wlopm --on '*'\" \
timeout ${time_to_lockscreen} \"pidof waylock || lockscreen\" \
after-resume \"wlopm --on '*'\" \
before-sleep \"pidof waylock || lockscreen\" &"
killall clipman
riverctl spawn "wl-paste -t text --watch clipman store"
# bash ~/.config/bin/gtktheme # setting our gtk variables
# killall polkit-gnome-authentication-agent-1
# /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
# start layouting engine
killall rivercarro
riverctl spawn "rivercarro -main-ratio 0.65"
# River will send the process group of the init executable SIGTERM on exit.
riverctl default-layout rivercarro
# exec rivercarro -main-ratio 0.65 -view-padding 6 -outer-padding 6 & # -> does not work with current rivercarro version (0.1.4)
brightnessctl set 70%

View File

@ -1,3 +0,0 @@
#!/usr/bin/env sh
export XKB_DEFAULT_OPTIONS='compose:menu'

View File

@ -1,185 +0,0 @@
{
"layer": "top",
"modules-left": ["river/tags", "custom/events", "custom/vidl", "river/window"],
"modules-center": ["clock", "custom/media"],
"modules-right": ["river/mode", "custom/wireguard", "custom/archupdates", "pulseaudio", "backlight", "network", "cpu", "memory", "temperature", "battery", "tray"],
"custom/archupdates": {
"format": "{} {icon}",
"format-alt-click": "right",
"format-icons": {
"default": ""
},
"return-type": "json",
"exec": "~/.config/waybar/modules/archupdates 5 json",
"interval": 3600,
"on-click": "$TERMINAL start --class float topgrade"
},
"backlight": {
"device": "intel_backlight",
"format": "{percent}% {icon}",
"format-icons": ["滋", "", "", ""],
"on-scroll-up": "brightnessctl set 1%+",
"on-scroll-down": "brightnessctl set 1%-"
},
"battery": {
"format": "{capacity}% {icon}",
"format-alt":"{capacity}% ({time}) {icon}",
"format-alt-click": "click-right",
"format-icons": ["", "", "", "", ""],
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
},
"clock": {
"format-alt": "{:%a, %d. %b %H:%M}",
"format-alt-click": "click-right",
"on-click": "gsimplecal"
},
"cpu": {
"interval": 10,
"format": "{usage}% ",
"max-length": 10,
"states": {
"warning": 50,
"critical": 80
},
"on-click": "$TERMINAL start --class float top",
"on-click-right": "$TERMINAL start --class float glances"
},
"custom/events": {
"format": "{}",
"interval": 300,
"exec": "~/.config/waybar/modules/khal.py 2>/dev/null",
"exec-if": "command -v khal >/dev/null 2>&1",
"return-type": "json",
"on-click": "$TERMINAL start --class float ikhal"
},
"memory": {
"interval": 30,
"format": "{avail:0.1f}G ",
"format-alt": "{used:0.1f}G/{total:0.1f}G ",
"format-alt-click": "click-right",
"max-length": 10
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}",
"format-disconnected": "ﱙ",
"format-stopped": "",
"interval": 10,
"consume-icons": {
"on": " " // Icon shows only when "consume" is on
},
"random-icons": {
"on": " "
},
"repeat-icons": {
"on": " "
},
"single-icons": {
"on": "1 "
},
"state-icons": {
"paused": "",
"playing": "",
},
"tooltip-format": "{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ",
"tooltip-format-disconnected": "MPD (disconnected)"
},
"custom/media": {
"format": "{icon}{}",
"format-alt-click": "right",
"return-type": "json",
"format-icons": {
"Playing": " ",
"Paused": " ",
},
"escape": true,
"max-length":70,
"exec": "playerctl -a metadata --format '{\"text\": \"\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F",
"exec-if": "command -v playerctl >/dev/null 2>&1",
"on-click": "playerctl play-pause",
"on-click-right": "playerctl stop",
},
"network": {
"format": "{ifname}",
"format-wifi": "{signalStrength}% ",
"format-ethernet": "{ipaddr}/{cidr} 󰈀",
"format-disconnected": "󰖪",
"tooltip-format": "{ifname} via {gwaddr} 󰈁",
"tooltip-format-wifi": "{essid}: {bandwidthDownBits}-{bandwidthUpBits} ({signalStrength}%)  {ifname}",
"tooltip-format-ethernet": "{ifname} 󰈀",
"tooltip-format-disconnected": "Disconnected",
"max-length": 50,
"on-click": "$TERMINAL start --class float nmtui",
// "on-click-right": "sudo rfkill toggle wlan"
},
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon} ",
"format-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "󰋎",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"scroll-step": 1,
"on-click": "$TERMINAL start --class float pulsemixer",
"on-scroll-up": "pactl set-sink-volume @DEFAULT_SINK@ +1%",
"on-scroll-down": "pactl set-sink-volume @DEFAULT_SINK@ -1%"
},
"river/tags": {
"num-tags": 10,
"tag-labels": [ "", "", "", "", "", "", "", "", "", "" ]
},
"river/mode": {
"format": "{} 󱐁",
},
"river/window": {
"format": " {}",
"max-length": 70
},
"temperature": {
// "thermal-zone": 2,
"hwmon-path": "/sys/class/hwmon/hwmon5/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}° ",
"format": "{temperatureC}° ",
"on-click": "$TERMINAL start --class float watch sensors"
},
"tray": {
"icon-size": 21,
"spacing": 10
},
"custom/weather": {
"exec": "curl 'https://wttr.in/?format=%t'",
"exec-if": "command -v curl >/dev/null 2>&1",
"interval": 3600
},
"custom/wireguard": {
"format-icons": {
"default": "󰖂"
},
"exec": "~/.config/waybar/modules/wireguard json",
"exec-if": "command -v nmcli >/dev/null 2>&1",
"return-type": "json",
"signal": 6,
"interval": 60,
},
"custom/vidl": {
"format": "{} {icon}",
"format-alt-click": "right",
"format-icons": {
"default": ""
},
"exec": "wc -l ~/.local/share/vidl/vidl_queue | cut -d' ' -f1",
"exec-if": "[ -f ~/.local/share/vidl/vidl_queue ]",
"interval": 5,
"on-click": "$TERMINAL start --class float nvim ~/.local/share/vidl/vidl_queue"
},
}

View File

@ -1,58 +0,0 @@
#!/bin/sh
#
# Check for available archupdates and return their number.
# Checks both repositories and aur,
# returns empty string when 0 packages are available, so
# that polybar simply displays nothing.
# Can be used to generate json-like output for waybar.
#
# dependencies: yay, (pacman-contrib optional)
# optional: jq
#
# Takes 2 arguments:
# Takes an optional integer argument, which is the minimum
# numer of package updates for an answer to be returned.
min_upd=${1:-0}
# Takes as second optional argument the output format
# Valid value is "json", everything else returns plain-text.
# json output requires jq.
format=${2:-plain}
# prefer checkupdates since it allows checking w/o partial upgrade
if command -v "checkupdates" >/dev/null; then
updates_repo="$(checkupdates 2>&1)"
fi
# fall back to yay, but be aware it will not find everything
# if checkupdates finds nothing or returns an error
if [ "$updates_repo" = "" ] || [ -z "${updates_repo##*==> ERROR: Cannot fetch updates*}" ]; then
updates_repo="$(yay -Qun 2>/dev/null)"
fi
updates_repo=$(echo "$updates_repo" | wc -l)
updates_aur="$(yay -Qum 2>/dev/null | wc -l)"
# updates_aur=$(cower -u 2> /dev/null | wc -l)
# updates_aur=$(trizen -Su --aur --quiet | wc -l)
# updates_aur=$(pikaur -Qua 2> /dev/null | wc -l)
# updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l)
updates=$((updates_repo + updates_aur))
text="${updates}"
alt="${updates_repo}|${updates_aur}"
tooltip="Repositories: ${updates_repo} | AUR: ${updates_aur}"
[ "$updates" -gt "$min_upd" ] && class="available" || class="empty"
if [ "$format" = "json" ]; then
printf "{\"text\": \"%s\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": \"%s\"}" \
"$text" \
"$alt" \
"$tooltip" \
"$class"
exit
fi
if [ "$updates" -gt "$min_upd" ]; then
echo "$updates"
else
echo ""
fi

View File

@ -1,35 +0,0 @@
#!/usr/bin/env python
# from https://gist.github.com/bjesus/178a9bd3453470d74803945dbbf9ed40
# List upcoming khal events in simple json container fit for waybar
import subprocess
import datetime
import json
from html import escape
data = {}
today = datetime.date.today().strftime("%Y-%m-%d")
next_week = (datetime.date.today() + datetime.timedelta(days=10)).strftime("%Y-%m-%d")
output = subprocess.check_output("khal list now " + next_week, shell=True)
output = output.decode("utf-8")
lines = output.split("\n")
new_lines = []
for line in lines:
clean_line = escape(line).split(" ::")[0]
if len(clean_line) and not clean_line[0] in ["0", "1", "2"]:
clean_line = "\n<b>" + clean_line + "</b>"
new_lines.append(clean_line)
output = "\n".join(new_lines).strip()
if today in output:
data["text"] = "" + output.split("\n")[1]
else:
data["text"] = ""
data["tooltip"] = output
print(json.dumps(data))

View File

@ -1,151 +0,0 @@
#!/usr/bin/env bash
# nmcli WireGuard abstraction layer for use with my waybar module and rofi custom menu script
#
# requires nmcli on your path
# install to the same directory as wireguard-rofi.sh
#
# usage: ./wireguard.sh [menu|toggle NAME]
# no argument: print current connections
# json: print waybar-ready json output
# menu: print all connections
# toggle NAME: toggle connection NAME
if ! command -v nmcli >/dev/null 2>&1; then
echo "err: nmcli not found"
exit 1
fi
nargs=$#
showmenu="no"
dotoggle="no"
printjson="no"
if [[ $nargs == 1 ]]; then
if [[ $1 == "menu" ]]; then
showmenu="yes"
elif [[ $1 == "json" ]]; then
printjson="yes"
fi
elif [[ $nargs == 2 ]]; then
if [[ $1 == "toggle" ]]; then
dotoggle="yes"
conn="$2"
fi
fi
nmclicmd="nmcli connection"
wgconns="$nmclicmd show"
wgactive="$wgconns --active"
connected=()
available=()
function print_as_json() {
text="󰖂" # only prints a single icon when connected
# text="${1}" # use this line to show all output in text
alt="${1}"
tooltip="${1}"
[ -n "$1" ] && class="connected" || class="disconnected"
printf "{\"text\": \"%s\", \"alt\": \"%s\", \"tooltip\": \"%s\", \"class\": \"%s\"}" \
"$text" \
"$alt" \
"$tooltip" \
"$class"
}
function get_conns {
while read -r name _ type device; do
if [[ $type != "wireguard" && ($type != "tun" || $device != "proton0") ]]; then
continue
fi
if [[ $device != "--" ]]; then
while read -r key value; do
if [[ $key != "ipv4.addresses:" ]]; then
continue
fi
connected+=("$name: $value")
done < <($wgconns "$name")
else
available+=("$name")
fi
done < <($1)
}
function get_pia {
if ! command -v piactl >/dev/null 2>&1; then
return 1
fi
status=$(piactl get connectionstate)
if [[ $status = "Connected" ]]; then
connected+=("$(piactl get region): $(piactl get vpnip)")
fi
}
function print_conns {
local first="yes"
local array_print="$1[@]"
local array_print=("${!array_print}")
if [[ $2 == "list" ]]; then
for c in "${array_print[@]}"; do
output="$1: $c"
done
else
output=""
for c in "${array_print[@]}"; do
if [[ "$first" != "yes" ]]; then
output+=" | "
fi
output+="$c"
first="no"
done
fi
if [[ "$printjson" == "yes" ]]; then
print_as_json "$output"
else
echo "$output"
fi
}
function array_contains {
local array_has="$1[@]"
local array_has=("${!array_has}")
local element="$2"
for e in "${array_has[@]}"; do
if [[ "$e" == *"$element"* ]]; then
echo "yes"
return
fi
done
echo "no"
}
if [[ $nargs == 0 ]] || [[ $printjson = "yes" ]]; then
get_conns "$wgactive"
get_pia
print_conns connected
elif [[ $showmenu == "yes" ]]; then
get_conns "$wgconns"
get_pia
print_conns connected "list"
print_conns available "list"
elif [[ $dotoggle == "yes" ]]; then
get_conns "$wgconns"
get_pia
if [[ "$(array_contains connected "$conn")" == "yes" ]]; then
$nmclicmd down "$conn"
elif [[ "$(array_contains available "$conn")" == "yes" ]]; then
$nmclicmd up "$conn"
else
echo "err: connection not found"
exit 1
fi
else
echo "err: wrong args"
exit 1
fi

View File

@ -1,162 +0,0 @@
* {
border: none;
border-radius: 0;
min-height: 0;
font-family: Cantarell, Signika, Iosevka Nerd Font, Iosevka, monospace;
}
window#waybar {
font-size: 15px;
color: @base0F;
background-color: @base00;
border-bottom: 1px solid @base01;
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
opacity: 0.2;
}
#tags button {
font-size:17px;
font-weight:900;
background-color: transparent;
color: @base03;
margin: 0px;
padding: 0px 5px;
/* Use box-shadow instead of border so the text isn't offset */
}
/* /1* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect *1/ */
#tags button:hover {
background: rgba(0, 0, 0, 0.2);
/* box-shadow: inset 0 -1px #d5c4a1; */
box-shadow: inset 0 0;
}
#tags button.occupied {
font-weight: 400;
color: @base05;
}
#tags button.focused {
font-weight: 400;
color: @base0D;
}
#tags button.urgent {
color: @base0C;
}
#clock,
#battery,
#cpu,
#memory,
#disk,
#temperature,
#backlight,
#network,
#pulseaudio,
#tray,
#mode,
#idle_inhibitor,
#mpd,
#window,
#custom-archupdates,
#custom-wireguard,
#custom-events,
#custom-vidl,
#custom-media {
padding: 0 10px;
margin: 0 5px;
color: @base05;
background-color: @base01;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #tags {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #tags {
margin-right: 0;
}
#battery.charging, #battery.plugged {
background-color: @base02;
}
/* Mark active output through highlighted window background */
#window {
background-color: transparent;
}
#window.focused {
background-color: @base01;
}
#battery.warning {
background-color: @base09;
color: @base00;
}
@keyframes blink {
to {
background-color: @base08;
color: @base00;
}
}
#battery.critical:not(.charging) {
color: @base05;
background-color: @base00;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#cpu.warning {
color: @base00;
background-color: @base0A;
}
#cpu.critical {
color: @base05;
background-color: @base08;
}
#custom-archupdates.empty {
background-color: transparent;
color: transparent;
font-size: 0;
margin: 0;
padding: 0;
}
#custom-wireguard.disconnected {
background-color: transparent;
color: transparent;
font-size: 0;
margin: 0;
padding: 0;
}
#temperature.critical {
background-color: @base08;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
}
#mpd.disconnected {
background-color: transparent;
color: transparent;
font-size: 0;
margin: 0;
padding: 0;
}
@import "/home/marty/.local/state/waybar/colorscheme.css";

View File

@ -1,26 +0,0 @@
#!/usr/bin/env sh
picker=dmenu
if exist bemenu; then
picker=bemenu
elif exist wofi; then
picker=wofi
elif exist rofi; then
picker=rofi
fi
list=$(flavours list -l)
flavour=$(printf "%s\nrandom\nlight" "$list" | "$picker")
if [ -z "$flavour" ]; then
return
elif [ "$flavour" = "random" ]; then
flavours apply '*'
elif [ "$flavour" = "light" ]; then
flavours apply '*light'
else
flavours apply "$flavour"
fi
if [ "$1" = '-v' ]; then
notify-send "Theme set" "set to: $flavour"
fi

View File

@ -1,48 +0,0 @@
#!/usr/bin/env sh
# Take a screenshot on wayland
# By default takes a screenshot of the whole desktop
# If 'region' or 'area' command is passed in will allow selecting a region to screenshot.
# Example: `screenshot region`
TIME="$(date +%Y-%m-%d-%H-%M-%S)"
readonly TIME
readonly TMPSCREENSHOTDIR="$HOME/.cache/screenshot"
readonly TMPIMGPATH="$TMPSCREENSHOTDIR/img-$TIME.png"
FULLSCREEN=true
if [ "$1" = "area" ] || [ "$1" = "region" ]; then
FULLSCREEN=false
fi
main() {
prepare_cache
take_screenshot "$FULLSCREEN"
if [ -n "$SCREENSHOT_POSTPROCESS" ]; then
eval "$SCREENSHOT_POSTPROCESS"
else
postprocess
fi
}
prepare_cache() {
if [ ! -d "$TMPSCREENSHOTDIR" ]; then
mkdir -p "$TMPSCREENSHOTDIR"
fi
}
take_screenshot() {
if $1; then
grim "$TMPIMGPATH"
else
grim -g "$(slurp)" "$TMPIMGPATH"
fi
}
postprocess() {
notify-send -i "$TMPIMGPATH" "Screenshot taken" "$TMPIMGPATH"
echo "$TMPIMGPATH" | wl-copy
echo "$TMPIMGPATH"
}
main "$@"

View File

@ -1,94 +0,0 @@
# Wayland desktop environment
Contains:
[riverwm](https://github.com/riverwm/river)
[waybar](https://github.com/Alexays/Waybar)
mako -- notification daemon
font settings
kanshi -- display output setup
The thoughts below are overhauled and fairly old - they are still based on my first days and weeks on wayland.
Takeaway is this: I love the river wm, waybar is unexciting but does what it's supposed to and the wayland environment is totally worth it.
---
My first foray into wayland is based on river,
a tiling window manager somewhat based on bspwm.
This is only a very work-in-progress README file.
Since wayland handles key presses and so on completely differently
from X,
I can't for example use sxhkd anymore which is a shame.
On the other hand, there is an amazing key *re* binding tool
(which also works under X I've now found out)
`keyd` which takes care of some X functionality (xcape) at a lower level.
I have not found a good replacement for `clutter`
(which automatically hides your mouse cursor after inactivity)
which is independent from the window manager.
I believe `swaywm` would include similar functionality, but `river` does not.
## River
River is set up to come close to my old i3 setup.
Of course, some mappings are different
(especially those for movement between windows),
but overall the keys map to the old ones.
Since the window manager now also takes over the task of compositor
and does not pass through all keys to all programs,
it takes over the role of `sxhkd` as well and summons other programs.
I am not entirely sure how I feel about this bundling of tasks into one application,
but so far it works.
Since river is also, mimicking bspwm, using an executable file
(any executable file)
as its configuration file it is also reasonable that the setup can be tamed and refactored better than a single i3 configuration file.
## Waybar
Waybar replaces the old [polybar](https://gitlab.com/marty-oehme/dotfiles/-/tree/89d1402b3e711c4aa473386e47e84f3593e5ae56/polybar) setup.
It displays the first 10 tags on its left,
with tags highlighted that are either occupied by windows or currently in focus.
In the center it displays a clock which can be clicked to open a simple calendar.
![Simple waybar configuration](.assets/waybar/simple.png)
To the right is where most of the info modules are:
If there are upcoming events listed for the khal application, it will display a calendar module here.
If music is playing through an mpris-compatible player, its status is shown here.
If a connection through wireguard or over a vpn tunnel is established, it is shown here.
Then, from left to right, audio, brightness, wifi, cpu, ram, temperature, and battery information are displayed.
Some displays have alternative display states, with for example the battery showing remaining time and ram information showing used and total available.
Clicking on:
* audio opens pulsemixer
* network opens nmtui
* cpu opens top (or glances on right-click)
* temperature shows sensors
## keyd
keyd is set up within `/etc/` and not in the dotfiles themselves.
If using the included `./install.sh` file, there is an option to also set up files outside the home directory, including keyd options.
It is configured through `/etc/keyd/default.cfg`.
Currently, it takes care of mapping `capslock` to both control and escape (depending on if its used alone or with other keys),
as well as adding some German characters that I am otherwise missing on my en_US keyboard.
Lastly, it allows easy clipboard pasting with the `insert` key.
## Swaybg
`swaybg` is used to set the wallpaper from the river configuration file.
## Missing
things not yet set up:
* [-] modes: media, academia (worth?)
* [ ] display current desktop mode in status bar

View File

@ -1 +0,0 @@
../udiskie.service

View File

@ -1,9 +0,0 @@
[Unit]
Description=Automated mounting of removable devices (udisks)
[Service]
ExecStart=/usr/bin/udiskie --config %h/.config/udiskie/config.yml
Restart=always
[Install]
WantedBy=default.target

View File

@ -1,9 +0,0 @@
program_options:
tray: auto
automount: true
notify: true
device_config:
# ignore any snap loopback devices
# see https://github.com/coldfix/udiskie/issues/180
- id_type: squashfs
ignore: true

View File

@ -1,9 +0,0 @@
# Removable disk configuration
This simple unit depends on `udiskie2` being installed and enables auto-mounting of any inserted removable media.
It will additionally *ignore* any snaps managed by `snapd`, since they would otherwise be detected as loopback devices.
Automatically installs a `systemd` service which is also enabled to start up on system start (as a user service).
The end result is `udiskie` 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.

433
dunst/.config/dunst/dunstrc Normal file
View File

@ -0,0 +1,433 @@
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x5-30+20"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 20
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#aaaaaa"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = auto
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
idle_threshold = 120
### Text ###
font = Monospace 10
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = full
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Stack together notifications with the same content
stack_duplicates = true
# Hide the count of stacked notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = off
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = xdg-open
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
# Manage dunst's desire for talking
# Can be one of the following values:
# crit: Critical features. Dunst aborts
# warn: Only non-fatal warnings
# mesg: Important Messages
# info: all unimportant stuff
# debug: all less than unimportant stuff
verbosity = mesg
# Define the corner radius of the notification window
# in pixel size. If the radius is 0, you have no rounded
# corners.
# The radius will be automatically lowered if it exceeds half of the
# notification height to avoid clipping text and/or icons.
corner_radius = 1
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
### mouse
# Defines action of mouse event
# Possible values are:
# * none: Don't do anything.
# * do_action: If the notification has exactly one action, or one is marked as default,
# invoke it. If there are multiple and no default, open the context menu.
# * close_current: Close current notification.
# * close_all: Close all notifications.
mouse_left_click = close_current
mouse_middle_click = close_all
mouse_right_click = do_action
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#222222"
foreground = "#888888"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#285577"
foreground = "#ffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#900000"
foreground = "#ffffff"
frame_color = "#ff0000"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
#
# Messages can be matched by
# appname (discouraged, see desktop_entry)
# body
# category
# desktop_entry
# icon
# match_transient
# msg_urgency
# stack_tag
# summary
#
# and you can override the
# background
# foreground
# format
# frame_color
# fullscreen
# new_icon
# set_stack_tag
# set_transient
# timeout
# urgency
#
# Shell-like globbing will get expanded.
#
# Instead of the appname filter, it's recommended to use the desktop_entry filter.
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
# Disable the transient hint so that idle_threshold cannot be bypassed from the
# client
#[transient_disable]
# match_transient = yes
# set_transient = no
#
# Make the handling of transient notifications more strict by making them not
# be placed in history.
#[transient_history_ignore]
# match_transient = yes
# history_ignore = yes
# fullscreen values
# show: show the notifications, regardless if there is a fullscreen window opened
# delay: displays the new notification, if there is no fullscreen window active
# If the notification is already drawn, it won't get undrawn.
# pushback: same as delay, but when switching into fullscreen, the notification will get
# withdrawn from screen again and will get delayed like a new notification
#[fullscreen_delay_everything]
# fullscreen = delay
[fullscreen_show_critical]
msg_urgency = critical
fullscreen = show
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[skip-display]
# # This notification will not be displayed, but will be included in the history
# summary = "foobar"
# skip_display = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
#[stack-volumes]
# appname = "some_volume_notifiers"
# set_stack_tag = "volume"
#
# vim: ft=cfg
# Base16 tomorrow-night - dunst color config
frame_color = "#c5c8c6"
separator_color = "#c5c8c6"
[base16_low]
msg_urgency = low
background = "#282a2e"
foreground = "#969896"
[base16_normal]
msg_urgency = normal
background = "#373b41"
foreground = "#c5c8c6"
[base16_critical]
msg_urgency = critical
background = "#cc6666"
foreground = "#e0e0e0"
# Base16End tomorrow-night - dunst color config

View File

@ -1,6 +1,7 @@
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- Replacements from http://bohoomil.com/doc/05-fonts/ (until ibfonts-meta-extended) -->
<alias>
<family>serif</family>
<prefer><family>Heuristica</family></prefer>
@ -11,7 +12,7 @@
</alias>
<alias>
<family>monospace</family>
<prefer><family>Iosevka Nerd Font</family></prefer>
<prefer><family>Iosevka</family></prefer>
</alias>
<alias>
<family>fantasy</family>
@ -21,27 +22,40 @@
<family>cursive</family>
<prefer><family>Comic Neue</family></prefer>
</alias>
<!-- more advanced replacements (replacing many fonts with open alternatives) see spark/fonts/local.conf -->
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit name="rgba" mode="assign">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit name="lcdfilter" mode="assign">
<const>lcddefault</const>
</edit>
</match>
<match target="font">
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
</match>
<match target="pattern">
<edit name="dpi" mode="assign">
<double>93</double>
<double>92</double>
</edit>
</match>
</fontconfig>

View File

@ -1,77 +1,24 @@
[user]
email = marty.oehme@gmail.com
name = Marty Oehme
signingkey = 73BA40D5AFAF49C9
[init]
defaultBranch = main
[core]
pager = git delta
[pager]
difftool = true
[interactive]
diffFilter = git delta --color-only
[merge]
conflictstyle = diff3
[delta]
navigate = true
line-numbers = true
syntax-theme = base16
[sendemail]
smtpserver = "/usr/bin/msmtp"
annotate = yes
email = marty.oehme@gmail.com
name = Marty Oehme
signingkey = 0CCB0526EFB9611A
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[alias]
ignore = "!gitignore -f"
last = "diff HEAD~ HEAD"
pushall = "!git remote | xargs -I R git push R" # push to all connected remotes
fetchall = "!git remote | xargs -I R git fetch R" # fetch from all connected remotes
diffword = "!git diff --word-diff=color --word-diff-regex='[0-9A-Za-z_]+'" # word-wise diff, good for prose
diffsyn = "!git difftool --tool difftastic" # add syntax-driven diff using treesitter
diffside = "!DELTA_FEATURES='+side-by-side' git diff" # add side-by-side diffing
delta = "![ $TERM_DARK = false ] && delta --light || delta" # Take care that we always display right color scheme
[commit]
gpgsign = true # sign commits as me
verbose = true # Always show diff when preparing commit message
[fetch]
prune = true # remove references to non-existent remote branches
[pull]
rebase = true # always rebase on pulling, obviates merge commits
[diff]
colorMoved = zebra # also color stuff that has simply been moved, in a classy zebra-color
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[color "diff"]
meta = "9"
frag = "magenta bold"
commit = "yellow bold"
old = "red bold"
new = "green bold"
whitespace = "red reverse"
[color "diff-highlight"]
oldNormal = "red bold"
oldHighlight = "red bold 52"
newNormal = "green bold"
newHighlight = "green bold 22"
[rebase]
autostash = true
autoSquash = true
# Make use of git urls for git{lab,hub}, but only do so for pushing
# since pulling will create troubles with some applications
ignore = "!gitignore -f"
pushmerge = "push -o merge_request.merge_when_pipeline_succeeds" # see https://docs.gitlab.com/ce/user/project/push_options.html#merge-when-pipeline-succeeds-alias
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"
pushInsteadOf = "http://github.com/"
pushInsteadOf = "gh:"
pushInsteadOf = "http://github.com/"
pushInsteadOf = "gh:"
[url "git@gitlab.com:"]
pushInsteadOf = "https://gitlab.com"
pushInsteadOf = "http://gitlab.com"
[url "git@git.martyoeh.me:"]
pushInsteadOf = "https://git.martyoeh.me"
pushInsteadOf = "http://git.martyoeh.me"
pushInsteadOf = "git@martyoeh.me"
pullInsteadOf = "git@martyoeh.me"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
pushInsteadOf = "http://gitlab.com"
[commit]
# sign commits as me
gpgsign = true
# Show diff when preparing commit message
verbose = true

View File

@ -1,115 +1,58 @@
#!/usr/bin/env sh
if ! exist git; then
return 1
fi
# git alias
if exist git; then
alias g='git'
# print git version output and get raw version number by stripping prefix
git_version=$(git --version 2>/dev/null)
git_version="${git_version##git version }"
alias ga='git add'
alias gaa='git add --all'
alias gai='git add -i'
alias gb='git branch'
alias gbd='git branch -d'
alias g='git'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias ga='git add'
alias gaa='git add --all'
alias gai='git add -i'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcb='git checkout -b'
alias gco='git checkout'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gd='git diff'
alias gds='git diff --staged'
if version_at_least 2.23 "$git_version"; then
alias gcm='git switch master 2>/dev/null || git switch main'
alias gcd='git switch develop 2>/dev/null || git switch staging'
gcb() {
git switch "$@" 2>/dev/null || git switch -c "$@"
}
else
alias gcm='git checkout master 2>/dev/null || git checkout main'
alias gcd='git checkout develop'
alias gcb='git checkout -b'
fi
alias gco='git checkout'
alias gi='git ignore'
alias gi='git ignore'
alias glog='git log --stat'
alias glg='git log --oneline --decorate --graph'
alias glga='git log --oneline --decorate --graph --remotes --all'
alias glgp='git log --stat -p'
# normal diff
alias gd='git diff'
alias gds='git diff --staged'
# word-based diff (with custom word regex)
alias gdw='git diffword'
alias gdws='git diffword --staged'
# side-by-side diff
alias gdd='git diffside'
alias gdds='git diffside --staged'
# syntax-based diff
if exist difft; then
alias gdy='git diffsyn'
alias gdys='git diffsyn --staged'
fi
alias gdd='git diffside'
alias gdds='git diffside --staged'
# show last committed content
alias gdl='git last'
alias gf='git fetch'
alias gl='git pull'
# show quick log overview
alias glg='git log --oneline --decorate --graph'
alias glga='git log --oneline --decorate --graph --remotes --all'
# show quick log overview - with dates
alias glgd="git log --graph --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"
alias glgad="git log --graph --remotes --all --pretty=format:'%C(auto)%h%Creset %C(cyan)%ar%Creset%C(auto)%d%Creset %s'"
# show detailed log overview
alias glog='git log --stat'
# show detailed log overview with contents
alias gloog='git log --stat -p'
alias gpn='git push --dry-run'
alias gp='git push'
alias gpf!='git push --force'
alias gpm='git pushmerge'
alias gf='git fetch'
alias gfa='git fetchall'
alias gl='git pull'
alias grv='git remote -v'
alias gpn='git push --dry-run'
alias gp='git push'
alias gpf!='git push --force'
alias gpm='git pushmerge'
alias gpa='git pushall'
alias grs='git restore --staged'
alias grs!='git restore'
alias grv='git remote -v'
alias grbi='git rebase -i'
alias grbc='git rebase --continue'
alias grs='git restore --staged'
alias grs!='git restore'
alias gst='git status'
alias grb='git rebase'
alias grbi='git rebase -i'
alias grbc='git rebase --continue'
alias grbm='git rebase master || git rebase main'
alias gst='git status'
alias gstp='git stash pop'
alias gstl='git stash list'
alias gstL='git stash list --stat'
if version_at_least 2.13 "$git_version"; then
autoload -Uz is-at-least
if is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')"; then
alias gsta='git stash push'
else
else
alias gsta='git stash save'
fi
alias gstp='git stash pop'
alias gstl='git stash list'
fi
if exist git-bug; then
gb() {
if [ "$#" -eq 1 ]; then
git bug show "$1"
else
git bug ls "$@"
fi
}
alias gbt='git bug termui'
alias gba='git bug add'
alias gbm='git bug comment add'
alias gbc='git bug status close'
alias gbp='git bug push'
alias gbl='git bug pull'
fi
unset -v git_version

View File

@ -9,28 +9,14 @@
## Global git settings
This is probably the first thing that needs to be customized, since it points to a different identity for each git user.
I sign all my commits by default, so take out the corresponding lines if you don't, or exchange it with your gpg key.
Git will rewrite any remotes using http(s) to use the ssh notation for pushes to github and gitlab so that, even if you set up the repository using an https url you can utilize your usual ssh key for pushing.
Finally, the configuration makes use of a custom pager called `dsf` which is also contained in this module.
It tries to use `diff-so-fancy` if that is installed on the path, otherwise uses git's internal diff prettifier.
If nothing exists it falls back to the standard output.
You can move between changed files in diffs with n/N.
Otherwise, the git config is prepared to handle lfs repositories, and it has an assortment of smaller quality of life changes, though nothing major.
## Basic git command aliases
This module contains a heap of aliases to every-day git commands.
Most of them follow a two-to-three letter combination of things to do which corresponds to the mnemonic of the longer git command.
As such, they are mostly similar to those found in the Oh My Zsh [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git).
As such, they are mostly similar to those found in the Oh My Zsh [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git)
Examples of some common aliases are `alias ga=git add`, `alias gst=git status`, `alias gp=git push`, `alias gl=git pull`.
Two aliases might be of note:
`gi` allows quickly generating a gitignore file for the current directory, using the included `gitignore` script.
And `gll` quickly pulls up the contents of the last commit. (`ll` since `gl` already pulls from the remote)
## Gitignore generation script
Adds a `gitignore` script which pulls relevant .gitignore lines from [gitignore.io](https://www.gitignore.io) and sends them to standard out, or creates a .gitignore file in the current directory.

View File

@ -0,0 +1,2 @@
root:
path: gpgcli-gitcli-fs+file://~/.local/share/gopass/passwords

261
gopass/.local/bin/rofi-gopass Executable file
View File

@ -0,0 +1,261 @@
#!/usr/bin/env bash
#
# Original inspiration from https://github.com/carnager/rofi-pass/
# selector wrapper
# uses rofi if found, or dmenu if found, complains if no selector available
# passes along any options given to main script
rofi_opts=("$@")
_rofi() {
if type rofi 1>/dev/null 2>/dev/null; then
rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "Entry"
elif type dmenu 1>/dev/null 2>/dev/null; then
dmenu -i "${rofi_opts[@]}" "$@" -p "Entry"
else
exist rofi critical "rofi-gopass" || exit 0
fi
}
# parse, see https://unix.stackexchange.com/a/331965/8541
_parse_config() {
(grep -E "^$2=" -m 1 "$1" 2>/dev/null || printf "VAR=__UNDEFINED__\n") | head -n1 | cut -d '=' -f 2-
}
# read config file
get_config() {
local locations=(
"$RGP_CONFIGURATION_FILE"
"${XDG_CONFIG_HOME:-$HOME/.config}/rofi-gopass/rofi-gopass.conf"
"$HOME/.rofi-gopass.conf"
"/etc/rofi-gopass.conf"
)
# return the first config file with a valid path
for config in "${locations[@]}"; do
if [[ -n "$config" && -f "$config" ]]; then
# see if the config has been given a value
local val
val="$(_parse_config "$config" "$1")"
break
fi
done
# if there was a config file but no value
# or there was no config file at all
if [ "$val" = "__UNDEFINED__" ] || [ -z "$val" ]; then
val="$2"
fi
printf -- "%s" "$val"
}
set_defaults() {
# The location of the rofi-gopass config file
# ROFI_PASS_CONFIGURATION_FILE="~/.config/rofi-gopass"
# set options, leaving already set environment variables intact
# try to read any settings from config files
KEY_AUTOFILL="${RGP_KEY_AUTOFILL:-$(get_config KEY_AUTOFILL Return)}"
KEY_ENTRY_OPEN="${RGP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}"
KEY_FILL_USER="${RGP_KEY_FILL_USER:-$(get_config KEY_FILL_USER Alt+u)}"
KEY_CLIP_USER="${RGP_KEY_CLIP_USER:-$(get_config KEY_CLIP_USER Ctrl+Alt+u)}"
KEY_FILL_PASS="${RGP_KEY_FILL_PASS:-$(get_config KEY_FILL_PASS Alt+p)}"
KEY_CLIP_PASS="${RGP_KEY_CLIP_PASS:-$(get_config KEY_CLIP_PASS Ctrl+Alt+p)}"
KEY_ENTRYMENU_FILL="${RGP_KEY_ENTRYMENU_FILL:-$(get_config KEY_ENTRYMENU_FILL Return)}"
KEY_ENTRYMENU_CLIP="${RGP_KEY_ENTRYMENU_CLIP:-$(get_config KEY_ENTRYMENU_CLIP Alt+Return)}"
KEY_ENTRYMENU_QUIT="${RGP_KEY_ENTRYMENU_QUIT:-$(get_config KEY_ENTRYMENU_QUIT Alt+BackSpace)}"
AUTOFILL_BACKEND="${RGP_BACKEND:-$(get_config AUTOFILL_BACKEND xdotool)}"
AUTOFILL_CHAIN="${RGP_AUTOENTRY_CHAIN:-$(get_config AUTOFILL_CHAIN 'username :tab password')}"
AUTOFILL_DELAY="${RGP_AUTOENTRY_DELAY:-$(get_config AUTOFILL_DELAY 30)}"
GOPASS_USERNAME_FIELD="${RGP_GOPASS_USERNAME_FIELD:-$(get_config GOPASS_USERNAME_FIELD 'username user login')}"
}
# exit on escape pressed
# rofi returns exit code 1 on esc
exit_check() {
[ "$1" -eq 1 ] && exit
}
# simply return a list of all passwords in gopass store
# TODO choose password store
# TODO only show website names (+ folder names), and account names for multiple accounts on one site
list_passwords() {
gopass list --flat
}
# return password for argument passed
show_password() {
gopass show -f --password "$1"
}
# send password to clipboard
clip_password() {
gopass show -c "$1"
}
# attempt to return the field specified
# attempts all (space separated) fields until the
# first one successfully returned
_gp_get_field() {
local gp_entry="$1"
local gp_field="$2"
local clip="$3"
for key in $gp_field; do
# return on first successfully returned key
if [ -n "$clip" ]; then
gopass show -c "$gp_entry" "$key" && break
else
gopass show -f "$gp_entry" "$key" && break
fi
done
}
# return username for argument passed
show_username() {
_gp_get_field "$1" "${GOPASS_USERNAME_FIELD}"
}
clip_username() {
_gp_get_field "$1" "${GOPASS_USERNAME_FIELD}" "-c"
}
show_field() {
_gp_get_field "$1" "$2"
}
clip_field() {
_gp_get_field "$1" "$2" "-c"
}
list_fields() {
gopass show -f "$1" | tail -n+2
}
# invoke the dotool to type inputs
_type() {
local tool="${AUTOFILL_BACKEND}"
local toolmode="$1"
local key="$2"
"$tool" "$toolmode" --delay "${AUTOFILL_DELAY}" "$key"
}
# automatically fill out fields
# transform special chain entries into valid dotool commands
autofill() {
local selected="${1}"
local autoentry_chain="${2}"
for part in $autoentry_chain; do
case "$part" in
":tab") _type key Tab ;;
":return") _type key Return ;;
":space") _type key space ;;
"username") _type type "$(show_username "$selected")" ;;
"password") _type type "$(show_password "$selected")" ;;
":direct") _type type "$selected" ;;
*) printf '%s' "$selected" ;;
esac
done
}
# opens a menu for the specified gopass entry, containing its individual fields
entrymenu() {
local entry="$1"
local k_entrymenu_fill="${KEY_ENTRYMENU_FILL}"
local k_entrymenu_clip="${KEY_ENTRYMENU_CLIP}"
local k_entrymenu_quit="${KEY_ENTRYMENU_QUIT}"
local pass_obfuscation="(hidden)"
local field
field=$(
printf "password: %s\n%s" "$pass_obfuscation" "$(list_fields "$entry")" |
_rofi \
-kb-accept-entry "" \
-kb-custom-1 "$k_entrymenu_fill" \
-kb-custom-2 "$k_entrymenu_clip" \
-kb-custom-3 "$k_entrymenu_quit" \
-mesg " ᐊ $k_entrymenu_quit ᐊ | $k_entrymenu_fill: fill selection | $k_entrymenu_clip: clip selection |"
)
exit_value=$?
exit_check "$exit_value"
# get field name
field=${field%%:*}
case "$exit_value" in
"10")
if [ "$field" = "password" ]; then
autofill "$entry" "password"
else
autofill "$(show_field "$entry" "$field")" ":direct"
fi
exit 0
;;
"11")
if [ "$field" = "password" ]; then
clip_password "$entry"
else
clip_field "$entry" "$field"
fi
exit 0
;;
"12")
main
;;
esac
}
main() {
local autoentry_chain="${AUTOFILL_CHAIN}"
local k_autofill="${KEY_AUTOFILL}"
local k_fill_user="${KEY_FILL_USER}"
local k_clip_user="${KEY_CLIP_USER}"
local k_fill_pass="${KEY_FILL_PASS}"
local k_clip_pass="${KEY_CLIP_PASS}"
local k_submenu="${KEY_ENTRY_OPEN}"
entry="$(
list_passwords |
_rofi -kb-accept-entry "" \
-kb-custom-1 "$k_autofill" \
-kb-custom-2 "$k_clip_user" \
-kb-custom-3 "$k_clip_pass" \
-kb-custom-4 "$k_fill_user" \
-kb-custom-5 "$k_fill_pass" \
-kb-custom-6 "$k_submenu" \
-mesg "| $k_autofill: fill credentials | $k_submenu: open entry | $k_fill_user: fill username | $k_fill_pass: fill password | $k_clip_user: clip username | $k_clip_pass: clip password |"
)"
exit_value=$?
exit_check "$exit_value"
case "$exit_value" in
"10")
autofill "$entry" "$autoentry_chain"
exit 0
;;
"11")
clip_username "$entry"
exit 0
;;
"12")
clip_password "$entry"
exit
;;
"13")
autofill "$entry" "username"
exit
;;
"14")
autofill "$entry" "password"
exit
;;
"15")
entrymenu "$entry"
exit
;;
esac
}
set_defaults
main

54
gopass/README.md Normal file
View File

@ -0,0 +1,54 @@
# gopass
[gopass](https://www.gopass.pw/) - command-line password manager, [pass](https://www.passwordstore.org) compatible, git by default
The gopass module tries to make interacting with the basic necessities of gopass painless and quick -- it is focused on accessing secrets, and quickly auto-filling forms or copying secrets to the clipboard. It relies on the default gopass auto-deleting clipping, so your secrets are automatically removed after a short while.
The configuration of gopass is relatively standard, it tries to follow XDG_specifications, putting the default pass store into `~/.local/share/gopass/passwords`.
## rofi-gopass
To make accessing secrets easy, it uses the `rofi-gopass` script, which creates a small rofi menu displaying all your secrets (names only), and from which you have quick access to copy, fill, or open the individual entries. An example of the menu in action:
![rofi-gopass demonstration](.assets/gopass/rofi-menu.gif)
There are several keybindings available, to either fill or copy to clipboard the username, password, or open the full view to an individual entry. For every send to clipboard action, the clipboard will be automatically cleared after the time specified in your gopass settings. For auto-filling to work correctly, the username field will (by default) have to be highlighted.
| keybinding | function | setting name |
| -------- | -------- | ---------- |
| Return | Auto-fill username & password | KEY_AUTOFILL |
| Alt+Return | Open individual entry | KEY_OPEN_ENTRY |
| Alt+u | Auto-fill username | KEY_FILL_USER |
| Alt+p | Auto-fill password | KEY_FILL_PASS |
| Ctrl+Alt+u | Send username to clipboard | KEY_CLIP_USER |
| Ctrl+Alt+p | Send password to clipboard | KEY_CLIP_PASS |
| Return | Auto-fill selected field (from opened entry) | KEY_ENTRYMENU_FILL |
| Alt+Return | Send selected field to clipboard (from opened entry) | KEY_ENTRYMENU_CLIP |
| Alt+BackSpace | Close individual entry, return to overview | KEY_ENTRYMENU_QUIT |
These keys, as well as the additional configuration can be changed by setting the corresponding environment variable, through a configuration file, or at the top of the script file itself. The script tries to follow xdg-specification, meaning it looks for a configuration file in the following directories (in descending order):
* `XDG_CONFIG_HOME/rofi-gopass/rofi-gopass.conf`
* `~/.config/rofi-gopass/rofi-gopass.conf`
* `~/.rofi-gopass.conf`
* `/etc/rofi-gopass.conf`
or, alternatively, a custom directory if the `RGP_CONFIGURATION_FILE` variable points to a configuration file.
To use environment variables to configure any of these options or keys, prefix them with `RGP_`, so that e.g. `KEY_AUTOFILL` becomes `RGP_KEY_AUTOFILL`. Environment variables take precedence over configuration file settings.
Additional configuration options:
* `AUTOFILL_BACKEND`
:sets the auto-filling tool used, only tested with `xdotool` currently.
* `AUTOFILL_CHAIN`
:sets the chain of keys that should be sent to auto-fill an entry. Can use the following special fields: `:tab`, `:space`, `:return`, `username`, `password`.
The default chain is `username :tab password`, which will enter the username, simulate the tab-key to switch from the username to the password field, and enter the password. This can be changed to suit your needs. To, for example, log in fully automatically at the end of the sequence, change it to `username :tab password :return`, and there will be no further user input for the login required.
* `AUTOFILL_DELAY`
:sets the time for xdotool to wait in-between simulated actions, if some letters appear missing or the fields are not switched between quickly enough, it can usually be fixed by increasing this delay (though typing will also take longer)
* `GOPASS_USERNAME_FIELD`
:sets the name of the field in gopass secrets which contain the username. Usually, the default setting should be fine (it will look for `user`, then `username`, then `login`) but custom field names can be supplied. If multiple field names are given, it will use the first supplied field name a secret contains.

13
home/.bash_profile Normal file
View File

@ -0,0 +1,13 @@
#
# ~/.bash_profile
#
if [ -d $XDG_CONFIG_HOME/shell/login.d ]; then
for file in $XDG_CONFIG_HOME/shell/login.d/*.sh; do
source $file
done
fi
[[ -f ~/.bashrc ]] && . ~/.bashrc
export PATH="$HOME/.cargo/bin:$PATH"

23
home/.bashrc Normal file
View File

@ -0,0 +1,23 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Load files from rc.d
if [ -d $XDG_CONFIG_HOME/shell/rc.d ]; then
for file in $XDG_CONFIG_HOME/shell/rc.d/*.sh; do
source $file
done
fi
# Load files from bashrc.d
if [ -d $XDG_CONFIG_HOME/shell/bashrc.d ]; then
for file in $XDG_CONFIG_HOME/shell/bashrc.d/*.bash; do
source $file
done
fi
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

View File

@ -3,4 +3,4 @@
# make zsh source the correct directory
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
ZDOTDIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh"
ZDOTDIR="$XDG_CONFIG_HOME/zsh"

235
i3/.config/i3/config Normal file
View File

@ -0,0 +1,235 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
set $modemod Mod1
set $font "pango:Iosevka 8"
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
#font pango:monospace 8
font $font
workspace_auto_back_and_forth yes
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# kill focused window
bindsym $mod+Shift+c kill
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+Shift+s split v
# split in vertical orientation
bindsym $mod+s split h
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+w layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+v floating toggle
# change focus between tiling / floating windows
bindsym $mod+v focus mode_toggle
# focus the parent/child container
bindsym $mod+Shift+a focus parent
bindsym $mod+a focus child
# make a (floating) window stick to all workspaces
bindsym $mod+ctrl+v sticky toggle
# set up scratch pad for todo and 'drop-down' terminal
# call scratchpads to current workspace -- scratchpads started on i3 starting (see end of file)
bindsym $mod+t [class="Alacritty" instance="scratchpad" title="todo.md"] scratchpad show
bindsym $mod+Shift+Return [class="Alacritty" instance="scratchpad" title="dropdown"] scratchpad show
# GAP MANAGEMENT
# disable titles and borders, necessary for i3gaps to work apparently
for_window [class="^.*"] border pixel 0
# by default set no gaps when multiple windows are on the workspace
gaps inner 0
gaps outer 0
# increase/decrease inner gapping
bindsym $mod+shift+g gaps inner current plus 10
bindsym $mod+g gaps inner current minus 10
# increase/decrease border sizes
bindsym $mod+b border toggle 2
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym Shift+h resize shrink width 30 px or 30 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym Shift+j resize grow height 30 px or 30 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym Shift+k resize shrink height 30 px or 30 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Shift+l resize grow width 30 px or 30 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $modemod+r mode "default"
}
set $mode_media "Media"
mode $mode_media {
# Pressing left will move 5s back
bindsym h exec playerctl position 5-
bindsym Shift+h exec playerctl position 15-
# Pressing down will move to the next file
bindsym j exec playerctl next
# Pressing up will move to the previous file
bindsym k exec playerctl previous
# Pressing right will move 5s forward
bindsym l exec playerctl position 5+
bindsym Shift+l exec playerctl position 30+
# Pressing p will play/pause current track
bindsym p exec playerctl play-pause
# Pressing p will play/pause current track
bindsym s exec playerctl stop
#TODO add option to open file, loop, shuffle, show/select players
# back to normal
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $modemod+m mode "default"
}
bindsym $modemod+r mode "resize"
bindsym $modemod+m mode $mode_media
# reload the configuration file
bindsym $mod+F12 reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+F12 restart
# set a pretty wallpaper
exec_always --no-startup-id feh --bg-scale ~/pictures/wall.jpg
# launch polybar (script ensures only 1 instance existing at a time)
exec_always --no-startup-id polybar-launch simple-top
# default workspaces for most used apps
# assign [class="^qutebrowser$"] → number 1
# spotify needs for_window, see https://i3wm.org/docs/userguide.html#assign_workspace
assign [class="^spotify$"] → 10
assign [class="^Spotify$"] → 10
#fix for spotify not moving to workspace 10
for_window [class="^spotify$"] move to workspace 10
# set up scratch pad for todo and 'drop-down' terminal
# to be called to current workspace when needed
exec --no-startup-id alacritty --title "todo.md" --class "scratchpad,Alacritty" -e nvim -c ":set nonumber norelativenumber noshowmode noruler laststatus=0 noshowcmd shortmess=F" ~/todo.md
exec --no-startup-id alacritty --title "dropdown" --class scratchpad,Alacritty
for_window [class="Alacritty" instance="scratchpad"] floating enable
for_window [class="Alacritty" instance="scratchpad"] move scratchpad
# autostart often used apps
# needs to be done like this to both automatically start the apps on correct workspace
# and not confine them there forever
exec $XDG_CONFIG_HOME/i3/scripts/i3-applications-autostart

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Wait for program coming up
wait_for_program() {
n=0
while true; do
# PID of last background command
if xdotool search --onlyvisible --pid $! 2>/dev/null; then
break
else
if [ $n -eq 200 ]; then
notify-send -u critical "Error during start: last program $! did not started fast enough"
break
else
n=$($n + 1)
sleep 0.1
fi
fi
done
}
i3-msg "workspace number 2"
alacritty &
wait_for_program
i3-msg "workspace number 10"
spotify &
wait_for_program
i3-msg "workspace number 1"
qutebrowser &
wait_for_program
i3-msg "workspace number 3"

View File

@ -2,137 +2,90 @@
#
# install.sh
#
# Installs dotfiles and packages for my setup.
# Needs to be invoked from containing dotfile directory to work correctly.
# Installs dotfiles and packages for my setup
#
# Will first install yay, then all my used packages (read from bootstrap/packages.txt)
# Will first install yay, then all my used packages (read from bootstrap/packages.csv)
#
# Finally, symlinks all dotfiles into their correct locations using dotter
# Finally, symlinks all dotfiles into their correct locations using stow
bootstrap_dir="${DOT_BOOTSTRAP_DIR:-./bootstrap}"
unattended_install="${DOT_UNATTENDED_INSTALL:-false}"
link_systemfiles="${DOT_LINK_SYSTEMFILES:-true}"
help() {
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
exit "${1:-0}"
}
bootstrap_dir="${BOOTSTRAP_DIRECTORY:-./_bootstrap}"
main() {
local cmd=""
local ret=0
case "$1" in
-v | --version)
printf "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n"
;;
-h | --help)
help 0
;;
-f | --force)
unattended_install=true
;;
*)
install
;;
esac
shift
local cmd=""
local ret=0
$cmd "$@"
ret=$((ret + $?))
exit $ret
case "$1" in
-v | --version)
printf "Personal system bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1.1\n"
;;
-h | --help)
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
;;
-f | --force)
install true
;;
*)
install false
;;
esac
shift
$cmd "$@"
ret=$((ret + $?))
exit $ret
}
# takes default value (y/n), question, abort message as arguments
# automatically answers yes if unattended install
check_consent() {
if [ "$unattended_install" == "true" ]; then
true
else
[[ "$1" == "y" ]] && default_consent="[Y/n]" || default_consent="[y/N]"
printf "%b %b " "$2" "$default_consent"
read -r answer
if [[ "$1" == "n" ]] && [[ "$answer" != y* ]]; then
printf "%s\n" "$3"
false
elif [[ "$1" == "y" ]] && [[ "$answer" == n* ]]; then
printf "%s\n" "$3"
false
else
true
fi
fi
}
entry_question() {
check_consent n "This will take a while and install many packages and link dotfiles all over the place depending on your selections.\nYou need to be in the base directory of the dotfiles repository.\nProceed?" "Aborting." || exit
echo "This will take a while, install many packages and link dotfiles all over the place. Proceed [y/N]?"
read -r yes
if [[ "$yes" != y* ]]; then
echo "Exiting."
exit
fi
}
enable_git_hooks() {
check_consent y "Should we enable git hooks for this repository, so that missing or additionally installed packages are automatically compared to the repository when committing?" "Not changing repository settings." || return
git config --local core.hooksPath .githooks/
echo "Changed repository settings."
}
manage_dotfiles() {
check_consent y "Link dot files?" "Not linking dotfiles." || return
check_consent n "Link system settings files? This will require sudo access but will not overwrite existing files." "Not touching system files." || link_systemfiles=false
if [ "$link_systemfiles" == "false" ]; then
dotter deploy
echo "Linked dotfiles."
else
if [ -e "/etc/pacman.conf" ]; then
check_consent n "Found an existing pacman.conf file, installation will error if it exists. Remove file?" && run_elevated rm "/etc/pacman.conf"
fi
dotter deploy -l .dotter/systemwide.toml
echo "Linked dotfiles and system files."
fi
}
run_elevated() {
if command -v doas >/dev/null 2>&1; then
doas "$@"
elif command -v sudo >/dev/null 2>&1; then
sudo "$@"
fi
}
install_packages() {
check_consent n "Install pre-designated packages? This will take a while, install a lot of packages and require super user privileges." "Not installing packages." || return
if [ "$unattended_install" == "true" ]; then
"$bootstrap_dir"/install_packages.sh -f
else
"$bootstrap_dir"/install_packages.sh
fi
echo "Installed packages."
}
headline() {
len="${#1}"
target_len=85
side_len=$(((target_len - len) / 2))
for ((i = 1; i <= side_len; i++)); do printf '='; done
printf " %s " "$1"
for ((i = 1; i <= side_len; i++)); do printf '='; done
printf "\n"
if [ "$1" == "false" ]; then
echo "Should we enable git hooks for this repository, so that installed packages are automatically compared when committing? [Y/n]"
read -r no
if [[ "$no" == n* ]]; then
echo "Not changing repository settings."
return
fi
fi
git config --local core.hooksPath .githooks/
echo "Changed repository settings."
}
install() {
if [ "$unattended_install" == false ] ; then
entry_question
fi
unattended=$1
if ! "$unattended"; then
check_consent
fi
echo "====================== BEGINNING INSTALLATION ============================="
if ! "$unattended"; then
export BOOTSTRAP_PACKAGES="_bootstrap/packages.txt"
"$bootstrap_dir"/install_packages.sh
else
export BOOTSTRAP_PACKAGES="_bootstrap/packages.txt"
"$bootstrap_dir"/install_packages.sh -f
fi
unset BOOTSTRAP_PACKAGES
headline "BEGINNING PACKAGE INSTALLATION"
install_packages
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
# get all top level directories, remove their slashes and dots
# finally get rid of .dot-directories, since they are for the repo not for my homedir
targets="$(find . -maxdepth 1 -type d | sed -e 's/^\.\/\(.*\)$/\1/' | sed -e '/^\./d')"
headline "BEGINNING DOTFILE MANAGEMENT"
manage_dotfiles
# shellcheck disable=2086
# -- for some reason stow only works with unqoted var expansion
stow -R ${targets} 2> >(grep -v 'Absolute/relative mismatch between Stow dir' 1>&2)
headline "ENABLING GIT REPOSITORY HOOKS"
enable_git_hooks
echo "================== ENABLING GIT REPOSITORY HOOKS =========================="
enable_git_hooks "$unattended"
echo "INSTALLATION FINISHED"
exit 0
echo "====================== INSTALLATION FINISHED =============================="
exit 0
}
main "$@"

View File

@ -0,0 +1,193 @@
# Configuration file for libinput-gestures.
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Lines starting with '#' and blank lines are ignored. Currently
# "gesture" and "device" configuration keywords are supported as
# described below. The keyword can optionally be appended with a ":" (to
# maintain compatibility with original format configuration files).
#
# Each gesture line has 3 [or 4] arguments separated by whitespace:
#
# action motion [finger_count] command
#
# where action and motion is either:
# swipe up
# swipe down
# swipe left
# swipe right
# pinch in
# pinch out
#
# command is the remainder of the line and is any valid shell command +
# arguments.
#
# finger_count is a single numeric digit and is optional (and is
# typically 3 or 4). If specified then the command is executed when
# exactly that number of fingers is used in the gesture. If not
# specified then the command is executed when that gesture is executed
# with any number of fingers. Gesture lines specified with finger_count
# have priority over the same gesture specified without any
# finger_count.
#
# Typically command will be xdotool, or wmctrl. See "man xdotool" for
# the many things you can action with that tool. Note that unfortunately
# xdotool does not work with native Wayland clients.
###############################################################################
# SWIPE GESTURES:
###############################################################################
# Gestures with 4 fingers: Move around desktops
# next dekstop
gesture swipe right 4 _internal ws_up
# previous desktop
gesture swipe left 4 _internal ws_down
# hide all windows (show desktop)
gesture swipe down 4 xdotool key Control_L+F12
# show all open windows
gesture swipe up 4 xdotool key Control_L+F10
# show desktop grid
gesture swipe right_down 3 xdotool key Control_L+F8
# show activity manager
gesture swipe left_down 3 xdotool key Super_L+q
# Show all open windows of desktop
gesture swipe up 3 xdotool key Control_L+F9
# minimize window (Super_L = Meta; Next = PgDown)
gesture swipe down 3 xdotool key Super_L+Next
# 45degree Gestures with 3 fingers: control tab & browsing behavior
# next tab
gesture swipe right 3 xdotool key Control_L+Tab
# previous tab
gesture swipe left 3 xdotool key Control_L+Shift+Tab
# new tab
gesture swipe right_up 3 xdotool key Control_L+t
# close tab
gesture swipe left_up 3 xdotool key Control_L+w
# Note the default is an "internal" command that uses wmctrl to switch
# workspaces and, unlike xdotool, works on both Xorg and Wayland (via
# XWayland). It also can be configured for vertical and horizontal
# switching over tabular workspaces, as per the example below. You can
# also add "-w" to the internal command to allow wrapping workspaces.
# Move to next workspace (works for GNOME/KDE/etc on Wayland and Xorg)
# gesture swipe up _internal ws_up
# NOTE ABOUT FINGER COUNT:
# The above command will configure this command for all fingers (i.e. 3
# for 4) but to configure it for 3 fingers only, change it to:
# gesture swipe up 3 _internal ws_up
# Then you can configure something else for 4 fingers or leave 4 fingers
# unconfigured. You can configure an explicit finger count like this for
# all example commands in this configuration file.
#
# gesture swipe up xdotool key super+Page_Down
# Move to prev workspace (works for GNOME/KDE/etc on Wayland and Xorg)
# gesture swipe down _internal ws_down
# gesture swipe down xdotool key super+Page_Up
# Browser go forward (works only for Xorg, and Xwayland clients)
# gesture swipe left xdotool key alt+Right
# Browser go back (works only for Xorg, and Xwayland clients)
# gesture swipe right xdotool key alt+Left
# NOTE: If you don't use "natural" scrolling direction for your touchpad
# then you may want to swap the above default left/right and up/down
# configurations.
# Optional extended swipe gestures, e.g. for browser tab navigation:
#
# Jump to next open browser tab
# gesture swipe right_up xdotool key control+Tab
#
# Jump to previous open browser tab
# gesture swipe left_up xdotool key control+shift+Tab
#
# Close current browser tab
# gesture swipe left_down xdotool key control+w
#
# Reopen and jump to last closed browser tab
# gesture swipe right_down xdotool key control+shift+t
# Example of 8 static workspaces, e.g. using KDE virtual-desktops,
# arranged in 2 rows of 4 across using swipe up/down/left/right to
# navigate in fixed planes. Must match how you have configured your
# virtual desktops.
# gesture swipe up _internal --col=2 ws_up
# gesture swipe down _internal --col=2 ws_down
# gesture swipe left _internal --row=4 ws_up
# gesture swipe right _internal --row=4 ws_down
# Example virtual desktop switching for Ubuntu Unity/Compiz. The
# _internal command does not work for Compiz but you can explicitly
# configure the swipe commands to work for a Compiz virtual 2
# dimensional desktop as follows:
# gesture swipe up xdotool key ctrl+alt+Up
# gesture swipe down xdotool key ctrl+alt+Down
# gesture swipe left xdotool key ctrl+alt+Left
# gesture swipe right xdotool key ctrl+alt+Right
# Example to change audio volume:
# Note this only works on an Xorg desktop (not Wayland).
# gesture swipe up xdotool key XF86AudioRaiseVolume
# gesture swipe down xdotool key XF86AudioLowerVolume
###############################################################################
# PINCH GESTURES:
###############################################################################
# GNOME SHELL open/close overview (works for GNOME on Xorg only)
#gesture pinch in xdotool key super+s
#gesture pinch out xdotool key super+s
# KDE Plasma open/close overview
# gesture pinch in xdotool key ctrl+F9
# gesture pinch out xdotool key ctrl+F9
# GNOME SHELL open/close overview (works for GNOME on Wayland and Xorg)
# Note since GNOME 3.24 on Wayland this is implemented natively so no
# real point configuring for Wayland.
# gesture pinch in dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
# gesture pinch out dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:'Main.overview.toggle();'
# Optional extended pinch gestures:
# gesture pinch clockwise <whatever command>
# gesture pinch anticlockwise <whatever command>
###############################################################################
# This application normally determines your touchpad device
# automatically. Some users may have multiple touchpads but by default
# we use only the first one found. However, you can choose to specify
# the explicit device name to use. Run "libinput list-devices" to work
# out the name of your device (from the "Device:" field). Then add a
# device line specifying that name, e.g:
#
# device DLL0665:01 06CB:76AD Touchpad
#
# If the device name starts with a '/' then it is instead considered as
# the explicit device path although since device paths can change
# through reboots this is best to be a symlink. E.g. instead of specifying
# /dev/input/event12, use the corresponding full path link under
# /dev/input/by-path/*.
#
# You can choose to use ALL touchpad devices by setting the device name
# to "all". E.g. Do this if you have multiple touchpads which you want
# to use in parallel. This reduces performance slightly so only set this
# if you have to.
#
# device all
###############################################################################
# You can set a minimum travel distance threshold before swipe gestures
# are actioned using the swipe_threshold configuration command.
# Specify this value in dots. The default is 0.
# E.g. set it to 100 dots with "swipe_threshold 100".
# swipe_threshold 0

View File

@ -37,9 +37,8 @@ I script-message playlistmanager show filename
R cycle-values video-aspect "16:9" "4:3" "3.25:1" "no" "-1" # cycle aspect ratios
# uosc definitions and menu
o script-message-to uosc toggle-elements timeline
O script-binding uosc/toggle-ui
m script-binding uosc/menu
o script-binding uosc/peek-timeline
menu script-binding uosc/menu
# script-binding uosc/open-file #! Open file
# script-binding uosc/load-subtitles #! Load subtitles
@ -49,4 +48,3 @@ m script-binding uosc/menu
# script-binding uosc/playlist #! Utils > Playlist
# script-binding uosc/chapters #! Utils > Chapters
# script-binding uosc/open-config-directory #! Utils > Open config directory

View File

@ -21,7 +21,7 @@ msg-module=yes
### screenshots
screenshot-directory="${XDG_PICTURES_DIR:-~/media/pictures}/screenshots"
screenshot-directory=~/pictures/screenshots
# filename_HH-MM-SS
screenshot-template="screen_%F_%wH-%wM-%wS"
screenshot-format=png
@ -35,8 +35,8 @@ screenshot-tag-colorspace=yes
osc=no
osd-bar=no
osd-font='Iosevka Nerd Font'
osd-font-size=15
osd-font='Iosevka Mono'
osd-font-size=48
### Subtitles
@ -81,13 +81,18 @@ volume-max=150
audio-file-auto=fuzzy
# playing at different speed will pitch-correct
audio-pitch-correction=yes
# no audio popping on seek
audio-stream-silence
# lets mpv calc latency instead of PA; disable if errors on network playback or similar
pulse-latency-hacks=yes
### Video
hwdec=auto
profile=opengl-hq
opengl-early-flush=auto
opengl-pbo=no
# brigheen video slightly to account for daylight displaying
gamma-factor=1.1
# ever so slightly up saturation
saturation=12
# interpolation options, will take some more cpu
@ -108,9 +113,9 @@ ytdl-format=(bestvideo[vcodec=vp9.2][height<=1080]/bestvideo[vcodec=vp9][fps>30]
### Languages
# prefer english subtitles, use german if you have to
slang=en,eng,de,deu,ger
alang=en,eng,de,deu,ger
# prefer original language, use dub if necessary
alang=ja,jp,jpn,en,eng,de,deu,ger
slang=ja,jp,jpn,en,eng,de,deu,ger
### Protocol configuration

View File

@ -0,0 +1,27 @@
-- If the laptop is on battery, the profile 'lq' will be loaded; otherwise 'hq' is used
--
local lqprofile = "lowquality"
local hqprofile = "highquality"
local function powerstate()
local f =io.open("/sys/class/power_supply/AC/online")
if f == nil then
return
end
local t = f:read("*n")
f:close()
return t
end
local function adjust()
local state = powerstate()
-- this actually overrides automatically applied profiles
-- like 'protocol.http'
if state == 0 then
mp.msg.info("Running on battery, setting low-quality options.")
mp.set_property("profile", lqprofile)
else
mp.msg.info("Not running on battery, setting high-quality options.")
end
end
mp.add_hook("on_load", 1, adjust)

View File

@ -0,0 +1,973 @@
local settings = {
-- #### FUNCTIONALITY SETTINGS
--navigation keybindings force override only while playlist is visible
--if "no" then you can display the playlist by any of the navigation keys
dynamic_binds = true,
-- to bind multiple keys separate them by a space
key_moveup = "UP",
key_movedown = "DOWN",
key_selectfile = "RIGHT LEFT",
key_unselectfile = "",
key_playfile = "ENTER",
key_removefile = "BS",
key_closeplaylist = "ESC",
--replaces matches on filenames based on extension, put as empty string to not replace anything
--replace rules are executed in provided order
--replace rule key is the pattern and value is the replace value
--uses :gsub('pattern', 'replace'), read more http://lua-users.org/wiki/StringLibraryTutorial
--'all' will match any extension or protocol if it has one
--uses json and parses it into a lua table to be able to support .conf file
filename_replace = "",
--[=====[ START OF SAMPLE REPLACE, to use remove start and end line
--Sample replace: replaces underscore to space on all files
--for mp4 and webm; remove extension, remove brackets and surrounding whitespace, change dot between alphanumeric to space
filename_replace = [[
[
{
"ext": { "all": true},
"rules": [
{ "_" : " " }
]
},{
"ext": { "mp4": true, "mkv": true },
"rules": [
{ "^(.+)%..+$": "%1" },
{ "%s*[%[%(].-[%]%)]%s*": "" },
{ "(%w)%.(%w)": "%1 %2" }
]
},{
"protocol": { "http": true, "https": true },
"rules": [
{ "^%a+://w*%.?": "" }
]
}
]
]],
--END OF SAMPLE REPLACE ]=====]
--json array of filetypes to search from directory
loadfiles_filetypes = [[
[
"jpg", "jpeg", "png", "tif", "tiff", "gif", "webp", "svg", "bmp",
"mp3", "wav", "ogm", "flac", "m4a", "wma", "ogg", "opus",
"mkv", "avi", "mp4", "ogv", "webm", "rmvb", "flv", "wmv", "mpeg", "mpg", "m4v", "3gp"
]
]],
--loadfiles at startup if there is 0 or 1 items in playlist, if 0 uses worḱing dir for files
loadfiles_on_start = false,
--sort playlist on mpv start
sortplaylist_on_start = false,
--sort playlist when files are added to playlist
sortplaylist_on_file_add = false,
--use alphanumerical sort
alphanumsort = true,
--"linux | windows | auto"
system = "auto",
--Use ~ for home directory. Leave as empty to use mpv/playlists
playlist_savepath = "",
--show playlist or filename every time a new file is loaded
--2 shows playlist, 1 shows current file(filename strip applied) as osd text, 0 shows nothing
--instead of using this you can also call script-message playlistmanager show playlist/filename
--ex. KEY playlist-next ; script-message playlistmanager show playlist
show_playlist_on_fileload = 0,
--sync cursor when file is loaded from outside reasons(file-ending, playlist-next shortcut etc.)
--has the sideeffect of moving cursor if file happens to change when navigating
--good side is cursor always following current file when going back and forth files with playlist-next/prev
sync_cursor_on_load = true,
--playlist open key will toggle visibility instead of refresh, best used with long timeout
open_toggles = true,
--allow the playlist cursor to loop from end to start and vice versa
loop_cursor = true,
--#### VISUAL SETTINGS
--prefer to display titles for following files: "all", "url", "none". Sorting still uses filename.
prefer_titles = "url",
--call youtube-dl to resolve the titles of urls in the playlist
resolve_titles = false,
--osd timeout on inactivity, with high value on this open_toggles is good to be true
playlist_display_timeout = 5,
--amount of entries to show before slicing. Optimal value depends on font/video size etc.
showamount = 16,
--font size scales by window, if false requires larger font and padding sizes
scale_playlist_by_window=true,
--playlist ass style overrides inside curly brackets, \keyvalue is one field, extra \ for escape in lua
--example {\\fnUbuntu\\fs10\\b0\\bord1} equals: font=Ubuntu, size=10, bold=no, border=1
--read http://docs.aegisub.org/3.2/ASS_Tags/ for reference of tags
--undeclared tags will use default osd settings
--these styles will be used for the whole playlist
style_ass_tags = "{}",
--paddings from top left corner
text_padding_x = 10,
text_padding_y = 30,
--set title of window with stripped name
set_title_stripped = false,
title_prefix = "",
title_suffix = " - mpv",
--slice long filenames, and how many chars to show
slice_longfilenames = false,
slice_longfilenames_amount = 70,
--Playlist header template
--%mediatitle or %filename = title or name of playing file
--%pos = position of playing file
--%cursor = position of navigation
--%plen = playlist length
--%N = newline
playlist_header = "[%cursor/%plen]",
--Playlist file templates
--%pos = position of file with leading zeros
--%name = title or name of file
--%N = newline
--you can also use the ass tags mentioned above. For example:
-- selected_file="{\\c&HFF00FF&}➔ %name" | to add a color for selected file. However, if you
-- use ass tags you need to reset them for every line (see https://github.com/jonniek/mpv-playlistmanager/issues/20)
normal_file = "○ %name",
hovered_file = "● %name",
selected_file = "➔ %name",
playing_file = "▷ %name",
playing_hovered_file = "▶ %name",
playing_selected_file = "➤ %name",
-- what to show when playlist is truncated
playlist_sliced_prefix = "...",
playlist_sliced_suffix = "..."
}
local opts = require("mp.options")
opts.read_options(settings, "playlistmanager", function(list) update_opts(list) end)
local utils = require("mp.utils")
local msg = require("mp.msg")
local assdraw = require("mp.assdraw")
--check os
if settings.system=="auto" then
local o = {}
if mp.get_property_native('options/vo-mmcss-profile', o) ~= o then
settings.system = "windows"
else
settings.system = "linux"
end
end
--global variables
local playlist_visible = false
local strippedname = nil
local path = nil
local directory = nil
local filename = nil
local pos = 0
local plen = 0
local cursor = 0
--table for saved media titles for later if we prefer them
local url_table = {}
-- table for urls that we have request to be resolved to titles
local requested_urls = {}
--state for if we sort on playlist size change
local sort_watching = false
local filetype_lookup = {}
function update_opts(changelog)
msg.verbose('updating options')
--parse filename json
if changelog.filename_replace then
if(settings.filename_replace~="") then
settings.filename_replace = utils.parse_json(settings.filename_replace)
else
settings.filename_replace = false
end
end
--parse loadfiles json
if changelog.loadfiles_filetypes then
settings.loadfiles_filetypes = utils.parse_json(settings.loadfiles_filetypes)
filetype_lookup = {}
--create loadfiles set
for _, ext in ipairs(settings.loadfiles_filetypes) do
filetype_lookup[ext] = true
end
end
if changelog.resolve_titles then
resolve_titles()
end
if changelog.playlist_display_timeout then
keybindstimer = mp.add_periodic_timer(settings.playlist_display_timeout, remove_keybinds)
keybindstimer:kill()
end
if playlist_visible then showplaylist() end
end
update_opts({filename_replace = true, loadfiles_filetypes = true})
function on_loaded()
filename = mp.get_property("filename")
path = mp.get_property('path')
--if not a url then join path with working directory
if not path:match("^%a%a+:%/%/") then
path = utils.join_path(mp.get_property('working-directory'), path)
directory = utils.split_path(path)
else
directory = nil
end
refresh_globals()
if settings.sync_cursor_on_load then
cursor=pos
--refresh playlist if cursor moved
if playlist_visible then draw_playlist() end
end
local media_title = mp.get_property("media-title")
if path:match('^https?://') and not url_table[path] and path ~= media_title then
url_table[path] = media_title
end
strippedname = stripfilename(mp.get_property('media-title'))
if settings.show_playlist_on_fileload == 2 then
showplaylist()
elseif settings.show_playlist_on_fileload == 1 then
mp.commandv('show-text', strippedname)
end
if settings.set_title_stripped then
mp.set_property("title", settings.title_prefix..strippedname..settings.title_suffix)
end
local didload = false
if settings.loadfiles_on_start and plen == 1 then
didload = true --save reference for sorting
msg.info("Loading files from playing files directory")
playlist()
end
--if we promised to sort files on launch do it
if promised_sort then
promised_sort = false
msg.info("Your playlist is sorted before starting playback")
if didload then sortplaylist() else sortplaylist(true) end
end
--if we promised to listen and sort on playlist size increase do it
if promised_sort_watch then
promised_sort_watch = false
sort_watching = true
msg.info("Added files will be automatically sorted")
mp.observe_property('playlist-count', "number", autosort)
end
end
function on_closed()
strippedname = nil
path = nil
directory = nil
filename = nil
if playlist_visible then showplaylist() end
end
function refresh_globals()
pos = mp.get_property_number('playlist-pos', 0)
plen = mp.get_property_number('playlist-count', 0)
end
function escapepath(dir, escapechar)
return string.gsub(dir, escapechar, '\\'..escapechar)
end
--strip a filename based on its extension or protocol according to rules in settings
function stripfilename(pathfile, media_title)
if pathfile == nil then return '' end
local ext = pathfile:match("^.+%.(.+)$")
local protocol = pathfile:match("^(%a%a+)://")
if not ext then ext = "" end
local tmp = pathfile
if settings.filename_replace and not media_title then
for k,v in ipairs(settings.filename_replace) do
if ( v['ext'] and (v['ext'][ext] or (ext and not protocol and v['ext']['all'])) )
or ( v['protocol'] and (v['protocol'][protocol] or (protocol and not ext and v['protocol']['all'])) ) then
for ruleindex, indexrules in ipairs(v['rules']) do
for rule, override in pairs(indexrules) do
tmp = tmp:gsub(rule, override)
end
end
end
end
end
if settings.slice_longfilenames and tmp:len()>settings.slice_longfilenames_amount+5 then
tmp = tmp:sub(1, settings.slice_longfilenames_amount).." ..."
end
return tmp
end
--gets a nicename of playlist entry at 0-based position i
function get_name_from_index(i, notitle)
refresh_globals()
if plen <= i then msg.error("no index in playlist", i, "length", plen); return nil end
local _, name = nil
local title = mp.get_property('playlist/'..i..'/title')
local name = mp.get_property('playlist/'..i..'/filename')
local should_use_title = settings.prefer_titles == 'all' or name:match('^https?://') and settings.prefer_titles == 'url'
--check if file has a media title stored or as property
if not title and should_use_title then
local mtitle = mp.get_property('media-title')
if i == pos and mp.get_property('filename') ~= mtitle then
if not url_table[name] then
url_table[name] = mtitle
end
title = mtitle
elseif url_table[name] then
title = url_table[name]
end
end
--if we have media title use a more conservative strip
if title and not notitle and should_use_title then return stripfilename(title, true) end
--remove paths if they exist, keeping protocols for stripping
if string.sub(name, 1, 1) == '/' or name:match("^%a:[/\\]") then
_, name = utils.split_path(name)
end
return stripfilename(name)
end
function parse_header(string)
local esc_title = stripfilename(mp.get_property("media-title"), true):gsub("%%", "%%%%")
local esc_file = stripfilename(mp.get_property("filename")):gsub("%%", "%%%%")
return string:gsub("%%N", "\\N")
:gsub("%%pos", mp.get_property_number("playlist-pos",0)+1)
:gsub("%%plen", mp.get_property("playlist-count"))
:gsub("%%cursor", cursor+1)
:gsub("%%mediatitle", esc_title)
:gsub("%%filename", esc_file)
-- undo name escape
:gsub("%%%%", "%%")
end
function parse_filename(string, name, index)
local base = tostring(plen):len()
local esc_name = stripfilename(name):gsub("%%", "%%%%")
return string:gsub("%%N", "\\N")
:gsub("%%pos", string.format("%0"..base.."d", index+1))
:gsub("%%name", esc_name)
-- undo name escape
:gsub("%%%%", "%%")
end
function parse_filename_by_index(index)
local template = settings.normal_file
local is_idle = mp.get_property_native('idle-active')
local position = is_idle and -1 or pos
if index == position then
if index == cursor then
if selection then
template = settings.playing_selected_file
else
template = settings.playing_hovered_file
end
else
template = settings.playing_file
end
elseif index == cursor then
if selection then
template = settings.selected_file
else
template = settings.hovered_file
end
end
return parse_filename(template, get_name_from_index(index), index)
end
function draw_playlist()
refresh_globals()
local ass = assdraw.ass_new()
ass:new_event()
ass:pos(settings.text_padding_x, settings.text_padding_y)
ass:append(settings.style_ass_tags)
if settings.playlist_header ~= "" then
ass:append(parse_header(settings.playlist_header).."\\N")
end
local start = cursor - math.floor(settings.showamount/2)
local showall = false
local showrest = false
if start<0 then start=0 end
if plen <= settings.showamount then
start=0
showall=true
end
if start > math.max(plen-settings.showamount-1, 0) then
start=plen-settings.showamount
showrest=true
end
if start > 0 and not showall then ass:append(settings.playlist_sliced_prefix.."\\N") end
for index=start,start+settings.showamount-1,1 do
if index == plen then break end
ass:append(parse_filename_by_index(index).."\\N")
if index == start+settings.showamount-1 and not showall and not showrest then
ass:append(settings.playlist_sliced_suffix)
end
end
local w, h = mp.get_osd_size()
if settings.scale_playlist_by_window then w,h = 0, 0 end
mp.set_osd_ass(w, h, ass.text)
end
function toggle_playlist()
if settings.open_toggles then
if playlist_visible then
remove_keybinds()
return
end
end
showplaylist()
end
function showplaylist(duration)
refresh_globals()
if plen == 0 then return end
playlist_visible = true
add_keybinds()
draw_playlist()
keybindstimer:kill()
if duration then
keybindstimer = mp.add_periodic_timer(duration, remove_keybinds)
else
keybindstimer:resume()
end
end
selection=nil
function selectfile()
refresh_globals()
if plen == 0 then return end
if not selection then
selection=cursor
else
selection=nil
end
showplaylist()
end
function unselectfile()
selection=nil
showplaylist()
end
function removefile()
refresh_globals()
if plen == 0 then return end
selection = nil
if cursor==pos then mp.command("script-message unseenplaylist mark true \"playlistmanager avoid conflict when removing file\"") end
mp.commandv("playlist-remove", cursor)
if cursor==plen-1 then cursor = cursor - 1 end
showplaylist()
end
function moveup()
refresh_globals()
if plen == 0 then return end
if cursor~=0 then
if selection then mp.commandv("playlist-move", cursor,cursor-1) end
cursor = cursor-1
elseif settings.loop_cursor then
if selection then mp.commandv("playlist-move", cursor,plen) end
cursor = plen-1
end
showplaylist()
end
function movedown()
refresh_globals()
if plen == 0 then return end
if cursor ~= plen-1 then
if selection then mp.commandv("playlist-move", cursor,cursor+2) end
cursor = cursor + 1
elseif settings.loop_cursor then
if selection then mp.commandv("playlist-move", cursor,0) end
cursor = 0
end
showplaylist()
end
function Watch_later()
if mp.get_property_bool("save-position-on-quit") then
mp.command("write-watch-later-config")
end
end
function playfile()
refresh_globals()
if plen == 0 then return end
selection = nil
local is_idle = mp.get_property_native('idle-active')
if cursor ~= pos or is_idle then
mp.set_property("playlist-pos", cursor)
else
if cursor~=plen-1 then
cursor = cursor + 1
end
Watch_later()
mp.commandv("playlist-next", "weak")
end
if settings.show_playlist_on_fileload ~= 2 then
remove_keybinds()
end
end
function get_files_windows(dir)
local args = {
'powershell', '-NoProfile', '-Command', [[& {
Trap {
Write-Error -ErrorRecord $_
Exit 1
}
$path = "]]..dir..[["
$escapedPath = [WildcardPattern]::Escape($path)
cd $escapedPath
$list = (Get-ChildItem -File | Sort-Object { [regex]::Replace($_.Name, '\d+', { $args[0].Value.PadLeft(20) }) }).Name
$string = ($list -join "/")
$u8list = [System.Text.Encoding]::UTF8.GetBytes($string)
[Console]::OpenStandardOutput().Write($u8list, 0, $u8list.Length)
}]]
}
local process = utils.subprocess({ args = args, cancellable = false })
return parse_files(process, '%/')
end
function get_files_linux(dir)
local args = { 'ls', '-1pv', dir }
local process = utils.subprocess({ args = args, cancellable = false })
return parse_files(process, '\n')
end
function parse_files(res, delimiter)
if not res.error and res.status == 0 then
local valid_files = {}
for line in res.stdout:gmatch("[^"..delimiter.."]+") do
local ext = line:match("^.+%.(.+)$")
if ext and filetype_lookup[ext:lower()] then
table.insert(valid_files, line)
end
end
return valid_files, nil
else
return nil, res.error
end
end
--Creates a playlist of all files in directory, will keep the order and position
--For exaple, Folder has 12 files, you open the 5th file and run this, the remaining 7 are added behind the 5th file and prior 4 files before it
function playlist(force_dir)
refresh_globals()
if not directory and plen > 0 then return end
local hasfile = true
if plen == 0 then
hasfile = false
dir = mp.get_property('working-directory')
else
dir = directory
end
if force_dir then dir = force_dir end
local files, error
if settings.system == "linux" then
files, error = get_files_linux(dir)
else
files, error = get_files_windows(dir)
end
local c, c2 = 0,0
if files then
local cur = false
local filename = mp.get_property("filename")
for _, file in ipairs(files) do
local appendstr = "append"
if not hasfile then
cur = true
appendstr = "append-play"
hasfile = true
end
if cur == true then
mp.commandv("loadfile", utils.join_path(dir, file), appendstr)
msg.info("Appended to playlist: " .. file)
c2 = c2 + 1
elseif file ~= filename then
mp.commandv("loadfile", utils.join_path(dir, file), appendstr)
msg.info("Prepended to playlist: " .. file)
mp.commandv("playlist-move", mp.get_property_number("playlist-count", 1)-1, c)
c = c + 1
else
cur = true
end
end
if c2 > 0 or c>0 then
mp.osd_message("Added "..c + c2.." files to playlist")
else
mp.osd_message("No additional files found")
end
cursor = mp.get_property_number('playlist-pos', 1)
else
msg.error("Could not scan for files: "..(error or ""))
end
if sort_watching then
msg.info("Ignoring directory structure and using playlist sort")
sortplaylist()
end
refresh_globals()
if playlist_visible then showplaylist() end
return c + c2
end
function parse_home(path)
if not path:find("^~") then
return path
end
local home_dir = os.getenv("HOME") or os.getenv("USERPROFILE")
if not home_dir then
local drive = os.getenv("HOMEDRIVE")
local path = os.getenv("HOMEPATH")
if drive and path then
home_dir = utils.join_path(drive, path)
else
msg.error("Couldn't find home dir.")
return nil
end
end
local result = path:gsub("^~", home_dir)
return result
end
--saves the current playlist into a m3u file
function save_playlist()
local length = mp.get_property_number('playlist-count', 0)
if length == 0 then return end
--get playlist save path
local savepath
if settings.playlist_savepath == nil or settings.playlist_savepath == "" then
savepath = mp.command_native({"expand-path", "~~home/"}).."/playlists"
else
savepath = parse_home(settings.playlist_savepath)
if savepath == nil then return end
end
--create savepath if it doesn't exist
if utils.readdir(savepath) == nil then
local windows_args = {'powershell', '-NoProfile', '-Command', 'mkdir', savepath}
local unix_args = { 'mkdir', savepath }
local args = settings.system == 'windows' and windows_args or unix_args
local res = utils.subprocess({ args = args, cancellable = false })
if res.status ~= 0 then
msg.error("Failed to create playlist save directory "..savepath..". Error: "..(res.error or "unknown"))
return
end
end
local date = os.date("*t")
local datestring = ("%02d-%02d-%02d_%02d-%02d-%02d"):format(date.year, date.month, date.day, date.hour, date.min, date.sec)
local savepath = utils.join_path(savepath, datestring.."_playlist-size_"..length..".m3u")
local file, err = io.open(savepath, "w")
if not file then
msg.error("Error in creating playlist file, check permissions. Error: "..(err or "unknown"))
else
local i=0
while i < length do
local pwd = mp.get_property("working-directory")
local filename = mp.get_property('playlist/'..i..'/filename')
local fullpath = filename
if not filename:match("^%a%a+:%/%/") then
fullpath = utils.join_path(pwd, filename)
end
local title = mp.get_property('playlist/'..i..'/title')
if title then file:write("#EXTINF:,"..title.."\n") end
file:write(fullpath, "\n")
i=i+1
end
msg.info("Playlist written to: "..savepath)
file:close()
end
end
function alphanumsort(a, b)
local function padnum(d)
local dec, n = string.match(d, "(%.?)0*(.+)")
return #dec > 0 and ("%.12f"):format(d) or ("%s%03d%s"):format(dec, #n, n)
end
return tostring(a):lower():gsub("%.?%d+",padnum)..("%3d"):format(#b)
< tostring(b):lower():gsub("%.?%d+",padnum)..("%3d"):format(#a)
end
function dosort(a,b)
if settings.alphanumsort then
return alphanumsort(a,b)
else
return a < b
end
end
function sortplaylist(startover)
local length = mp.get_property_number('playlist-count', 0)
if length < 2 then return end
--use insertion sort on playlist to make it easy to order files with playlist-move
for outer=1, length-1, 1 do
local outerfile = get_name_from_index(outer, true)
local inner = outer - 1
while inner >= 0 and dosort(outerfile, get_name_from_index(inner, true)) do
inner = inner - 1
end
inner = inner + 1
if outer ~= inner then
mp.commandv('playlist-move', outer, inner)
end
end
cursor = mp.get_property_number('playlist-pos', 0)
if startover then
mp.set_property('playlist-pos', 0)
end
if playlist_visible then showplaylist() end
end
function autosort(name, param)
if param == 0 then return end
if plen < param then
msg.info("Playlistmanager autosorting playlist")
refresh_globals()
sortplaylist()
end
end
function reverseplaylist()
local length = mp.get_property_number('playlist-count', 0)
if length < 2 then return end
for outer=1, length-1, 1 do
mp.commandv('playlist-move', outer, 0)
end
if playlist_visible then showplaylist() end
end
function shuffleplaylist()
refresh_globals()
if plen < 2 then return end
mp.command("playlist-shuffle")
math.randomseed(os.time())
mp.commandv("playlist-move", pos, math.random(0, plen-1))
mp.set_property('playlist-pos', 0)
refresh_globals()
if playlist_visible then showplaylist() end
end
function bind_keys(keys, name, func, opts)
if not keys then
mp.add_forced_key_binding(keys, name, func, opts)
return
end
local i = 1
for key in keys:gmatch("[^%s]+") do
local prefix = i == 1 and '' or i
mp.add_forced_key_binding(key, name..prefix, func, opts)
i = i + 1
end
end
function unbind_keys(keys, name)
if not keys then
mp.remove_key_binding(name)
return
end
local i = 1
for key in keys:gmatch("[^%s]+") do
local prefix = i == 1 and '' or i
mp.remove_key_binding(name..prefix)
i = i + 1
end
end
function add_keybinds()
bind_keys(settings.key_moveup, 'moveup', moveup, "repeatable")
bind_keys(settings.key_movedown, 'movedown', movedown, "repeatable")
bind_keys(settings.key_selectfile, 'selectfile', selectfile)
bind_keys(settings.key_unselectfile, 'unselectfile', unselectfile)
bind_keys(settings.key_playfile, 'playfile', playfile)
bind_keys(settings.key_removefile, 'removefile', removefile, "repeatable")
bind_keys(settings.key_closeplaylist, 'closeplaylist', remove_keybinds)
end
function remove_keybinds()
keybindstimer:kill()
keybindstimer = mp.add_periodic_timer(settings.playlist_display_timeout, remove_keybinds)
keybindstimer:kill()
mp.set_osd_ass(0, 0, "")
playlist_visible = false
if settings.dynamic_binds then
unbind_keys(settings.key_moveup, 'moveup')
unbind_keys(settings.key_movedown, 'movedown')
unbind_keys(settings.key_selectfile, 'selectfile')
unbind_keys(settings.key_unselectfile, 'unselectfile')
unbind_keys(settings.key_playfile, 'playfile')
unbind_keys(settings.key_removefile, 'removefile')
unbind_keys(settings.key_closeplaylist, 'closeplaylist')
end
end
keybindstimer = mp.add_periodic_timer(settings.playlist_display_timeout, remove_keybinds)
keybindstimer:kill()
if not settings.dynamic_binds then
add_keybinds()
end
if settings.loadfiles_on_start and mp.get_property_number('playlist-count', 0) == 0 then
playlist()
end
promised_sort_watch = false
if settings.sortplaylist_on_file_add then
promised_sort_watch = true
end
promised_sort = false
if settings.sortplaylist_on_start then
promised_sort = true
end
mp.observe_property('playlist-count', "number", function()
if playlist_visible then showplaylist() end
if settings.prefer_titles == 'none' then return end
-- resolve titles
resolve_titles()
end)
--resolves url titles by calling youtube-dl
function resolve_titles()
if not settings.resolve_titles then return end
local length = mp.get_property_number('playlist-count', 0)
if length < 2 then return end
local i=0
-- loop all items in playlist because we can't predict how it has changed
while i < length do
local filename = mp.get_property('playlist/'..i..'/filename')
local title = mp.get_property('playlist/'..i..'/title')
if i ~= pos
and filename
and filename:match('^https?://')
and not title
and not url_table[filename]
and not requested_urls[filename]
then
requested_urls[filename] = true
local args = { 'youtube-dl', '--no-playlist', '--flat-playlist', '-sJ', filename }
local req = mp.command_native_async(
{
name = "subprocess",
args = args,
playback_only = false,
capture_stdout = true
}, function (success, res)
if res.killed_by_us then
msg.verbose('Request to resolve url title ' .. filename .. ' timed out')
return
end
if res.status == 0 then
local json, err = utils.parse_json(res.stdout)
if not err then
local is_playlist = json['_type'] and json['_type'] == 'playlist'
local title = (is_playlist and '[playlist]: ' or '') .. json['title']
msg.verbose(filename .. " resolved to '" .. title .. "'")
url_table[filename] = title
refresh_globals()
if playlist_visible then showplaylist() end
return
else
msg.error("Failed parsing json, reason: "..(err or "unknown"))
end
else
msg.error("Failed to resolve url title "..filename.." Error: "..(res.error or "unknown"))
end
end)
mp.add_timeout(5, function()
mp.abort_async_command(req)
end)
end
i=i+1
end
end
--script message handler
function handlemessage(msg, value, value2)
if msg == "show" and value == "playlist" then
if value2 ~= "toggle" then
showplaylist(value2)
return
else
toggle_playlist()
return
end
end
if msg == "show" and value == "filename" and strippedname and value2 then
mp.commandv('show-text', strippedname, tonumber(value2)*1000 ) ; return
end
if msg == "show" and value == "filename" and strippedname then
mp.commandv('show-text', strippedname ) ; return
end
if msg == "sort" then sortplaylist(value) ; return end
if msg == "shuffle" then shuffleplaylist() ; return end
if msg == "reverse" then reverseplaylist() ; return end
if msg == "loadfiles" then playlist(value) ; return end
if msg == "save" then save_playlist() ; return end
end
mp.register_script_message("playlistmanager", handlemessage)
mp.add_key_binding("CTRL+p", "sortplaylist", sortplaylist)
mp.add_key_binding("CTRL+P", "shuffleplaylist", shuffleplaylist)
mp.add_key_binding("CTRL+R", "reverseplaylist", reverseplaylist)
mp.add_key_binding("P", "loadfiles", playlist)
mp.add_key_binding("p", "saveplaylist", save_playlist)
mp.add_key_binding("SHIFT+ENTER", "showplaylist", toggle_playlist)
mp.register_event("file-loaded", on_loaded)
mp.register_event("end-file", on_closed)

View File

@ -0,0 +1,469 @@
-- sponsorblock.lua
--
-- This script skips sponsored segments of YouTube videos
-- using data from https://github.com/ajayyy/SponsorBlock
local ON_WINDOWS = package.config:sub(1,1) ~= '/'
local options = {
server_address = "https://sponsor.ajay.app",
python_path = ON_WINDOWS and "python" or "python3",
-- Whether or not to automatically skip sponsors
skip = true,
-- If true, sponsored segments will only be skipped once
skip_once = true,
-- Note that sponsored segments may ocasionally be inaccurate if this is turned off
-- see https://blog.ajay.app/voting-and-pseudo-randomness-or-sponsorblock-or-youtube-sponsorship-segment-blocker
local_database = true,
-- Update database on first run, does nothing if local_database is false
auto_update = true,
-- User ID used to submit sponsored segments, leave blank for random
user_id = "",
-- Name to display on the stats page https://sponsor.ajay.app/stats/ leave blank to keep current name
display_name = "",
-- Tell the server when a skip happens
report_views = true,
-- Auto upvote skipped sponsors
auto_upvote = true,
-- Use sponsor times from server if they're more up to date than our local database
server_fallback = true,
-- Create chapters at sponsor boundaries for OSC display and manual skipping with skip=false
make_chapters = true,
-- Minimum duration for sponsors (in seconds), segments under that threshold will be ignored
min_duration = 1,
-- Fade audio for smoother transitions
audio_fade = false,
-- Audio fade step, applied once every 100ms until cap is reached
audio_fade_step = 10,
-- Audio fade cap
audio_fade_cap = 0,
-- Fast forward through sponsors instead of skipping
fast_forward = false,
-- Playback speed modifier when fast forwarding, applied once every second until cap is reached
fast_forward_increase = .2,
-- Playback speed cap
fast_forward_cap = 2,
-- Pattern for video id in local files, ignored if blank
-- Recommended value for base youtube-dl is "-([%a%d%-_]+)%.[mw][kpe][v4b][m]?$"
local_pattern = ""
}
mp.options = require "mp.options"
mp.options.read_options(options, "sponsorblock")
local legacy = mp.command_native_async == nil
if legacy then
options.local_database = false
end
local utils = require "mp.utils"
if mp.get_script_directory == nil then
scripts_dir = mp.find_config_file("scripts/sponsorblock")
else
scripts_dir = mp.get_script_directory()
end
local sponsorblock = utils.join_path(scripts_dir, "shared/sponsorblock.py")
local uid_path = utils.join_path(scripts_dir, "shared/sponsorblock.txt")
local database_file = options.local_database and utils.join_path(scripts_dir, "shared/sponsorblock.db") or ""
local youtube_id = nil
local ranges = {}
local init = false
local segment = {a = 0, b = 0, progress = 0, first = true}
local retrying = false
local last_skip = {uuid = "", dir = nil}
local speed_timer = nil
local fade_timer = nil
local fade_dir = nil
local volume_before = mp.get_property_number("volume")
function file_exists(name)
local f = io.open(name,"r")
if f ~= nil then io.close(f) return true else return false end
end
function t_count(t)
local count = 0
for _ in pairs(t) do count = count + 1 end
return count
end
function time_sort(a, b)
return a.time < b.time
end
function clean_chapters()
local chapters = mp.get_property_native("chapter-list")
local new_chapters = {}
for _, chapter in pairs(chapters) do
if chapter.title ~= "Preview segment start" and chapter.title ~= "Preview segment end" then
table.insert(new_chapters, chapter)
end
end
mp.set_property_native("chapter-list", new_chapters)
end
function create_chapter(chapter_title, chapter_time)
local chapters = mp.get_property_native("chapter-list")
local duration = mp.get_property_native("duration")
table.insert(chapters, {title=chapter_title, time=(duration == nil or duration > chapter_time) and chapter_time or duration - .001})
table.sort(chapters, time_sort)
mp.set_property_native("chapter-list", chapters)
end
function getranges(_, exists, db, more)
if type(exists) == "table" and exists["status"] == "1" then
if options.server_fallback then
mp.add_timeout(0, function() getranges(true, true, "") end)
else
return mp.osd_message("[sponsorblock] database update failed, gave up")
end
end
if db ~= "" and db ~= database_file then db = database_file end
if exists ~= true and not file_exists(db) then
if not retrying then
mp.osd_message("[sponsorblock] database update failed, retrying...")
retrying = true
end
return update()
end
if retrying then
mp.osd_message("[sponsorblock] database update succeeded")
retrying = false
end
local sponsors
local args = {
options.python_path,
sponsorblock,
"ranges",
db,
options.server_address,
youtube_id
}
if not legacy then
sponsors = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
else
sponsors = utils.subprocess({args = args})
end
if not string.match(sponsors.stdout, "^%s*(.*%S)") then return end
if string.match(sponsors.stdout, "error") then return getranges(true, true) end
local new_ranges = {}
local r_count = 0
if more then r_count = -1 end
for t in string.gmatch(sponsors.stdout, "[^:%s]+") do
uuid = string.match(t, '[^,]+$')
if ranges[uuid] then
new_ranges[uuid] = ranges[uuid]
else
start_time = tonumber(string.match(t, '[^,]+'))
end_time = tonumber(string.sub(string.match(t, ',[^,]+'), 2))
for o_uuid, o_t in pairs(ranges) do
if (start_time >= o_t.start_time and start_time <= o_t.end_time) or (o_t.start_time >= start_time and o_t.start_time <= end_time) then
new_ranges[o_uuid] = o_t
goto continue
end
end
if end_time - start_time >= options.min_duration then
new_ranges[uuid] = {
start_time = start_time,
end_time = end_time,
skipped = false
}
end
if options.make_chapters then
create_chapter("Sponsor start (" .. string.sub(uuid, 1, 6) .. ")", start_time)
create_chapter("Sponsor end (" .. string.sub(uuid, 1, 6) .. ")", end_time)
end
end
::continue::
r_count = r_count + 1
end
local c_count = t_count(ranges)
if c_count == 0 or r_count >= c_count then
ranges = new_ranges
end
end
function fast_forward()
local last_speed = mp.get_property_number("speed")
local new_speed = math.min(last_speed + options.fast_forward_increase, options.fast_forward_cap)
if new_speed <= last_speed then return end
mp.set_property("speed", new_speed)
end
function fade_audio(step)
local last_volume = mp.get_property_number("volume")
local new_volume = math.max(options.audio_fade_cap, math.min(last_volume + step, volume_before))
if new_volume == last_volume then
if step >= 0 then fade_dir = nil end
if fade_timer ~= nil then fade_timer:kill() end
fade_timer = nil
return
end
mp.set_property("volume", new_volume)
end
function skip_ads(name, pos)
if pos == nil then return end
local sponsor_ahead = false
for uuid, t in pairs(ranges) do
if (options.fast_forward == uuid or not options.skip_once or not t.skipped) and t.start_time <= pos and t.end_time > pos then
if options.fast_forward == uuid then return end
if options.fast_forward == false then
mp.osd_message("[sponsorblock] sponsor skipped")
mp.set_property("time-pos", t.end_time)
else
mp.osd_message("[sponsorblock] skipping sponsor")
end
t.skipped = true
last_skip = {uuid = uuid, dir = nil}
if options.report_views or options.auto_upvote then
local args = {
options.python_path,
sponsorblock,
"stats",
database_file,
options.server_address,
youtube_id,
uuid,
options.report_views and "1" or "",
uid_path,
options.user_id,
options.auto_upvote and "1" or ""
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess_detached({args = args})
end
end
if options.fast_forward ~= false then
options.fast_forward = uuid
speed_timer = mp.add_periodic_timer(1, fast_forward)
end
return
elseif (not options.skip_once or not t.skipped) and t.start_time <= pos + 1 and t.end_time > pos + 1 then
sponsor_ahead = true
end
end
if options.audio_fade then
if sponsor_ahead then
if fade_dir ~= false then
if fade_dir == nil then volume_before = mp.get_property_number("volume") end
if fade_timer ~= nil then fade_timer:kill() end
fade_dir = false
fade_timer = mp.add_periodic_timer(.1, function() fade_audio(-options.audio_fade_step) end)
end
elseif fade_dir == false then
fade_dir = true
if fade_timer ~= nil then fade_timer:kill() end
fade_timer = mp.add_periodic_timer(.1, function() fade_audio(options.audio_fade_step) end)
end
end
if options.fast_forward and options.fast_forward ~= true then
options.fast_forward = true
speed_timer:kill()
mp.set_property("speed", 1)
end
end
function vote(dir)
if last_skip.uuid == "" then return mp.osd_message("[sponsorblock] no sponsors skipped, can't submit vote") end
local updown = dir == "1" and "up" or "down"
if last_skip.dir == dir then return mp.osd_message("[sponsorblock] " .. updown .. "vote already submitted") end
last_skip.dir = dir
local args = {
options.python_path,
sponsorblock,
"stats",
database_file,
options.server_address,
youtube_id,
last_skip.uuid,
"",
uid_path,
options.user_id,
dir
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess({args = args})
end
mp.osd_message("[sponsorblock] " .. updown .. "vote submitted")
end
function update()
mp.command_native_async({name = "subprocess", playback_only = false, args = {
options.python_path,
sponsorblock,
"update",
database_file,
options.server_address
}}, getranges)
end
function file_loaded()
local initialized = init
ranges = {}
segment = {a = 0, b = 0, progress = 0, first = true}
last_skip = {uuid = "", dir = nil}
local video_path = mp.get_property("path")
local youtube_id1 = string.match(video_path, "https?://youtu%.be/([%a%d%-_]+).*")
local youtube_id2 = string.match(video_path, "https?://w?w?w?%.?youtube%.com/v/([%a%d%-_]+).*")
local youtube_id3 = string.match(video_path, "/watch%?v=([%a%d%-_]+).*")
local youtube_id4 = string.match(video_path, "/embed/([%a%d%-_]+).*")
local local_pattern = nil
if options.local_pattern ~= "" then
local_pattern = string.match(video_path, options.local_pattern)
end
youtube_id = youtube_id1 or youtube_id2 or youtube_id3 or youtube_id4 or local_pattern
if not youtube_id then return end
init = true
if not options.local_database then
getranges(true, true)
else
local exists = file_exists(database_file)
if exists and options.server_fallback then
getranges(true, true)
mp.add_timeout(0, function() getranges(true, true, "", true) end)
elseif exists then
getranges(true, true)
elseif options.server_fallback then
mp.add_timeout(0, function() getranges(true, true, "") end)
end
end
if initialized then return end
if options.skip then
mp.observe_property("time-pos", "native", skip_ads)
end
if options.display_name ~= "" then
local args = {
options.python_path,
sponsorblock,
"username",
database_file,
options.server_address,
youtube_id,
"",
"",
uid_path,
options.user_id,
options.display_name
}
if not legacy then
mp.command_native_async({name = "subprocess", playback_only = false, args = args}, function () end)
else
utils.subprocess_detached({args = args})
end
end
if not options.local_database or (not options.auto_update and file_exists(database_file)) then return end
update()
end
function set_segment()
if not youtube_id then return end
local pos = mp.get_property_number("time-pos")
if pos == nil then return end
if segment.progress > 1 then
segment.progress = segment.progress - 2
end
if segment.progress == 1 then
segment.progress = 0
segment.b = pos
mp.osd_message("[sponsorblock] segment boundary B set, press again for boundary A", 3)
else
segment.progress = 1
segment.a = pos
mp.osd_message("[sponsorblock] segment boundary A set, press again for boundary B", 3)
end
if options.make_chapters and not segment.first then
local start_time = math.min(segment.a, segment.b)
local end_time = math.max(segment.a, segment.b)
if end_time - start_time ~= 0 and end_time ~= 0 then
clean_chapters()
create_chapter("Preview segment start", start_time)
create_chapter("Preview segment end", end_time)
end
end
segment.first = false
end
function submit_segment()
if not youtube_id then return end
local start_time = math.min(segment.a, segment.b)
local end_time = math.max(segment.a, segment.b)
if end_time - start_time == 0 or end_time == 0 then
mp.osd_message("[sponsorblock] empty segment, not submitting")
elseif segment.progress <= 1 then
mp.osd_message(string.format("[sponsorblock] press Shift+G again to confirm: %.2d:%.2d:%.2d to %.2d:%.2d:%.2d", math.floor(start_time/(60*60)), math.floor(start_time/60%60), math.floor(start_time%60), math.floor(end_time/(60*60)), math.floor(end_time/60%60), math.floor(end_time%60)), 5)
segment.progress = segment.progress + 2
else
mp.osd_message("[sponsorblock] submitting segment...", 30)
local submit
local args = {
options.python_path,
sponsorblock,
"submit",
database_file,
options.server_address,
youtube_id,
tostring(start_time),
tostring(end_time),
uid_path,
options.user_id
}
if not legacy then
submit = mp.command_native({name = "subprocess", capture_stdout = true, playback_only = false, args = args})
else
submit = utils.subprocess({args = args})
end
if string.match(submit.stdout, "success") then
segment = {a = 0, b = 0, progress = 0, first = true}
mp.osd_message("[sponsorblock] segment submitted")
if options.make_chapters then
clean_chapters()
create_chapter("Submitted segment start", start_time)
create_chapter("Submitted segment end", end_time)
end
elseif string.match(submit.stdout, "error") then
mp.osd_message("[sponsorblock] segment submission failed, server may be down. try again", 5)
elseif string.match(submit.stdout, "502") then
mp.osd_message("[sponsorblock] segment submission failed, server is down. try again", 5)
elseif string.match(submit.stdout, "400") then
mp.osd_message("[sponsorblock] segment submission failed, impossible inputs", 5)
segment = {a = 0, b = 0, progress = 0, first = true}
elseif string.match(submit.stdout, "429") then
mp.osd_message("[sponsorblock] segment submission failed, rate limited. try again", 5)
elseif string.match(submit.stdout, "409") then
mp.osd_message("[sponsorblock] segment already submitted", 3)
segment = {a = 0, b = 0, progress = 0, first = true}
else
mp.osd_message("[sponsorblock] segment submission failed", 5)
end
end
end
mp.register_event("file-loaded", file_loaded)
mp.add_key_binding("e", "sponsorblock_set_segment", set_segment)
mp.add_key_binding("E", "sponsorblock_submit_segment", submit_segment)
mp.add_key_binding("w", "sponsorblock_upvote", function() return vote("1") end)
mp.add_key_binding("W", "sponsorblock_downvote", function() return vote("0") end)

View File

@ -0,0 +1,110 @@
import urllib.request
import urllib.parse
import sqlite3
import random
import string
import json
import sys
import os
if sys.argv[1] in ["submit", "stats", "username"]:
if not sys.argv[8]:
if os.path.isfile(sys.argv[7]):
with open(sys.argv[7]) as f:
uid = f.read()
else:
uid = "".join(random.choices(string.ascii_letters + string.digits, k=36))
with open(sys.argv[7], "w") as f:
f.write(uid)
else:
uid = sys.argv[8]
opener = urllib.request.build_opener()
opener.addheaders = [("User-Agent", "mpv_sponsorblock/1.0 (https://github.com/po5/mpv_sponsorblock)")]
urllib.request.install_opener(opener)
if sys.argv[1] == "ranges" and (not sys.argv[2] or not os.path.isfile(sys.argv[2])):
times = []
try:
response = urllib.request.urlopen(sys.argv[3] + "/api/getVideoSponsorTimes?videoID=" + sys.argv[4])
data = json.load(response)
for i, time in enumerate(data["sponsorTimes"]):
times.append(str(time[0]) + "," + str(time[1]) + "," + data["UUIDs"][i])
print(":".join(times))
except (TimeoutError, urllib.error.URLError) as e:
print("error")
except urllib.error.HTTPError as e:
if e.code == 404:
print("")
else:
print("error")
elif sys.argv[1] == "ranges":
conn = sqlite3.connect(sys.argv[2])
conn.row_factory = sqlite3.Row
c = conn.cursor()
c.execute("SELECT startTime, endTime, votes, UUID FROM sponsorTimes WHERE videoID = ? AND shadowHidden = 0 AND votes > -1 AND category = 'sponsor'", (sys.argv[4],))
times = []
sponsors = c.fetchall()
best = list(sponsors)
dealtwith = []
similar = []
for sponsor_a in sponsors:
for sponsor_b in sponsors:
if sponsor_a is not sponsor_b and sponsor_a["startTime"] >= sponsor_b["startTime"] and sponsor_a["startTime"] <= sponsor_b["endTime"]:
similar.append([sponsor_a, sponsor_b])
if sponsor_a in best:
best.remove(sponsor_a)
if sponsor_b in best:
best.remove(sponsor_b)
for sponsors_a in similar:
if sponsors_a in dealtwith:
continue
group = set(sponsors_a)
for sponsors_b in similar:
if sponsors_b[0] in group or sponsors_b[1] in group:
group.add(sponsors_b[0])
group.add(sponsors_b[1])
dealtwith.append(sponsors_b)
best.append(max(group, key=lambda x:x["votes"]))
for time in best:
times.append(str(time["startTime"]) + "," + str(time["endTime"]) + "," + time["UUID"])
print(":".join(times))
elif sys.argv[1] == "update":
try:
urllib.request.urlretrieve(sys.argv[3] + "/database.db", sys.argv[2] + ".tmp")
os.replace(sys.argv[2] + ".tmp", sys.argv[2])
except PermissionError:
print("database update failed, file currently in use", file=sys.stderr)
exit(1)
except ConnectionResetError:
print("database update failed, connection reset", file=sys.stderr)
exit(1)
except TimeoutError:
print("database update failed, timed out", file=sys.stderr)
exit(1)
except urllib.error.URLError:
print("database update failed", file=sys.stderr)
exit(1)
elif sys.argv[1] == "submit":
try:
response = urllib.request.urlopen(sys.argv[3] + "/api/postVideoSponsorTimes?videoID=" + sys.argv[4] + "&startTime=" + sys.argv[5] + "&endTime=" + sys.argv[6] + "&userID=" + uid)
print("success")
except urllib.error.HTTPError as e:
print(e.code)
except:
print("error")
elif sys.argv[1] == "stats":
try:
if sys.argv[6]:
urllib.request.urlopen(sys.argv[3] + "/api/viewedVideoSponsorTime?UUID=" + sys.argv[5])
if sys.argv[9]:
urllib.request.urlopen(sys.argv[3] + "/api/voteOnSponsorTime?UUID=" + sys.argv[5] + "&userID=" + uid + "&type=" + sys.argv[9])
except:
pass
elif sys.argv[1] == "username":
try:
data = urllib.parse.urlencode({"userID": uid, "userName": sys.argv[9]}).encode()
req = urllib.request.Request(sys.argv[3] + "/api/setUsername", data=data)
urllib.request.urlopen(req)
except:
pass

View File

@ -0,0 +1,3 @@
if mp.get_script_directory == nil then
dofile(mp.find_config_file("scripts/sponsorblock/main.lua"))
end

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
"""
This script emulates "unique application" functionality on Linux. When starting
@ -19,6 +19,10 @@ will typically just fill ~/.xsession-errors with garbage.
mpv will terminate if there are no more files to play, and running the umpv
script after that will start a new mpv instance.
Note that you can control the mpv instance by writing to the command fifo:
echo "cycle fullscreen" > ~/.umpv_fifo
Note: you can supply custom mpv path and options with the MPV environment
variable. The environment variable will be split on whitespace, and the
first item is used as path to mpv binary and the rest is passed as options
@ -28,9 +32,10 @@ Note: you can supply custom mpv path and options with the MPV environment
import sys
import os
import socket
import errno
import subprocess
import fcntl
import stat
import string
files = sys.argv[1:]
@ -41,63 +46,59 @@ def is_url(filename):
if len(parts) < 2:
return False
# protocol prefix has no special characters => it's an URL
allowed_symbols = string.ascii_letters + string.digits + "_"
allowed_symbols = string.ascii_letters + string.digits + '_'
prefix = parts[0]
return all(map(lambda c: c in allowed_symbols, prefix))
# make them absolute; also makes them safe against interpretation as options
def make_abs(filename):
if not is_url(filename):
return os.path.abspath(filename)
return filename
files = [make_abs(f) for f in files]
SOCK = os.path.join(str(os.getenv("HOME")), ".umpv_socket")
FIFO = os.path.join(os.getenv("HOME"), ".umpv_fifo")
sock = None
fifo_fd = -1
try:
sock = socket.socket(socket.AF_UNIX)
sock.connect(SOCK)
except socket.error as e:
if e.errno == errno.ECONNREFUSED:
sock = None
pass # abandoned socket
fifo_fd = os.open(FIFO, os.O_NONBLOCK | os.O_WRONLY)
except OSError as e:
if e.errno == errno.ENXIO:
pass # pipe has no writer
elif e.errno == errno.ENOENT:
sock = None
pass # doesn't exist
pass # doesn't exist
else:
raise e
if sock:
if fifo_fd >= 0:
# Unhandled race condition: what if mpv is terminating right now?
fcntl.fcntl(fifo_fd, fcntl.F_SETFL, 0) # set blocking mode
fifo = os.fdopen(fifo_fd, "w")
for f in files:
# escape: \ \n "
f = f.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n")
f = '"' + f + '"'
sock.send(("raw loadfile " + f + " append\n").encode("utf-8"))
f = f.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n")
f = "\"" + f + "\""
fifo.write("raw loadfile " + f + " append\n")
else:
# Let mpv recreate socket if it doesn't already exist.
# Recreate pipe if it doesn't already exist.
# Also makes sure it's safe, and no other user can create a bogus pipe
# that breaks security.
try:
os.unlink(FIFO)
except OSError as e:
pass
os.mkfifo(FIFO, 0o600)
opts = (os.getenv("MPV") or "mpv").split()
opts.extend(
[
"--no-terminal",
"--force-window",
"--input-ipc-server=" + SOCK,
# position on lower left screen corner
# contains funky fix for slight resizings depending on video
# move it 10px more left than it wants; 5px more up
"--geometry=15%+-10-+5",
"--on-all-workspaces",
"--force-window=immediate",
"--x11-name=float",
"--wayland-app-id=float",
"--",
]
)
opts.extend(["--no-terminal",
"--on-all-workspaces",
# position on lower left screen corner
# contains funky fix for slight resizings depending on video
# move it 10px more left than it wants; 5px more up
"--geometry=15%+-10-+5",
"--force-window=immediate",
"--input-file=" + FIFO,
"--"])
opts.extend(files)
subprocess.check_call(opts)

View File

@ -1,15 +1,8 @@
# Multimedia module
# mpv module
[mpv](https://mpv.io) -- free, open-source, cross-platform media player
beets -- organize your music library
mopidy -- serve your music library
ncmpcpp -- actually play your music (and twist your tongue pronouncing it)
The largest modifications so far are definitely to mpv (described below),
with beets and mopidy being somewhat configured to my tastes as well.
mpv is set up to hopefully strike a balance between high quality playback, streaming with a reasonable speed and saving battery power.
It is set up to play both local files and streams from the web (especially youtube with playlisting and ad skipping), via a qutebrowser mapping if the corresponding module is installed.
* mpv by default does not come with a gui, this configuration uses [uosc](https://github.com/darsain/uosc) to enable a comfortable gui
* available subtitles are loaded and shown in a consistently high quality, as much as possible
@ -20,7 +13,7 @@ It is set up to play both local files and streams from the web (especially youtu
* default video is adjusted for playback during the day, in a normally lit room
* simple context menu (opened with `menu` key on keyboard) to load files, subtitles, chapters, and more
* newly defined keybindings, look in `input.conf` for their definitions
* when a battery is being discharged, mpv starts in a slightly lower quality but battery saving playback profile
* when a battery
## vim-like navigation
@ -55,8 +48,12 @@ It degrades gracefully, and simply keeps running in higher quality if the file i
## sponsorblock
The [minimal mpv-sponsorblock](https://codeberg.org/jouni/mpv_sponsorblock_minimal) script is included to enable automatically skipping many sponsorship segments integrated within youtube videos.
The [mpv-sponsorblock](https://github.com/po5/mpv_sponsorblock) script is included to enable automatically skipping many sponsorship segments integrated within youtube videos.
This works mostly fully automated, it checks the database and finds affected segments, which it then automatically skips over.
This works mostly fully automated, it checks the database and marks affected segments in red on your timeline, which it automatically skips over.
To toggle sponsorblock on or off just hit `b`, it will confirm the choice via osd.
If you are watching a video with sponsorship segments that have not yet been marked, you can add your own segment with `e`
(once at the beginning of the segment, once at the end) and when that is done send it off to the database with `E`.
If you watch a video and it contains a well-functioning skip, simply hit `w` to upvote the previous segment.
If a segment did not work well, skipped over other content or similar issues, hit `W` to downvote it.

View File

@ -1,118 +0,0 @@
# much of this such as the whitelist, canonical list for lasgenre
# is stolen from https://github.com/montchr/beets-config/ with much gratitude
directory: ~/media/audio/music
library: ~/.local/share/beets/library.db
threaded: true
art_filename: albumart
# Use the album's original date instead of the release's date
original_date: yes
# Use safer pathnames
asciify_paths: yes
max_filename_length: 255
# Long format - I don't need all the extra info for each invocation
#format_item: '[$id] [$album_id] [$singleton] $albumartist - $title - $album - $original_year - [$format - $bitrate $length $filesize]'
#format_album: '[$id] $albumartist - $album - $original_year [$catalognum]'
clutter:
- Thumbs.db
- .DS_Store
- '*.m3u'
- '*.pls'
- '*.db'
import:
copy: false
move: true
write: true
bell: true
# incremental: true
languages:
- en
log: ~/.cache/beets.log
quiet_fallback: skip
timid: false
ignore_hidden: yes
paths:
default: "%the{$albumartist}/$album/$track $title"
singleton: "singletons/%the{$artist - $title}"
comp: compilations/$album/$track $title
albumtype:soundtrack: soundtracks/$album/$track $title
item_fields:
multidisc: 1 if disctotal > 1 else 0
artist_differs: 1 if albumartist != artist else 0
musicbrainz:
extra_tags: [year, catalognum, country, media, label]
user: {{multimedia_beets_musicbrainz_user}}
pass: {{multimedia_beets_musicbrainz_pass}}
auto: yes
remove: yes
match:
preferred:
countries: ["US", "UK|GB", "DE", "NL", "SE"]
media: ["Digital Media|File", "CD"]
strong_rec_thresh: 0.15
medium_red_thresh: 0.25
rec_gap_thresh: 0.25
plugins:
- bandcamp
- chroma
- deezer
- describe
- edit
- embedart
- export
- fetchart
- fromfilename
- ftintitle
- fuzzy
- importadded
- info
- inline
- lastgenre
- lastimport
- lyrics
- mbcollection
- mbsync
- missing
- spotify
- the
- ydl
edit:
itemfields: track title artist album
albumfields: album albumartist albumtype
ignore_fields: id path
fetchart:
sources: filesystem coverart itunes discogs amazon albumart
store_source: yes
lastgenre:
auto: true
canonical: ~/.config/beets/lastgenre_canonicallist.yaml
count: 4
fallback: ""
force: yes
min_weight: 6
prefer_specific: false
separator: "; "
source: album
whitelist: ~/.config/beets/lastgenre_whitelist.txt
lastfm:
user: schmitzkater
lyrics:
sources: musixmatch genius
fallback: ''
bandcamp:
art: true

View File

@ -1,783 +0,0 @@
- 2-step
- acapella
- acid
- acid house
- acid jazz
- acid techno
- adult contemporary
- african
- african blues
- african heavy metal
- african hip hop
- afrobeat
- aggrotech
- alternative country
- alternative metal
- alternative rock
- ambient
- ambient dub
- ambient house
- ambient space jazz
- ambient techno
- american folk revival
- americana
- anison
- anti-folk
- apala
- arab pop
- asian underground
- atlanta hip hop:
- snap music
- australian country music
- avant-garde
- avant-garde jazz
- axé
- bachata
- baithak gana
- bakersfield sound
- balearic beat
- ballet
- baltimore club
- barbershop
- baroque pop
- baroque:
- baroque music
- bebop
- benga
- berlin school:
- berlin school of electronic music
- berlin-school
- big band
- big beat
- bikutsi
- black metal:
- viking metal
- blue-eyed soul
- bluegrass:
- progressive bluegrass
- reactionary bluegrass
- blues
- blues country
- blues rock
- blues shouter
- bolero
- bongo flava
- boogie
- boogie-woogie
- bossa nova
- bounce music
- brazilian
- brazilian rock
- breakbeat:
- 4-beat
- acid breaks
- breakbeat hardcore
- broken beat
- florida breaks
- nu skool breaks
- breakcore
- brega
- british blues
- british folk revival
- britpop:
- post-britpop
- bubblegum pop
- c-pop:
- cantopop
- cajun:
- cajun fiddle tunes
- calypso
- canadian blues
- cantata
- cape jazz
- celtic music
- chamber jazz
- chamber music:
- string quartet
- chanson
- chicago blues
- chicago house
- chillwave:
- chill wave
- chimurenga
- chiptune:
- bitpop
- game boy music
- nintendocore
- video game music
- yorkshire bleeps and bass
- choro
- christian country music
- christian hip hop
- christian metal
- christian pop
- christian rock
- chutney
- chutney soca
- classic country
- classical crossover
- classical:
- classical music
- orchestra:
- orchestral
- symphonic
- symphony
- close harmony
- coldwave
- comedy:
- comedy music
- comedy rock
- humor
- parody music
- stand-up
- compas
- computer music
- concerto:
- concerto grosso
- contemporary folk
- contemporary r&b
- continental jazz
- cool jazz
- country
- country blues
- country pop
- country rap
- country rock
- country soul
- country-rap
- coupé-décalé
- cowpunk
- crunkcore
- cybergrind
- dance-punk
- dance-rock
- dancehall
- dansband music
- dark ambient
- dark electro
- darkwave:
- dark wave
- death industrial
- death metal:
- goregrind
- deconstructed club
- deep house
- deep techno
- delta blues
- detroit blues
- detroit techno
- digital hardcore:
- bouncy house
- bouncy techno
- hardstyle
- jumpstyle
- makina
- uk hardcore
- disco:
- disco polo:
- euro disco
- nu-disco
- diva house
- dixieland
- doo wop
- doom metal
- doomcore
- downtempo:
- chill out
- ethnic electronica
- moombahton
- nu jazz
- dream pop
- drone metal
- drone:
- drone music
- drum and bass:
- darkcore
- darkstep
- drumfunk
- drumstep
- hardstep
- intelligent drum and bass
- jump-up
- liquid funk
- neurofunk
- raggacore
- sambass
- techstep
- dub poetry
- dub techno
- dub:
- dub music
- dubstep
- dubtronica
- dungeon synth
- dutch house
- east coast hip hop:
- brick city club
- hardcore hip hop
- mafioso rap
- new jersey hip hop
- easy listening:
- background music
- beautiful music
- elevator music
- furniture music
- middle of the road
- ebm:
- electronic body music:
- futurepop
- edm:
- electronic dance music
- electric blues
- electro
- electro house
- electro-grime
- electro-industrial
- electroacoustic:
- acousmatic music
- electroacoustic improvisation
- live electronics
- electroclash
- electrofunk
- electronic rock:
- alternative dance:
- baggy
- madchester
- electronicore
- ethereal wave
- new rave
- electropop
- electropunk
- emo
- enka
- eurodance:
- bubblegum dance
- italo dance
- turbofolk
- europop:
- austropop
- balkan pop
- french pop
- latin pop
- laïkó
- nederpop
- russian pop
- experimental pop
- experimental rock
- experimental:
- experimental music
- fann at-tanbura
- field recording
- fijiri
- filmi
- folk metal:
- celtic metal
- medieval metal
- folk punk:
- celtic punk
- gypsy punk
- folk rock
- folk:
- filk music
- folk music
- folktronica
- footwork
- forró
- fourth world:
- ethnic ambient
- tribal ambient
- franco-country
- freak folk
- free jazz
- free funk
- free improvisation
- freestyle house
- freestyle rap
- freestyle:
- freestyle music
- french house
- frevo
- fuji music
- funk carioca
- funk metal
- funk:
- deep funk
- go-go
- funky house
- g-funk
- gabber
- gamelan
- gangsta rap
- garage rock
- garage:
- 4x4
- bassline
- breakstep
- funky
- speed garage
- genge
- ghetto house
- ghettotech
- glam metal
- glam rock
- glitch-hop
- glitch:
- clicks 'n' cuts
- goa:
- dark psytranceon
- goa trance
- psybreaks
- psyprog
- gospel blues
- goth rock:
- gothic rock
- gothic metal
- grime
- grindcore:
- crustgrind
- noisegrind
- grunge:
- post-grunge
- gulf and western
- gypsy jazz
- happy hardcore
- hard bop
- hard rock
- hardbag
- hardcore punk:
- street punk
- hellbilly music
- hi-nrg:
- eurobeat
- hard nrg
- new beat
- highlife
- hill country blues
- hip house
- hip-hop:
- alternative hip hop
- avant-garde hip hop
- chap hop
- chicago hip hop
- conscious hip hop
- detroit hip hop
- hip hop
- hip hop soul
- hip pop
- horrorcore
- hyphy
- jazz rap
- low bap
- lyrical hip hop
- merenrap
- motswako
- new jack swing
- new school hip hop
- old school hip hop
- political hip hop
- rap opera
- songo-salsa
- st. louis hip hop
- twin cities hip hop
- underground hip hop
- urban pasifika
- hiplife
- hokum
- hokum blues
- hong kong english pop
- honky tonk
- horror punk
- house
- houston hip hop:
- chopped and screwed
- idm
- illbient
- indian pop
- indie folk
- indie pop:
- dunedin sound
- twee pop
- indie rock
- indietronica
- industrial
- industrial dance
- industrial folk
- industrial hip hop
- industrial metal:
- neue deutsche härte
- industrial rock
- instrumental country
- instrumental hip hop
- iranian pop
- isicathamiya
- isolationism
- italo disco
- italo house
- j-pop
- jazz blues
- jazz fusion:
- fusion
- fusion jazz
- jazz rock
- jazz-funk
- jazz:
- british dance band
- crossover jazz
- cubop
- ethno jazz
- european free jazz
- m-base
- mainstream jazz
- novelty ragtime
- orchestral jazz
- shibuya-kei
- stride jazz
- third stream
- trad jazz
- vocal jazz
- west coast gypsy jazz
- west coast jazz
- jit
- jump blues
- jungle:
- oldschool jungle:
- darkside jungle
- ragga jungle
- jùjú
- k-pop:
- korean pop
- kansas city blues
- kansas city jazz
- kapuka
- kayōkyoku
- khaliji
- kizomba
- kosmische:
- kraut rock
- krautrock
- kuduro
- kwaito
- kwela
- lambada
- latin house
- latin jazz
- latin:
- chicha
- criolla
- cumbia
- huayno
- mariachi
- ranchera
- tejano
- live coding
- liwa
- lo-fi
- louisiana blues
- lounge:
- lounge music
- lovers rock
- lowercase
- lubbock sound
- luk thung:
- luk krung
- makossa
- maloya
- mambo
- mandopop
- manila sound
- maracatu
- marrabenta
- martial industrial
- mass
- math rock
- mbalax
- mbaqanga
- mbube
- melodic death metal
- memphis blues
- metal:
- heavy metal
- metalcore:
- deathcore
- mathcore:
- djent
- mexican pop
- miami bass
- minimal house
- minimal techno
- minimal wave
- modal jazz
- modern classical:
- contemporary classical
- morlam
- morna
- museve
- musique concrète:
- tape music
- méringue:
- merengue
- música popular brasileira
- música sertaneja
- nashville sound
- neo soul
- neo-bop jazz
- neo-psychedelia
- neo-swing
- neofolk
- neotraditional country
- nerdcore
- new age:
- new age music
- new-age
- new-age music
- new wave
- no wave
- noise pop
- noise rock
- noise:
- harsh noise
- japanoise
- noise music
- northern soul
- nu metal
- onkyokei
- opera
- oratorio
- organum
- outlaw country
- p-funk
- pagode
- palm-wine
- piano blues
- piedmont blues
- pinoy pop
- pop punk
- pop rock
- pop sunda
- pop:
- jangle pop
- latin ballad
- levenslied
- louisiana swamp pop
- motorpop
- new romanticism
- pop rap
- popera
- schlager
- sophisti-pop
- sunshine pop
- traditional pop music
- vispop
- wonky pop
- post-bop
- post-disco:
- dance-pop
- post-hardcore
- post-punk
- post-punk revival
- post-rock:
- post-metal
- power electronics
- power metal
- power noise
- powerviolence
- progressive country
- progressive electronic:
- progressive breaks
- progressive drum & bass
- progressive house/trance:
- disco house
- dream house
- space house
- progressive techno
- progressive folk
- progressive house
- progressive metal
- progressive rock:
- canterbury scene
- new prog
- rock in opposition
- psychedelic folk
- psychedelic pop
- psychedelic rock:
- acid rock
- freakbeat
- raga rock
- psychobilly
- psychobilly
- punk blues
- punk jazz
- punk:
- anarcho punk:
- crust punk:
- d-beat
- art punk
- christian punk
- deathrock
- garage punk
- skate punk
- punta
- punta rock
- r&b:
- rhythm and blues
- ragga:
- raggamuffin
- ragini
- ragtime
- rap rock:
- rap metal
- rapcore
- rasin
- rave:
- rave music
- raï
- red dirt
- reggae:
- 2 tone
- reggae en español:
- reggae 110
- reggae bultrón
- romantic flow
- spanish reggae
- reggae fusion
- reggaeton
- requiem
- riot grrrl
- rock and roll
- rock:
- art rock
- beat music
- chinese rock
- dark cabaret
- desert rock
- paisley underground
- power pop
- visual kei:
- nagoya kei
- rockabilly
- rocksteady
- roots reggae
- sacred music:
- cantique
- gregorian chant
- sadcore
- sakara
- salsa
- samba
- samba rock
- sawt
- screamo
- sega
- seggae
- semba
- sertanejo
- shoegaze
- ska
- ska jazz
- ska punk:
- ska-core
- slowcore
- sludge metal
- smooth jazz
- soca
- soft rock
- son
- sonata
- soukous
- soul
- soul blues
- soul jazz
- south and southeast asian:
- baila
- bhangra
- bhojpuri
- dangdut
- lavani
- southern hip hop
- southern rock
- space age pop
- space disco:
- cosmic disco
- space rock
- speed metal
- speedcore
- st. louis blues
- stoner metal
- stoner rock
- straight-ahead jazz
- sufi rock
- sung poetry
- surf pop
- surf rock
- swamp blues
- swing
- swing house
- symphonic metal
- synthcore
- synthpop
- synthpunk
- taarab
- taiwanese pop
- tech house
- technical death metal
- techno-folk
- techno:
- free tekno
- nortec
- schranz
- techno-dnb
- tecno brega
- toytown techno
- technopop
- tecnobrega
- teen pop
- terrorcore
- texas blues
- texas country
- thai pop
- thrash metal:
- crossover thrash
- groove metal
- thrash
- thrashcore
- timba
- traditional country music
- trance:
- acid trance
- classic trance
- dream trance
- hard trance
- progressive trance
- psychedelic trance
- psytrance
- tech trance
- uplifting trance:
- orchestral uplifting
- vocal trance
- trap
- trip-hop:
- trip hop
- tropicalia
- truck-driving country
- turkish pop
- turntablism
- twoubadou
- uk garage
- uk hard house
- us garage
- vaporwave
- vocal house
- west coast blues
- west coast hip hop:
- chicano rap
- jerkin'
- western swing
- witch house
- world:
- world music
- worldbeat
- world fusion
- zouglou
- zouk
- zouk-lambada
- zydeco

View File

@ -1,491 +0,0 @@
2-step
acapella
acid
acid house
acid jazz
acid techno
adult contemporary
african
african blues
african heavy metal
african hip hop
afrobeat
aggrotech
alternative country
alternative metal
alternative rock
ambient
ambient dub
ambient house
ambient space jazz
ambient techno
american folk revival
americana
anison
anti-folk
apala
arab pop
asian underground
atlanta hip hop
australian country music
avant-garde
avant-garde jazz
axé
bachata
baithak gana
bakersfield sound
balearic beat
ballet
baltimore club
barbershop
baroque pop
baroque
bebop
benga
berlin school
big band
big beat
bikutsi
black metal
blue-eyed soul
bluegrass
blues
blues country
blues rock
blues shouter
bolero
bongo flava
boogie
boogie-woogie
bossa nova
bounce music
brazilian
brazilian rock
breakbeat
breakcore
brega
british blues
british folk revival
britpop
bubblegum pop
c-pop
cajun
calypso
canadian blues
cantata
cape jazz
celtic music
chamber jazz
chamber music
chanson
chicago blues
chicago house
chillwave
chimurenga
chiptune
choro
christian country music
christian hip hop
christian metal
christian pop
christian rock
chutney
chutney soca
classic country
classical crossover
classical
close harmony
coldwave
comedy
compas
computer music
concerto
contemporary folk
contemporary r&b
continental jazz
cool jazz
country
country blues
country pop
country rap
country rock
country soul
country-rap
coupé-décalé
cowpunk
crunkcore
cybergrind
dance-punk
dance-rock
dancehall
dansband music
dark ambient
dark electro
darkwave
death industrial
death metal
deconstructed club
deep house
deep techno
delta blues
detroit blues
detroit techno
digital hardcore
disco
diva house
dixieland
doo wop
doom metal
doomcore
downtempo
dream pop
drone metal
drone
drum and bass
dub poetry
dub techno
dub
dubstep
dubtronica
dungeon synth
dutch house
east coast hip hop
easy listening
ebm
edm
electric blues
electro
electro house
electro-grime
electro-industrial
electroacoustic
electroclash
electrofunk
electronic rock
electropop
electropunk
emo
enka
eurodance
europop
experimental pop
experimental rock
experimental
fann at-tanbura
field recording
fijiri
filmi
folk metal
folk punk
folk rock
folk
folktronica
footwork
forró
fourth world
franco-country
freak folk
free jazz
freestyle house
freestyle rap
freestyle
french house
frevo
fuji music
funk carioca
funk metal
funk
funky house
g-funk
gabber
gamelan
gangsta rap
garage rock
garage
genge
ghetto house
ghettotech
glam metal
glam rock
glitch-hop
glitch
goa
gospel blues
goth rock
gothic metal
grime
grindcore
grunge
gulf and western
gypsy jazz
happy hardcore
hard bop
hard rock
hardbag
hardcore punk
hellbilly music
hi-nrg
highlife
hill country blues
hip house
hip-hop
hiplife
hokum
hokum blues
hong kong english pop
honky tonk
horror punk
house
houston hip hop
idm
illbient
indian pop
indie folk
indie pop
indie rock
indietronica
industrial
industrial dance
industrial folk
industrial hip hop
industrial metal
industrial rock
instrumental country
instrumental hip hop
iranian pop
isicathamiya
isolationism
italo disco
italo house
j-pop
jazz blues
jazz fusion
jazz rock
jazz-funk
jazz
jit
jump blues
jungle
jùjú
k-pop
kansas city blues
kansas city jazz
kapuka
kayōkyoku
khaliji
kizomba
kosmische
kuduro
kwaito
kwela
lambada
latin house
latin jazz
latin
live coding
liwa
lo-fi
louisiana blues
lounge
lovers rock
lowercase
lubbock sound
luk thung
makossa
maloya
mambo
mandopop
manila sound
maracatu
marrabenta
martial industrial
mass
math rock
mbalax
mbaqanga
mbube
melodic death metal
memphis blues
metal
metalcore
mexican pop
miami bass
minimal house
minimal techno
minimal wave
modal jazz
modern classical
morlam
morna
museve
musique concrète
méringue
música popular brasileira
música sertaneja
nashville sound
neo soul
neo-bop jazz
neo-psychedelia
neo-swing
neofolk
neotraditional country
nerdcore
new age
new wave
no wave
noise pop
noise rock
noise
northern soul
nu metal
onkyokei
opera
oratorio
organum
outlaw country
p-funk
pagode
palm-wine
piano blues
piedmont blues
pinoy pop
pop punk
pop rock
pop sunda
pop
post-bop
post-disco
post-hardcore
post-punk
post-punk revival
post-rock
power electronics
power metal
power noise
powerviolence
progressive country
progressive electronic
progressive folk
progressive house
progressive metal
progressive rock
psychedelic folk
psychedelic pop
psychedelic rock
psychobilly
psychobilly
punk blues
punk jazz
punk
punta
punta rock
r&b
ragga
ragini
ragtime
rap rock
rasin
rave
raï
red dirt
reggae
reggaeton
requiem
riot grrrl
rock and roll
rock
rockabilly
rocksteady
roots reggae
sacred music
sadcore
sakara
salsa
samba
samba rock
sawt
screamo
sega
seggae
semba
sertanejo
shoegaze
ska
ska jazz
ska punk
slowcore
sludge metal
smooth jazz
soca
soft rock
son
sonata
soukous
soul
soul blues
soul jazz
south and southeast asian
southern hip hop
southern rock
space age pop
space disco
space rock
speed metal
speedcore
st. louis blues
stoner metal
stoner rock
straight-ahead jazz
sufi rock
sung poetry
surf pop
surf rock
swamp blues
swing
swing house
symphonic metal
synthcore
synthpop
synthpunk
taarab
taiwanese pop
tech house
technical death metal
techno-folk
techno
technopop
tecnobrega
teen pop
terrorcore
texas blues
texas country
thai pop
thrash metal
thrashcore
timba
traditional country music
trance
trap
trip-hop
tropicalia
truck-driving country
turkish pop
turntablism
twoubadou
uk garage
uk hard house
us garage
vaporwave
vocal house
west coast blues
west coast hip hop
western swing
witch house
world
worldbeat
world fusion
gregorian chant
zouglou
zouk
zouk-lambada
zydeco

View File

@ -1,20 +0,0 @@
[options]
background = #080808
overlay = false
overlay_position_bottom = true
overlay_font = monospace:12
overlay_text_color = #c6c6c6
overlay_background_color = #1c1c1c
overlay_background_alpha = ff
[binds]
n = next
p = prev
o = overlay
<Shift+K> = zoom 5
<Shift+J> = zoom -5
<Shift+R> = rotate by 90
z = flip horizontal
<Shift+Z> = flip vertical
y = exec wl-copy "$imv_current_file"
Y = exec wl-copy < "$imv_current_file"

View File

@ -1,266 +0,0 @@
# For further information about options in this file see:
# https://docs.mopidy.com/
#
# The initial commented out values reflect the defaults as of:
# Mopidy 3.4.1
# Mopidy-Bandcamp 1.1.5
# Mopidy-File 3.4.1
# Mopidy-HTTP 3.4.1
# Mopidy-Iris 3.65.0
# Mopidy-Local 3.2.1
# Mopidy-M3U 3.4.1
# Mopidy-MPD 3.3.0
# Mopidy-MPRIS 3.0.3
# Mopidy-Scrobbler 2.0.1
# Mopidy-SoftwareMixer 3.4.1
# Mopidy-SomaFM 2.0.2
# Mopidy-Spotify 4.1.1
# Mopidy-Stream 3.4.1
# Mopidy-YouTube 3.5
#
# Available options and defaults might have changed since then,
# run `mopidy config` to see the current effective config and
# `mopidy --version` to check the current version.
[core]
#cache_dir = $XDG_CACHE_DIR/mopidy
#config_dir = $XDG_CONFIG_DIR/mopidy
#data_dir = $XDG_DATA_DIR/mopidy
#max_tracklist_length = 10000
#restore_state = false
[logging]
#verbosity = 0
#format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
#color = true
#config_file =
[audio]
#mixer = software
#mixer_volume =
#output = autoaudiosink
#buffer_time =
[proxy]
#scheme =
#hostname =
#port =
#username =
#password =
[spotify]
enabled = false
#username =
#password =
#client_id =
#client_secret =
#bitrate = 160
#volume_normalization = true
#private_session = false
timeout = 5000
#allow_cache = true
#allow_network = true
#allow_playlists = true
#search_album_count = 20
#search_artist_count = 10
#search_track_count = 50
#toplist_countries =
[iris]
#enabled = true
#country = NZ
#locale = en_NZ
#verify_certificates = true
#snapcast_enabled = true
#snapcast_host = localhost
#snapcast_port = 1780
#snapcast_ssl = false
#snapcast_stream = Default
#spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
#lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
#genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
#data_dir = $XDG_DATA_DIR/iris
[file]
enabled = false
#media_dirs =
# $XDG_MUSIC_DIR|Music
# ~/|Home
#excluded_file_extensions =
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip
#show_dotfiles = false
#follow_symlinks = false
#metadata_timeout = 1000
[http]
#enabled = true
#hostname = 127.0.0.1
#port = 6680
#zeroconf = Mopidy HTTP server on $hostname
#allowed_origins =
#csrf_protection = true
#default_app = mopidy
[m3u]
#enabled = true
#base_dir = $XDG_MUSIC_DIR
#default_encoding = latin-1
#default_extension = .m3u8
#playlists_dir =
[softwaremixer]
#enabled = true
[stream]
#enabled = true
#protocols =
# http
# https
# mms
# rtmp
# rtmps
# rtsp
#metadata_blacklist =
#timeout = 5000
[mpd]
#enabled = true
#hostname = 127.0.0.1
#port = 6600
#password =
#max_connections = 20
#connection_timeout = 60
#zeroconf = Mopidy MPD server on $hostname
#command_blacklist =
# listall
# listallinfo
#default_playlist_scheme = m3u
[local]
enabled = false
#max_search_results = 100
media_dir = $XDG_MUSIC_DIR
scan_timeout = 5000
#scan_flush_threshold = 100
#scan_follow_symlinks = false
#included_file_extensions =
#excluded_file_extensions =
# .cue
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip
#directories =
# Albums local:directory?type=album
# Artists local:directory?type=artist
# Composers local:directory?type=artist&role=composer
# Genres local:directory?type=genre
# Performers local:directory?type=artist&role=performer
# Release Years local:directory?type=date&format=%25Y
# Tracks local:directory?type=track
# Last Week's Updates local:directory?max-age=604800
# Last Month's Updates local:directory?max-age=2592000
#timeout = 10
#use_artist_sortname = false
#album_art_files =
# *.jpg
# *.jpeg
# *.png
[subidy]
url={{multimedia_mopidy_subidy_url}}
username={{multimedia_mopidy_subidy_user}}
password={{multimedia_mopidy_subidy_pass}}
[mpris]
#enabled = true
#bus_type = session
[scrobbler]
#enabled = true
#username =
#password =
[somafm]
#enabled = true
#encoding = mp3
#quality = fast
dj_as_artist = false
[youtube]
#enabled = true
allow_cache = true
#youtube_api_key =
#search_results = 15
#playlist_max_videos = 20
#api_enabled = false
#channel_id =
#musicapi_enabled = false
#musicapi_cookie =
#autoplay_enabled = false
#strict_autoplay = false
#max_autoplay_length = 600
#max_degrees_of_separation = 3
youtube_dl_package = yt-dlp
[bandcamp]
enabled = false
#discover_pages = 1
#collection_items = 50
discover_genres =
# All
# Electronic
# Rock
# Metal
# Alternative
# Hip-Hop/Rap
# Experimental
# Punk
# Folk
# Pop
# Ambient
# Soundtrack
# World
# Jazz
# Acoustic
# Funk
# R&B/Soul
# Devotional
# Classical
# Reggae
# Podcasts
# Country
# Spoken Word
# Comedy
# Blues
# Kids
# Audiobooks
# Latin
discover_tags =
Outrun
Future Funk
Alternative Hip-Hop
Cozy Synth
Post Metal
Post Punk
# Tokyo, Japan
#image_sizes =
# 10
# 5
# 2
#identity =

View File

@ -1,2 +0,0 @@
# use fork instead
ytdl_path=yt-dlp

View File

@ -1,268 +0,0 @@
-- This script automatically loads playlist entries before and after the
-- the currently played file. It does so by scanning the directory a file is
-- located in when starting playback. It sorts the directory entries
-- alphabetically, and adds entries before and after the current file to
-- the internal playlist. (It stops if it would add an already existing
-- playlist entry at the same position - this makes it "stable".)
-- Add at most 5000 * 2 files when starting a file (before + after).
--[[
To configure this script use file autoload.conf in directory script-opts (the "script-opts"
directory must be in the mpv configuration directory, typically ~/.config/mpv/).
Example configuration would be:
disabled=no
images=no
videos=yes
audio=yes
--]]
MAXENTRIES = 5000
local msg = require("mp.msg")
local options = require("mp.options")
local utils = require("mp.utils")
o = {
disabled = false,
images = true,
videos = true,
audio = true,
}
options.read_options(o)
function Set(t)
local set = {}
for _, v in pairs(t) do
set[v] = true
end
return set
end
function SetUnion(a, b)
local res = {}
for k in pairs(a) do
res[k] = true
end
for k in pairs(b) do
res[k] = true
end
return res
end
EXTENSIONS_VIDEO = Set({
"mkv",
"avi",
"mp4",
"ogv",
"webm",
"rmvb",
"flv",
"wmv",
"mpeg",
"mpg",
"m4v",
"3gp",
})
EXTENSIONS_AUDIO = Set({
"mp3",
"wav",
"ogm",
"flac",
"m4a",
"wma",
"ogg",
"opus",
})
EXTENSIONS_IMAGES = Set({
"jpg",
"jpeg",
"png",
"tif",
"tiff",
"gif",
"webp",
"svg",
"bmp",
})
EXTENSIONS = Set({})
if o.videos then
EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_VIDEO)
end
if o.audio then
EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_AUDIO)
end
if o.images then
EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_IMAGES)
end
function add_files_at(index, files)
index = index - 1
local oldcount = mp.get_property_number("playlist-count", 1)
for i = 1, #files do
mp.commandv("loadfile", files[i], "append")
mp.commandv("playlist-move", oldcount + i - 1, index + i - 1)
end
end
function get_extension(path)
match = string.match(path, "%.([^%.]+)$")
if match == nil then
return "nomatch"
else
return match
end
end
table.filter = function(t, iter)
for i = #t, 1, -1 do
if not iter(t[i]) then
table.remove(t, i)
end
end
end
-- splitbynum and alnumcomp from alphanum.lua (C) Andre Bogus
-- Released under the MIT License
-- http://www.davekoelle.com/files/alphanum.lua
-- split a string into a table of number and string values
function splitbynum(s)
local result = {}
for x, y in (s or ""):gmatch("(%d*)(%D*)") do
if x ~= "" then
table.insert(result, tonumber(x))
end
if y ~= "" then
table.insert(result, y)
end
end
return result
end
function clean_key(k)
k = (" " .. k .. " "):gsub("%s+", " "):sub(2, -2):lower()
return splitbynum(k)
end
-- compare two strings
function alnumcomp(x, y)
local xt, yt = clean_key(x), clean_key(y)
for i = 1, math.min(#xt, #yt) do
local xe, ye = xt[i], yt[i]
if type(xe) == "string" then
ye = tostring(ye)
elseif type(ye) == "string" then
xe = tostring(xe)
end
if xe ~= ye then
return xe < ye
end
end
return #xt < #yt
end
local autoloaded = nil
function find_and_add_entries()
local path = mp.get_property("path", "")
local dir, filename = utils.split_path(path)
msg.trace(("dir: %s, filename: %s"):format(dir, filename))
if o.disabled then
msg.verbose("stopping: autoload disabled")
return
elseif #dir == 0 then
msg.verbose("stopping: not a local path")
return
end
local pl_count = mp.get_property_number("playlist-count", 1)
-- check if this is a manually made playlist
if
(pl_count > 1 and autoloaded == nil)
or (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil)
then
msg.verbose("stopping: manually made playlist")
return
else
autoloaded = true
end
local pl = mp.get_property_native("playlist", {})
local pl_current = mp.get_property_number("playlist-pos-1", 1)
msg.trace(("playlist-pos-1: %s, playlist: %s"):format(pl_current, utils.to_string(pl)))
local files = utils.readdir(dir, "files")
if files == nil then
msg.verbose("no other files in directory")
return
end
table.filter(files, function(v, k)
if string.match(v, "^%.") then
return false
end
local ext = get_extension(v)
if ext == nil then
return false
end
return EXTENSIONS[string.lower(ext)]
end)
table.sort(files, alnumcomp)
if dir == "." then
dir = ""
end
-- Find the current pl entry (dir+"/"+filename) in the sorted dir list
local current
for i = 1, #files do
if files[i] == filename then
current = i
break
end
end
if current == nil then
return
end
msg.trace("current file position in files: " .. current)
local append = { [-1] = {}, [1] = {} }
for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1
for i = 1, MAXENTRIES do
local file = files[current + i * direction]
local pl_e = pl[pl_current + i * direction]
if file == nil or file[1] == "." then
break
end
local filepath = dir .. file
if pl_e then
-- If there's a playlist entry, and it's the same file, stop.
msg.trace(pl_e.filename .. " == " .. filepath .. " ?")
if pl_e.filename == filepath then
break
end
end
if direction == -1 then
if pl_current == 1 then -- never add additional entries in the middle
msg.info("Prepending " .. file)
table.insert(append[-1], 1, filepath)
end
else
msg.info("Adding " .. file)
table.insert(append[1], filepath)
end
end
end
add_files_at(pl_current + 1, append[1])
add_files_at(pl_current, append[-1])
end
mp.register_event("start-file", find_and_add_entries)

View File

@ -1,37 +0,0 @@
-- If the laptop is on battery, the profile 'lq' will be loaded; otherwise 'hq' is used
local mp = require("mp")
local SHOULD_ADJUST = false
local lqprofile = "lowquality"
local hqprofile = "highquality"
local function powerstate()
local f = io.open("/sys/class/power_supply/AC/online")
if f == nil then
return
end
local t = f:read("*n")
f:close()
return t
end
local function adjust()
if not SHOULD_ADJUST then
return
end
local state = powerstate()
-- this actually overrides automatically applied profiles
-- like 'protocol.http'
if state == 0 then
mp.set_property("profile", lqprofile)
mp.msg.info("[quality] running battery, setting low-quality options.")
mp.osd_message("[quality] LQ")
else
mp.set_property("profile", hqprofile)
mp.msg.info("[quality] running ac, setting high-quality options.")
mp.osd_message("[quality] HQ")
end
end
mp.add_hook("on_load", 1, adjust)

Some files were not shown because too many files have changed in this diff Show More