From 1c023883253a9d31482fc3b503d4dc49fe13ab91 Mon Sep 17 00:00:00 2001 From: Neptune Date: Mon, 3 Aug 2020 00:32:24 +0200 Subject: [PATCH] Sakura, imv on swallow --- .gitignore | 2 + bspwm/.config/bspwm/bspwmrc | 6 + bspwm/.config/sxhkd/sxhkdrc | 2 + music/.config/mpv/manager.json | 57 +++++++ sway/.config/waybar/config | 159 ++++++++++++++++++++ terminal/.config/fish/config.fish | 89 +++++++---- terminal/.config/fish/functions/n.fish | 36 +++++ terminal/.config/fish/functions/sakura.fish | 9 ++ terminal/.config/imv/config | 2 +- terminal/.config/kitty/diff.conf | 1 + terminal/.config/kitty/kitty.conf | 2 +- terminal/.config/vifm/vifmrc | 12 +- web/.config/qutebrowser/jmatrix-rules | 9 +- 13 files changed, 348 insertions(+), 38 deletions(-) create mode 100644 music/.config/mpv/manager.json create mode 100644 sway/.config/waybar/config create mode 100644 terminal/.config/fish/functions/n.fish create mode 100644 terminal/.config/fish/functions/sakura.fish create mode 120000 terminal/.config/kitty/diff.conf diff --git a/.gitignore b/.gitignore index 45fde3e..24ad372 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ **/qutebrowser/qsettings **/qutebrowser/autoconfig.yml **/mpv/watch_later +**/mpv/scripts +**/mpv/shaders **/mpd/database **/mpd/log **/mpd/pid diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 18e4608..1ceab35 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -52,6 +52,9 @@ mpd & xset s off & xset -dpms & +## No time to waste +xset r rate 300 50 & + ## Compositor picom --experimental-backends --backend glx -b & redshift -l 44.481:0.3545 & @@ -59,3 +62,6 @@ redshift -l 44.481:0.3545 & ## Peripherals xsetwacom set $(xsetwacom --list devices | awk '/Pen stylus/ { if ($7 == "id:") { print $8 } }') MapToOutput HDMI-A-1 & xow & + +## Swallow +pidswallow --loop & diff --git a/bspwm/.config/sxhkd/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc index fb90e0e..6d235c8 100644 --- a/bspwm/.config/sxhkd/sxhkdrc +++ b/bspwm/.config/sxhkd/sxhkdrc @@ -200,3 +200,5 @@ super + @XF86AudioMute @XF86ScreenSaver slock +super + v + bspc query --nodes --node focused | pidswallow -t diff --git a/music/.config/mpv/manager.json b/music/.config/mpv/manager.json new file mode 100644 index 0000000..70e91c4 --- /dev/null +++ b/music/.config/mpv/manager.json @@ -0,0 +1,57 @@ +[ + { + "git":"https://github.com/wiiaboo/mpv-scripts", + "whitelist":"auto%-profiles%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/uosc", + "whitelist":"%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/mpv-webm", + "whitelist":"webm%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/trackselect", + "whitelist":"%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/chapterskip", + "whitelist":"%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/groupwatch_sync", + "whitelist":"%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/mpv_irc", + "whitelist":"%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://github.com/po5/mpv-scripts", + "whitelist":"coverart%.lua$", + "dest":"~~/scripts" + }, + { + "git":"https://gist.github.com/igv/8a77e4eb8276753b54bb94c1c50c317e", + "whitelist":"%.glsl$", + "dest":"~~/shaders" + }, + { + "git":"https://gist.github.com/igv/a015fc885d5c22e6891820ad89555637", + "whitelist":"%.glsl$", + "dest":"~~/shaders" + }, + { + "git":"https://github.com/bjin/mpv-prescalers", + "whitelist":"ravu%-lite%-r4%.hook$|ravu%-zoom%-r4%-chroma%.hook$", + "dest":"~~/shaders" + } +] diff --git a/sway/.config/waybar/config b/sway/.config/waybar/config new file mode 100644 index 0000000..938e6eb --- /dev/null +++ b/sway/.config/waybar/config @@ -0,0 +1,159 @@ +// vi: set ft=json : +{ + "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": ["sway/window"], + "modules-right": ["custom/alsa", "mpd", "temperature", "clock"], + // Modules configuration + "sway/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{name}: {icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "urgent": "", + "focused": "", + "default": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "mpd": { + // "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ", + "format": " {stateIcon} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", + "format-disconnected": "Disconnected ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "off": " ", + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "tooltip-format": "{:%Y-%m-%d | %H:%M}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "hwmon-path" : "/sys/devices/pci0000:00/0000:00:03.1/0000:1c:00.0/hwmon/hwmon0/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + // "format-icons": ["", "", ""], + "format-icons": ["", "", "", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + }, + "custom/alsa": { + "exec": "$HOME/.config/waybar/scripts/alsa.sh 2> /dev/null", + // "on-click": "amixer set Master toggle; pkill -x -RTMIN+11 waybar", + // "on-scroll-up": "amixer set Master 1+; pkill -x -RTMIN+11 waybar", + // "on-scroll-down": "amixer set Master 1-; pkill -x -RTMIN+11 waybar", + "signal": 11, + "interval": 1, + "tooltip": false + } +} diff --git a/terminal/.config/fish/config.fish b/terminal/.config/fish/config.fish index 1282881..40540fa 100644 --- a/terminal/.config/fish/config.fish +++ b/terminal/.config/fish/config.fish @@ -1,14 +1,16 @@ # vim: set ft=fish : + +# Activate vi mode +fish_vi_key_bindings set fish_greeting -set -x GOPATH "$HOME/go" -set -x EDITOR nvim + +# Accelerate key bindings set -U SXHKD_SHELL sh -## PATH -set -x PATH "$PATH:$HOME/.gem/ruby/2.7.0/bin" -set -x PATH "$PATH:$HOME/.local/bin" -set -x PATH "$PATH:$HOME/bin" -set -x PATH "$PATH:$HOME/go/bin" +# Default programs: +set -x EDITOR "nvim" +set -x TERMINAL "kitty" +set -x BROWSER "qutebrowser" ## Fuzzy finder set -x FZF_DEFAULT_OPTS '--preview "~/.config/kitty/preview {}" --preview-window left:40%' @@ -16,43 +18,72 @@ set -x FZF_EXCLUDE_GLOB '--glob "!.git/*" --glob "!.steam/*" --glob "!.local/sha set -x FZF_DEFAULT_COMMAND "rg --files --hidden --follow $FZF_EXCLUDE_GLOB" set -x FZF_FIND_FILE_COMMAND "rg --files --hidden --follow $FZF_EXCLUDE_GLOB" +# ~/ Clean-up: +set -x XDG_CONFIG_HOME "$HOME/.config" +set -x XDG_DATA_HOME "$HOME/.local/share" +set -x XDG_CACHE_HOME "$HOME/.cache" +#set -x XAUTHORITY "$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs. +set -x NOTMUCH_CONFIG "$XDG_CONFIG_HOME/notmuch-config" +set -x GTK2_RC_FILES "$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0" +set -x LESSHISTFILE "-" +set -x WGETRC "$XDG_CONFIG_HOME/wget/wgetrc" +set -x INPUTRC "$XDG_CONFIG_HOME/inputrc" +set -x ZDOTDIR "$XDG_CONFIG_HOME/zsh" +#set -x GNUPGHOME "$XDG_DATA_HOME/gnupg" +set -x WINEPREFIX "$XDG_DATA_HOME/wineprefixes/default" +set -x PASSWORD_STORE_DIR "$XDG_DATA_HOME/password-store" +set -x TMUX_TMPDIR "$XDG_RUNTIME_DIR" +set -x ANDROID_SDK_HOME "$XDG_CONFIG_HOME/android" +set -x CARGO_HOME "$XDG_DATA_HOME/cargo" +set -x GOPATH "$XDG_DATA_HOME/go" +set -x ANSIBLE_CONFIG "$XDG_CONFIG_HOME/ansible/ansible.cfg" +set -x UNISON "$XDG_DATA_HOME/unison" +set -x HISTFILE "$XDG_DATA_HOME/history" + +## PATH +set -x PATH "$PATH:$HOME/.gem/ruby/2.7.0/bin" +set -x PATH "$PATH:$HOME/.local/bin" +set -x PATH "$PATH:$HOME/bin" +set -x PATH "$PATH:$GOPATH/bin" + ## Packages set -x XBPS_DISTDIR "$HOME/.void-packages" -alias v='xbpsui' + +abbr v "xbpsui" ## Games set -x SDL_AUDIODRIVER alsa ## Utilities -alias icat='kitty +kitten icat' -alias d="kitty +kitten diff" -alias mpv='mpv --no-input-default-bindings' -alias music='mpc -q play; ~/.config/ncmpcpp/art.sh; sleep 1; ~/.config/ncmpcpp/kitty.sh &; ncmpcpp' -alias bars='~/.config/ncmpcpp/kitty.sh &; cava' -alias weather='curl wttr.in' +abbr icat 'kitty +kitten icat' +abbr d "kitty +kitten diff" +abbr mpv 'mpv --no-input-default-bindings' +abbr music 'mpc -q play; ~/.config/ncmpcpp/art.sh; sleep 1; ~/.config/ncmpcpp/kitty.sh &; ncmpcpp' +abbr bars '~/.config/ncmpcpp/kitty.sh &; cava' +abbr weather 'curl wttr.in' +abbr manga 'find -type f | sort | sw imv -s none -b 1F1F21' ## Web -alias manga='gallery-dl' # Weeb anime bullshit -alias nico='youtube-dl' -alias yt='youtube-dl -f bestvideo+bestaudio' # Youtube videos +abbr nico 'youtube-dl' +abbr yt 'youtube-dl -f bestvideo+bestaudio' # Youtube videos ## Torrent -alias seed='aria2c --check-integrity=true --seed-ratio=0.0' -alias seed_today="seed (find . -maxdepth 1 -name '*.torrent' -mtime -1)" -alias torrent='aria2c --bt-metadata-only=true --bt-save-metadata=true' +abbr seed 'aria2c --check-integrity=true --seed-ratio=0.0' +abbr seed_today "seed (find . -maxdepth 1 -name '*.torrent' -mtime -1)" +abbr torrent 'aria2c --bt-metadata-only=true --bt-save-metadata=true' ## Navigation -alias ls='exa' # ls with colors -alias r='vifm' +abbr ls 'exa' # ls with colors +abbr r 'vifm' ## Git -alias g:a='git add -A' -alias g:c='git commit -a' -alias g:d='git difftool --no-symlinks --dir-diff' -alias g:i='git init' -alias g:l='git pull' -alias g:p='git push' -alias g:s='git status' +abbr g:a 'git add -A' +abbr g:c 'git commit -a' +abbr g:d 'git difftool --no-symlinks --dir-diff' +abbr g:i 'git init' +abbr g:l 'git pull' +abbr g:p 'git push' +abbr g:s 'git status' ## Functions function git-replicate --description 'Copy git repository to new origin' diff --git a/terminal/.config/fish/functions/n.fish b/terminal/.config/fish/functions/n.fish new file mode 100644 index 0000000..47cda35 --- /dev/null +++ b/terminal/.config/fish/functions/n.fish @@ -0,0 +1,36 @@ +# Rename this file to match the name of the function +# e.g. ~/.config/fish/functions/n.fish +# or, add the lines to the 'config.fish' file. + +function n --wraps nnn --description 'support nnn quit and change directory' + # Block nesting of nnn in subshells + if test -n "$NNNLVL" + if [ (expr $NNNLVL + 0) -ge 1 ] + echo "nnn is already running" + return + end + end + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "-x" as in: + # set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + if test -n "$XDG_CONFIG_HOME" + set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + else + set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" + end + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn $argv + + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end +end diff --git a/terminal/.config/fish/functions/sakura.fish b/terminal/.config/fish/functions/sakura.fish new file mode 100644 index 0000000..0d41801 --- /dev/null +++ b/terminal/.config/fish/functions/sakura.fish @@ -0,0 +1,9 @@ +# Defined in /tmp/fish.1xT3XM/sakura.fish @ line 1 +function sakura + $argv & + set _pid (jobs -l | awk '{print $2}') + sleep 1 + set _wid (xdo id) + xprop -f WM_CLIENT_MACHINE 8s -set WM_CLIENT_MACHINE (hostname) -id $_wid + xprop -f _NET_WM_PID 32c -set _NET_WM_PID $_pid -id $_wid +end diff --git a/terminal/.config/imv/config b/terminal/.config/imv/config index 65a7012..4d3deb4 100644 --- a/terminal/.config/imv/config +++ b/terminal/.config/imv/config @@ -8,7 +8,7 @@ # config file. suppress_default_binds = true -scaling_mode = full +scaling_mode = none background = checks diff --git a/terminal/.config/kitty/diff.conf b/terminal/.config/kitty/diff.conf new file mode 120000 index 0000000..84433d7 --- /dev/null +++ b/terminal/.config/kitty/diff.conf @@ -0,0 +1 @@ +/home/jojo/.cache/wal/diff.conf \ No newline at end of file diff --git a/terminal/.config/kitty/kitty.conf b/terminal/.config/kitty/kitty.conf index 8b182c4..4300453 100644 --- a/terminal/.config/kitty/kitty.conf +++ b/terminal/.config/kitty/kitty.conf @@ -952,7 +952,7 @@ map kitty_mod+h show_scrollback #: example, the following opens the scrollback buffer in less in an #: overlay window:: -#: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R +map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay nvim - #: For more details on piping screen and buffer contents to external #: programs, see launch. diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 344caa4..2f335ec 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -159,19 +159,19 @@ filetype nvim filextype *.txt,*.json nvim " Books -filextype *.pdf,*.epub,*.cbz,*.cbr sw llpp %c %i & +filextype *.pdf,*.epub,*.cbz,*.cbr llpp %c %i & " Krita -filextype *.kra sw krita %c %i & +filextype *.kra krita %c %i & " Audios -filetype