Compare commits

...

16 commits

Author SHA1 Message Date
38c64fe9cf
dotter: Restructure global file 2023-10-03 15:23:23 +02:00
a3b54a155e
sioyek: Switch to dotter template for flavouring
Since sioyek does not support including into its configuration
file, we switch it to dotter templating and use the in-place
flavours insertion on theme selection for theming.

Any theming will not back filter into the repository.
2023-10-03 15:10:05 +02:00
08062027ae
mako: Add flavours templating start and end strings
Added strings which signify to flavours that it should insert
its theme color template in-between. Since the file is not
symlinked but *moved* to the config dir (through being
designated as 'template' in dotter), any future changes
should not reflect back into the repository.
2023-10-03 15:04:11 +02:00
4cfd863ecb
dotter: Fix templated files
Fixed an accidentally templated (papistui.yml) file, due to its
use of mustache-like double-braces.

Explicitly target another file as templated so we can change it
in the configuration directory (mako getting flavours colors
since it STILL lacks includes).
2023-10-03 14:56:15 +02:00
132c4c6c5b
dotter: Ignore cache directory 2023-10-03 14:49:02 +02:00
362c1f5375
dotter: Fix non-utf8 symlink warnings
Fix the warnings given by dotter for files that are not
utf-8 encoded to explicitly be identified as symlinks.

Should ultimately probably be either moved into data
directories or moved out of repo altogether, but for
now it works well.
2023-10-03 14:36:01 +02:00
5b2a55cfe3
qutebrowser: Remove qute-cookie-block script
Never completely functioned and worked to my satisfaction.
Need to find another tool or just accept the reality of
cookie banners.
2023-10-03 13:55:24 +02:00
8681d34946
qutebrowser: Make use of dotter for dir structure
Since we now use dotter we can simplify the dir structure for
qutebrowser a lot. Everything dot-filed earlier can now reside
in simple directories called config (for ~/.config/qutebrowser),
data (for ~/.local/share/qutebrowser), and scripts
(for ~/.local/bin) files.
2023-10-03 13:43:00 +02:00
dcde027a67
dotter: Simplify local setups
Everything that is in the repo should be listed in the global.toml
file. The local.toml file then picks the stuff to actually
write. For systemwide packages, a systemwide.toml (local) file
is used instead.
2023-10-03 13:19:48 +02:00
342a350c97
papis: Regress to textual priority entry
HACK Since there is some weirdness with the whoosh backend for papis not
being able to either index or search for integer values in custom
fields, this commit sets the priorities across the library (as well as
the tui picker) to make use of textual reprentations.

1 -> high
3 -> medium
5 -> low

This means we can't do simple arithmetic evaluations on priority anymore
but at least we can search it correctly in papis. Should probably put in
a ticket to see if it can be fixed.
2023-10-03 13:03:38 +02:00
3f335936c5
bootstrap: Remove unneeded installs, add dotter
Removed X11 programs like devour, broken plugins like mopidy-spotify.
2023-10-03 13:03:37 +02:00
47c3f7682d
bootstrap: Do not build paru on tmpfs
The tmp fs can sometimes be very small, too small in fact to build
paru on.
2023-10-03 13:03:37 +02:00
5e53105a62
install: Add simple dotter install 2023-10-03 13:03:35 +02:00
0a5d62909b
sh: Switch timg qr function to use viu
Since we switched to viu, we should also have qr
make use of it. Renamed the function to
qrurl to make its purpose clearer (sending
a simple file location/string/url via qr code)
and to distinguish it from programs like qrcp
which actually start a server and send a file
through qr.
2023-10-03 13:03:05 +02:00
ba042db7df
vifm: Fix wezterm image preview with chafa
We now use chafa to preview images. We use its iterm mode
since that seems to be the best integrated into wezterm
currently.

We have to use uncached previews so it is a little slower,
but at least it functions perfectly after the first image
is displayed.
2023-10-03 13:01:30 +02:00
7ccd7e4757
vifm: Fancy markdown display with glow or bat
For anything markdown or that gets displayed as markdown
(e.g. docx files) in the vifm preview, we now use glow
or bat to display a nicely styled and colored version.

For glow I added a script which tries to detect the
current terminal background between dark/light to
correctly set the color scheme.
2023-10-03 13:01:29 +02:00
66 changed files with 326 additions and 17567 deletions

91
.dotter/global.toml Normal file
View file

@ -0,0 +1,91 @@
[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"]
[shell.files]
"sh/README.md" = { target = "~/README.md", type = "symbolic", if = "false" }
sh = "~"
[git.files]
"git/README.md" = { target = "~/README.md", 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 = "~/README.md", type = "symbolic", if = "false" }
scripts = "~"
[ssh.files]
ssh = "~"
[terminal.files]
"terminal/.config/vifm" = { target = "~/.config/vifm", 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 = "~/README.md", type = "symbolic", if = "false" }
disks = "~"
[pass.files]
"pass/README.md" = { target = "~/README.md", 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 = "~/README.md", type = "symbolic", if = "false" }
"office/.config/glow/email.json" = { target = "~/.config/glow/email.json", type = "symbolic" }
office = "~"
[services.files]
"services/README.md" = { target = "~/README.md", type = "symbolic", if = "false" }
services = "~"
[social.files]
social = "~"
[writing.files]
"writing/README.md" = { target = "~/README.md", 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 = "~/README.md", type = "symbolic", if = "false" }
desktop = "~"
[multimedia.files]
"multimedia/README.md" = { target = "~/README.md", 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" }

6
.dotter/local.toml Normal file
View file

@ -0,0 +1,6 @@
includes = []
packages = ["workstation"]
[files]
[variables]

5
.dotter/systemwide.toml Normal file
View file

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

4
.gitignore vendored
View file

@ -1,3 +1,7 @@
# don't move the cache into repo
/.dotter/cache/
/.dotter/cache.toml
# no idea why gopass adds this image to config path # no idea why gopass adds this image to config path
gopass-logo-small.png gopass-logo-small.png
# #

View file

@ -45,10 +45,12 @@ install_paru() {
fi fi
# use tmp dir to make paru # use tmp dir to make paru
target=$(mktemp -d) tempdir=".paru"
git clone https://aur.archlinux.org/paru.git "$target" git clone https://aur.archlinux.org/paru.git "$tempdir"
cd "$target" || exit pushd "$tempdir" || exit 1
makepkg -si makepkg -si
popd || exit 1
rm -rf "$tempdir"
} }
update_repos() { update_repos() {

View file

@ -50,7 +50,6 @@ dbus-broker Linux D-Bus Message Broker R
dcnnt Yet another tool to connect Android phone with desktop similar to KDE Connect A dcnnt Yet another tool to connect Android phone with desktop similar to KDE Connect A
dconf-editor GSettings editor for GNOME R dconf-editor GSettings editor for GNOME R
dell-command-configure Configure various BIOS features on Dell laptops A dell-command-configure Configure various BIOS features on Dell laptops A
devour Window Manager agnostic swallowing feature for terminal emulators A
dhcpcd RFC2131 compliant DHCP client daemon R dhcpcd RFC2131 compliant DHCP client daemon R
distrobox Use any linux distribution inside your terminal. A distrobox Use any linux distribution inside your terminal. A
dnsmasq Lightweight, easy to configure DNS forwarder and DHCP server R dnsmasq Lightweight, easy to configure DNS forwarder and DHCP server R
@ -58,6 +57,7 @@ docker Pack, ship and run any application as a lightweight container R
docker-compose Fast, isolated development environments using Docker R docker-compose Fast, isolated development environments using Docker R
docx2txt Recovers text from DOCX files, with good formatting. R docx2txt Recovers text from DOCX files, with good formatting. R
dos2unix Text file format converter 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 duf Disk Usage/Free Utility R
dust A more intuitive version of du in rust R dust A more intuitive version of du in rust R
efm-langserver General purpose Language Server A efm-langserver General purpose Language Server A
@ -146,7 +146,6 @@ luacheck A tool for linting and static analysis of Lua code R
lutris Open Gaming Platform R lutris Open Gaming Platform R
ly TUI display manager A ly TUI display manager A
lynx A text browser for the World Wide Web R lynx A text browser for the World Wide Web R
maestral Open-source Dropbox client A
magic-wormhole Securely transfer data between computers R magic-wormhole Securely transfer data between computers R
maim Utility to take a screenshot using imlib2 R maim Utility to take a screenshot using imlib2 R
mako Lightweight notification daemon for Wayland R mako Lightweight notification daemon for Wayland R
@ -168,7 +167,6 @@ 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-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-scrobbler Mopidy extension for scrobbling played tracks to Last.fm A
mopidy-somafm Mopidy extension for playing music from SomaFM A mopidy-somafm Mopidy extension for playing music from SomaFM A
mopidy-spotify Mopidy extension for playing music from Spotify A
mopidy-youtube Mopidy extension for playing music from Youtube 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 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 mosh Mobile shell, surviving disconnects with local echo and line editing R
@ -225,7 +223,6 @@ 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 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 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 ptpython Python REPL build on top of prompt_toolkit A
pubs Your bibliography on the command line A
pulsemixer CLI and curses mixer for pulseaudio R pulsemixer CLI and curses mixer for pulseaudio R
pv A terminal-based tool for monitoring the progress of data through a pipeline. R pv A terminal-based tool for monitoring the progress of data through a pipeline. R
pyright Type checker for the Python language R pyright Type checker for the Python language R

Can't render this file because it has a wrong number of fields in line 29.

View file

@ -9,7 +9,11 @@ default-timeout=5000
ignore-timeout=1 ignore-timeout=1
font=monospace 14 font=monospace 14
# Intentionally left empty, automatically filled by flavours
# on switching theme.
# Start flavours
# End flavours
[urgency=critical] [urgency=critical]
#on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga #on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga

View file

@ -9,27 +9,33 @@
# #
# Finally, symlinks all dotfiles into their correct locations using stow # Finally, symlinks all dotfiles into their correct locations using stow
bootstrap_dir="${BOOTSTRAP_DIRECTORY:-./bootstrap}" 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}"
}
main() { main() {
local cmd="" local cmd=""
local ret=0 local ret=0
case "$1" in
case "$1" in -v | --version)
-v | --version) printf "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n"
printf "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n" ;;
;; -h | --help)
-h | --help) help 0
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)
-f | --force) unattended_install=true
install true ;;
;; *)
*) install
install false ;;
;; esac
esac shift
shift
$cmd "$@" $cmd "$@"
ret=$((ret + $?)) ret=$((ret + $?))
@ -39,93 +45,94 @@ main() {
# takes default value (y/n), question, abort message as arguments # takes default value (y/n), question, abort message as arguments
# automatically answers yes if unattended install # automatically answers yes if unattended install
check_consent() { check_consent() {
if [ "$UNATTENDED" == "true" ]; then if [ "$unattended_install" == "true" ]; then
true true
else else
[[ "$1" == "y" ]] && default_consent="[Y/n]" || default_consent="[y/N]" [[ "$1" == "y" ]] && default_consent="[Y/n]" || default_consent="[y/N]"
printf "%b %b " "$2" "$default_consent" printf "%b %b " "$2" "$default_consent"
read -r answer read -r answer
if [[ "$1" == "n" ]] && [[ "$answer" != y* ]]; then if [[ "$1" == "n" ]] && [[ "$answer" != y* ]]; then
printf "%s\n" "$3" printf "%s\n" "$3"
false false
elif [[ "$1" == "y" ]] && [[ "$answer" == n* ]]; then elif [[ "$1" == "y" ]] && [[ "$answer" == n* ]]; then
printf "%s\n" "$3" printf "%s\n" "$3"
false false
else else
true true
fi fi
fi fi
} }
entry_question() { 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 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
} }
enable_git_hooks() { enable_git_hooks() {
check_consent y "Should we enable git hooks for this repository, so that installed packages are automatically compared when committing?" "Not changing repository settings." || return 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/ git config --local core.hooksPath .githooks/
echo "Changed repository settings." echo "Changed repository settings."
} }
stow_dotfiles() { manage_dotfiles() {
check_consent y "Link home directory dot files?" "Not linking dotfiles." || return check_consent y "Link dot files?" "Not linking dotfiles." || return
# get all top level directories, remove their slashes and dots 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
# finally get rid of .dot-directories, since they are for the repo not for my homedir if [ "$link_systemfiles" == "false" ]; then
targets="$(find . -maxdepth 1 -type d | sed -e 's/^\.\/\(.*\)$/\1/' | sed -e '/^\./d')" dotter deploy
echo "Linked dotfiles."
# shellcheck disable=2086 else
# -- for some reason stow only works with unqoted var expansion if [ -e "/etc/pacman.conf" ]; then
stow -R ${targets} 2> >(grep -v 'Absolute/relative mismatch between Stow dir' 1>&2) check_consent n "Found an existing pacman.conf file, installation will error if it exists. Remove file?" && run_elevated rm "/etc/pacman.conf"
echo "Linked dotfiles." fi
dotter deploy -l .dotter/systemwide.toml
echo "Linked dotfiles and system files."
fi
} }
run_elevated() { run_elevated() {
if command -v doas >/dev/null 2>&1; then if command -v doas >/dev/null 2>&1; then
doas "$@" doas "$@"
elif command -v sudo >/dev/null 2>&1; then elif command -v sudo >/dev/null 2>&1; then
sudo "$@" sudo "$@"
fi fi
} }
stow_system_packages() {
check_consent n "Link system settings files? This will require sudo access and may overwrite existing files." "Not touching system files." || return
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
run_elevated stow --dir="$bootstrap_dir" --target="/" -R system-packages/
echo "Linked system files."
}
install_packages() { 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 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"; then if [ "$unattended_install" == "true" ]; then
"$bootstrap_dir"/install_packages.sh "$bootstrap_dir"/install_packages.sh -f
else else
"$bootstrap_dir"/install_packages.sh -f "$bootstrap_dir"/install_packages.sh
fi fi
echo "Installed packages." 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"
} }
install() { install() {
UNATTENDED=$1 if [ "$unattended_install" == false ] ; then
if ! "$UNATTENDED"; then entry_question
entry_question fi
fi
echo "====================== BEGINNING SYSTEM FILE MANAGEMENT =============================" headline "BEGINNING PACKAGE INSTALLATION"
stow_system_packages install_packages
echo "====================== BEGINNING PACKAGE INSTALLATION =============================" headline "BEGINNING DOTFILE MANAGEMENT"
install_packages manage_dotfiles
echo "=================== BEGINNING DOTFILE MANAGEMENT ==========================" headline "ENABLING GIT REPOSITORY HOOKS"
stow_dotfiles enable_git_hooks
echo "================== ENABLING GIT REPOSITORY HOOKS ==========================" echo "INSTALLATION FINISHED"
enable_git_hooks exit 0
echo "====================== INSTALLATION FINISHED =============================="
exit 0
} }
main "$@" main "$@"

View file

@ -13,51 +13,10 @@ foregoing some of its more advanced quality of life features.
The general functionality of password management should not be affected. The general functionality of password management should not be affected.
The last working `rofi-gopass` implementation before the switch can be found [here](https://gitlab.com/marty-oehme/dotfiles/-/tree/7456bb14ab18ee09bd8b9332faa43d35b22e9e55/gopass). The last working `rofi-gopass` implementation before the switch can be found [here](https://gitlab.com/marty-oehme/dotfiles/-/tree/7456bb14ab18ee09bd8b9332faa43d35b22e9e55/gopass).
## rofi-pass ## pass-pick
To make accessing secrets easy, it uses the `rofi-pass` 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: To make accessing secrets easy, it uses the `pass-pick` script, which creates a small selection 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) ![pass-pick 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 pass settings. For auto-filling to work correctly, the username field will (by default) have to be highlighted on the entry webpage or form. For pass-pick configuration and setup refer to the external program itself.
| 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 |
| From opened entry: | | |
| Return | Auto-fill selected field | KEY_ENTRYMENU_FILL |
| Alt+Return | Send selected field to clipboard | KEY_ENTRYMENU_CLIP |
| Alt+s | Reveal contents of the password field | KEY_ENTRYMENU_SHOWFIELD |
| 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-pass/rofi-pass.conf`
* `~/.config/rofi-pass/rofi-pass.conf`
* `~/.rofi-pass.conf`
* `/etc/rofi-pass.conf`
or, alternatively, a custom directory if the `RP_CONFIGURATION_FILE` variable points to a configuration file.
To use environment variables to configure any of these options or keys, prefix them with `RP_`, so that e.g. `KEY_AUTOFILL` becomes `RP_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)
* `PASS_USERNAME_FIELD`
:sets the name of the field in pass 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.

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#consent-page > div > div > div > form > div.wizard-body > div.actions.couple > a"/>
<wait/>
<click element="#select-legit-all-purpose > span.toggleAll.toggle-accpet-all"/>
<click element="#consent-page > div > form > div.page-footer > div > div > button"/>
</block>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#yDmH0d > c-wiz > div > div > div.NIoIEf > div.G4njw > div.qqtRac > div > div > div > a"/>
<wait/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(3) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(4) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(5) > div.IgeUeb > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > form > div > button"/>
</block>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- TODO: You cannot block cookies on ebay -->
<click element="#gdpr-banner > div.gdpr-banner__wrapper > div > a"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#onetrust-reject-all-handler"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#gdpr-single-choice-overlay > div > div.wt-overlay__footer.wt-pt-xs-3 > div.wt-overlay__footer__action.wt-display-flex-md.wt-flex-grow-md-1.wt-order-xs-1.wt-order-md-neg1.wt-justify-content-flex-end > button"/>
<wait/>
<click element="#gdpr-privacy-settings > div > div.wt-overlay__footer.wt-align-items-center > div.wt-overlay__footer__action > div > div:nth-child(3) > button"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- TODO: Facebook changes IDs of buttons -->
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#wrapper > div.notification-banner > div > a"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<remove element=".hide-consent"/>
</block>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#EDu5ze > div"/>
<wait/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(4) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(5) > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > div:nth-child(6) > div.IgeUeb > div.uScs5d > div > div.uScs5d > div:nth-child(1) > div > button"/>
<click element="#yDmH0d > c-wiz > div > div > div > div.VP4fnf > form > div > button"/>
</block>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- WARNING: The cookie-free version of this websites looks very different-->
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
<wait time="1000"/>
<click element="#__next > div.css-qbih8b > div > button.css-1glzvq1"/>
</block>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#onetrust-pc-btn-handler"/>
<click element="#cookie-preferences > div.save-preference-btn-container > button"/>
</block>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- TODO: You cannot block cookies, only accept? -->
<click element="body > div.RnEpo.Yx5HN > div > div > div > div.mt3GC > button.aOOlW.HoLwm"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#artdeco-global-alert-container > div.artdeco-global-alert.artdeco-global-alert--NOTICE.artdeco-global-alert--COOKIE_CONSENT > section > div > div.artdeco-global-alert-action__wrapper > button:nth-child(1)"/>
<wait time="1500"/>
<click element="body > header > a:nth-child(1) > li-icon"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
<wait time="1000"/>
<click element="#__next > div.css-1m0hjq0 > div > button.css-1mzn52w"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#modal-host > div > div > div > div > div > div > div.css-zndjj2 > a"/>
<wait/>
<click element="#__next > div.css-1m0hjq0 > div > button.css-1mzn52w"/>
</block>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#wcpConsentBannerCtrl > div._2j0fmugLb1FgYz6KPuB91w > button:nth-child(2)"/>
<wait/>
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c1_reject"/>
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c2_reject"/>
<click element="#_1dp8Vp5m3HwAqGx8qBmFV2_c3_reject"/>
<click element="#wcpCookiePreferenceCtrl > div.AFsJE948muYyzCMktdzuk > div > div.nohp3sIG12ZBhzcMnPala > button._3tOu1FJ59c_xz_PmI1lKV5._1zNQOqxpBFSokeCLGi_hGr"/>
</block>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- TODO: Clicking on the button does not work -->
<!-- <click element="#cookie-disclosure > div.cta-btn-container > button:nth-child(2)"/> -->
<!-- TODO: Workaround: Close -->
<click element="#cookie-disclosure > div.btn-container > button > span.icon-close"/>
</block>

View file

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<!-- CANNOT OPT OUT OF EVERYTHING -->
<!-- TODO: Does not work? -->
<click element="#site-content > div.gdpr.shown.expanded.expanded-dock.css-17nqy7q.e1x0szx60 > div.css-183a15u.ejw0p350 > div > div.css-1s2i4vk > a"/>
<debug/>
<wait/>
<debug msg="After"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(5) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(6) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(9) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(10) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(11) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(12) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-2 > tbody > tr:nth-child(14) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(5) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(6) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(9) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(10) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(11) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(12) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(13) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(14) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(15) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(16) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(17) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(18) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-3 > tbody > tr:nth-child(19) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(1) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(2) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(3) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(4) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(7) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#gdpr-faq-cookie-table-4 > tbody > tr:nth-child(8) > td:nth-child(5) > a:nth-child(2)"/>
<click element="#opt-out-of-new-york-times-nonessential-trackers"/>
<!-- TODO: Close the new tab -->
<!-- TODO: Close the banner -->
</block>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#manageCookiesLink"/>
<wait time="1000"/>
<click element="#performance"/>
<click element="#functional"/>
<click element="#submitCookiesBtn"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#SHORTCUT_FOCUSABLE_DIV > div:nth-child(6) > div._3q-XSJ2vokDQrvdG6mR__k > section > div > section > section > form:nth-child(1) > button"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#cookie-link-manage"/>
<!-- TODO: Not sure clicking the right thing -->
<click element="#cookie-btn-allow"/>
</block>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="body > div.ff-sans.ps-fixed.z-nav-fixed.ws4.sm\\:w-auto.p32.bg-black-750.fc-white.bar-lg.b16.l16.r16.js-consent-banner > div > button.grid--cell.s-btn.s-btn__filled.js-cookie-settings"/>
<wait time="1000"/>
<click element="#onetrust-pc-sdk > div > div.s-modal--footer.mt0.grid.gs8.gsx > button.grid--cell.s-btn.s-btn__primary.save-preference-btn-handler.onetrust-close-btn-handler.js-consent-banner-hide.js-consent-save"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#rejectAllButton"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#react-root > div > div > div.css-1dbjc4n.r-13qz1uu.r-417010 > main > div > div > div.css-1dbjc4n.r-1awozwy.r-1m3jxhj.r-1upvrn0.r-18u37iz.r-1d7fvdj.r-d9fdf6.r-tvv088.r-13qz1uu > div.css-18t94o4.css-1dbjc4n.r-1niwhzg.r-11mg6pl.r-sdzlij.r-1phboty.r-rs99b7.r-18kxxzh.r-1q142lx.r-1w2pmg.r-19u6a5r.r-1mnahxq.r-ero68b.r-1gg2371.r-1ny4l3l.r-1fneopy.r-o7ynqc.r-6416eg.r-lrvibr > div > span"/>
</block>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<remove element=".oaDry"/>
</block>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<block>
<click element="#consent-page > div > div > div > form > div.wizard-body > div.actions.couple > a"/>
<wait time="2000"/>
<!-- This is not my spelling mistake :) vvvvvv -->
<click element="#select-legit-all-purpose > span.toggleAll.toggle-accpet-all"/>
<click element="#consent-page > div > form > div.page-footer > div > div > button"/>
</block>

View file

@ -1 +0,0 @@
../../../bin/qutedmenu

View file

@ -1 +0,0 @@
../../../bin/recently-downloaded

View file

@ -17,7 +17,7 @@ def fixScribePath(url: QUrl):
# unquoted = parse.unquote( # unquoted = parse.unquote(
# url.path(options=QUrl.ComponentFormattingOption.FullyEncoded) # url.path(options=QUrl.ComponentFormattingOption.FullyEncoded)
# ) # )
path = parse.unquote(f"{url.path()}{url.query()}", encoding='ascii') path = parse.unquote(f"{url.path()}{url.query()}", encoding="ascii")
url.setQuery(None) url.setQuery(None)
new_path = re.sub(r"m/global-identity-2redirectUrl=", "", path) new_path = re.sub(r"m/global-identity-2redirectUrl=", "", path)
url.setPath( url.setPath(
@ -194,8 +194,10 @@ redirects = {
}, },
} }
def rewrite(request: interceptor.Request) -> None:
# if config.get(name="content.oss_redirects") is False:
# return
def rewrite(request: interceptor.Request):
if ( if (
request.resource_type != interceptor.ResourceType.main_frame request.resource_type != interceptor.ResourceType.main_frame
or request.request_url.scheme() in {"data", "blob"} or request.request_url.scheme() in {"data", "blob"}

View file

@ -0,0 +1 @@
../../scripts/qutedmenu

View file

@ -0,0 +1 @@
../../scripts/recently-downloaded

View file

@ -1,32 +0,0 @@
#!/usr/bin/env sh
# Add simple 'image ls' for a directory using timg
#
# Prints a thumbnail gallery right in the terminal.
# WILL stutter when you go crazy in a hundred/thousand
# picture folder.
if exist timg; then
il() {
images=$(find . -maxdepth 1 -type f -exec file --mime-type {} \+ | awk -F: '{if ($2 ~/image\//) print $1}')
if [ -z "$images" ]; then {
echo no images found.
return
}; fi
echo "$images" | timg --grid=4x3 --upscale=i --center --title --frames=1 -f -
}
IL() {
images=$(find . -type f -exec file --mime-type {} \+ | awk -F: '{if ($2 ~/image\//) print $1}')
if [ -z "$images" ]; then {
echo no images found.
return
}; fi
echo "$images" | timg --grid=4x3 --upscale=i --center --title --frames=1 -f -
}
qr() {
# if we are in a pipe, read from stdin and set fct arguments to it
if [ ! -t 0 ]; then
set -- "$(cat /dev/stdin)"
fi
qrencode -s1 -m2 "$@" -o- | timg --upscale=i -
}
fi

View file

@ -0,0 +1,14 @@
#!/usr/bin/env sh
# A nice little qc url creator.
# Takes whatever is passed and makes it qr-code readable
#
if exist viu; then
qrurl() {
# if we are in a pipe, read from stdin and set fct arguments to it
if [ ! -t 0 ]; then
set -- "$(cat /dev/stdin)"
fi
qrencode -s1 -m2 "$@" -o- | viu --upscale=i -
}
fi

View file

@ -50,6 +50,8 @@ export LANG="en_US.UTF-8"
export SHELL="${SHELL:-/bin/bash}" export SHELL="${SHELL:-/bin/bash}"
export TERM=xterm-256color export TERM=xterm-256color
# set env var to current shell background luminosity (used by vifm)
. dark_bg
if exist fzf; then if exist fzf; then
export FZF_DEFAULT_OPTS="--bind 'tab:toggle+down,shift-tab:toggle+up,ctrl-g:top,ctrl-t:toggle-preview,ctrl-d:preview-half-page-down,ctrl-u:preview-half-page-up' --color=light -1 -m --delimiter :" export FZF_DEFAULT_OPTS="--bind 'tab:toggle+down,shift-tab:toggle+up,ctrl-g:top,ctrl-t:toggle-preview,ctrl-d:preview-half-page-down,ctrl-u:preview-half-page-up' --color=light -1 -m --delimiter :"

72
sh/.local/bin/dark_bg Executable file
View file

@ -0,0 +1,72 @@
#!/usr/bin/env sh
#
# Determine if term background is dark or light.
# Uses a couple different heuristics, most of them
# from this:
# https://unix.stackexchange.com/questions/245378/common-environment-variable-to-set-dark-or-light-terminal-background
# unix exchange.
#
# If the background is dark, returns exit code 0 (true).
# If the background is light, returns exit code 1 (false).
# TODO implement alternative $COLORBFG method
is_dark() {
IFS=/ read -r bg_r bg_g bg_b << EOF
${1:-"0000/0000/0000"}
EOF
IFS=/ read -r fg_r fg_g fg_b << EOF
${2:-"ffff/ffff/ffff"}
EOF
calc=$(echo "($bg_r+$bg_g+$bg_b)-($fg_r+$fg_g+$fg_b)" | tr '[:lower:]' '[:upper:]')
luminance=$(echo "ibase=16; $calc" | bc)
if [ "$luminance" -lt 0 ]; then
true
else
false
fi
}
orig_ssty=$(stty -g)
stty raw -echo min 0 time 0
printf '\e]11;?\a'
sleep 0.01
read -r answer
bg="${answer#*;}"
printf '\e]10;?\a'
sleep 0.01
read -r answer
fg="${answer#*;}"
stty "$orig_ssty"
bg=$(echo "${bg}" | sed 's/.*\(rgb:[0-9a-f/]*\).*/\1/')
fg=$(echo "${fg}" | sed 's/.*\(rgb:[0-9a-f/]*\).*/\1/')
# from the amazing
# https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced
# answer
sourced=0
if [ -n "$ZSH_VERSION" ]; then
case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac
elif [ -n "$KSH_VERSION" ]; then
# shellcheck disable=SC2296
[ "$(cd -- "$(dirname -- "$0")" && pwd -P)/$(basename -- "$0")" != "$(cd -- "$(dirname -- "${.sh.file}")" && pwd -P)/$(basename -- "${.sh.file}")" ] && sourced=1
elif [ -n "$BASH_VERSION" ]; then
(return 0 2>/dev/null) && sourced=1
else
# Detects `sh` and `dash`; add additional shell filenames as needed.
case ${0##*/} in sh|-sh|dash|-dash) sourced=1;; esac
fi
is_dark "${bg#rgb:}" "${fg#rgb:}"
outp="$?"
if [ "$sourced" -eq 1 ]; then
if [ "$outp" -eq 0 ]; then
export TERM_DARK=true
else
export TERM_DARK=false
fi
else
exit "$outp"
fi

View file

@ -21,5 +21,5 @@ charset=${info#*=}
if [ "x$charset" == "xbinary" ]; then if [ "x$charset" == "xbinary" ]; then
hexdump -e '"%08_ax: "' -e '8/1 "%02x " " " 8/1 "%02x "' -e '" |" 16/1 "%_p"' -e '"\n"' -v -n $nbytes "$1" hexdump -e '"%08_ax: "' -e '8/1 "%02x " " " 8/1 "%02x "' -e '" |" 16/1 "%_p"' -e '"\n"' -v -n $nbytes "$1"
else else
head -$nlines "$1" | enconv -g -L $language -x $encoding head -$nlines "$1" | enconv -g -L $language -x $encoding | bat --color=always --style=plain
fi fi

View file

@ -427,12 +427,12 @@ fileviewer *.[1-8] man ./%c | col -b
" Images " Images
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in imv}
\ imv %f %i,
\ {View in viu} \ {View in viu}
\ viu --once --name %f; read -k 1 -s -r, \ viu --once --name %f; read -k 1 -s -r,
\ {View in nsxiv directory viewer} \ {View in nsxiv directory viewer}
\ vifm-thumbnailer %c, \ vifm-thumbnailer %c,
\ {View in imv}
\ imv %f,
\ {View in nsxiv} \ {View in nsxiv}
\ nsxiv %f, \ nsxiv %f,
\ {View in vimiv} \ {View in vimiv}
@ -444,11 +444,9 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ {View in gpicview} \ {View in gpicview}
\ gpicview %c, \ gpicview %c,
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
" to circumvent the bug: https://github.com/atanunq/viuer/issues/44 " needs to be %pu uncached or it flickers itself into oblivion :(
" thus, change the viuer library and build it with the new lib locally \ exist chafa && chafa -f iterm --size %pwx%ph %c:p %pd %pu %N || echo chafa not found
" put it into the local bin directory and you can see full pics. set previewoptions+=graphicsdelay:0
" Otherwise falls back to block-sized display
\ exist ~/.local/bin/viu && env -u COLORTERM ~/.local/bin/viu -w %pw -s %c %pd || env -u COLORTERM viu -b -w %pw -s %c %pd
" OpenRaster " OpenRaster
filextype *.ora filextype *.ora
@ -552,7 +550,8 @@ filetype *.docx
\ pandoc -s -t markdown %f | nvim, \ pandoc -s -t markdown %f | nvim,
\ docx2txt %f - | nvim \ docx2txt %f - | nvim
fileviewer *.docx fileviewer *.docx
\ pandoc -s -t markdown %f, \ [ "$TERM_DARK" = "true" ] && pandoc -s -t markdown %f | glow --style=dark - || pandoc -s -t markdown %f | glow --style=light -,
\ pandoc -s -t markdown %f | bat --color=always --style=plain
\ docx2txt %f - \ docx2txt %f -
" TuDu files " TuDu files
@ -569,6 +568,11 @@ fileviewer */
\ exa --color always --tree -L2, \ exa --color always --tree -L2,
\ tree -L 2, \ tree -L 2,
" markdown text
fileviewer *.md
\ [ "$TERM_DARK" = "true" ] && glow --style=dark %c || glow --style=light %c,
\ bat --color=always --style=plain
" use custom viewer script for rest " use custom viewer script for rest
fileviewer * vifm-default-viewer %c fileviewer * vifm-default-viewer %c

View file

@ -15,10 +15,10 @@ ref-format = bbt
add-folder-name = {doc[author_list][0][family]}-{doc[title]} add-folder-name = {doc[author_list][0][family]}-{doc[title]}
add-file-name = {doc[author_list][0][family]}{doc[year]} add-file-name = {doc[author_list][0][family]}{doc[year]}
header-format-file = ~/.config/papis/headerformat header-format-file = ~/.config/papis/headerformat
extra-bibtex-keys = ["tags", "readstatus"] extra-bibtex-keys = ["tags", "readstatus", "priority"]
database-backend = whoosh database-backend = whoosh
whoosh-schema-fields = ["doi", "ref", "author", "year", "title", "publisher", "tags", "readstatus", "date", "isbn", "type", "keyword", "qualityassured"] whoosh-schema-fields = ["doi", "ref", "author", "year", "title", "publisher", "tags", "readstatus", "date", "isbn", "type", "keyword", "qualityassured", "priority"]
# to make whoosh list everything by default # to make whoosh list everything by default
default-query-string = * default-query-string = *

View file

@ -8,6 +8,8 @@
# - [ ] select all in view # - [ ] select all in view
# - [ ] limit view to currently selected # - [ ] limit view to currently selected
# #
# for papis itself:
# - [ ] I can not search custom numeric fields in whoosh? i.e. 'priority:1' will not give results. 'priority:high' will
base: base:
vimflavour: nvim vimflavour: nvim
documentlist: documentlist:
@ -16,7 +18,7 @@ documentlist:
multilinestyle: multilinestyle:
rows: rows:
# TODO: show if already note attached; have info window display note content? # TODO: show if already note attached; have info window display note content?
- "{' ' if 'priority' not in doc or doc['priority'] > 3 else '<red>󱝇 </red>' if doc['priority'] <= 1 else '<yellow>󱝇 </yellow>'}<cyan>{doc.alias('type')} {doc['ref']}</cyan> {doc.alias('readstatus')} {' 󰘓 ' if doc['notes'] else ''}" - "{' ' if 'priority' not in doc or doc['priority'] == 'low' else '<red>󱝇 </red>' if doc['priority'] == 'high' else '<yellow>󱝇 </yellow>'}<cyan>{doc.alias('type')} {doc['ref']}</cyan> {doc.alias('readstatus')} {' 󰘓 ' if doc['notes'] else ''}"
- "<white><bold>{doc.html_escape['title']}</bold></white>" - "<white><bold>{doc.html_escape['title']}</bold></white>"
- "<blue>{doc.html_escape['author']}</blue>" - "<blue>{doc.html_escape['author']}</blue>"
- "{doc.foreach('tags', '<lightgray>(</lightgray><gray><dim>{}</dim></gray><lightgray>)</lightgray>', split = ', ', sep = ' ')}" - "{doc.foreach('tags', '<lightgray>(</lightgray><gray><dim>{}</dim></gray><lightgray>)</lightgray>', split = ', ', sep = ' ')}"
@ -28,7 +30,7 @@ documentlist:
columns: columns:
- { - {
header: "󱝇", header: "󱝇",
content: "{'' if 'priority' not in doc or doc['priority'] > 3 else '󰝥' if doc['priority'] <= 1 else '󰝦'}", content: "{'' if 'priority' not in doc or doc['priority'] == 'low' else '󰝥' if doc['priority'] == 'high' else '󰝦'}",
width: 1, width: 1,
} }
- { - {
@ -92,7 +94,7 @@ keymappings:
o: open -r "pdf$" o: open -r "pdf$"
O: open -d O: open -d
b: browse b: browse
B: browse -k doi B: papis browse -k doi papis_id:{doc['papis_id']}
R: view_reset R: view_reset
<c-r>: reload <c-r>: reload
e: e:
@ -127,13 +129,13 @@ keymappings:
- papis update -s readstatus "" papis_id:{doc['papis_id']} - papis update -s readstatus "" papis_id:{doc['papis_id']}
- set readstatus unread - set readstatus unread
",ph": ",ph":
- papis update -s priority 1 papis_id:{doc['papis_id']} - papis update -s priority high papis_id:{doc['papis_id']}
- set priority high - set priority high
",pm": ",pm":
- papis update -s priority 2 read papis_id:{doc['papis_id']} - papis update -s priority medium read papis_id:{doc['papis_id']}
- set priority medium - set priority medium
",pl": ",pl":
- papis update -s priority 3 read papis_id:{doc['papis_id']} - papis update -s priority low read papis_id:{doc['papis_id']}
- set priority low - set priority low
i: i:
- info_toggle - info_toggle

View file

@ -1,24 +1,5 @@
# START FLAVOURS # START FLAVOURS
# base16-sioyek (https://github.com/loiccoyle/base16-sioyek)
# by Loic Coyle
# Gruvbox dark, soft scheme byDawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
custom_background_color #32302f
custom_text_color #ebdbb2
page_separator_color #32302f
search_highlight_color #fabd2f
status_bar_color #32302f
status_bar_text_color #ebdbb2
ui_text_color #ebdbb2
ui_selected_text_color #ebdbb2
ui_background_color #3c3836
ui_selected_background_color #665c54
background_color #32302f
visual_mark_color 0.40 0.36 0.33 0.2
text_highlight_color #665c54
link_highlight_color #83a598
synctex_highlight_color #fb4934
# END FLAVOURS # END FLAVOURS
super_fast_search 1 super_fast_search 1