From 6f4cedc190879dc94d62536167cb9d559e939493 Mon Sep 17 00:00:00 2001 From: nojhan Date: Tue, 18 Nov 2025 08:34:47 +0100 Subject: [PATCH] whatever --- .bashrc | 41 ++- .config/dunst/dunstrc | 6 +- .config/i3/config | 8 +- {kak => .config/kak}/autoload/cpp.kak | 0 {kak => .config/kak}/colors/kalolo.kak | 0 kak/kakrc | 354 ------------------------- 6 files changed, 47 insertions(+), 362 deletions(-) rename {kak => .config/kak}/autoload/cpp.kak (100%) rename {kak => .config/kak}/colors/kalolo.kak (100%) delete mode 100644 kak/kakrc diff --git a/.bashrc b/.bashrc index 2bc5b50..51f1c21 100644 --- a/.bashrc +++ b/.bashrc @@ -358,6 +358,21 @@ calc() { } +# Concatenate movie files without re-encoding. +mp4_concat() { + rm -f MVIs.txt + for f in $@ ; do + echo "file '$f'" >> MVIs.txt + done + + ffmpeg -safe 0 -f concat -i MVIs.txt -c copy output.mp4 + + rm -f MVIs.txt + + echo "RESULTS IN output.mp4" +} + + ################# # Configuration # ################# @@ -422,6 +437,10 @@ if [[ $- == *i* ]]; then source ~/code/liquidprompt-powerline/powerline.theme JOLLY_SPACE_LINE="‎" # empty character JOLLY_ITEMS=("" "┃" "━") + _lp_connection + if [[ "$lp_connection" == "ssh" || "$lp_multiplexer" == "tmux" ]] ; then + JOLLY_SPACED=0 + fi source ~/code/lp-jolly/presets/variant-chevron.conf source ~/code/lp-jolly/jolly.theme && lp_theme jolly fi @@ -441,9 +460,11 @@ if [[ $- == *i* ]] ; then fi # Always connect to a tmux session when SSH. -if [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then - tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux -fi +# if [[ -n "$SSH_TTY" ]]; then +# if [[ "x${-##*i}" != "x$-" ]]; then +# tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux +# fi +# fi # In case of problem, just connect with bash --norc: # ssh -t myname@myserver bash --norc @@ -497,3 +518,17 @@ export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion alias bat="/usr/bin/batcat --style=header-filesize,header-filename,grid --color=always" + +pdfcompress () +{ + res="${2:-110}" + echo "Resolution: ${res}ppp" 2>&1 + out="${1%.*}.compressed.pdf" + gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=$res -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=$res -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=$res -sOutputFile="$out" "$1" + + sko=$(\ls -s $out | cut -d " " -f 1) + sh=$(\ls -s -h $out | cut -d " " -f 1) + echo "Final size: ${sh} / ${sko}Kb" 2>&1 +} + +fortune anarchism diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index e816db5..9d3b90b 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -316,7 +316,7 @@ background = "#aaaaaa" foreground = "#555555" frame_color = "#ffffff" - timeout = 10 + timeout = 2 # Icon for notifications with low urgency, uncomment to enable #default_icon = /path/to/icon @@ -324,7 +324,7 @@ background = "#284488" foreground = "#ffffff" frame_color = "#5877bb" - timeout = 30 + timeout = 5 # Icon for notifications with normal urgency, uncomment to enable #default_icon = /path/to/icon @@ -332,7 +332,7 @@ background = "#900000" foreground = "#ffffff" frame_color = "#ff0000" - timeout = 0 + timeout = 10 # Icon for notifications with critical urgency, uncomment to enable #default_icon = /path/to/icon diff --git a/.config/i3/config b/.config/i3/config index ebc9596..aba7f5c 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -31,7 +31,7 @@ exec --no-startup-id dex --autostart --environment i3 # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the # screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork --image=/home/nojhan/Images/Wood.png +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork --image=$(shuf -n 1 -e ~/Images/background/WLE_2025/*) # NetworkManager is the most popular way to manage wireless networks on Linux, # and nm-applet is a desktop environment-independent system tray GUI for it. @@ -222,6 +222,9 @@ bindsym $mod+Shift+v resize set 400 px # Binding to balance all windows' sizes bindsym $mod+m exec "i3_balance_workspace" +# Close all notifications +bindsym $mod+y exec "dunstctl close-all" +bindsym $mod+Shift+y "dunstctl set-pause toggle" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) @@ -272,7 +275,8 @@ workspace_auto_back_and_forth no # exec --no-startup-id "mpv --wid=0 --loop --no-terminal --speed=0.5 --video-align-x=0.5 --no-audio --video-sync=display-resample --interpolation --tscale=oversample ~/Vidéos/Blue_Turn_notitle.mp4" # Wallpaper as background -exec --no-startup-id feh --bg-scale /home/nojhan/Images/Wood.png +# exec --no-startup-id feh --bg-scale /home/nojhan/Images/Wood.png +exec --no-startup-id feh --bg-scale --randomize --auto-zoom /home/nojhan/Images/background/WLE_2025/* exec firefox diff --git a/kak/autoload/cpp.kak b/.config/kak/autoload/cpp.kak similarity index 100% rename from kak/autoload/cpp.kak rename to .config/kak/autoload/cpp.kak diff --git a/kak/colors/kalolo.kak b/.config/kak/colors/kalolo.kak similarity index 100% rename from kak/colors/kalolo.kak rename to .config/kak/colors/kalolo.kak diff --git a/kak/kakrc b/kak/kakrc deleted file mode 100644 index b9db727..0000000 --- a/kak/kakrc +++ /dev/null @@ -1,354 +0,0 @@ -################################# -# Convenience functions -################################# - -define-command filetype-hook -params 2 %{ - hook global WinSetOption "filetype=(%arg{1})" "%arg(2)" -} - -################################# -# Generic mappings -################################# - -# Comments -map global normal '$' -docstring 'Comment the selected lines' ': comment-line' -map global normal '' -docstring 'Comment the selected block with begin/end characters' ': comment-block' -map global normal '#' -docstring 'duplicate and comment line' 'xyP: comment-linej' -map global normal '–' -docstring 'comment selection with /*…*/' 'i/*a*/' - -map global normal '*' -docstring 'select all occurrences of the word under cursor' 'be*nvv' - -map global normal '=' -docstring 'indent like the line above' 'gijgi' - -map global normal '' -docstring 'move line down' 'xdkP' -map global normal '' -docstring 'move line down' 'xdp' -map global insert '' -docstring 'move line down' 'xdkPi' -map global insert '' -docstring 'move line down' 'xdpi' - -map global insert '' -docstring 'one word right in insert mode' 'eli' -map global insert '' -docstring 'one word left in insert mode' 'bi' -map global insert '' -docstring 'kill line in insert mode' 'GIc' - -map global normal 'è' -docstring 'select the inner sequence enclosed by matching characters' 'mLH' - -alias global bd delete-buffer - -def -params 1 extend-line-up %{ - exec "%arg{1}K" - try %{ - exec -draft ';\n' - exec X - } - exec '' -} -map global normal Y -docstring 'Extend selection to the previous line' ':extend-line-up %val{count}' - -define-command cq -docstring 'Quit with an (arbitrary) error code' %{q! 666} - -# Use Tab and Shift-Tab to navigate completion in insert mode. -hook global InsertCompletionShow .* %{ - try %{ - execute-keys -draft 'h\h' - map window insert - map window insert - hook -once -always window InsertCompletionHide .* %{ - map window insert - map window insert - } - } -} - -# Cursor switch. -map global normal -docstring 'Swap selections cursor and anchor' '' -map global normal -docstring 'Ensure selection cursor is after anchor' '' - -# Go to paragraph/indents. -map global goto 'p' -docstring 'select to next paragraph' ']p' -map global goto 'P' -docstring 'extend to next paragraph' '}p' -map global goto 'o' -docstring 'select to prev paragraph' '[p' -map global goto 'O' -docstring 'extend to prev paragraph' '{p' -map global goto 't' -docstring 'select to indent end' ']i' -map global goto 'T' -docstring 'select to indent beginning' '[i' - -# Paths. -map global prompt -docstring 'Current buffer name' '%' -map global prompt -docstring 'Current buffer directory' '%sh(dirname "$kak_bufname")/' - -################################# -# Generic config -################################# - -set-option -add global ui_options ncurses_assistant=none -set-option -add global ui_options ncurses_set_title=yes -set-option -add global ui_options ncurses_padding_fill=yes - -# Indent with 2 spaces and make tabs appear as 2 spaces. -set-option global tabstop 4 -set-option global indentwidth 4 - -# tabs to spaces -hook global InsertChar \t %{ - exec -draft h@ -} - -# Keep space around cursor when scrolling. -set-option global scrolloff 3,3 - -# Add characters as matching pairs. -set-option -add global matching_pairs ‹ › « » “ ” ‘ ’ - -hook global ModuleLoaded x11 %{ - set global termcmd 'terminator -e ' - alias global terminal x11-terminal -} - -# Persistent history across sessions. -hook global KakEnd .* %{ echo -to-file ~/.kak_history -quoting kakoune reg : %reg{:} } -hook global KakBegin .* %{ try %{ source ~/.kak_history } } - - -################################# -# Highlighting -################################# - -add-highlighter global/matching show-matching -add-highlighter global/wrap wrap -word -indent -marker ⤷ -add-highlighter global/suspicicous-whitespaces show-whitespaces -tab ⭲ -nbsp · -spc " " -lf " " -#add-highlighter global/trailing-whitespaces regex '\h+$' 0:error - -define-command -hidden show-trailing-whitespaces %{ try %{ add-highlighter global/trailing-whitespaces regex '\h+$' 0:default,red } } -define-command -hidden hide-trailing-whitespaces %{ try %{ remove-highlighter global/trailing-whitespaces } } -hook global WinDisplay .* show-trailing-whitespaces -hook global ModeChange 'insert:normal' show-trailing-whitespaces -hook global ModeChange 'normal:insert' hide-trailing-whitespaces - - -colorscheme kalolo - -# Highlight generic tags -hook global WinSetOption comment_line=(.+) %{ - add-highlighter -override window/here regex "\b(HERE)\b" 1:rgb:ffff00,rgb:ff0000+FB # WHERE - add-highlighter -override window/fixme regex "\b(FIXME)\b" 1:rgb:ffff00,rgb:ff0000+Fb - add-highlighter -override window/todo regex "\b(TODO)\b" 1:rgb:000000,rgb:ff00ff+Fb - add-highlighter -override window/note regex "\b(NOTE)\b" 1:rgb:000000,rgb:a5c261+Fb -} - -# Show line numbers (and highlight current cursor line) -hook global WinCreate ^[^*]+$ %{ - add-highlighter window/ number-lines -hlcursor -min-digits 3 -} - - -################################# -# Language specifics -################################# - -filetype-hook makefile %{ - set-option window indentwidth 0 -} - -filetype-hook latex %{ - set-option buffer autowrap_column 160 - autowrap-enable - addhl buffer/ column 160 white,black -} - -filetype-hook markdown %{ - # set-option buffer autowrap_column 80 - # autowrap-enable - addhl buffer/ column 80 white,black -} - -filetype-hook restructuredtext %{ - # set-option buffer autowrap_column 80 - # autowrap-enable - addhl buffer/ column 80 white,black -} - -filetype-hook c|cpp %{ - clang-enable-autocomplete - clang-enable-diagnostics - alias window lint clang-parse - alias window lint-next-error clang-diagnostics-next - set-option buffer formatcmd "clang-format -style='WebKit'" - map global normal A ': c-family-alternative-file' -} - -filetype-hook python %{ - jedi-enable-autocomplete - lint-enable - set-option global lintcmd 'flake8' -} - - -################################# -# Plugins -################################# - -# Autoinstall plug.kak if necessary. -evaluate-commands %sh{ - plugins="$HOME/.config/kak/plugins" - mkdir -p $plugins - [ ! -e "$plugins/plug.kak" ] && \ - git clone -q https://github.com/andreyorst/plug.kak "$plugins/plug.kak" - printf "%s\n" "source '$plugins/plug.kak/rc/plug.kak'" -} -# Load the plugin manager. -plug "andreyorst/plug.kak" noload - -# Buffers list. -plug 'delapouite/kakoune-buffers' %{ - hook global WinDisplay .* info-buffers - map global normal à ': enter-buffers-mode' -docstring 'buffers' - map global normal À ': enter-user-mode -lock buffers' -docstring 'buffers (lock)' -} - -# Multi-select all identical characters in the column. -plug 'occivink/kakoune-vertical-selection' %{ - map global user -docstring "Select all identical characters in the column downward" ': vertical-selection-down' - map global user -docstring "Select all identical characters in the column upward" ': vertical-selection-up' -} - -# System clipboard integration. -# FIXME bug: does not allow correct multi-cursors paste. -#plug "lePerdu/kakboard" %{ -# hook global WinCreate .* %{ kakboard-enable } -#} -# Keep the 1 register in sync with the system clipboard . -# FIXME: does not work either. -# hook global RegisterModified '1' %{ nop %sh{ -# printf %s "$kak_main_reg_dquote" | xsel --input --clipboard -# }} - -# Fuzzy search -plug "andreyorst/fzf.kak" %{ - map global normal ': fzf-mode' -} - -plug "andreyorst/tagbar.kak" defer "tagbar" %{ - set-option global tagbar_sort false - set-option global tagbar_size 40 - set-option global tagbar_display_anon false - set-option global tagbar_show_details false -} config %{ - # if you have wrap highlighter enamled in you configuration - # files it's better to turn it off for tagbar, using this hook: - hook global WinSetOption filetype=tagbar %{ - remove-highlighter window/wrap - # you can also disable rendering whitespaces here, line numbers, and - # matching characters - } - # To see what filetypes are supported use `ctags --list-kinds | awk '/^\w+/' - hook global WinSetOption filetype=(c|cpp|rust) %{ - tagbar-enable - } -} - -#plug 'delapouite/kakoune-cd' %{ -# # Suggested mapping -# map global user c ': enter-user-mode cd' -docstring 'cd' -# # Suggested aliases -# alias global cdb change-directory-current-buffer -# alias global cdr change-directory-project-root -# alias global ecd edit-current-buffer-directory -# alias global pwd print-working-directory -#} -# Automatically change working directory to be the buffer's one. -#hook global WinDisplay .* %{ -# # require delapouite/kakoune-cd -# change-directory-current-buffer -#} - -# Like alexherbo2/search-highlighter.kak, but which actually works. -# face global Search white,yellow -def search-highlight-enable %{ - hook window -group search-highlight NormalKey [/?*nN]| %{ try %{ - addhl window/search dynregex '%reg{/}' 0:Search - }} - hook window -group search-highlight NormalKey %{ rmhl window/search} -} -def search-highlight-disable %{ - rmhl window/search - rmhooks window search-highlight -} -# Always highlight search. -hook global WinDisplay .* %{ - search-highlight-enable -} - -plug "kak-lsp/kak-lsp" do %{ - cargo install --locked --force --path . -} config %{ - - # uncomment to enable debugging - # eval %sh{echo ${kak_opt_lsp_cmd} >> /tmp/kak-lsp.log} - # set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log" - - # ,l will display a specific menu for LSP - map global user l %{: enter-user-mode lsp} -docstring "LSP mode" - - # lsp-enable - set-option global lsp_server_configuration pyls.configurationSources=["flake8"] - - set global lsp_diagnostic_line_error_sign '║' - set global lsp_diagnostic_line_warning_sign '┊' - - # define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings } - # define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings } - # define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings } - - define-command lsp-restart -docstring 'restart lsp server' %{ lsp-stop; lsp-start } - - hook global WinSetOption filetype=(c|cpp|python) %{ - # Show matching objects? - set-option window lsp_auto_highlight_references false - map global '' -docstring 'Highlight related references' ': lsp-highlight-references' - - # Hint window next to the cursor? - set-option window lsp_hover_anchor false - - lsp-auto-hover-enable - lsp-enable-window - } - - hook global KakEnd .* lsp-exit -} - -plug "dmerejkowsky/kak-spell" config %{ - declare-user-mode kak-spell - map global user s ': enter-user-mode -lock kak-spell' -docstring 'enter spell user mode' - map global kak-spell a ': kak-spell-add' -docstring 'add the selection to the user dict' - map global kak-spell d ': kak-spell-disable' -docstring 'clear spelling highlighters' - map global kak-spell e ': kak-spell-enable en_US :kak-spell ' -docstring 'enable spell check in English' - map global kak-spell f ': kak-spell-enable fr_FR :kak-spell ' -docstring 'run spell check in French' - map global kak-spell l ': kak-spell-list ' -docstring 'list spelling errors in a buffer' - map global kak-spell n ': kak-spell-next' -docstring 'go to next spell error' - map global kak-spell p ': kak-spell-previous' -docstring 'go to next spell error' - map global kak-spell r ': kak-spell-replace' -docstring 'suggest a list of replacements' - map global kak-spell x ': kak-spell-remove' -docstring 'remove the selection from the user dict' -} - -map global user g '/[=]{7}vv' -docstring 'Search for Git conflict markers' - -set-option -add global ui_options ncurses_padding_char=╱ # Examples: ▚ ╳ ╱ ┼ ╲ - -# add-highlighter global/ scrollbar -# add-highlighter global/scrollbar/ scrollbar-indicator red,default lsp_error_lines -# add-highlighter global/scrollbar/ scrollbar-indicator yellow,default lint_flags -# # add-highlighter global/scrollbar/ scrollbar-indicator red,default git_diff_flags -# # git show-diff - - -# Force `liquidprompt` to be a shell filetype. -hook global BufCreate (.*/)?liquidprompt %{ - set buffer filetype sh -} - -# Force liquidprompt's *.theme files to be a shell filetype. -hook global BufCreate .*\.theme %{ - set buffer filetype sh -} -hook global BufCreate .*\.conf %{ - set buffer filetype sh -} -