Compare commits
16 commits
893c177358
...
38c64fe9cf
Author | SHA1 | Date | |
---|---|---|---|
38c64fe9cf | |||
a3b54a155e | |||
08062027ae | |||
4cfd863ecb | |||
132c4c6c5b | |||
362c1f5375 | |||
5b2a55cfe3 | |||
8681d34946 | |||
dcde027a67 | |||
342a350c97 | |||
3f335936c5 | |||
47c3f7682d | |||
5e53105a62 | |||
0a5d62909b | |||
ba042db7df | |||
7ccd7e4757 |
66 changed files with 326 additions and 17567 deletions
91
.dotter/global.toml
Normal file
91
.dotter/global.toml
Normal 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
6
.dotter/local.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
includes = []
|
||||
packages = ["workstation"]
|
||||
|
||||
[files]
|
||||
|
||||
[variables]
|
5
.dotter/systemwide.toml
Normal file
5
.dotter/systemwide.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
packages = ["system", "workstation"]
|
||||
|
||||
[files]
|
||||
|
||||
[variables]
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -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
|
||||
gopass-logo-small.png
|
||||
#
|
||||
|
|
|
@ -45,10 +45,12 @@ install_paru() {
|
|||
fi
|
||||
|
||||
# use tmp dir to make paru
|
||||
target=$(mktemp -d)
|
||||
git clone https://aur.archlinux.org/paru.git "$target"
|
||||
cd "$target" || exit
|
||||
tempdir=".paru"
|
||||
git clone https://aur.archlinux.org/paru.git "$tempdir"
|
||||
pushd "$tempdir" || exit 1
|
||||
makepkg -si
|
||||
popd || exit 1
|
||||
rm -rf "$tempdir"
|
||||
}
|
||||
|
||||
update_repos() {
|
||||
|
|
|
@ -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
|
||||
dconf-editor GSettings editor for GNOME R
|
||||
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
|
||||
distrobox Use any linux distribution inside your terminal. A
|
||||
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
|
||||
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
|
||||
|
@ -146,7 +146,6 @@ 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
|
||||
maestral Open-source Dropbox client A
|
||||
magic-wormhole Securely transfer data between computers R
|
||||
maim Utility to take a screenshot using imlib2 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-scrobbler Mopidy extension for scrobbling played tracks to Last.fm 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
|
||||
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
|
||||
|
@ -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
|
||||
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
|
||||
pubs Your bibliography on the command line 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
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 29.
|
|
@ -9,7 +9,11 @@ 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
|
||||
|
|
171
install.sh
171
install.sh
|
@ -9,27 +9,33 @@
|
|||
#
|
||||
# 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() {
|
||||
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)
|
||||
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 "Personal system bootstrap script.\n\nby Marty Oehme\n\nv0.2\n"
|
||||
;;
|
||||
-h | --help)
|
||||
help 0
|
||||
;;
|
||||
-f | --force)
|
||||
unattended_install=true
|
||||
;;
|
||||
*)
|
||||
install
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
||||
$cmd "$@"
|
||||
ret=$((ret + $?))
|
||||
|
@ -39,93 +45,94 @@ main() {
|
|||
# takes default value (y/n), question, abort message as arguments
|
||||
# automatically answers yes if unattended install
|
||||
check_consent() {
|
||||
if [ "$UNATTENDED" == "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
|
||||
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
|
||||
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() {
|
||||
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
|
||||
git config --local core.hooksPath .githooks/
|
||||
echo "Changed repository settings."
|
||||
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."
|
||||
}
|
||||
|
||||
stow_dotfiles() {
|
||||
check_consent y "Link home directory dot files?" "Not linking dotfiles." || return
|
||||
# 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')"
|
||||
|
||||
# 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)
|
||||
echo "Linked dotfiles."
|
||||
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
|
||||
if command -v doas >/dev/null 2>&1; then
|
||||
doas "$@"
|
||||
elif command -v sudo >/dev/null 2>&1; then
|
||||
sudo "$@"
|
||||
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() {
|
||||
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
|
||||
"$bootstrap_dir"/install_packages.sh
|
||||
else
|
||||
"$bootstrap_dir"/install_packages.sh -f
|
||||
fi
|
||||
echo "Installed 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"
|
||||
}
|
||||
|
||||
install() {
|
||||
UNATTENDED=$1
|
||||
if ! "$UNATTENDED"; then
|
||||
entry_question
|
||||
fi
|
||||
if [ "$unattended_install" == false ] ; then
|
||||
entry_question
|
||||
fi
|
||||
|
||||
echo "====================== BEGINNING SYSTEM FILE MANAGEMENT ============================="
|
||||
stow_system_packages
|
||||
headline "BEGINNING PACKAGE INSTALLATION"
|
||||
install_packages
|
||||
|
||||
echo "====================== BEGINNING PACKAGE INSTALLATION ============================="
|
||||
install_packages
|
||||
headline "BEGINNING DOTFILE MANAGEMENT"
|
||||
manage_dotfiles
|
||||
|
||||
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
|
||||
stow_dotfiles
|
||||
headline "ENABLING GIT REPOSITORY HOOKS"
|
||||
enable_git_hooks
|
||||
|
||||
echo "================== ENABLING GIT REPOSITORY HOOKS =========================="
|
||||
enable_git_hooks
|
||||
|
||||
echo "====================== INSTALLATION FINISHED =============================="
|
||||
exit 0
|
||||
echo "INSTALLATION FINISHED"
|
||||
exit 0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
@ -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 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.
|
||||
|
||||
| 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.
|
||||
For pass-pick configuration and setup refer to the external program itself.
|
||||
|
|
|
@ -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>
|
File diff suppressed because it is too large
Load diff
|
@ -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>
|
|
@ -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>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#onetrust-reject-all-handler"/>
|
||||
</block>
|
|
@ -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>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<!-- TODO: Facebook changes IDs of buttons -->
|
||||
</block>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#wrapper > div.notification-banner > div > a"/>
|
||||
</block>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<remove element=".hide-consent"/>
|
||||
</block>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<click element="#rejectAllButton"/>
|
||||
</block>
|
|
@ -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>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<block>
|
||||
<remove element=".oaDry"/>
|
||||
</block>
|
|
@ -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>
|
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
../../../bin/qutedmenu
|
|
@ -1 +0,0 @@
|
|||
../../../bin/recently-downloaded
|
|
@ -17,7 +17,7 @@ def fixScribePath(url: QUrl):
|
|||
# unquoted = parse.unquote(
|
||||
# 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)
|
||||
new_path = re.sub(r"m/global-identity-2redirectUrl=", "", path)
|
||||
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 (
|
||||
request.resource_type != interceptor.ResourceType.main_frame
|
||||
or request.request_url.scheme() in {"data", "blob"}
|
1
qutebrowser/data/userscripts/qutedmenu
Symbolic link
1
qutebrowser/data/userscripts/qutedmenu
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../scripts/qutedmenu
|
1
qutebrowser/data/userscripts/recently-downloaded
Symbolic link
1
qutebrowser/data/userscripts/recently-downloaded
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../scripts/recently-downloaded
|
|
@ -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
|
14
sh/.config/sh/alias.d/viu.sh
Normal file
14
sh/.config/sh/alias.d/viu.sh
Normal 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
|
|
@ -50,6 +50,8 @@ export LANG="en_US.UTF-8"
|
|||
export SHELL="${SHELL:-/bin/bash}"
|
||||
|
||||
export TERM=xterm-256color
|
||||
# set env var to current shell background luminosity (used by vifm)
|
||||
. dark_bg
|
||||
|
||||
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 :"
|
||||
|
|
72
sh/.local/bin/dark_bg
Executable file
72
sh/.local/bin/dark_bg
Executable 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
|
|
@ -21,5 +21,5 @@ charset=${info#*=}
|
|||
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"
|
||||
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
|
||||
|
|
|
@ -427,12 +427,12 @@ fileviewer *.[1-8] man ./%c | col -b
|
|||
|
||||
" Images
|
||||
filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
||||
\ {View in imv}
|
||||
\ imv %f %i,
|
||||
\ {View in viu}
|
||||
\ viu --once --name %f; read -k 1 -s -r,
|
||||
\ {View in nsxiv directory viewer}
|
||||
\ vifm-thumbnailer %c,
|
||||
\ {View in imv}
|
||||
\ imv %f,
|
||||
\ {View in nsxiv}
|
||||
\ nsxiv %f,
|
||||
\ {View in vimiv}
|
||||
|
@ -444,11 +444,9 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
|||
\ {View in gpicview}
|
||||
\ gpicview %c,
|
||||
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
|
||||
" to circumvent the bug: https://github.com/atanunq/viuer/issues/44
|
||||
" thus, change the viuer library and build it with the new lib locally
|
||||
" put it into the local bin directory and you can see full pics.
|
||||
" 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
|
||||
" needs to be %pu uncached or it flickers itself into oblivion :(
|
||||
\ exist chafa && chafa -f iterm --size %pwx%ph %c:p %pd %pu %N || echo chafa not found
|
||||
set previewoptions+=graphicsdelay:0
|
||||
|
||||
" OpenRaster
|
||||
filextype *.ora
|
||||
|
@ -552,7 +550,8 @@ filetype *.docx
|
|||
\ pandoc -s -t markdown %f | nvim,
|
||||
\ docx2txt %f - | nvim
|
||||
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 -
|
||||
|
||||
" TuDu files
|
||||
|
@ -569,6 +568,11 @@ fileviewer */
|
|||
\ exa --color always --tree -L2,
|
||||
\ 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
|
||||
fileviewer * vifm-default-viewer %c
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ ref-format = bbt
|
|||
add-folder-name = {doc[author_list][0][family]}-{doc[title]}
|
||||
add-file-name = {doc[author_list][0][family]}{doc[year]}
|
||||
header-format-file = ~/.config/papis/headerformat
|
||||
extra-bibtex-keys = ["tags", "readstatus"]
|
||||
extra-bibtex-keys = ["tags", "readstatus", "priority"]
|
||||
|
||||
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
|
||||
default-query-string = *
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
# - [ ] select all in view
|
||||
# - [ ] 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:
|
||||
vimflavour: nvim
|
||||
documentlist:
|
||||
|
@ -16,7 +18,7 @@ documentlist:
|
|||
multilinestyle:
|
||||
rows:
|
||||
# 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>"
|
||||
- "<blue>{doc.html_escape['author']}</blue>"
|
||||
- "{doc.foreach('tags', '<lightgray>(</lightgray><gray><dim>{}</dim></gray><lightgray>)</lightgray>', split = ', ', sep = ' ')}"
|
||||
|
@ -28,7 +30,7 @@ documentlist:
|
|||
columns:
|
||||
- {
|
||||
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,
|
||||
}
|
||||
- {
|
||||
|
@ -92,7 +94,7 @@ keymappings:
|
|||
o: open -r "pdf$"
|
||||
O: open -d
|
||||
b: browse
|
||||
B: browse -k doi
|
||||
B: papis browse -k doi papis_id:{doc['papis_id']}
|
||||
R: view_reset
|
||||
<c-r>: reload
|
||||
e:
|
||||
|
@ -127,13 +129,13 @@ keymappings:
|
|||
- papis update -s readstatus "" papis_id:{doc['papis_id']}
|
||||
- set readstatus unread
|
||||
",ph":
|
||||
- papis update -s priority 1 papis_id:{doc['papis_id']}
|
||||
- papis update -s priority high papis_id:{doc['papis_id']}
|
||||
- set priority high
|
||||
",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
|
||||
",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
|
||||
i:
|
||||
- info_toggle
|
||||
|
|
|
@ -1,24 +1,5 @@
|
|||
# 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
|
||||
|
||||
super_fast_search 1
|
||||
|
|
Loading…
Reference in a new issue