From edc4ef0106f7d4a37d367e81ae9e6470dbdc7087 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 22 Mar 2023 17:17:59 +0530 Subject: chore: config sync --- config/qutebrowser/config.py | 2 ++ config/qutebrowser/ui.py | 9 +++++++-- config/qutebrowser/userscripts/bookmark | 16 ++++++++++++++++ config/zsh/plugins/fzf-cd.zsh | 12 ++++++++++++ config/zsh/plugins/output-operations.zsh | 19 +++++++++++++++++++ 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100755 config/qutebrowser/userscripts/bookmark create mode 100644 config/zsh/plugins/fzf-cd.zsh create mode 100644 config/zsh/plugins/output-operations.zsh (limited to 'config') diff --git a/config/qutebrowser/config.py b/config/qutebrowser/config.py index 5f80067..97c7147 100644 --- a/config/qutebrowser/config.py +++ b/config/qutebrowser/config.py @@ -93,6 +93,8 @@ c.hints.chars = 'azsxdclmknjb' c.hints.auto_follow = 'unique-match' c.content.pdfjs = True +nunmap('m') +nunmap('M') nunmap("") nunmap('') nunmap('') diff --git a/config/qutebrowser/ui.py b/config/qutebrowser/ui.py index e976f98..aa16249 100644 --- a/config/qutebrowser/ui.py +++ b/config/qutebrowser/ui.py @@ -18,8 +18,13 @@ xresources = read_xresources('*') c.fonts.default_family = 'JetBrainsMono Nerd Font' c.fonts.default_size = '12px' c.colors.webpage.preferred_color_scheme = 'dark' -c.colors.webpage.bg = "white" -c.colors.webpage.darkmode.enabled = False + +c.colors.webpage.darkmode.enabled = True +c.colors.webpage.darkmode.algorithm = "lightness-cielab" +c.colors.webpage.darkmode.threshold.text = 150 +c.colors.webpage.darkmode.threshold.background = 100 +c.colors.webpage.darkmode.policy.images = 'always' +c.colors.webpage.darkmode.grayscale.images = 0.35 ## Hints c.colors.hints.bg = 'yellow' diff --git a/config/qutebrowser/userscripts/bookmark b/config/qutebrowser/userscripts/bookmark new file mode 100755 index 0000000..8695551 --- /dev/null +++ b/config/qutebrowser/userscripts/bookmark @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +BOOKMARKS_PATH="$HOME/nixos/extras/bookmarks" + +case "$1" in + show) + local link=$(dmenu -p 'Bookmark :: ' < "$BOOKMARKS_PATH") + if test "$link"; then + echo "open -t '$link'" >> "$QUTE_FIFO" + fi + ;; + new) + echo "$QUTE_URL" >> "$BOOKMARKS_PATH" + ;; +esac + diff --git a/config/zsh/plugins/fzf-cd.zsh b/config/zsh/plugins/fzf-cd.zsh new file mode 100644 index 0000000..e4b4337 --- /dev/null +++ b/config/zsh/plugins/fzf-cd.zsh @@ -0,0 +1,12 @@ +fzf-change-dir() { + local result=$(find -type d | fzf); + + if ! [[ -z "$result" ]]; then + cd "$result" + fi + + zle send-break +} + +zle -N fzf-change-dir; +bindkey '^P' fzf-change-dir; diff --git a/config/zsh/plugins/output-operations.zsh b/config/zsh/plugins/output-operations.zsh new file mode 100644 index 0000000..e9b3546 --- /dev/null +++ b/config/zsh/plugins/output-operations.zsh @@ -0,0 +1,19 @@ +# TODO + +# logoutputdir=$(mktemp -d /tmp/zsh-output-operations.XXXXXXXX/) + +output-file() { + local termid=$(tty | sed 's|/|-|g'); + echo "$logoutputdir/last-output-$termid"; +} + +xz() { + "$@" |& tee $(output-file); +} + +# Cleanup +function plugin-exit-handler { + rm -f $(output-file); +} + +# trap plugin-exit-handler EXIT -- cgit v1.3.1