From a76aa8c932030a64ba277ed9a9cbeadb8dd910d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 14 Sep 2021 11:04:04 +0300 Subject: Trying out vimb as main browser --- dotfiles/.config/mimeapps.list | 16 ++++++------- dotfiles/.config/sway/config | 14 ++++------- dotfiles/.config/vimb/config | 51 +++++++++++++++++++++++++++++++++++++++++ dotfiles/.config/vimb/style.css | 25 ++++++++++++++++++++ dotfiles/.local/bin/menuwebsurf | 16 ++++++++----- dotfiles/.profile | 2 +- 6 files changed, 99 insertions(+), 25 deletions(-) create mode 100644 dotfiles/.config/vimb/config create mode 100644 dotfiles/.config/vimb/style.css (limited to 'dotfiles') diff --git a/dotfiles/.config/mimeapps.list b/dotfiles/.config/mimeapps.list index a64163f..9d207f7 100644 --- a/dotfiles/.config/mimeapps.list +++ b/dotfiles/.config/mimeapps.list @@ -1,9 +1,9 @@ [Default Applications] application/pdf=org.pwmt.zathura-pdf-mupdf.desktop; application/epub+zip=org.pwmt.zathura-pdf-mupdf.desktop; -application/rdf+xml=org.qutebrowser.qutebrowser.desktop; -application/xhtml+xml=org.qutebrowser.qutebrowser.desktop; -application/xml=org.qutebrowser.qutebrowser.desktop; +application/rdf+xml=vimb.desktop; +application/xhtml+xml=vimb.desktop; +application/xml=vimb.desktop; audio/mpeg=mpv.desktop; audio/x-xm=mpv.desktop; audio/x-mod=mpv.desktop; @@ -12,13 +12,13 @@ image/jpeg=sxiv.desktop; image/png=sxiv.desktop; image/webp=sxiv.desktop; image/svg+xml=org.inkscape.Inkscape.desktop -text/html=org.qutebrowser.qutebrowser.desktop; +text/html=vimb.desktop; text/xml=nvim.desktop; text/plain=nvim.desktop; x-scheme-handler/discord-589393213723246592=discord-589393213723246592.desktop; -x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop; -x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop; +x-scheme-handler/http=vimb.desktop; +x-scheme-handler/https=vimb.desktop; x-scheme-handler/qute=org.qutebrowser.qutebrowser.desktop; x-scheme-handler/discord-455712169795780630=discord-455712169795780630.desktop -x-scheme-handler/mailto=aerc.desktop -x-scheme-handler/tg=userapp-Telegram Desktop-0V8IZ0.desktop +x-scheme-handler/mailto=neomutt.desktop +x-scheme-handler/tg=userapp-Telegram Desktop-I9W870.desktop diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index 47a2e74..8127c5f 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -6,7 +6,7 @@ set $mod Mod4 set $alt Mod1 set $term foot -set $browser qutebrowser +set $browser `$BROWSER` # set default desktop layout (default is tiling) # workspace_layout tabbed @@ -97,10 +97,6 @@ no_focus [title="mpvfloat"] # Dropdown-like windows -# VK Messenger -for_window [instance="vk" window_role="browser-window"] floating enable, sticky enable -# for_window [class="VK"] move scratchpad - # Telegram Desktop for_window [app_id="telegramdesktop"] floating enable, sticky enable # for_window [class="TelegramDesktop"] move scratchpad @@ -171,8 +167,8 @@ bindsym --to-code { $mod+Ctrl+Shift+space exec "makoctl restore" # Start Applications - $mod+Shift+w exec $browser - $mod+Ctrl+w exec chromium -enable-features=UseOzonePlatform -ozone-platform=wayland + $mod+Shift+w exec menuwebsurf + $mod+Ctrl+w exec menuwebsurf paste $mod+F1 exec menuman $mod+F2 exec menumako $mod+F3 exec menudisplay @@ -184,12 +180,10 @@ bindsym --to-code { $mod+s exec "xway steam" $mod+m exec $term ncmpcpp $mod+n exec $term -T "newsboat" newsboat && killall -42 waybar - $mod+a exec $term -T "aerc" aerc + $mod+a exec $term -T "neomutt" neomutt $mod+o exec notistats $mod+c exec camtoggle $mod+grave exec menuemoji - $mod+Ctrl+grave exec menuwebsurf - $mod+Shift+grave exec menuwebsurf paste $mod+apostrophe exec menupass $mod+Shift+apostrophe exec "menupass -l" $mod+Ctrl+apostrophe exec "menupass -f" diff --git a/dotfiles/.config/vimb/config b/dotfiles/.config/vimb/config new file mode 100644 index 0000000..1bdce52 --- /dev/null +++ b/dotfiles/.config/vimb/config @@ -0,0 +1,51 @@ +#set home-page=https://srx.yaroslavps.com/ +set home-page=about:blank + +set download-path=~/dls + +set editor-command=foot nvim %s + +set input-autohide=true + +set spell-checking=true +set spell-checking-languages=en,es,ru + +set webgl=true + +set incsearch=true + +set default-font=monospace + +shortcut-add s=https://srx.yaroslavps.com/search?q=$0 +shortcut-add d=http://dict.cc/?s=$0 +shortcut-add y=http://www.youtube.com/results?search_query=$0 +shortcut-add duck=https://duckduckgo.com/?q=$0 + +shortcut-default s + +nmap + zI +nmap - zO +nmap = zz + +set hint-keys-same-length=true +set hint-keys=asdfghjkl +set hint-timeout=0 + +set x-hint-command=:sh! xdg-open ; + +set geolocation=never + +set prevent-newwindow=true + +set cookie-accept=origin + +# GUI color settings +# Color scheme: Base16 Eighties (https://github.com/chriskempson/base16) +set completion-css=color:#6d974b;background-color:#151517;font:10pt monospace; +set completion-hover-css=color:#6d974b;background-color:#232328;font:10pt monospace; +set completion-selected-css=color:#6d974b;background-color:#515151;font:10pt monospace; +set input-css=color:#6d974b;background-color:#393939;font:10pt monospace; +set input-error-css=color:#b73030;background-color:#393939;font:10pt monospace; +set status-css=color:#faf6e5;background-color:#393939;font:10pt monospace; +set status-ssl-css=color:#99cc99;background-color:#393939;font:10pt monospace; +set status-ssl-invalid-css=color:#f2777a;background-color:#393939;font:10pt monospace; diff --git a/dotfiles/.config/vimb/style.css b/dotfiles/.config/vimb/style.css new file mode 100644 index 0000000..3e3d0b4 --- /dev/null +++ b/dotfiles/.config/vimb/style.css @@ -0,0 +1,25 @@ +/* Hint mode color styling + * + * The precedence of the user style is lower than that of the website so you + * have to mark your style definition to have higher priority. + */ +span[vimbhint^='label'] { + background-color: #5b8277 !important; + border: 0 !important; + color: #151517 !important; + font: bold 10pt monospace !important; + opacity: 1 !important; + padding: .1em .4em !important; + text-transform: uppercase !important; +} +span[vimbhint='label focus'] { + font: bold 13pt monospace !important; +} +*[vimbhint^='hint'] { + background-color: #e6e3d6 !important; + color: #151517 !important; +} +*[vimbhint='hint focus'] { + background-color: #e2b55a !important; + color: #151517 !important; +} diff --git a/dotfiles/.local/bin/menuwebsurf b/dotfiles/.local/bin/menuwebsurf index bef9890..cb32299 100755 --- a/dotfiles/.local/bin/menuwebsurf +++ b/dotfiles/.local/bin/menuwebsurf @@ -5,18 +5,22 @@ # Source settings from .bemenurc . ~/.config/bemenurc -prompt="🌐" +searchurl="https://srx.yaroslavps.com/search?q=" +histf="$HOME/.config/vimb/history" # Have to use this "hack" because bemenu doesn't know how to paste if [ "$1" = "paste" ]; then - prompt="$(wl-paste)" + prompt="$(wl-paste)" +else + prompt="$(cat "$histf")" fi -choice=$(echo "$prompt" | bemenu -i -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") || exit 1 +choice=$(printf "%s" "$prompt" | bemenu -i -l 25 -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") || exit 1 -if [ "$choice" = "🌐" ]; then - $BROWSER +if echo "$choice" | egrep ".*://.*" >/dev/null 2>&1; then + choice="$(echo "$choice" | cut -f 1)" + mimeo "$choice" else - mimeo "$choice" + $BROWSER "$choice" fi diff --git a/dotfiles/.profile b/dotfiles/.profile index 7d6f809..4db0bac 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -17,7 +17,7 @@ export LANG=en_US.UTF-8 export TERMINAL=foot export EDITOR="nvim" export PAGER="less -R -j.5" -export BROWSER=qutebrowser +export BROWSER=vimb # Sanely export XDG Base dir variables eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" -- cgit v1.2.3 From 86d08f80c0f9a8159139e29c070a87e55469fbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 14 Sep 2021 21:31:11 +0300 Subject: neomutt keybinds S is to move to spam is s to sync. --- dotfiles/.config/mutt/muttrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/mutt/muttrc b/dotfiles/.config/mutt/muttrc index 207f7c4..61fa2e6 100644 --- a/dotfiles/.config/mutt/muttrc +++ b/dotfiles/.config/mutt/muttrc @@ -55,7 +55,7 @@ bind pager,browser gg top-page bind pager,browser G bottom-page bind index,pager,browser \CD half-down bind index,pager,browser \CU half-up -bind index,pager S sync-mailbox +bind index,pager s sync-mailbox bind index,pager R group-reply bind index \031 previous-undeleted # Mouse wheel bind index \005 next-undeleted # Mouse wheel @@ -75,6 +75,7 @@ macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decode macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" #macro index A "all\n" "show all messages (undo limit)" macro index,pager A ";=Archive" "archive mail" +macro index,pager S ";=Spam" "send mail to spam" # Sidebar mappings set sidebar_visible = yes -- cgit v1.2.3 From 376d68b0443a60a237e9e35462781a2ff504c7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 16 Sep 2021 12:27:11 +0300 Subject: Config cleaning * Removed unused stuff. * Script for updating hosts file with latest unwanted domains. * Other slight changes. --- dotfiles/.config/mutt/muttrc | 1 + 1 file changed, 1 insertion(+) (limited to 'dotfiles') diff --git a/dotfiles/.config/mutt/muttrc b/dotfiles/.config/mutt/muttrc index 61fa2e6..016dc68 100644 --- a/dotfiles/.config/mutt/muttrc +++ b/dotfiles/.config/mutt/muttrc @@ -20,6 +20,7 @@ set forward_quote # include message in forwards set reverse_name # reply as whomever it was to set include # include message in replies set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) +unignore x-spam-status auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted #set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. -- cgit v1.2.3 From a479092a592bc1f97f849410593f8a06a8688cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Fri, 17 Sep 2021 23:59:38 +0300 Subject: Some changes/improvements * New menuman mode to search with apropos * Dragon drag-and-drop marked images in sxiv * Other changes. --- dotfiles/.config/sway/config | 1 + dotfiles/.config/sxiv/exec/key-handler | 76 +++++++++++++++++++--------------- dotfiles/.config/vimb/config | 2 - dotfiles/.config/zsh/shortcuts | 5 +++ dotfiles/.local/bin/menuman | 60 ++++++++++++++++++++++++--- 5 files changed, 102 insertions(+), 42 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index 8127c5f..dc8eec2 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -170,6 +170,7 @@ bindsym --to-code { $mod+Shift+w exec menuwebsurf $mod+Ctrl+w exec menuwebsurf paste $mod+F1 exec menuman + $mod+Shift+F1 exec menuman -s $mod+F2 exec menumako $mod+F3 exec menudisplay $mod+F4 exec menublk diff --git a/dotfiles/.config/sxiv/exec/key-handler b/dotfiles/.config/sxiv/exec/key-handler index 17abf60..f20a143 100755 --- a/dotfiles/.config/sxiv/exec/key-handler +++ b/dotfiles/.config/sxiv/exec/key-handler @@ -9,39 +9,47 @@ rotate() { esac } +if [ "$1" = "t" ]; then + while read file; do + files="$(printf "%s\n%s" "$files" "$file")" + done + dragon-drag-and-drop -a $files + exit 0 +fi + while read file; do - case "$1" in - "C-a" | "C-1") - setbg "$file" - exit ;; - "C-2") - setbg "$file" "2" - exit ;; - "C-s") - setbglblur "$file" - exit ;; - "C-d") - setbglsimple "$file" - exit ;; - "C-c") - wl-copy < "$file" - exit ;; - "C-f") - wl-copy "$file" - exit ;; - "C-r") - # Move file to 'trash' directory, if the current directory's name is - # JPEG, remove the NEF file as well - dir="$(dirname "$file")" - name="$(basename "$file")" - base="${name%.*}" - mv "$file" ~/.local/trash/ - if [ "JPEG" = "$(basename $dir)" ]; then - mv $(dirname "$dir")/"$base".NEF ~/.local/trash/ - fi - exit ;; - "C-comma") rotate 270 $file ;; - "C-period") rotate 90 $file ;; - "C-slash") rotate 180 $file ;; - esac + case "$1" in + "C-a" | "C-1") + setbg "$file" + exit ;; + "C-2") + setbg "$file" "2" + exit ;; + "C-s") + setbglblur "$file" + exit ;; + "C-d") + setbglsimple "$file" + exit ;; + "C-c") + wl-copy < "$file" + exit ;; + "C-f") + wl-copy "$file" + exit ;; + "C-r") + # Move file to 'trash' directory, if the current directory's name is + # JPEG, remove the NEF file as well + dir="$(dirname "$file")" + name="$(basename "$file")" + base="${name%.*}" + mv "$file" ~/.local/trash/ + if [ "JPEG" = "$(basename $dir)" ]; then + mv $(dirname "$dir")/"$base".NEF ~/.local/trash/ + fi + exit ;; + "C-comma") rotate 270 $file ;; + "C-period") rotate 90 $file ;; + "C-slash") rotate 180 $file ;; + esac done diff --git a/dotfiles/.config/vimb/config b/dotfiles/.config/vimb/config index 1bdce52..29f07e2 100644 --- a/dotfiles/.config/vimb/config +++ b/dotfiles/.config/vimb/config @@ -35,8 +35,6 @@ set x-hint-command=:sh! xdg-open ; set geolocation=never -set prevent-newwindow=true - set cookie-accept=origin # GUI color settings diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts index 9ec350c..e203a26 100644 --- a/dotfiles/.config/zsh/shortcuts +++ b/dotfiles/.config/zsh/shortcuts @@ -68,6 +68,11 @@ alias yta="youtube-dl --add-metadata -xic" # Download only audio alias YT="youtube-viewer" alias starwars="telnet towel.blinkenlights.nl" +# git +gitcc () { + git clone "$(wl-paste --no-newline)" +} + # Audio and Music alias mute="lmc mute" alias vu="lmc up" diff --git a/dotfiles/.local/bin/menuman b/dotfiles/.local/bin/menuman index acad4c4..30a5424 100755 --- a/dotfiles/.local/bin/menuman +++ b/dotfiles/.local/bin/menuman @@ -1,19 +1,67 @@ #!/bin/sh # Search and open man page +# Options: +# -t use in terminal with fzf otherwise launch bemenu. +# -s search with apropos. -list="$(man -k . | awk '{ print $1$2 }')" +# Source settings from .bemenurc +. ~/.config/bemenurc -if [ "$1" = "-t" ]; then - chosen=$(printf "$list" | fzf) +issearch= +isterminal= + +printusage() { + echo "Options:" >2 + echo " -t use in terminal with fzf otherwise launch bemenu." >2 + echo " -s search with apropos." >2 +} + +while getopts "st" curopt "$@"; do + case "$curopt" in + "s") + issearch=1 + continue;; + "t") + isterminal=1 + continue;; + "?") + printusage + exit 1;; + esac +done + +if [ ! -z "$issearch" ]; then + if [ ! -z "$isterminal" ]; then + printf "Enter query:\t" + read query + else + query="$(echo "" | bemenu -p "Enter apropos query:" -i --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" + fi + if [ -z "$query" ]; then + echo "Empty query" >2 + exit 1 + fi + list="$(apropos "$query")" else - # Source settings from .bemenurc - . ~/.config/bemenurc + list="$(man -k . | awk '{ print $1$2 }')" +fi - chosen=$(printf "$list" | bemenu -p "Select man page:" -i -l 25 --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") +if [ ! -z "$isterminal" ]; then + chosen=$(printf "$list" | fzf) +else + chosen=$(printf "$list" | bemenu -p "Select man page:" -i -l 25 --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") fi if [ -z "$chosen" ]; then exit 0 fi +if [ ! -z "$issearch" ]; then + chosen="$(printf "$chosen" | sed "s/\(.* ([a-zA-Z0-9]*)\)\s*-.*/\1/")" +fi + +if [ ! -z "$isterminal" ]; then + man "$chosen" && exit +fi + $TERMINAL -T "man $chosen" man $chosen -- cgit v1.2.3 From 52a2aa5d4168f4f82ee62b778f4f57dc4d1a975b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 21 Sep 2021 19:58:36 +0300 Subject: menuman: fix redirect to stderr --- dotfiles/.local/bin/menuman | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/.local/bin/menuman b/dotfiles/.local/bin/menuman index 30a5424..98efc02 100755 --- a/dotfiles/.local/bin/menuman +++ b/dotfiles/.local/bin/menuman @@ -11,9 +11,9 @@ issearch= isterminal= printusage() { - echo "Options:" >2 - echo " -t use in terminal with fzf otherwise launch bemenu." >2 - echo " -s search with apropos." >2 + echo "Options:" >&2 + echo " -t use in terminal with fzf otherwise launch bemenu." >&2 + echo " -s search with apropos." >&2 } while getopts "st" curopt "$@"; do @@ -38,7 +38,7 @@ if [ ! -z "$issearch" ]; then query="$(echo "" | bemenu -p "Enter apropos query:" -i --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" fi if [ -z "$query" ]; then - echo "Empty query" >2 + echo "Empty query" >&2 exit 1 fi list="$(apropos "$query")" -- cgit v1.2.3 From 03b2f9b30700848862f4920f76cd6113bdf8c3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sun, 26 Sep 2021 13:22:57 +0300 Subject: Minor changes * Update bemenu's moronic monitor variable once more * Neomutt shutdown hook to update waybar. --- dotfiles/.config/bemenurc | 2 +- dotfiles/.config/mutt/muttrc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/bemenurc b/dotfiles/.config/bemenurc index a05d7b2..9f4f283 100755 --- a/dotfiles/.config/bemenurc +++ b/dotfiles/.config/bemenurc @@ -22,4 +22,4 @@ BEMENU_HF="#151517" ## command for the terminal application to be used: TERMINAL_CMD="terminal -e" -BEMENU_MONITOR="-1" +BEMENU_MONITOR="-2" diff --git a/dotfiles/.config/mutt/muttrc b/dotfiles/.config/mutt/muttrc index 016dc68..b7c6935 100644 --- a/dotfiles/.config/mutt/muttrc +++ b/dotfiles/.config/mutt/muttrc @@ -20,6 +20,7 @@ set forward_quote # include message in forwards set reverse_name # reply as whomever it was to set include # include message in replies set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) +shutdown-hook 'echo `killall -43 waybar`' unignore x-spam-status auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted -- cgit v1.2.3 From 919a26f95787a163800e9505fc4c8cd0c9098f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Sun, 26 Sep 2021 14:41:39 +0300 Subject: Replaced pulseaudio with pipewire Getting rid of poetteringware bit by bit. --- dotfiles/.config/sway/config | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index dc8eec2..f54e4f3 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -54,7 +54,11 @@ exec_always { ##### Startup scripts and programs ##### # Waybar exec waybar_launch -# music daemon +# Audio +exec pipewire +exec pipewire-media-session +exec pipewire-pulse +# Music daemon exec mpd # Bluetooth adapter applet exec_always blueman-applet -- cgit v1.2.3 From dec85ad80a0e7b0b49c354280e1ee3ff4157b9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 28 Sep 2021 18:58:29 +0300 Subject: workspace script A quick script to quickly open several terminal windows, in a layout that I often use, all in the specified directory. --- dotfiles/.local/bin/workspace | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 dotfiles/.local/bin/workspace (limited to 'dotfiles') diff --git a/dotfiles/.local/bin/workspace b/dotfiles/.local/bin/workspace new file mode 100755 index 0000000..bfc2357 --- /dev/null +++ b/dotfiles/.local/bin/workspace @@ -0,0 +1,40 @@ +#!/bin/sh + +# Yaroslav de la Peña Smirnov 2021 +# +# A quick script to quickly open several terminal windows, in a layout that I +# often use, all in the specified directory. The layout looks something like +# this: +# +# ┌──────────────────┬──────────────────────────────────────────────┐ +# │ │ │ +# │ │ │ +# │ lf │ │ +# │ │ │ +# │ │ │ +# ├──────────────────┤ │ +# │ │ shell │ +# │ │ │ +# │ │ │ +# │ shell │ │ +# │ │ │ +# │ │ │ +# │ │ │ +# └──────────────────┴──────────────────────────────────────────────┘ + +if [ -z "$1" ]; then + echo "Specify working directory" + exit 1 +fi + +swaymsg "gaps inner current set 0; gaps outer current set 0" + +cd "$1" +setsid $TERMINAL -a "$TERMINAL lf:$1" "lf" >/dev/null 2>&1 & sleep 0.1 +setsid $TERMINAL -a "$TERMINAL edit:$1" >/dev/null 2>&1 & sleep 0.1 + +sleep 0.2 +swaymsg "[app_id=\"$TERMINAL lf:$1\"] focus; resize set width 27ppt; split v" +setsid $TERMINAL >/dev/null 2>&1 & sleep 0.2 +swaymsg "resize set height 60ppt" && sleep 0.1 +swaymsg "[app_id=\"$TERMINAL edit:$1\"] focus" -- cgit v1.2.3 From f2aa61e910a8ccab62579a82fdc3e756cd1bd960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Tue, 28 Sep 2021 19:03:34 +0300 Subject: fix zsh fzf shortcut aliases Forgot to surround the command result with quotes. --- dotfiles/.config/zsh/shortcuts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts index e203a26..aa34603 100644 --- a/dotfiles/.config/zsh/shortcuts +++ b/dotfiles/.config/zsh/shortcuts @@ -30,8 +30,8 @@ alias testinet="ping -c2 example.com" # Fuzzy finder alias fzd='cd "$(find . -type d | fzf || echo ".")"' -alias fzv='nvim $(find . -type f | fzf)' -alias fzo='op $(find . -type f | fzf)' +alias fzv='nvim "$(find . -type f | fzf)"' +alias fzo='op "$(find . -type f | fzf)"' # Function for changing working dir after exiting lf lfcd () { -- cgit v1.2.3 From 3f6bb9f7ddc34fdd9af3d8ae3b0c00b882027843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 30 Sep 2021 20:56:04 +0300 Subject: zsh: history search bindings --- dotfiles/.config/zsh/.zshrc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dotfiles') diff --git a/dotfiles/.config/zsh/.zshrc b/dotfiles/.config/zsh/.zshrc index 727bfe0..a744585 100644 --- a/dotfiles/.config/zsh/.zshrc +++ b/dotfiles/.config/zsh/.zshrc @@ -38,6 +38,12 @@ bindkey -M menuselect 'L' vi-forward-char bindkey -M menuselect 'J' vi-down-line-or-history bindkey -v '^?' backward-delete-char +# History search +bindkey "^[[A" history-search-backward +bindkey "^[[B" history-search-forward +bindkey -a "k" history-search-backward +bindkey -a "j" history-search-forward + # Change cursor shape for different vi modes. function zle-keymap-select { if [[ ${KEYMAP} == vicmd ]] || -- cgit v1.2.3 From 570ac7ec050d0a79fb46832df9a19be4da241469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 7 Oct 2021 10:18:09 +0300 Subject: zsh: switch binds to history-beginning-search-* --- dotfiles/.config/zsh/.zshrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/.config/zsh/.zshrc b/dotfiles/.config/zsh/.zshrc index a744585..ad70614 100644 --- a/dotfiles/.config/zsh/.zshrc +++ b/dotfiles/.config/zsh/.zshrc @@ -39,10 +39,10 @@ bindkey -M menuselect 'J' vi-down-line-or-history bindkey -v '^?' backward-delete-char # History search -bindkey "^[[A" history-search-backward -bindkey "^[[B" history-search-forward -bindkey -a "k" history-search-backward -bindkey -a "j" history-search-forward +bindkey "^[[A" history-beginning-search-backward +bindkey "^[[B" history-beginning-search-forward +bindkey -a "k" history-beginning-search-backward +bindkey -a "j" history-beginning-search-forward # Change cursor shape for different vi modes. function zle-keymap-select { -- cgit v1.2.3 From d24e93fbc4d147627e99ef751b6f945a8924a14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 7 Oct 2021 14:00:03 +0300 Subject: Revert "Trying out vimb as main browser" This reverts commit a76aa8c932030a64ba277ed9a9cbeadb8dd910d2. And makes changes to adapt qutebrowser history to menuwebsurf. Sorry vimb, you are nice and I like that you are really minimal. But even though qb is written in Python, it still manages to work better than you (even though slower on startup). --- dotfiles/.config/mimeapps.list | 12 ++++++------ dotfiles/.local/bin/menuwebsurf | 13 +++++++++---- dotfiles/.local/share/applications/neomutt.desktop | 6 ++++++ dotfiles/.profile | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 dotfiles/.local/share/applications/neomutt.desktop (limited to 'dotfiles') diff --git a/dotfiles/.config/mimeapps.list b/dotfiles/.config/mimeapps.list index 9d207f7..b230d15 100644 --- a/dotfiles/.config/mimeapps.list +++ b/dotfiles/.config/mimeapps.list @@ -1,9 +1,9 @@ [Default Applications] application/pdf=org.pwmt.zathura-pdf-mupdf.desktop; application/epub+zip=org.pwmt.zathura-pdf-mupdf.desktop; -application/rdf+xml=vimb.desktop; -application/xhtml+xml=vimb.desktop; -application/xml=vimb.desktop; +application/rdf+xml=org.qutebrowser.qutebrowser.desktop; +application/xhtml+xml=org.qutebrowser.qutebrowser.desktop; +application/xml=org.qutebrowser.qutebrowser.desktop; audio/mpeg=mpv.desktop; audio/x-xm=mpv.desktop; audio/x-mod=mpv.desktop; @@ -12,12 +12,12 @@ image/jpeg=sxiv.desktop; image/png=sxiv.desktop; image/webp=sxiv.desktop; image/svg+xml=org.inkscape.Inkscape.desktop -text/html=vimb.desktop; +text/html=org.qutebrowser.qutebrowser.desktop; text/xml=nvim.desktop; text/plain=nvim.desktop; x-scheme-handler/discord-589393213723246592=discord-589393213723246592.desktop; -x-scheme-handler/http=vimb.desktop; -x-scheme-handler/https=vimb.desktop; +x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop; +x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop; x-scheme-handler/qute=org.qutebrowser.qutebrowser.desktop; x-scheme-handler/discord-455712169795780630=discord-455712169795780630.desktop x-scheme-handler/mailto=neomutt.desktop diff --git a/dotfiles/.local/bin/menuwebsurf b/dotfiles/.local/bin/menuwebsurf index cb32299..9e1a7a9 100755 --- a/dotfiles/.local/bin/menuwebsurf +++ b/dotfiles/.local/bin/menuwebsurf @@ -6,19 +6,24 @@ . ~/.config/bemenurc searchurl="https://srx.yaroslavps.com/search?q=" -histf="$HOME/.config/vimb/history" # Have to use this "hack" because bemenu doesn't know how to paste if [ "$1" = "paste" ]; then prompt="$(wl-paste)" else - prompt="$(cat "$histf")" + qmarks="$HOME/.config/qutebrowser/quickmarks" + hist="$HOME/.local/share/qutebrowser/history.sqlite" + prompt="$(sqlite3 -separator ' ' "$hist" \ + 'select title, url from CompletionHistory' | + cat "$qmarks" -)" fi -choice=$(printf "%s" "$prompt" | bemenu -i -l 25 -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") || exit 1 +choice=$(printf "%s" "$prompt" | + bemenu -i -l 25 -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") || exit 1 if echo "$choice" | egrep ".*://.*" >/dev/null 2>&1; then - choice="$(echo "$choice" | cut -f 1)" + choice="$(echo "$choice" | sed -E 's/[^ ]+ +//g' | + grep -E "https?:" || echo "$choice")" mimeo "$choice" else $BROWSER "$choice" diff --git a/dotfiles/.local/share/applications/neomutt.desktop b/dotfiles/.local/share/applications/neomutt.desktop new file mode 100644 index 0000000..326ccfc --- /dev/null +++ b/dotfiles/.local/share/applications/neomutt.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=neomutt +GenericName=Email Client +Exec=neomutt %u +Terminal=true +MimeType=x-scheme-handler/mailto diff --git a/dotfiles/.profile b/dotfiles/.profile index 4db0bac..7d6f809 100644 --- a/dotfiles/.profile +++ b/dotfiles/.profile @@ -17,7 +17,7 @@ export LANG=en_US.UTF-8 export TERMINAL=foot export EDITOR="nvim" export PAGER="less -R -j.5" -export BROWSER=vimb +export BROWSER=qutebrowser # Sanely export XDG Base dir variables eval "$(sed 's/^[^#].*/export &/g;t;d' ~/.config/user-dirs.dirs)" -- cgit v1.2.3 From 4213b8745e62801b9926c699edf7ad3ffd94f0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 7 Oct 2021 14:40:43 +0300 Subject: menuworkspace script --- dotfiles/.config/sway/config | 1 + dotfiles/.config/zsh/shortcuts | 6 +++--- dotfiles/.local/bin/menuworkspace | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 dotfiles/.local/bin/menuworkspace (limited to 'dotfiles') diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index f54e4f3..f440c0b 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -193,6 +193,7 @@ bindsym --to-code { $mod+Shift+apostrophe exec "menupass -l" $mod+Ctrl+apostrophe exec "menupass -f" $mod+Ctrl+Shift+apostrophe exec "menupass -s" + $mod+backslash exec "menuworkspace" # Network management $mod+Shift+c exec togglevpn diff --git a/dotfiles/.config/zsh/shortcuts b/dotfiles/.config/zsh/shortcuts index aa34603..199faee 100644 --- a/dotfiles/.config/zsh/shortcuts +++ b/dotfiles/.config/zsh/shortcuts @@ -29,9 +29,9 @@ alias spw="setsid $TERMINAL >/dev/null 2>&1 &" alias testinet="ping -c2 example.com" # Fuzzy finder -alias fzd='cd "$(find . -type d | fzf || echo ".")"' -alias fzv='nvim "$(find . -type f | fzf)"' -alias fzo='op "$(find . -type f | fzf)"' +alias fzd='cd "$(find . -type d -path "*/\.*" -prune -o -not -name ".*" -type d | fzf || echo ".")"' +alias fzv='nvim "$(find . -type d -path "*/\.*" -prune -o -not -name ".*" -type f | fzf)"' +alias fzo='op "$(find . -type d -path "*/\.*" -prune -o -not -name ".*" -type f | fzf)"' # Function for changing working dir after exiting lf lfcd () { diff --git a/dotfiles/.local/bin/menuworkspace b/dotfiles/.local/bin/menuworkspace new file mode 100755 index 0000000..7d947d0 --- /dev/null +++ b/dotfiles/.local/bin/menuworkspace @@ -0,0 +1,12 @@ +#!/bin/sh + +# Open a "workspace" (see workspace) from a list of dirs under home + +# Source settings from .bemenurc +. ~/.config/bemenurc + +# All dirs under home, except ones under hidden dirs +dirs="$(find $HOME -type d -path "*/\.*" -prune -o -not -name ".*" -type d)" + +workspace "$(echo "$dirs" | + bemenu -i -l 25 -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" -- cgit v1.2.3