dots: migrate to river & minor changes

This commit is contained in:
Dmitry Zakharchenko 2023-05-11 17:43:31 +03:00
parent d7b0dc74c1
commit b83ba634e6
29 changed files with 265 additions and 85 deletions

View File

@ -1,45 +0,0 @@
set document.colors.background = "1a1a1a"
set document.colors.image = "99cc99"
set document.colors.link = "6699cc"
set document.colors.link_number = "cc99cc"
set document.colors.text = "f2f0ec"
set document.colors.ensure_contrast = 0
set document.colors.use_document_colors = 0
set document.colors.use_link_number_color = 1
set document.history.global.enable = 0
set document.browse.links.active_link.colors.background = "1a1a1a"
set document.browse.links.active_link.colors.text = "ffcc66"
set document.browse.links.active_link.enable_color = 0
set document.browse.links.active_link.invert = 0
set document.browse.scrolling.vertical_step = 1
set terminal.foot.block_cursor = 1
set terminal.foot.colors = 3
set ui.leds.enable = 0
set ui.show_status_bar = 0
set ui.show_title_bar = 0
set ui.colors.color.title.title-text.text = "f2f0ec"
set ui.colors.color.title.title-bar.background = "262626"
bind "main" "j" = "scroll-down"
bind "main" "k" = "scroll-up"
bind "main" "h" = "history-move-back"
bind "main" "l" = "history-move-forward"
bind "main" "g" = "move-document-start"
bind "main" "G" = "move-document-end"
bind "main" "f" = "toggle-numbered-links"
bind "main" "q" = "really-quit"
set mime.handler.image_viewer.unix.ask = 0
set mime.handler.image_viewer.unix.block = 0
set mime.handler.image_viewer.unix.program = "linkhandler %u"
set mime.type.image.jpg = "image_viewer"
set mime.type.image.jpeg = "image_viewer"
set mime.type.image.png = "image_viewer"
set mime.type.image.gif = "image_viewer"
set mime.type.image.bmp = "image_viewer"

View File

@ -15,7 +15,7 @@ regular0=1a1a1a # black
regular1=f2777a # red
regular2=99cc99 # green
regular3=ffcc66 # yellow
regular4=6699cc # blue
regular4=538cc6 # blue
regular5=cc99cc # magenta
regular6=66cccc # cyan
regular7=d3d0c8 # white

View File

@ -4,8 +4,7 @@
cm = commit
co = checkout
df = diff
lc = log -1 HEAD --stat
ll = log --oneline
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
pf = push -f
sc = pull --rebase upstream master
st = status -sb
@ -14,6 +13,8 @@
name = Dmitry Zakharchenko
email = dmitz@disroot.org
username = dmitz
[core]
editor = nvim
[push]
autoSetupRemote = true
[sendemail]

View File

@ -11,3 +11,5 @@ l seek 5
x add sub-delay +1
z add sub-delay -1
tab script-message osc-chapterlist 2 ; show-text "${osd-ass-cc/0}{\\an9}${osd-ass-cc/1}${chapter}"
WHEEL_UP ignore
WHEEL_DOWN ignore

View File

@ -1,6 +1,6 @@
alang=eng
audio-file-auto=all
hwdec=auto-safe
hwdec=auto
slang=eng
sub-ass-override=no
sub-auto=all

View File

@ -42,4 +42,6 @@ song_window_title_format = "Now playing: {%a > }{%t}|{%f}"
search_engine_display_mode = "columns" (classic/columns)
follow_now_playing_lyrics = "yes"
user_interface = "alternative" (classic/alternative)
execute_on_song_change="pkill -RTMIN+11 someblocks"
vim:ft=config

View File

@ -20,12 +20,10 @@ https://youtube.com/feeds/videos.xml?channel_id=UCjFaPUcJU1vwk193mnW_w1w "(ytb)"
https://youtube.com/feeds/videos.xml?channel_id=UCLx053rWZxCiYWsBETgdKrQ "(ytb)"
"HL" "(---)"
https://youtube.com/feeds/videos.xml?channel_id=UCjulQNQQJmpYzI-BD1-s03w "(ytb)"
https://youtube.com/feeds/videos.xml?channel_id=UCpi0JLkVK0RrAHkfpB3B2Aw "(ytb)"
https://youtube.com/feeds/videos.xml?channel_id=UC2WNW0NZVyMeEPvtLmScgvQ "(ytb)"
https://youtube.com/feeds/videos.xml?channel_id=UCiUkcNS6W0n8QdosuZASduQ "(ytb)"
"TCH" "(---)"
https://twitchrss.appspot.com/vod/uebermarginal "(tch)" "~uebermarginal"
https://twitchrss.appspot.com/vod/lastmiles "(tch)" "~lastmiles"
@ -91,6 +89,7 @@ https://rss.nixnet.services/?action=display&bridge=Bandcamp&context=By+band&band
"DEV" "(---)"
https://repology.org/maintainer/dmitz%40disroot.org/feed-for-repo/alpine_edge/atom "(www)"
https://github.com/kolunmi/sandbar/commits/main.atom "(ghb)"
https://github.com/djpohly/dwl/commits/main.atom "(ghb)"
https://git.sr.ht/~raphi/somebar/log/master/rss.xml "(srt)"
https://github.com/riverwm/river/commits/master.atom "(ghb)"

View File

@ -231,6 +231,12 @@ call <sid>hi("SpellRare", "", s:cterm00, "underline", "")
" Java highlighting
call <sid>hi("javaOperator", s:cterm0D, "", "", "")
" Telescope highlighting
call <sid>hi("TelescopeMatching", s:cterm07, "", "", "")
call <sid>hi("TelescopePreviewLine", s:cterm0A, "", "bold", "")
call <sid>hi("TelescopePromptPrefix", "", "", "none", "")
call <sid>hi("TelescopeSelection", s:cterm07, "", "bold", "")
" Remove functions
delf <sid>hi

View File

@ -2,12 +2,14 @@ require 'paq' {
'hrsh7th/cmp-buffer';
'hrsh7th/cmp-nvim-lsp';
'hrsh7th/nvim-cmp';
'windwp/nvim-autopairs';
'neovim/nvim-lspconfig';
'nvim-lua/plenary.nvim';
'nvim-telescope/telescope.nvim'
}
require('sets')
require('maps')
require('lsp')
require('tlp')
vim.cmd('colorscheme eighties')

View File

@ -1,8 +1,8 @@
local map = vim.keymap.set
local opts = { noremap=true, silent=true }
local builtin = require('telescope.builtin')
vim.g.mapleader = ' '
vim.g.fzf_action = { enter = 'tab split', ['ctrl-t'] = 'vsplit' }
map('n', '<C-h>', '<C-w>h')
map('n', '<C-j>', '<C-w>j')
@ -19,7 +19,9 @@ map('n', '<C-o>', ':bprevious<CR>')
map('n', '<C-p>', ':bnext<CR>')
map('n', '<C-x>', ':bdelete<CR>')
map('n', '<leader>f', builtin.find_files, {})
map('n', '<leader>d', builtin.buffers, {})
map('n', '<leader>g', builtin.live_grep, {})
map('', '<leader>c', ':w! | !compiler "<c-r>%"<CR>')
map('', '<leader>f', ':FZF<CR>')
map('', '<leader>p', ':!opout <c-r>%<CR><CR>')
map('', '<leader>se', ':setlocal spell! spelllang=en_us<CR>')

View File

@ -29,7 +29,6 @@ o.undofile = true
wo.wrap = false
g.fzf_layout = { down = '30%' }
g.is_posix = 1
au({ 'BufWritePre' }, { pattern = { '*' }, command = [[%s/\n\+\%$//e]] })

46
.config/nvim/lua/tlp.lua Normal file
View File

@ -0,0 +1,46 @@
local actions = require('telescope.actions')
require('telescope').setup {
defaults = {
mappings = {
n = {
["Z"] = actions.select_vertical,
["X"] = actions.select_horizontal,
["C"] = actions.select_tab
},
},
},
pickers = {
buffers = {
ignore_current_buffer = true,
initial_mode = "normal",
previewer = false,
sort_lastused = true,
theme = "ivy",
mappings = {
n = {
["<c-x>"] = actions.delete_buffer,
},
},
layout_config = {
height = 10,
},
},
find_files = {
hidden = false,
initial_mode = "normal",
layout_strategies = "vertical",
theme = "ivy",
layout_config = {
height = 15,
},
},
live_grep = {
no_ignore = true,
theme = "ivy",
layout_config = {
height = 15,
},
},
},
}

View File

@ -101,7 +101,7 @@ our $CONFIG = {
video_players => {
mpv => {
arg => "--really-quiet --force-media-title=*TITLE* *URL*",
cmd => "mpv",
cmd => "setsid -f mpv",
fs => "--fullscreen",
novideo => "--no-video",
srt => "--sub-file=*SUB*",

View File

@ -1,4 +1,4 @@
c.url.searchengines = {'DEFAULT': 'https://search.femboy.hu/search.php?q={}',
c.url.searchengines = {'DEFAULT': 'https://librex.baczek.me/search.php?q={}',
'y': 'https://tube.cadence.moe/search?q={}',
'gh': 'https://github.com/search?q={}',
'md': 'https://reelgood.com/search?q={}',
@ -17,6 +17,7 @@ c.downloads.remove_finished = 500
c.tabs.background = True
c.url.start_pages = ['about:blank']
c.url.default_page = 'about:blank'
c.qt.args=["enable-accelerated-video-decode", "enable-gpu-rasterization", "ignore-gpu-blocklist"]
c.colors.completion.odd.bg = "#1a1a1a"
c.colors.completion.even.bg = "#1a1a1a"

View File

@ -1,7 +1,7 @@
t web.telegram.org
s steamcommunity.com
m miped.ru/f
y yewtu.be
y invidious.lunar.icu
gh github.com
ap gitlab.alpinelinux.org/alpine/aports
cs teachyourselfcs.com

145
.config/river/init Executable file
View File

@ -0,0 +1,145 @@
#!/bin/sh
# Background and border color
riverctl background-color 0x1a1a1a
riverctl border-color-focused 0x005577
riverctl border-color-unfocused 0x262626
# General binds
riverctl map normal Super Return spawn foot
riverctl map normal Alt 1 spawn "wlfreerdp $XDG_DATA_HOME/rdp/aws.rdp /dynamic-resolution"
riverctl map normal Super A send-layout-cmd rivertile "padding toggle"
riverctl map normal Super B spawn "echo 'all toggle-visibility' > $XDG_RUNTIME_DIR/sandbar-0"
riverctl map normal Super C spawn "foot pipe-viewer"
riverctl map normal Super D spawn passmenu
riverctl map normal Super E spawn "foot aerc"
riverctl map normal Super F toggle-fullscreen
riverctl map normal Super F2 spawn "wlopm --toggle '*'"
riverctl map normal Super M spawn "foot -T float ncmpcpp"
riverctl map normal Super N spawn "foot newsboat"
riverctl map normal Super Q close
riverctl map normal Super R spawn "foot vifm"
riverctl map normal Super T spawn "torwrap open"
riverctl map normal Super W spawn qutebrowser
riverctl map normal Super+Shift B spawn bluetooth
riverctl map normal Super+Shift BackSpace spawn "sysact reb"
riverctl map normal Super+Shift F toggle-float
riverctl map normal Super+Shift M spawn "foot -T float pulsemixer"
riverctl map normal Super+Shift Q spawn "sysact rest"
riverctl map normal Super+Shift R spawn "foot btm"
riverctl map normal Super+Shift T spawn "torwrap toggle"
riverctl map normal Super+Shift W spawn "qutebrowser --temp-basedir -s content.private_browsing true"
riverctl map normal Super+Shift X spawn "sysact shut"
# Volume and MPD
for mode in normal locked
do
riverctl map $mode None XF86AudioMute spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; kill -45 $(pidof someblocks)"
riverctl map $mode Super BackSpace spawn "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; kill -45 $(pidof someblocks)"
riverctl map -repeat $mode None XF86AudioLowerVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; kill -45 $(pidof someblocks)"
riverctl map -repeat $mode None XF86AudioRaiseVolume spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+; kill -45 $(pidof someblocks)"
riverctl map -repeat $mode Super Equal spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+; kill -45 $(pidof someblocks)"
riverctl map -repeat $mode Super Minus spawn "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-; kill -45 $(pidof someblocks)"
riverctl map $mode Super Comma spawn "mpc prev"
riverctl map $mode Super P spawn "mpc toggle"
riverctl map $mode Super Period spawn "mpc next"
riverctl map $mode Super+Shift Comma spawn "mpc seek 0%"
riverctl map $mode Super+Shift Period spawn "mpc repeat"
done
# Screenshots
riverctl map normal None Print spawn "grim pic-full-$(date '+%y%m%d-%H%M-%S').png"
riverctl map normal Shift Print spawn "grimpick"
# Nodes/tags manipulation
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
riverctl map normal Super $i set-focused-tags $tags
riverctl map normal Super+Shift $i set-view-tags $tags
done
riverctl map normal Control+Alt H snap left
riverctl map normal Control+Alt J snap down
riverctl map normal Control+Alt K snap up
riverctl map normal Control+Alt L snap right
riverctl map normal Super J focus-view next
riverctl map normal Super K focus-view previous
riverctl map normal Super Space zoom
riverctl map normal Super Tab focus-previous-tags
riverctl map normal Super BackSlash focus-previous-tags
riverctl map normal Super+Shift J swap next
riverctl map normal Super+Shift K swap previous
# Scratchpad and sticky
all_tags=$(((1 << 32) - 1))
scratch_tag=$((1 << 20 ))
all_but_scratch_tag=$(( $all_tags ^ $scratch_tag ))
riverctl map normal Super Z set-view-tags $scratch_tag
riverctl map normal Super X toggle-focused-tags $scratch_tag
riverctl spawn-tagmask $all_but_scratch_tag
# Sticky
sticky_tag=$((1 << 31))
all_but_sticky_tag=$(( $all_tags ^ $sticky_tag ))
riverctl map normal Super S toggle-view-tags $sticky_tag
riverctl spawn-tagmask $all_but_sticky_tag
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
riverctl map normal Super $i set-focused-tags $(($sticky_tag + $tags))
done
# Resizing
riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05"
riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05"
riverctl map normal Alt Right resize horizontal 100
riverctl map normal Alt Left resize horizontal -100
riverctl map normal Alt Up resize vertical 100
riverctl map normal Alt Down resize vertical -100
# Layout orientation
riverctl map normal Super Up send-layout-cmd rivertile "main-location top"
riverctl map normal Super Right send-layout-cmd rivertile "main-location right"
riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom"
riverctl map normal Super Left send-layout-cmd rivertile "main-location left"
# Input
pad=$(riverctl list-inputs | grep -i touchpad)
riverctl input $pad accel-profile adaptive
riverctl input $pad disable-while-typing enabled
riverctl input $pad disabled-on-external-mouse enabled
riverctl input $pad tap enabled
riverctl input $pad natural-scroll disabled
riverctl xcursor-theme Adwaita
riverctl focus-follows-cursor normal
riverctl hide-cursor timeout 5000
riverctl keyboard-layout -options "grp:ctrl_shift_toggle,altwin:menu_win" "us,ua"
riverctl set-repeat 50 300
riverctl map-pointer normal Super BTN_LEFT move-view
riverctl map-pointer normal Super BTN_MIDDLE toggle-float
riverctl map-pointer normal Super BTN_RIGHT resize-view
# Rules
riverctl rule-add float -title "float"
# Autostart
autostart="pipewire mpd mako"
for program in $autostart; do
pidof -sx "$program" || riverctl spawn "$program" &
done
riverctl spawn "startbar"
riverctl spawn "gpg-agent --daemon"
riverctl declare-mode normal
riverctl default-layout rivertile
riverctl attach-mode bottom
rivertile -view-padding 4 -outer-padding 4 &

View File

@ -2,7 +2,6 @@
alias f="$FILE" \
v="$EDITOR" \
z="zathura" \
cp="cp -i" \
mv="mv -i" \
rm="rm -i" \
@ -26,8 +25,13 @@ cfz="$EDITOR $XDG_CONFIG_HOME/zsh/.zshrc" \
cfp="$EDITOR $XDG_CONFIG_HOME/zsh/.zprofile" \
cfq="$EDITOR $XDG_CONFIG_HOME/qutebrowser/config.py" \
cfu="$EDITOR $XDG_CONFIG_HOME/newsboat/urls" \
cfv="$EDITOR $XDG_CONFIG_HOME/nvim/init.lua"
cfv="$EDITOR $XDG_CONFIG_HOME/nvim/init.lua" \
hist="$EDITOR $XDG_CACHE_HOME/history"
for command in apk rc rc-service rc-update mount umount poweroff reboot ; do
for program in zathura mpv imv; do
alias $program="setsid -f $program"
done; unset program
for command in apk wg-quick rc-service rc-update mount umount poweroff reboot ; do
alias $command="doas $command"
done; unset command

View File

@ -15,6 +15,6 @@ prompt-text = ">"
result-spacing = 20
selection-background = #005577
selection-color = #f2f0ec
selection-background-padding = 8
selection-background-padding = 10
text-color = #bbbbbb
width = 100%

View File

@ -1,17 +1,19 @@
set vicmd=$EDITOR
set syscalls
colorscheme eighties
set ignorecase
set incsearch
set nofollowlinks
set nohlsearch
set scrolloff=4
set smartcase
set sortnumbers
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
set syscalls
set statusline=" %t%= %A %10u:%-7g %20d "
set timefmt='%Y/%m/%d %H:%M'
set undolevels=100
set vicmd=$EDITOR
set wildmenu
set wildstyle=popup
set scrolloff=4
set ignorecase
set smartcase
set nohlsearch
set incsearch
set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
colorscheme eighties
map R :restart<CR>
map E :!$EDITOR %f<CR>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -22,10 +22,11 @@ export FILE="vifm"
export READER="zathura"
export TERMINAL="foot"
export ELINKS_CONFDIR="$XDG_CONFIG_HOME"/elinks
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
export GOPATH="$XDG_DOCUMENTS_DIR/code/go"
export GOTELEMETRY=off
export GOTOOLCHAIN=local
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0"
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
export LESS=-R
@ -40,4 +41,4 @@ export LESS_TERMCAP_us="$(printf '%b' '')"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s dwl >/dev/null 2>&1 && dbus-run-session -- dwl -s somebar
[ "$(tty)" = "/dev/tty1" ] && ! pidof -s river >/dev/null 2>&1 && dbus-run-session river

View File

@ -3,20 +3,18 @@
feed="${1:-$(printf "%s" | tofi --prompt-text 'Paste URL or file path')}"
case "$feed" in
*mkv|*webm|*mp4|*watch?v*|*youtu.be*|*yewtu.be*|*videos.lukesmith.xyz*|*spacepub.space*|*twitch.tv*)
*mkv|*webm|*mp4|*watch?v*|*youtu.be*|*music.youtube.com*|*invidious.lunar.icu*|*videos.lukesmith.xyz*|*spacepub.space*|*twitch.tv*)
case "$(printf "yt-dlp\\nyt-dlp (audio)\\nyt-dlp (music)\\nmpv\\nmpv (audio)" | tofi --prompt-text "Handle media with?")" in
"yt-dlp") qndl "$feed" >/dev/null 2>&1 ;;
"yt-dlp (audio)") qndl -a "$feed" >/dev/null 2>&1 ;;
"yt-dlp (music)") qndl -m "$feed" >/dev/null 2>&1 ;;
"mpv") setsid -f "$TERMINAL" -e mpv --quiet "$feed" >/dev/null 2>&1 ;;
"mpv") setsid -f mpv --quiet "$feed" >/dev/null 2>&1 ;;
"mpv (audio)") setsid -f "$TERMINAL" -e mpv --quiet --no-video "$feed" >/dev/null 2>&1 ;;
esac ;;
*png|*jpg|*jpe|*jpeg|*gif)
curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && setsid -f imv "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;;
*pdf|*cbz|*cbr)
curl -sL "$feed" > "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" && setsid -f zathura "/tmp/$(echo "$feed" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 ;;
*go.dev*|*lukesmith.xyz*|*drewdevault.com*)
setsid -f "$TERMINAL" -e elinks "$feed" >/dev/null 2>&1 ;;
*ogg|*mp3|*wav)
qndl -a "$feed" >/dev/null 2>&1 ;;
magnet*)

View File

@ -6,7 +6,7 @@ case $1 in
reb)
prompt "Reboot computer?" "doas reboot" ;;
rest)
prompt "Leave dwl?" "kill -TERM $(pgrep -u $USER "\bdwl$")" ;;
prompt "Leave WM?" "riverctl exit" ;;
lock)
mpc pause; waylock -init-color 0x000000 -input-color 0x005577
esac

View File

@ -3,5 +3,5 @@
for battery in /sys/class/power_supply/BAT?
do
capacity=$(cat "$battery"/capacity 2>/dev/null) || break
printf "%s%%" "$capacity"
printf "bat: %s%%" "$capacity"
done

4
.local/bin/statusbar/cpu Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
temp=$(cat /sys/class/thermal/thermal_zone0/temp | awk '{print $1 / 1000}') || break
printf "cpu: %d°" "$temp"

View File

@ -1,5 +1,9 @@
#!/bin/sh
mpc -f %title% | sed "/^volume:/d;s/\\&/&amp;/g;s/\\[paused\\].*/[P]/g;/\\[playing\\].*/d;/^ERROR/Q" | paste -sd ' ';
state=$(mpc -f %title% | awk 'NR==2 {print $1}')
[ -z "$state" ] && state="[stopped]"
printf "mus: %s" "${state:1:-1}"
pidof -x mpdup >/dev/null 2>&1 || mpdup >/dev/null 2>&1 &

View File

@ -4,5 +4,6 @@ wp="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
vol="$(echo $wp | awk '{print $2 * 100}')"
ismuted="$(echo "$wp" | awk '{print $3}')"
[ -n "$ismuted" ] && echo Muted && exit
printf "%s%%" "$vol"
[ -n "$ismuted" ] && echo muted && exit
printf "vol: %s%%" "$vol"

View File

@ -1,4 +1,4 @@
pinentry-program /usr/bin/pinentry-qt
default-cache-ttl 5000
max-cache-ttl 7200
default-cache-ttl 60000
max-cache-ttl 60000
enable-ssh-support

View File

@ -1 +1,7 @@
Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye"
Host juno
HostName 18.159.216.33
User admin
RequestTTY yes
RemoteCommand screen -d -RR