Compare commits

...

26 Commits

Author SHA1 Message Date
a4a1f44e4e scanner: add wrapper script 2025-06-20 15:20:55 +02:00
93f5122723 a5ona4: fix and simplify script to work with newer pdflatex versions 2025-06-15 11:36:03 +02:00
951eebe79b dunst: update to new syntax 2024-12-09 18:17:40 +01:00
5bf85682ed nvim: fix vimtex not being able to start autocompiler due to airlatex 2024-10-25 14:52:24 +02:00
75e7744f01 startmpv: support rumble by first starting yt-dlp separately 2024-10-10 11:33:27 +02:00
56e4a5ebfb picom: fix unfocussed images being darker 2024-10-07 15:03:06 +02:00
76e72f4d46 mpv: printout marked files using the "M" key similar to sxiv 2024-09-20 10:31:32 +02:00
a73c95b3a6 papis: fix ref for jinja2 after PR has been merged 2024-09-19 11:42:06 +02:00
562a454d63 papis: fix author key read-in for now 2024-09-18 13:36:53 +02:00
1dcd003a8d papis: refs are <AuthorLastName><Year><Title15chars> 2024-09-18 12:34:47 +02:00
52af3677cf statusbar: fix vpnstatus not showing inside of ETH network (non-vpn) 2024-09-17 10:45:24 +02:00
c12e14fb65 nvim: no inlay hints for variables in python 2024-09-16 10:56:42 +02:00
7d07cb92de nvim: add coc-settings.json 2024-09-16 10:53:19 +02:00
4188c07932 statusbar: fix vpnstatus never showing 2024-09-09 15:17:43 +02:00
585f192551 papis: file-formatted to <year>-<first_author>-<title> 2024-08-25 14:50:41 +02:00
809a7210e0 mpd: persist queue between restarts using state file 2024-08-25 13:05:46 +02:00
162bce097d zathura: yank filename using "y" 2024-08-18 21:13:58 +02:00
ab72387a96 mbsync: move away from deprecated SSLType 2024-08-16 09:45:18 +02:00
69212cf836 mpv: yanking of title possible 2024-06-05 16:44:17 +02:00
5c345b8a8c mpv: custom yanker no new line 2024-06-04 21:28:01 +02:00
a2eaec5dba mpv: add full path to options 2024-06-04 21:11:12 +02:00
e104755b24 mpv: custom name and dir yanker 2024-06-04 20:54:33 +02:00
944a2bb4e8 dunst: remove icon 2024-05-29 10:33:45 +02:00
15a6065ec0 nvim: push latest state 2024-05-22 20:25:03 +02:00
f074a1c74e qutebrowser: open window on same location using <Alt-Return> like st, ranger, zathura, and mpv 2024-05-14 21:28:52 +02:00
4f8a4671d2 rifle: also open audio with mpv (wtf) 2024-05-01 07:39:28 +02:00
17 changed files with 310 additions and 38 deletions

View File

@ -27,13 +27,13 @@
width = 300
# The maximum height of a single notification, excluding the frame.
height = 300
height = (0, 300)
# Position the notification in the top right corner
origin = top-right
# Offset from the origin
offset = 0x26
offset = (0, 26)
# Scale factor. It is auto-detected if value is 0.
scale = 0
@ -206,7 +206,7 @@
# icon_theme = "Adwaita, breeze"
# Align icons left/right/top/off
icon_position = left
icon_position = off
# Scale small icons up to this size, set to 0 to disable. Helpful
# for e.g. small files or high-dpi screens. In case of conflict,

124
.config/mbsync/config Normal file
View File

@ -0,0 +1,124 @@
IMAPStore alexander@bocken.org-remote
Host mail.bocken.org
Port 993
User alexander
PassCmd "pass alexander@bocken.org"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore alexander@bocken.org-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/alexander@bocken.org/
Inbox /home/alex/.local/share/mail/alexander@bocken.org/INBOX
Channel alexander@bocken.org
Expunge Both
Far :alexander@bocken.org-remote:
Near :alexander@bocken.org-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
IMAPStore abocken@ethz.ch-remote
Host outlook.office365.com
Port 993
User abocken@ethz.ch
PassCmd "mutt_oauth2.py ~/.local/share/mail/eth.token"
AuthMechs XOAUTH2
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore abocken@ethz.ch-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/abocken@ethz.ch/
Inbox /home/alex/.local/share/mail/abocken@ethz.ch/INBOX
Channel abocken@ethz.ch
Expunge Both
Far :abocken@ethz.ch-remote:
Near :abocken@ethz.ch-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
#IMAPStore abocken@ethz.ch-remote
#Host mail.ethz.ch
#Port 993
#User abocken
#PassCmd "pass 'ETH/nETHz - abocken@ethz.ch'"
#AuthMechs LOGIN
#TLSType IMAPS
#CertificateFile /etc/ssl/certs/ca-certificates.crt
#
#MaildirStore abocken@ethz.ch-local
#Subfolders Verbatim
#Path /home/alex/.local/share/mail/abocken@ethz.ch/
#Inbox /home/alex/.local/share/mail/abocken@ethz.ch/INBOX
#
#Channel abocken@ethz.ch
#Expunge Both
#Far :abocken@ethz.ch-remote:
#Near :abocken@ethz.ch-local:
#Patterns * !"[Gmail]/All Mail"
#Create Both
#SyncState *
#MaxMessages 0
#ExpireUnread no
IMAPStore alexander@aaathats3as.com-remote
Host mail.cock.li
Port 993
User alexander@aaathats3as.com
PassCmd "pass eMail/aaathats3as.com"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore alexander@aaathats3as.com-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/alexander@aaathats3as.com/
Inbox /home/alex/.local/share/mail/alexander@aaathats3as.com/INBOX
Channel alexander@aaathats3as.com
Expunge Both
Far :alexander@aaathats3as.com-remote:
Near :alexander@aaathats3as.com-local:
Patterns * !"[Gmail]/All Mail"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile
IMAPStore account@bocken.org-remote
Host mail.bocken.org
Port 993
User account
PassCmd "pass account@bocken.org"
AuthMechs LOGIN
TLSType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
MaildirStore account@bocken.org-local
Subfolders Verbatim
Path /home/alex/.local/share/mail/account@bocken.org/
Inbox /home/alex/.local/share/mail/account@bocken.org/INBOX
Channel account@bocken.org
Expunge Both
Far :account@bocken.org-remote:
Near :account@bocken.org-local:
Patterns * !"[Gmail]/All Mail" !"*fts-flatcurve*" !"*virtual*"
Create Both
SyncState *
MaxMessages 0
ExpireUnread no
# End profile

View File

@ -1,5 +1,6 @@
music_directory "~/msc"
playlist_directory "~/.config/mpd/playlists"
state_file "~/.local/share/mpd/state"
auto_update "yes"
bind_to_address "127.0.0.1"

View File

@ -0,0 +1,80 @@
-- Define the time window for keypresses
local time_window = 2 -- seconds
-- Variables to keep track of 'y' keypress and the timer
local y_pressed = false
local y_timer = nil
-- Function to reset the 'y' keypress state
local function reset_y()
y_pressed = false
if y_timer then
mp.cancel_timer(y_timer)
y_timer = nil
end
end
-- Function to handle 'y' keypress
local function handle_yanker()
reset_y()
y_pressed = true
-- Start a timer to reset the state after 2 seconds
y_timer = mp.add_timeout(time_window, reset_y)
end
-- Function to handle 'n' keypress
-- Copy the filename to clipboard
local function handle_filename()
if y_pressed then
local filename = mp.get_property("filename")
-- Use a method to copy 'filename' to clipboard (platform-specific)
-- For example, on Unix-like systems, you might use 'xclip'
os.execute("printf %s" .. filename .. " | xclip -selection clipboard")
mp.osd_message("Copied filename " .. filename .. " to clipboard", 3)
reset_y() -- Reset the 'y' keypress state
end
end
-- Bind the keys to their respective functions
-- Function to handle 'd' keypress
-- Copy the directory to clipboard
local function handle_dir()
if y_pressed then
local filepath = mp.get_property("path")
local directory = string.match(filepath, "(.*/)")
os.execute("printf %s" .. directory .. " | xclip -selection clipboard")
mp.osd_message("Copied directory " .. directory .. " to clipboard", 3)
reset_y()
end
end
-- Function to handle 'p' keypress
local function handle_path()
if y_pressed then
local full_path = mp.get_property("path")
os.execute("printf %s " .. full_path .. " | xclip -selection clipboard")
mp.osd_message("Copied full path " .. full_path .. " to clipboard", 3)
reset_y()
end
end
-- Function to copy the title to clipboard
local function handle_title()
if y_pressed then
local title = mp.get_property("media-title")
if title and title ~= mp.get_property("filename") then
os.execute("printf %s" .. title .. " | xclip -selection clipboard")
mp.osd_message("Copied title " .. title .. " to clipboard", 3)
else
handle_filename() -- Call the function to copy the filename
end
reset_y()
end
end
mp.add_key_binding("y", "check_y", handle_yanker)
mp.add_key_binding("n", "check_n", handle_filename)
mp.add_key_binding("p", "check_p", handle_path)
mp.add_key_binding("d", "check_d", handle_dir)
mp.add_key_binding("t", "check_t", handle_title)

View File

@ -0,0 +1,30 @@
-- mpv script to mark videos
local utils = require 'mp.utils'
local marked_videos = {}
local marked_file = "marked"
function toggle_mark()
local path = mp.get_property("path")
if marked_videos[path] then
marked_videos[path] = nil
mp.osd_message("Unmarked: " .. path)
else
marked_videos[path] = true
mp.osd_message("Marked: " .. path)
end
end
function save_marks()
-- Do not write anything if "marked_videos" is empty
if next(marked_videos) == nil then
return
end
local file = io.open(marked_file, "a")
for path, _ in pairs(marked_videos) do
file:write(path .. "\n")
end
file:close()
end
mp.add_key_binding("M", "toggle_mark", toggle_mark)
mp.register_event("shutdown", save_marks)

View File

@ -1,5 +1,6 @@
{
"suggest.enablePreselect": false,
"suggest.noselect": true,
"svelte.enable-ts-plugin": true
"svelte.enable-ts-plugin": true,
"pyright.inlayHints.variableTypes": false
}

View File

@ -1,4 +1,5 @@
let mapleader =","
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..."
@ -7,6 +8,8 @@ if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autolo
autocmd VimEnter * PlugInstall
endif
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
@ -28,9 +31,11 @@ Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'github/copilot.vim',
Plug 'dmadisetti/AirLatex.vim', {'branch': 'main'}
Plug 'nathangrigg/vim-beancount'
call plug#end()
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
set title
set bg=light
set go=a
@ -71,7 +76,7 @@ colorscheme nord
""" Autocompile RMarkdown on save if flag is set in file
" Define a function to check for the autocompile flag and compile if present
function! CompileRMarkdown()
let autocompile = search('<\!--\s\+vim:\s\+set\s\+autocompile=true:\s\+-->', 'nW') != 0
let autocompile = search('<\!--\s\+vim:\s\+set\s\+autocompile=true\s\+-->', 'nW') != 0
if autocompile
silent !Rscript -e 'rmarkdown::render("%")'
redraw!
@ -123,7 +128,7 @@ let g:jukit_convert_open_default = -1
let g:jukit_hist_use_ueberzug = 0
" - Set to 1 to use Überzug to display saved outputs instead of an ipython split window
let g:jukit_ueberzug_use_cached = 0
let g:jukit_ueberzug_use_cached = 1
" - Whether to cache created images of saved outputs. If set to 0, will convert saved outputs to png from scratch each time. Note that this will make displaying saved outputs significantly slower.
let g:jukit_ueberzug_pos = [0.25, 0.25, 0.4, 0.6]
" - position and dimension of Überzug window WITH output split present - [x, y, width, height]. Use `:call jukit#ueberzug#set_default_pos()` to modify/visualize.
@ -144,7 +149,7 @@ let g:jukit_ueberzug_jupyter_cmd = 'jupyter'
" - path to jupyter executable. By default it just uses the jupyter command found in your environment. If you started an output split in a virtual environment, make sure that you either have jupyter installed in that environment or set the absolute path to the python3 command.
let g:jukit_ueberzug_cutycapt_cmd = 'CutyCapt'
" - path to cutycapt executable
let g:jukit_ueberzug_imagemagick_cmd = 'convert'
let g:jukit_ueberzug_imagemagick_cmd = 'magick'
" - path to imagemagick (`convert` command) executable
" Nerd tree
@ -165,12 +170,6 @@ let R_start_libs = 'base,stats,graphics,grDevices,utils,methods'
let R_hl_term = 0
" let Rout_more_colors = 1
" AirLatex
" your login-name
" let g:AirLatexCookieDB="~/.mozilla/firefox/do0jepvp.default-release/cookies.sqlite"
let g:AirLatexCookie="cookies:overleaf2_session=s%3AtveT0u3Xn8VXTJmkUuSpO2p1o5SLGNYI.ARSAQd4K%2FO7L5ilui54Ht7voJWjD%2BxctQ1ngTRrlo6A"
" let g:AirLatexUsername="cookies:overleaf_session2=s%3AMANcnaAAj4VeIgXsNIiCINZ0QgwtYNzn.9x0PVRqOp8egbGYpnIHuffJUxmH%2F%2F2W%2FFnTBPmDny1M"
"This allows for change paste motion cp{motion}
nmap <silent> cp :set opfunc=ChangePaste<CR>g@
function! ChangePaste(type, ...)
@ -178,11 +177,6 @@ function! ChangePaste(type, ...)
silent exe "normal! p"
endfunction
" optional: set server name
let g:AirLatexDomain="www.overleaf.com"
let g:AirLatexAllowInsecure=0
" vimtex:
let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_latexmk = { 'build_dir' : '',

34
.config/papis/config Normal file
View File

@ -0,0 +1,34 @@
[papers]
dir = ~/dox/papers
extra-bibtex-keys = ["doc_url"]
use-git = True
formatter = jinja2
# Format folder & file in format <year>-<last_name_first_author>-<paper_title>
add-file-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
add-folder-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
ref-format = {{doc.author_list[0].family if doc.author_list else "AUTHOR MISSING"}}{{doc.year}}{{doc.title.title().translate(None, ' -')[:15]}}
# Defaults simply converted to jinja2
header-format = <ansired>{{doc.html_escape.title}}</ansired>\n <ansigreen>{{doc.html_escape.author}}</ansigreen>\n <ansiblue>({{doc.html_escape.year}})</ansiblue> [<ansiyellow>{{doc.html_escape.tags}}</ansiyellow>]
match-format = {{doc.tags}}{{doc.subfolder}}{{doc.title}}{{doc.author}}{{doc.year}}
document-description-format = {{doc.title}} - {{doc.author}}
multiple-authors-format = {{au.family}}, {{au.given}}
browse-query-format = {{doc.title}} {{doc.author}}
notes-name = notes.md
[books]
dir = ~/dox/books
add-file-name = {doc[author]}{doc[title]}
use-git = True
[settings]
opentool = rifle
default-library = papers
file-browser = ranger
[tui]
editmode = vi
options_list.selected_margin_style = bg:ansigreen fg:ansired
options_list.unselected_margin_style =

View File

@ -101,7 +101,7 @@ fade-out-step = 0.03;
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1
inactive-opacity = 0.8;
inactive-opacity = 1.0;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0

View File

@ -7,6 +7,7 @@ c.auto_save.session = False
c.backend = "webengine"
c.bindings.commands = { "normal":
{
"<Alt-Return>": "open -t {url}",
"u": "undo --window",
",C": "spawn -d st castyt {url}",
",S": "spawn -d mpvallvids {url}",
@ -28,9 +29,10 @@ c.content.blocking.method = "both"
c.content.desktop_capture = "ask"
c.content.fullscreen.window = False
#c.content.javascript.enabled = True
#c.content.javascript.enabled = True # make editable via autoconfig
c.content.local_content_can_access_remote_urls = True
c.content.notifications.presenter = "libnotify"
c.content.javascript.clipboard = "access-paste"
from os.path import expanduser
c.downloads.location.directory = expanduser("~")

View File

@ -130,7 +130,7 @@ ext midi?, terminal, has wildmidi = wildmidi -- "$@"
#-------------------------------------------
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video|audio, has mpv, X, flag f = mpv -- "$@"
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"

View File

@ -16,3 +16,4 @@ map g goto top
map <C-s> exec zathura_backward_search.sh
map <A-Return> exec "openfilebrowser $FILE"
map <C-h> exec "movepdf $FILE"
map y exec "copyfilepath $FILE"

2
.local/bin/scanner Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
QT_SCALE_FACTOR=1.6666666666666666 skanlite

View File

@ -1,5 +1,5 @@
#!/bin/bash
pgrep openconnect > /dev/null || if ping -c 1 -W 1 -q webprint.ethz.ch > /dev/null
if ping -c 1 -W 1 -q webprint.ethz.ch > /dev/null;
then
printf '🔬'
fi

View File

@ -4,21 +4,10 @@ for file in $@; do
INPUTPDF=/tmp/file.pdf
cp -f "$file" $INPUTPDF
printf '\\documentclass[a4paper,final]{article}
\\usepackage{pdfpages}
\\usepackage{ifpdf,ifxetex,everyshi}
\\makeatletter
\\ifpdf
\\EveryShipout{\\ifodd\\c@page\\else\\pdfpageattr{/Rotate 180}\\fi}%%
\\fi
\\ifxetex
\\EveryShipout{\\ifodd\\c@page\\special{pdf: put @thispage << /Rotate 180 >>}%%
\\fi
}
\\fi
\\makeatother
\\begin{document}
\\includepdf[pages=-, nup=1x2, booklet=true, landscape]{%s}
\\end{document}' "$INPUTPDF" > /tmp/tmp$$.tex
\\usepackage{pdfpages}
\\begin{document}
\\includepdf[pages=-, nup=2x1, booklet=true, landscape]{%s}
\\end{document}' "$INPUTPDF" > /tmp/tmp$$.tex
cd /tmp || exit
pdflatex /tmp/tmp$$.tex
only_filename="$(echo "$file" | awk -F/ '{print $NF}')"

3
.local/bin/tools/copyfilepath Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
printf %s "$*" | xclip -selection clipboard &&
notify-send "Copied to clipboard: $*"

View File

@ -14,6 +14,17 @@ if echo "$1" | grep -qE 'youtube.*list'; then
sed 's/^/https:\/\/www.youtube.com\/watch?v=/' |
xargs mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' ||
notify-send "startmpv" "An error has occured with playlist $playlist_id"
elif echo "$1" | grep -qE 'rumble.com'; then
notify-send "startmpv" "Rumble videos are not supported by mpv, first ripping, then playing..."
(
cd /tmp
yt-dlp "$1" &
# get the filename of the downloaded video
filename="$(yt-dlp -e "$1")"
sleep 5
mpv /tmp/$filename*part
rm /tmp/$filename*part
)
else
mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1"
fi