diff options
123 files changed, 1285 insertions, 366 deletions
diff --git a/.config/BetterDiscord/data/stable/settings.json b/.config/BetterDiscord/data/stable/settings.json index 42a2be1..551163e 100644 --- a/.config/BetterDiscord/data/stable/settings.json +++ b/.config/BetterDiscord/data/stable/settings.json @@ -3,11 +3,21 @@ "voiceDisconnect": false, "showToasts": true, "mediaKeys": false, - "bdContextMenu": true + "bdContextMenu": true, + "themeAttributes": true, + "notificationPosition": "top-right", + "notificationEnabled": true }, "addons": { "addonErrors": true, - "editAction": "detached" + "editAction": "detached", + "checkForUpdates": true, + "updateInterval": 4 + }, + "store": { + "bdAddonStore": true, + "alwaysEnable": false, + "addonEmbeds": true }, "customcss": { "customcss": true, @@ -15,17 +25,21 @@ "openAction": "settings" }, "editor": { + "theme": "system", "lineNumbers": true, "minimap": true, "hover": true, "quickSuggestions": true, + "insertSpaces": false, + "tabSize": 4, "fontSize": 14, "renderWhitespace": "selection" }, "window": { "transparency": false, "removeMinimumSize": true, - "frame": false + "frame": false, + "inAppTrafficLights": false }, "developer": { "debugLogs": false, @@ -33,6 +47,8 @@ "debuggerHotkey": false, "reactDevTools": false, "inspectElement": false, - "devToolsWarning": false + "devToolsWarning": false, + "recovery": true, + "canary": false } }
\ No newline at end of file diff --git a/.config/BetterDiscord/data/stable/themes.json b/.config/BetterDiscord/data/stable/themes.json index 3afcd03..419725e 100644 --- a/.config/BetterDiscord/data/stable/themes.json +++ b/.config/BetterDiscord/data/stable/themes.json @@ -1,5 +1,5 @@ { "Horizontal Server List": true, - "flat": true, - "mode": true + "flat": false, + "mode": false }
\ No newline at end of file diff --git a/.config/BetterDiscord/themes/HorizontalServerList.theme.css b/.config/BetterDiscord/themes/HorizontalServerList.theme.css deleted file mode 100644 index 5b82210..0000000 --- a/.config/BetterDiscord/themes/HorizontalServerList.theme.css +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @name Horizontal Server List - * @author Gibbu#1211 - * @version 2.1.0 - * @invite ZHthyCw - * @description Moves the server list from the left to the top of Discord. Compatible with Server Folders and most basic transparent themes - * @source https://github.com/DiscordStyles/HorizontalServerList - * @website https://www.gibbu.me -*/ - -@import url("https://discordstyles.github.io/HorizontalServerList/dist/HorizontalServerList.css"); - -/* Bottom HorizontalServerList. Simply remove the comments surrounding the @import to enable it. */ -/* @import url("https://discordstyles.github.io/Addons/bottomhsl.css"); */ - -:root { - --HSL-server-icon-size: 40px; /* Size of the server icons | DEFAULT: 40px */ - --HSL-server-spacing: 10px; /* Spacing between each server icon | DEFAULT: 10px */ - --HSL-server-direction: column; /* Direct of the server list. | Options: column, column-reverse | DEFAULT: column */ -} diff --git a/.config/X11/base b/.config/X11/base new file mode 100644 index 0000000..a538320 --- /dev/null +++ b/.config/X11/base @@ -0,0 +1,13 @@ +*.font: monospace:size=7.5:antialias=true:autohint=true +*.borderpx: 10 +*.termname: st-256color +*.tabspaces: 2 + +Xft.dpi: 96 +Xft.hinting: 1 +Xft.hintstyle: hintslight +Xft.antialias: 1 +Xft.rgba: rgb + +Xcursor.theme: OpenZone_Black_Slim + diff --git a/.config/X11/base##template b/.config/X11/base##template deleted file mode 100644 index 04bf1d1..0000000 --- a/.config/X11/base##template +++ /dev/null @@ -1,20 +0,0 @@ -{% if yadm.hostname == "thoncc" %} -*.font: JetBrainsMono Nerd Font:size=7.5:antialias=true:autohint=true -*.borderpx: 8 -{% else %} -*.font: JetBrainsMono Nerd Font:size=9:antialias=true:autohint=true -*.borderpx: 16 -{% endif %} -Xcursor.theme: OpenZone_Black_Slim - -*.termname: st-256color -*.shell: /bin/sh - -*.tabspaces: 4 - -Xft.dpi: 96 -Xft.hinting: 1 -Xft.hintstyle: hintslight -Xft.antialias: 1 -Xft.rgba: rgb - diff --git a/.config/clangd/config.yaml b/.config/clangd/config.yaml new file mode 100644 index 0000000..f4fa3e0 --- /dev/null +++ b/.config/clangd/config.yaml @@ -0,0 +1,9 @@ +CompileFlags: + Add: + # ignore unknown (gcc) compiler flags + - -Wno-unknown-warning-option + - -Wno-gnu-folding-constant + Remove: + - -m* + - -f* + diff --git a/.config/coc/extensions/package.json b/.config/coc/extensions/package.json index 03b7e7d..fc6acf7 100644 --- a/.config/coc/extensions/package.json +++ b/.config/coc/extensions/package.json @@ -2,20 +2,20 @@ "dependencies": { "coc-css": ">=2.1.0", "coc-emmet": ">=1.1.6", - "coc-go": ">=1.3.33", + "coc-go": ">=1.3.35", "coc-html": ">=1.8.0", - "coc-java": ">=1.15.2", - "coc-json": ">=1.9.2", - "coc-python": ">=1.2.13", - "coc-rust-analyzer": ">=0.75.2", - "coc-tsserver": ">=2.1.4", + "coc-java": ">=1.26.1", + "coc-json": ">=1.9.3", + "coc-rust-analyzer": ">=0.85.0", + "coc-tsserver": ">=2.3.1", "coc-vimtex": ">=1.1.5", "coc-lua": ">=2.0.6", - "coc-deno": ">=3.13.0", - "coc-sh": ">=1.2.2", - "coc-solargraph": ">=1.2.4" + "coc-deno": ">=3.15.0", + "coc-sh": ">=1.2.4", + "coc-solargraph": ">=1.2.4", + "coc-pyright": ">=1.1.405" }, "disabled": [], "locked": [], - "lastUpdate": 1716395488358 + "lastUpdate": 1756725613973 }
\ No newline at end of file diff --git a/.config/fcitx5/conf/clipboard.conf b/.config/fcitx5/conf/clipboard.conf new file mode 100644 index 0000000..6a38473 --- /dev/null +++ b/.config/fcitx5/conf/clipboard.conf @@ -0,0 +1,8 @@ +# Paste Primary +PastePrimaryKey= +# Number of entries +Number of entries=30 + +[TriggerKey] +0=Control+semicolon + diff --git a/.config/fcitx5/conf/imselector.conf b/.config/fcitx5/conf/imselector.conf index 87428a1..de02872 100644 --- a/.config/fcitx5/conf/imselector.conf +++ b/.config/fcitx5/conf/imselector.conf @@ -1,10 +1,13 @@ -# Trigger Key for only current input context +# 現在の入力コンテキストのみのトリガーキー TriggerKeyLocal= -# Hotkey for switching to the N-th input method -SwitchKey= -# Hotkey for switching to the N-th input method for only current input context +# 現在の入力コンテキストのみをN番目の入力メソッドに切り替えるホットキー SwitchKeyLocal= [TriggerKey] 0=Super+Z +[SwitchKey] +0=Launch5 +1=Launch6 +2=Launch7 + diff --git a/.config/fcitx5/conf/quickphrase.conf b/.config/fcitx5/conf/quickphrase.conf new file mode 100644 index 0000000..9e49067 --- /dev/null +++ b/.config/fcitx5/conf/quickphrase.conf @@ -0,0 +1,10 @@ +# キーモディファイアーを選択 +Choose Modifier=None +# スペルチェックを有効にする +Spell=True +# フォールバック時のスペルチェック言語 +FallbackSpellLanguage=en + +[TriggerKey] +0=Super+semicolon + diff --git a/.config/fcitx5/conf/xcb.conf b/.config/fcitx5/conf/xcb.conf new file mode 100644 index 0000000..642bc03 --- /dev/null +++ b/.config/fcitx5/conf/xcb.conf @@ -0,0 +1,5 @@ +# Allow Overriding System XKB Settings +Allow Overriding System XKB Settings=True +# Always set layout to be only group layout +AlwaysSetToGroupLayout=True + diff --git a/.config/fcitx5/conf/xim.conf b/.config/fcitx5/conf/xim.conf new file mode 100644 index 0000000..57abf4b --- /dev/null +++ b/.config/fcitx5/conf/xim.conf @@ -0,0 +1,3 @@ +# XIM で On The Spot スタイルを使う(再起動が必要) +UseOnTheSpot=True + diff --git a/.config/fcitx5/config b/.config/fcitx5/config index 3ae8195..12e7a48 100644 --- a/.config/fcitx5/config +++ b/.config/fcitx5/config @@ -25,6 +25,8 @@ PrevPage= NextPage= # 埋め込みプリエディットの切り替え TogglePreedit= +# 修飾キーのショートカットをトリガーするための時間制限(ミリ秒) +ModifierOnlyKeyTimeout=250 [Hotkey/PrevCandidate] 0=Shift+Tab diff --git a/.config/firefox/chrome/userChrome.css b/.config/firefox/chrome/userChrome.css index 233a1ba..330b18e 100644 --- a/.config/firefox/chrome/userChrome.css +++ b/.config/firefox/chrome/userChrome.css @@ -3,7 +3,10 @@ #appMenu-fxa-status2, #appMenu-fxa-separator, #fullscreen-warning, -.findbar-highlight +.findbar-highlight, +#urlbar-searchmode-switcher, +#translations-button, +#reader-mode-button { display: none !important; } /* undo shit */ @@ -13,9 +16,12 @@ /* make shit compact */ body { font-size: 10pt; } -.tab-background { - min-height: unset !important; - margin-block: 0 !important; +.tab-background { margin-block: 0 !important; } +#TabsToolbar { --toolbarbutton-inner-padding: 8px; } +:root { --tab-min-height: 24px !important; } +.tab-label-container { + height: unset !important; + margin-right: var(--toolbarbutton-inner-padding); } .tabbrowser-tab @@ -29,3 +35,5 @@ body { font-size: 10pt; } #navigator-toolbox { border: none !important; } +#urlbar-input +{ padding: 0px 8px !important; } diff --git a/.config/firefox/user.js b/.config/firefox/user.js index 778631e..a18c1e9 100644 --- a/.config/firefox/user.js +++ b/.config/firefox/user.js @@ -2,9 +2,18 @@ user_pref("browser.toolbars.bookmarks.visibility", "never"); user_pref("browser.quitShortcut.disabled", true); user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false); -user_pref("intl.regional_prefs.use_os_locales", true); user_pref("layout.spellcheckDefault", 0); +user_pref("findbar.highlightAll", true); + +// i know what i'm doing user_pref("browser.safebrowsing.downloads.enabled", false); +user_pref("browser.safebrowsing.malware.enabled", false); +user_pref("browser.safebrowsing.phishing.enabled", false); + +// i18n +user_pref("intl.regional_prefs.use_os_locales", true); +user_pref("layout.spellcheckDefault", 0); +user_pref("browser.translations.automaticallyPopup", false); // privacy user_pref("signon.rememberSignons", false); @@ -31,3 +40,21 @@ user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); user_pref("devtools.chrome.enabled", true); user_pref("devtools.debugger.remote-enabled", true); +// no first time ux +user_pref("trailhead.firstrun.didSeeAboutWelcome", true); +user_pref("app.normandy.first_run", false); +user_pref("browser.aboutConfig.showWarning", false); +user_pref("browser.aboutwelcome.didSeeFinalScreen", true); +user_pref("browser.bookmarks.addedImportButton", true); +user_pref("browser.bookmarks.restore_default_bookmarks", false); + +// no new tab page +user_pref("browser.newtabpage.enabled", false); +user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); + +// fonts +user_pref("font.default.x-western", "sans-serif"); +user_pref("font.name.monospace.x-western", "monospace"); +user_pref("font.name.sans-serif.x-western", "sans-serif"); +user_pref("font.name.serif.x-western", "serif"); + diff --git a/.config/fontconfig/conf.d/10-inter-features.conf b/.config/fontconfig/conf.d/10-inter-features.conf new file mode 100644 index 0000000..5a641d6 --- /dev/null +++ b/.config/fontconfig/conf.d/10-inter-features.conf @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>Enable font features for Inter</description> + <match target="font"> + <test name="family" compare="eq" ignore-blanks="true"> + <string>Inter</string> + </test> + <edit name="fontfeatures" mode="append"> + <string>ss07 on</string> <!-- Square punctuation --> + <string>ss08 on</string> <!-- Square quotes --> + </edit> + </match> +</fontconfig> diff --git a/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf b/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf new file mode 100644 index 0000000..fcd51f3 --- /dev/null +++ b/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>Enable sub-pixel font rendering</description> + <match target="pattern"> + <edit name="rgba" mode="append"><const>rgb</const></edit> + </match> +</fontconfig> diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index b3897e9..955c797 100644 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -12,7 +12,7 @@ </alias> <alias binding="strong"> <family>monospace</family> - <prefer><family>JetBrainsMono Nerd Font</family></prefer> + <prefer><family>JetBrains Mono</family></prefer> </alias> <alias binding="strong"> <family>system-ui</family> diff --git a/.config/fzmp/conf b/.config/fzmp/conf index 22439c3..a51f36d 100644..120000 --- a/.config/fzmp/conf +++ b/.config/fzmp/conf @@ -1,3 +1 @@ -default_view songs -full_song_format [[[%artist% - %album% / ][%title%]]|%file%] -fzf_options --ignore-case +../mpcplus/fzmp.conf
\ No newline at end of file diff --git a/.config/gdb/gdbinit b/.config/gdb/gdbinit index 7e59573..919b13a 100644 --- a/.config/gdb/gdbinit +++ b/.config/gdb/gdbinit @@ -1,2 +1,9 @@ -set disassembly-flavor intel -set debuginfod enabled off +python +import sys, os +sys.path.append(os.path.join(os.environ["XDG_CONFIG_HOME"], "gdb")) +import gdbinit +end + +alias mk = !mk +alias reset = monitor reset + diff --git a/.config/gdb/gdbinit.py b/.config/gdb/gdbinit.py new file mode 100644 index 0000000..a6ebfea --- /dev/null +++ b/.config/gdb/gdbinit.py @@ -0,0 +1,14 @@ +import gdb + +def try_execute(*args): + try: + gdb.execute(*args) + except gdb.error: + pass + +# x86 only +try_execute("set disassembly-flavor intel") + +gdb.execute("set debuginfod enabled off") +gdb.execute("set confirm off") + diff --git a/.config/git/config##template b/.config/git/config##template index f8c16b2..0a3418a 100644 --- a/.config/git/config##template +++ b/.config/git/config##template @@ -1,5 +1,7 @@ [init] defaultBranch = master +[core] + quotepath = off [user] email = loek@pipeframe.xyz name = Loek Le Blansch @@ -31,3 +33,11 @@ l = log d = diff cloc = !git ls-files -z | xargs -0 cloc + conflict = !git diff --name-only --diff-filter=U --relative + ec = !git conflict -z | xargs -0 -- $EDITOR + ours = !git conflict -z | xargs -0 -- git checkout --ours + theirs = !git conflict -z | xargs -0 -- git checkout --theirs +[pager] + log = diff-highlight | less + show = diff-highlight | less + diff = diff-highlight | less diff --git a/.config/gtk-4.0/env b/.config/gtk-4.0/env index 42b34f5..2eac735 100644 --- a/.config/gtk-4.0/env +++ b/.config/gtk-4.0/env @@ -1,5 +1,6 @@ #!/bin/sh export GTK_THEME="adw-gtk3" -. "$XDG_CACHE_HOME/mode/state/theme" +mode_state="$XDG_CACHE_HOME/mode/state/theme" +[ -e "$mode_state" ] && . "$mode_state" [ "$mode" = "dark" ] && GTK_THEME="$GTK_THEME:dark" export GTK_THEME diff --git a/.config/i3/autostart##template b/.config/i3/autostart index 6b7f908..70b7616 100755 --- a/.config/i3/autostart##template +++ b/.config/i3/autostart @@ -1,7 +1,7 @@ #!/bin/sh . "$HOME/.profile" xrdb -override < "$XDG_CONFIG_HOME/X11/base" -mode --no-reload restore +mode --no-reload --no-cfggen restore /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & polybar & @@ -11,15 +11,13 @@ dunst & autocutsel -selection CLIPBOARD & fcitx5 & xbindkeys --nodaemon & -{% if yadm.hostname == "thoncc" %} xdimmer -t 45 -p 3 & -light-locker --no-late-locking & -{% else %} redshift -l 52:6 & nicotine --hidden & desktop2mqtt --config "$XDG_CONFIG_HOME/desktop2mqtt/config.yml" & -{% endif %} -flashfocus & +light-locker --late-locking --lock-after-screensaver=0 --no-lock-on-suspend --no-lock-on-lid & +systembus-notify & +nmpassd & # auto start lazy script after everything else [ -x "$HOME/do.sh" ] && "$HOME/do.sh" & diff --git a/.config/i3/config##template b/.config/i3/config##template index 2af8c10..fec43f9 100644 --- a/.config/i3/config##template +++ b/.config/i3/config##template @@ -1,23 +1,13 @@ # variables set $mod Mod4 -{% if yadm.hostname == "thoncc" %} set $inner_gaps 8 -{% else %} -set $inner_gaps 10 -{% endif %} set $outer_gaps 0 # set gaps gaps inner $inner_gaps gaps outer $outer_gaps -# border color -client.focused #262427 #262427 #fdf9f7 #262427 #262427 -client.focused_inactive #121213 #121213 #fdf9f7 #121213 #121213 -client.unfocused #121213 #121213 #fdf9f7 #121213 #121213 -client.urgent #121213 #de9dac #fdf9f7 #de9dac #de9dac -client.placeholder #000000 #0c0c0c #fdf9f7 #121213 #121213 -client.background #f9ece8 +include color.conf # Replace window decorations with a border for_window [class=".*"] border pixel 0 @@ -89,7 +79,7 @@ for_window [class="steam"] floating enable for_window [class="RAIL"] floating enable for_window [class="Conky"] floating enable for_window [title="Farge"] floating enable -for_window [title="^\[floating\].*"] floating enable +for_window [title="^\[floating\].*" tiling_from=auto] floating enable for_window [window_type=notification] floating enable for_window [title="JidePopup"] floating enable diff --git a/.config/kwalletrc b/.config/kwalletrc new file mode 100644 index 0000000..6f0a8f5 --- /dev/null +++ b/.config/kwalletrc @@ -0,0 +1,4 @@ +[Wallet] +Default Wallet=Default keyring +Enabled=false +First Use=false diff --git a/.config/latexmk/latexmkrc b/.config/latexmk/latexmkrc index ad6c178..6d6ec09 100644 --- a/.config/latexmk/latexmkrc +++ b/.config/latexmk/latexmkrc @@ -1,4 +1 @@ -$pdflatex = "xelatex %O %S"; -$pdf_mode = 1; -$dvi_mode = 0; -$postscript_mode = 0; +$pdf_previewer = "fork xdg-open %O %S"; diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 88560a8..295077d 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -1,6 +1,11 @@ set shell sh set shellopts '-eu' +set ifs "\n" +set filesep "\n" set scrolloff 10 +set info size +set dircounts +set mouse true set previewer preview cmd open $open $fx @@ -8,13 +13,17 @@ cmd open $open $fx set cursorpreviewfmt "" set errorfmt "\033[31m" set promptfmt "\033[34;1m%d\033[0m\033[1m%f\033[0m" -set statfmt "\033[36m%p\033[0m| %S| -> %l" +set statfmt "\033[36m%p| -> %l" +set rulerfmt " %a| %p| \033[7;31m mv %m \033[0m| \033[7;33m cp %c \033[0m| \033[7;35m sel %s \033[0m| \033[7;34m %f \033[0m" map v :toggle ; down map V invert map <backspace> set hidden! # <C-h> +map u +map uv unselect +map uc clear -cmd bulkrename $renamer $fx +cmd bulkrename $renamer -n $fx # vim:ft=cfg diff --git a/.config/mozc/config1.db b/.config/mozc/config1.db Binary files differnew file mode 100644 index 0000000..e116637 --- /dev/null +++ b/.config/mozc/config1.db diff --git a/.config/mozc/user_dictionary.db b/.config/mozc/user_dictionary.db Binary files differindex 644c695..9147808 100644 --- a/.config/mozc/user_dictionary.db +++ b/.config/mozc/user_dictionary.db diff --git a/.config/mpcplus/fzmp.conf b/.config/mpcplus/fzmp.conf new file mode 100644 index 0000000..22439c3 --- /dev/null +++ b/.config/mpcplus/fzmp.conf @@ -0,0 +1,3 @@ +default_view songs +full_song_format [[[%artist% - %album% / ][%title%]]|%file%] +fzf_options --ignore-case diff --git a/.config/mpd/mpd.conf##hostname.thoncc b/.config/mpd/mpd.conf##default index a374418..f999a2b 100644 --- a/.config/mpd/mpd.conf##hostname.thoncc +++ b/.config/mpd/mpd.conf##default @@ -4,7 +4,7 @@ playlist_directory "/mnt/mpd/playlists" pid_file "/mnt/mpd/mpd.pid" state_file "/mnt/mpd/mpdstate" -bind_to_address "*" +bind_to_address "0.0.0.0" port "6600" restore_paused "yes" diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf index 150b696..711242e 100644 --- a/.config/mpv/input.conf +++ b/.config/mpv/input.conf @@ -1,3 +1,4 @@ ALT+c script-message-to copy_subs copy ALT+SHIFT+c script-message-to copy_subs auto +CTRL+z set sub-delay 0 diff --git a/.config/ncmpcpp/config##template b/.config/ncmpcpp/config##template index e38258f..8059509 100644 --- a/.config/ncmpcpp/config##template +++ b/.config/ncmpcpp/config##template @@ -1,9 +1,9 @@ -mpd_host = "127.0.0.1" +mpd_host = "0.0.0.0" mpd_port = "6600" #mpd_host = "/mnt/e/mpd/socket" mpd_music_dir = "/mnt/e/mpd/music" -mpd_connection_timeout = "5" -mpd_crossfade_time = "1" +mpd_connection_timeout = 1 +mpd_crossfade_time = 1 external_editor = "{{ env.EDITOR }}" ncmpcpp_directory = "{{ env.XDG_CONFIG_HOME }}/ncmpcpp" @@ -12,10 +12,12 @@ lyrics_directory = "{{ env.XDG_CACHE_HOME }}/lyrics" progressbar_look = "───" progressbar_color = black progressbar_elapsed_color = default +visualizer_color = default playlist_display_mode = classic autocenter_mode = yes centered_cursor = yes -user_interface = alternative +user_interface = classic +connected_message_on_startup = no header_visibility = no statusbar_visibility = no @@ -25,11 +27,11 @@ state_flags_color = black:b main_window_color = white current_item_prefix = "$r" song_columns_list_format = "(20)[]{a} (6f)[blue]{NE} (50)[default]{t|f:Title} (20)[blue]{} (7f)[magenta]{l}" -song_list_format = " {{%a - %t}|{%f}}{$R%l} " +song_list_format = " {{%a - %t}|{%f}}$R{ %l} " window_border_color = default -alternative_header_first_line_format = "{{%a $8-$0 $b%t$/b}|{%f}}" -alternative_header_second_line_format = "$8{{%b}{ (%y)}}|{%D}" +alternative_header_first_line_format = "{{%a $8-$0 %t}|{%f}}" +alternative_header_second_line_format = "$8{{%b}|{%D}}" now_playing_prefix = "$b$0" now_playing_suffix = "$/b" diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc index cd071ef..af63b3f 100644 --- a/.config/neomutt/neomuttrc +++ b/.config/neomutt/neomuttrc @@ -9,18 +9,18 @@ set record = "+Sent" set trash = "+Trash" set postponed = "+Drafts" -# imap credentials -set imap_user = "loek@mail.pipeframe.xyz" +# credentials +set imap_user = "loek" set imap_pass = "$(pass srv/wipper/passwd/loek)" - -# smtp credentials set smtp_pass = "$imap_pass" set smtp_url = "smtp://$imap_user@mail.pipeframe.xyz:587" +set smtp_authenticators = 'login' +set ssl_starttls = yes set ssl_force_tls = yes # automatically refresh incoming mail set mail_check = 60 -unset wait_key +set wait_key = no push "<shell-escape> systemctl --user start mbsync & <enter>" # mailboxes diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 35566e8..7e27657 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -6,26 +6,33 @@ set noexpandtab set tabstop=2 set shiftwidth=2 set termguicolors -set shortmess=I +set shortmess+=It set splitbelow splitright set noshowmode set ignorecase set smartcase set timeoutlen=500 set updatetime=100 +set smoothscroll set mouse=a set cino=N-s,E-s,l1,g-1,j1 set linebreak " set wrap but don't wrap inside words set viminfo+='1000,n~/.local/nvim/viminfo -set guifont=JetBrainsMono\ Nerd\ Font:h9:#e-subpixelantialias:#h-slight +set guifont=monospace:h9:#e-subpixelantialias:#h-slight set linespace=5 +set tabpagemax=999 +set breakindent +set breakindentopt=shift:2 +set formatoptions+=mM +set tags^=build/tags let g:sneak#label = 1 let g:which_key_map = {} let g:airline_powerline_fonts = 1 let g:minimap_highlight='Visual' let g:python3_host_prog='/usr/bin/python3' -let g:vimtex_quickfix_open_on_warning = 0 -let g:vimtex_imaps_enabled = 0 +let g:DiffColors = 0 +let g:AutoPairsMultilineClose = 0 +filetype plugin on if exists("g:neovide") nmap <silent> <C-=> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1<CR> @@ -37,17 +44,22 @@ if exists("g:neovide") let g:neovide_floating_shadow = v:false let g:neovide_cursor_animation_length = 0.06 let g:neovide_cursor_trail_size = 0.0 - let g:neovide_padding_top=16 - let g:neovide_padding_left=16 - let g:neovide_padding_right=16 - let g:neovide_padding_bottom=16 + let g:neovide_padding_top=10 + let g:neovide_padding_left=10 + let g:neovide_padding_right=10 + let g:neovide_padding_bottom=10 endif " plugged call plug#begin('~/.config/nvim/plugged') +" tim <3 +Plug 'tpope/vim-surround' +Plug 'tpope/vim-speeddating' +Plug 'tpope/vim-eunuch' +Plug 'tpope/vim-commentary' + " quality of life Plug 'jiangmiao/auto-pairs' -Plug 'tpope/vim-surround' Plug 'itchyny/lightline.vim' Plug 'terryma/vim-multiple-cursors' Plug 'liuchengxu/vim-which-key' @@ -57,17 +69,16 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'puremourning/vimspector' Plug 'junegunn/goyo.vim' Plug 'psliwka/vim-smoothie' -" Plug 'tpope/vim-fugitive' Plug 'airblade/vim-gitgutter' Plug 'wellle/targets.vim' -" Plug 'dstein64/vim-startuptime' Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' } Plug 'dkarter/bullets.vim' Plug 'editorconfig/editorconfig-vim' +Plug 'rickhowe/diffunitsyntax' +Plug 'lervag/file-line' " language plugins Plug 'lervag/vimtex' -" Plug 'pangloss/vim-javascript' Plug 'hail2u/vim-css3-syntax' Plug 'octol/vim-cpp-enhanced-highlight' Plug 'vim-python/python-syntax' @@ -76,7 +87,6 @@ Plug 'bartlomiejdanek/vim-dart' Plug 'HerringtonDarkholme/yats.vim' Plug 'cespare/vim-toml' Plug 'tikhomirov/vim-glsl' -" Plug 'gabrielelana/vim-markdown' Plug 'vim-scripts/syntaxm4.vim' Plug 'elkowar/yuck.vim' Plug 'eraserhd/parinfer-rust', {'do': 'cargo build --release'} @@ -85,26 +95,24 @@ Plug 'aklt/plantuml-syntax' Plug 'fymyte/rasi.vim' Plug 'habamax/vim-asciidoctor' Plug 'lonkaars/coc-khard' +Plug 'sile-typesetter/vim-sile' +Plug 'ahf/cocci-syntax' " themes Plug 'arzg/vim-colors-xcode' -Plug '~/.config/nvim/local/bliss' -Plug '~/.config/nvim/local/polarlight.vim' -Plug '~/.config/nvim/local/autonyaa.vim' -Plug 'lonkaars/blubber' Plug 'romgrk/github-light.vim' Plug 'vv9k/vim-github-dark' -Plug 'rose-pine/neovim' +Plug 'rose-pine/neovim', {'as': 'rose-pine'} + +Plug '~/.config/nvim/local/coc-markdown-links' call plug#end() " keybinds tnoremap <Esc> <C-\><C-n> - nnoremap tt :tabnew<CR> - -nmap <CR> o<Esc> -nmap <leader>qf <Plug>(coc-fix-current) - +nnoremap <CR> o<Esc> +nnoremap <leader>qf <Plug>(coc-fix-current) +nnoremap <silent> * yiw:let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR> nnoremap <silent> <A-j> :m +1<CR> nnoremap <silent> <A-k> :m -2<CR> @@ -194,10 +202,23 @@ let g:which_key_map['.'] = { map <silent> <leader>u :UndotreeToggle<cr> let g:which_key_map.u = 'toggle undo tree' +nnoremap <silent> <leader>e 0f!xC<c-r>=system(@-)<cr><esc>ddk$ +let g:which_key_map.e = 'read and execute after !' + +nnoremap <leader>] <c-w>v<c-]>zt +let g:which_key_map[']'] = 'open tag in split' + " cmd maps cnoreabbrev W w cnoreabbrev sudow w !sudo tee % +" emacs bindings in vim command-line +cnoremap <A-b> <S-Left> +cnoremap <A-f> <S-Right> +cnoremap <C-a> <Home> +cnoremap <C-e> <End> +cnoremap <A-backspace> <C-w> + " hexokinase let g:Hexokinase_termDisabled = 1 let g:Hexokinase_optOutPatterns = [ 'colour_names' ] @@ -241,27 +262,15 @@ call lightline#init() " vimtex config let g:tex_flavor = 'latex' -let g:vimtex_compiler_latexmk = { - \ 'backend' : 'nvim', - \ 'background' : 1, - \ 'build_dir' : '', - \ 'callback' : 1, - \ 'continuous' : 1, - \ 'executable' : 'latexmk', - \ 'engine' : 'xelatex', - \ 'hooks' : [], - \ 'options' : [ - \ '-xelatex', - \ '-file-line-error', - \ '-synctex=1', - \ '-interaction=nonstopmode', - \ ], - \} +let g:vimtex_quickfix_open_on_warning = 0 +let g:vimtex_imaps_enabled = 0 +let g:vimtex_compiler_method = 'latexmk' +let g:vimtex_compiler_latexmk_engines = { '_': '' } " TeX quotes autocmd FileType tex let b:surround_{char2nr("q")} = "`\r'" autocmd FileType tex let b:surround_{char2nr('Q')} = "``\r''" -autocmd FileType tex let b:AutoPairs = AutoPairsDefine({'(':')', '[':']', '{':'}', "``":"''", "`":"'", '$':'$', '"':'"'}) +autocmd FileType tex let b:AutoPairs = {'(':')', '[':']', '{':'}', "``":"''", "`":"'", '$':'$', '"':'"'} " AutoPairs for plantuml autocmd FileType plantuml let b:AutoPairs = {'(':')', '[':']', '{':'}', '`':'`'} @@ -355,6 +364,19 @@ augroup Binary au BufWritePost *.bin set noeol augroup END +" highlight Zephyr .overlay files as devicetree source (dts) +augroup devicetree_ft + au! + au BufRead,BufNewFile *.overlay set syntax=dts + au BufRead,BufNewFile *.dtsi set syntax=dts +augroup END + +augroup BibLaTeX + " add allowed characters in biblatex labels to word delimiters + autocmd! + autocmd FileType bib setlocal iskeyword+=:,- +augroup END + " sneak let g:sneak#use_ic_scs = 0 @@ -365,3 +387,9 @@ autocmd InsertLeave * call system("fcitx5-temp-off &") " colorscheme source $XDG_CONFIG_HOME/nvim/mode.vim +" use .exrc files +set exrc +set secure + +" file-line +let g:file_line_crosshairs = v:false diff --git a/.config/picom.conf b/.config/picom.conf index f88a591..0f59fde 100644 --- a/.config/picom.conf +++ b/.config/picom.conf @@ -53,12 +53,30 @@ rules = ( match = "window_type *= 'dock'"; shadow = false; corner-radius = 0; + animations = ( + { + triggers = [ "open" ]; + preset = "slide-in"; + direction = "up"; + duration = 0.175; + }, + { + triggers = [ "close" ]; + preset = "slide-out"; + direction = "up"; + duration = 0.175; + }, + ); }, { - match = "window_type *= 'popup_menu'"; + match = "window_type *= 'combo'"; shadow = true; corner-radius = 10; }, + { + match = "class_i *= 'RAIL'"; + corner-radius = 0; + }, ) animations = ( diff --git a/.config/pipewire/pipewire.conf.d/50-bitrate.conf b/.config/pipewire/pipewire.conf.d/50-bitrate.conf index f7c4a93..bbf2c92 100644 --- a/.config/pipewire/pipewire.conf.d/50-bitrate.conf +++ b/.config/pipewire/pipewire.conf.d/50-bitrate.conf @@ -1,6 +1,5 @@ context.properties = { - default.clock.rate = 44100 - default.clock.allowed-rates = [ 44100, 48000, 96000 ] - default.clock.min-quantum = 16 + default.clock.rate = 96000 + default.clock.allowed-rates = [ 96000 ] } diff --git a/.config/poke/pokerc.conf b/.config/poke/pokerc.conf new file mode 100644 index 0000000..90a320f --- /dev/null +++ b/.config/poke/pokerc.conf @@ -0,0 +1,7 @@ +.set obase 16 +.set omode tree +.set pretty-print yes +.set oacutoff 32 + +pk_dump_cluster_by = 4 + diff --git a/.config/polybar/config.ini##template b/.config/polybar/config.ini##template index ed5371a..2521ce4 100644 --- a/.config/polybar/config.ini##template +++ b/.config/polybar/config.ini##template @@ -42,8 +42,9 @@ font-1 = "sans-serif:pixelsize=8:weight=bold:size=0;2" font-2 = "Hiragino Kaku Gothic ProN W3:pixelsize=8:weight=medium:size=0;1" font-3 = "Hiragino Kaku Gothic ProN W6:pixelsize=8:weight=medium:size=0;1" font-4 = "Noto Sans KR:pixelsize=8:weight=medium:size=0;2" +font-5 = "Noto Sans CJK SC:pixelsize=8:weight=medium:size=0;2" -modules-left = time date cal +modules-left = time date {% if yadm.hostname == "thoncc" %} modules-center = battery1 battery2 brightness modules-right = mpd wireless keyboard volume @@ -116,26 +117,21 @@ label-font = 2 [module/keyboard] type = custom/script -exec = ~/.local/share/bin/kbindicator +exec = kbindicator tail = true -[module/cal] -type = custom/script -exec = now | ansi2polybar -interval = 60 - [module/mpd] type = internal/mpd format-online = <label-song> format-offline = format-stopped = -label-song = %artist% - %{T2}%title%%{T-} +label-song = %artist% - %title% label-song-maxlen = 50 label-song-ellipsis = true [module/wacomtouch] type = custom/script -exec = ~/.local/share/bin/wacomtouch +exec = wacomtouch interval = 1 [module/battery1] diff --git a/.config/rofi/config.rasi##template b/.config/rofi/config.rasi##template index c467dcd..bb09bdf 100644 --- a/.config/rofi/config.rasi##template +++ b/.config/rofi/config.rasi##template @@ -20,9 +20,10 @@ configuration { window { padding: 2px; - background-color: ${background}; - text-color: ${foreground}; + background-color: ${bg}; + text-color: ${fg}; width: 350px; + border-radius: 10px; } * { @@ -42,7 +43,7 @@ inputbar { } entry { - padding: 10px; + padding: 10px 10px 8px 10px; cursor-width: 1px; } @@ -51,14 +52,14 @@ listview { scrollbar: false; lines: 6; fixed-height: false; - padding: 1px 0px; + padding: 2px 0px; } element { - margin: -1px 0px; - padding: 6px 10px; + margin: -2px 0px; + padding: 6px 10px 2px 10px; background-color: transparent; - text-color: ${foreground}; + text-color: ${fg}; } element selected { diff --git a/.config/winapps/winapps.conf b/.config/winapps/winapps.conf new file mode 100644 index 0000000..2ef2dae --- /dev/null +++ b/.config/winapps/winapps.conf @@ -0,0 +1,15 @@ +RDP_USER="$(id -un)" +RDP_PASS="$(pass etc/rdpwin)" +VM_NAME="rdpwin" +WAFLAVOR="libvirt" +RDP_SCALE="100" +REMOVABLE_MEDIA="/mnt" +RDP_FLAGS="/cert:tofu /sound /microphone +home-drive -decorations +span /kbd:remap:0x3a=0x1d" +DEBUG="true" +AUTOPAUSE="off" +AUTOPAUSE_TIME="300" +PORT_TIMEOUT="5" +RDP_TIMEOUT="30" +APP_SCAN_TIMEOUT="30" +BOOT_TIMEOUT="0" +HIDEF="off" diff --git a/.config/wireplumber/wireplumber.conf.d/50-bluez.conf b/.config/wireplumber/wireplumber.conf.d/50-bluez.conf new file mode 100644 index 0000000..c957f73 --- /dev/null +++ b/.config/wireplumber/wireplumber.conf.d/50-bluez.conf @@ -0,0 +1,5 @@ +monitor.bluez.properties = { + bluez5.enable-msbc = false + bluez5.enable-cvsd = false + bluez5.default.rate = 96000 +} diff --git a/.config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf b/.config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf index d4eebbf..212afe6 100644 --- a/.config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf +++ b/.config/wireplumber/wireplumber.conf.d/50-disable-suspend.conf @@ -1,28 +1,30 @@ monitor.alsa.rules = [ - { - matches = [ - { node.name = "~alsa_input.*" } - { node.name = "~alsa_output.*" } - ] - actions = { - update-props = { - session.suspend-timeout-seconds = 0 - } - } - } + { + matches = [ + { node.name = "~alsa_input.*" } + { node.name = "~alsa_output.*" } + ] + actions = { + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } ] monitor.bluez.rules = [ - { - matches = [ - { node.name = "~bluez_input.*" } - { node.name = "~bluez_output.*" } - ] - actions = { - update-props = { - session.suspend-timeout-seconds = 0 - } - } - } + { + matches = [ + { node.name = "~bluez_input.*" } + { node.name = "~bluez_output.*" } + ] + actions = { + update-props = { + audio.format = "S24_3LE" + audio.rate = 96000 + session.suspend-timeout-seconds = 0 + } + } + } ] diff --git a/.config/xbindkeys/main##template b/.config/xbindkeys/main index a1b5251..47a89f6 100644 --- a/.config/xbindkeys/main##template +++ b/.config/xbindkeys/main @@ -25,30 +25,26 @@ "pactl set-sink-volume @DEFAULT_SINK@ -1%" Mod1+Mod4+minus +"pactl set-sink-volume @DEFAULT_SINK@ -1%" + XF86AudioLowerVolume "pactl set-sink-volume @DEFAULT_SINK@ +1%" Mod1+Mod4+equal - "pactl set-sink-volume @DEFAULT_SINK@ +1%" XF86AudioRaiseVolume -"pactl set-sink-volume @DEFAULT_SINK@ -1%" - XF86AudioLowerVolume "pactl set-sink-mute @DEFAULT_SINK@ toggle" XF86AudioMute "pactl set-source-mute @DEFAULT_SOURCE@ toggle" XF86AudioMicMute -{% if yadm.hostname == "thoncc" %} -"xbacklight -inc 10 -time 100 -fps 60" - XF86MonBrightnessUp -"xbacklight -dec 10 -time 100 -fps 60" - XF86MonBrightnessDown -{% else %} -"brightness - 20" +"brightness -10" Shift+Mod4 + minus -"brightness + 20" +"brightness -10" + XF86MonBrightnessDown +"brightness +10" Shift+Mod4 + equal -{% endif %} +"brightness +10" + XF86MonBrightnessUp "playerctl play-pause" XF86AudioPlay @@ -95,6 +91,15 @@ "i3-msg move right" Mod4 + Shift + l +"i3-msg move workspace to output left" + Mod1 + Mod4 + Shift + h +"i3-msg move workspace to output down" + Mod1 + Mod4 + Shift + j +"i3-msg move workspace to output up" + Mod1 + Mod4 + Shift + k +"i3-msg move workspace to output right" + Mod1 + Mod4 + Shift + l + "i3-msg resize grow width 10 px" Mod4 + period "i3-msg resize shrink width 10 px" @@ -119,3 +124,5 @@ "fcitx5-remote -s mozc" XF86Launch7 + Release +"autorandr --change" + XF86Display diff --git a/.config/xsettingsd/xsettingsd.conf b/.config/xsettingsd/xsettingsd.conf new file mode 100644 index 0000000..46d4730 --- /dev/null +++ b/.config/xsettingsd/xsettingsd.conf @@ -0,0 +1,4 @@ +Xft/Hinting 1 +Xft/HintStyle "hintslight" +Xft/Antialias 1 +Xft/RGBA "rgb" diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index f1e3267..372735d 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -1,8 +1,14 @@ #!/bin/sh + cd "$(dirname "$0")" . "$HOME/.profile" . ./lib/bootstrap +# never use custom locale in TTY/logs +export LANG=C + +alias s=silent + # ensure required packages are installed begintask "installing packages" "$XDG_CONFIG_HOME/yadm/install-arch" > pkgs.log 2>&1 @@ -43,13 +49,13 @@ endtask begintask "building st (terminal) from source" mkdir -p ~/.local cd ~/.local - s git clone --depth 1 https://git.pipeframe.xyz/lonkaars/st + s git clone --depth 1 https://git.pipeframe.xyz/fork/st cd st s make -j endtask ) -[ "$(find ~/.ssh -name 'id*' | wc -l)" -eq 0 ] && ( +[ "$(find ~/.ssh -name 'id*' 2>/dev/null | wc -l)" -eq 0 ] && ( begintask "generating ssh keys" s ssh-keygen -q -N "" < /dev/zero endtask diff --git a/.config/yadm/install-arch b/.config/yadm/install-arch index 94721c3..a2ed199 100755 --- a/.config/yadm/install-arch +++ b/.config/yadm/install-arch @@ -8,6 +8,5 @@ cd "$(dirname "$0")" # filter comments and pipe package name list to yay -sed -e 's/#.*//g' -e 's/ //g' -e '/^$/d' packages-arch |\ - yay --noprogressbar --quiet --noconfirm --needed -Sy - +sed -e 's/#.*//g' -e 's/ //g' -e '/^$/d' packages-arch | yay --needed -Sy - diff --git a/.config/yadm/lib/bootstrap b/.config/yadm/lib/bootstrap index e367320..5dafb62 100644 --- a/.config/yadm/lib/bootstrap +++ b/.config/yadm/lib/bootstrap @@ -1,17 +1,17 @@ #!/bin/sh -unset LANG # never use custom locale in TTY/logs - TIMESTART="$(date +%s)" begintask() { printf '%s ...' "$1" } + endtask() { EXIT_CODE=$? [ $EXIT_CODE -eq 0 ] && echo ' OK' || echo ' ERROR' return $EXIT_CODE } -s() { # s for silent + +silent() { "$@" 1> /dev/null 2> /dev/null } diff --git a/.config/yadm/packages-arch b/.config/yadm/packages-arch index e35a5db..b9b9781 100644 --- a/.config/yadm/packages-arch +++ b/.config/yadm/packages-arch @@ -14,7 +14,9 @@ xorg-xrdb xorg-xset # directly used in scripts / startup +augeas autocutsel +bat dbus dunst fcitx5 @@ -23,9 +25,11 @@ imagemagick jq libpulse # for pactl maim +moreutils mpd neovim-remote nicotine+ +nodejs pastel picom pipewire @@ -34,6 +38,7 @@ polkit-gnome polybar python python-pip +python-pipx redshift rofi xbanish @@ -52,10 +57,7 @@ openssh openssl sshfs usb_modeswitch # required for android usb tethering - -# network stuff (TODO) -# NetworkManager # currently only used on laptop... -dhcpcd # i am unsure if i need this +networkmanager # applications anki-bin @@ -78,6 +80,7 @@ pass pass-otp pavucontrol pinentry +qt5-tools ranger restic rofi-pass-git @@ -86,6 +89,7 @@ scrot slock sudo sxiv +unarchiver unzip vdirsyncer vim-plug diff --git a/.config/yadm/root/bootstrap b/.config/yadm/root/bootstrap index b244471..f8b59fb 100755 --- a/.config/yadm/root/bootstrap +++ b/.config/yadm/root/bootstrap @@ -2,6 +2,12 @@ cd "$(dirname "$0")" . ../lib/bootstrap +# never use custom locale in TTY/logs +export LANG=C + +alias s=silent + + wrong_call() { cat << EOF run this script as root and with the username of your user account @@ -25,7 +31,7 @@ s getent passwd "$SETUP_USER" || wrong_call [ $(id -u "$SETUP_USER") -eq 0 ] && wrong_call begintask "copy system config files" -s cp -r etc/. /etc +s cp -r --preserve=mode,timestamps etc/. /etc endtask PINENTRY="pinentry-gnome3" @@ -72,6 +78,10 @@ s grep '^#\s*\<Color\>' /etc/pacman.conf && ( endtask ) +begintask "set autorandr to run at lightdm display startup" +s augtool set '/files/etc/lightdm/lightdm.conf/Seat:*/display-setup-script' '/etc/lightdm/autorandr-change' +endtask + [ "$(getent passwd "$SETUP_USER" | cut -d: -f7 | xargs basename)" != "zsh" ] && ( begintask "set user shell to zsh" s chsh -s "$(command -v zsh)" "$SETUP_USER" diff --git a/.config/yadm/root/etc/NetworkManager/dispatcher.d/70-auto-wifi.sh b/.config/yadm/root/etc/NetworkManager/dispatcher.d/70-auto-wifi.sh new file mode 100755 index 0000000..4680626 --- /dev/null +++ b/.config/yadm/root/etc/NetworkManager/dispatcher.d/70-auto-wifi.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +export LANG=C + +interface="$1" +action="$2" + +connectivity="$(nmcli networking connectivity)" +interface_type="$(nmcli -g GENERAL.TYPE device show "$interface")" +interface_state="$(nmcli -g GENERAL.STATE device show "$interface" | grep -o '^[0-9]\+')" + +if [ "$action" = "down" ] && [ "$connectivity" = "none" ]; then + nmcli radio wifi on + exit +fi + +if [ "$action" = "up" ] && [ "$interface_type" == "ethernet" ] && [ "$interface_state" = "100" ]; then + nmcli radio wifi off + exit +fi + diff --git a/.config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf b/.config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf index 6c7cfad..d4f95ff 100644 --- a/.config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf +++ b/.config/yadm/root/etc/X11/xorg.conf.d/00-keyboard.conf @@ -1,6 +1,9 @@ Section "InputClass" - Identifier "default keyboard repeat speed" + Identifier "system-keyboard" MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbModel" "pc105" + Option "XkbOptions" "ctrl:nocaps" Option "AutoRepeat" "250 40" EndSection diff --git a/.config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf b/.config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf new file mode 100644 index 0000000..f390b93 --- /dev/null +++ b/.config/yadm/root/etc/X11/xorg.conf.d/40-trackpad.conf @@ -0,0 +1,9 @@ +Section "InputClass" + Identifier "Trackpad preferences" + MatchIsTouchpad "on" + Driver "libinput" + Option "NaturalScrolling" "1" + Option "Tapping" "1" + Option "ScrollPixelDistance" "40" +EndSection + diff --git a/.config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf b/.config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf new file mode 100644 index 0000000..a1071b0 --- /dev/null +++ b/.config/yadm/root/etc/X11/xorg.conf.d/90-libinput-logitech.conf @@ -0,0 +1,8 @@ +Section "InputClass" + Identifier "Logitech MX Master 3S High res scrolling" + MatchUSBID "046d:c548" + MatchDevicePath "/dev/input/event*" + Driver "libinput" + Option "HighResolutionWheelScrolling" "false" +EndSection + diff --git a/.config/yadm/root/etc/containers/nodocker b/.config/yadm/root/etc/containers/nodocker new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/yadm/root/etc/containers/nodocker diff --git a/.config/yadm/root/etc/default/earlyoom b/.config/yadm/root/etc/default/earlyoom new file mode 100644 index 0000000..53ddf8b --- /dev/null +++ b/.config/yadm/root/etc/default/earlyoom @@ -0,0 +1 @@ +EARLYOOM_ARGS="-M 102400 -r 3600 -n --avoid '(^|/)(init|systemd|Xorg|sshd)$'" diff --git a/.config/yadm/root/etc/kernel/cmdline b/.config/yadm/root/etc/kernel/cmdline new file mode 100644 index 0000000..2448b2c --- /dev/null +++ b/.config/yadm/root/etc/kernel/cmdline @@ -0,0 +1 @@ +quiet diff --git a/.config/yadm/root/etc/libinput/local-overrides.quirks b/.config/yadm/root/etc/libinput/local-overrides.quirks new file mode 100644 index 0000000..9a897c2 --- /dev/null +++ b/.config/yadm/root/etc/libinput/local-overrides.quirks @@ -0,0 +1,4 @@ +[Logitech MX Master 3S] +MatchVendor=0x046D +MatchProduct=0xC548 +AttrEventCode=-REL_WHEEL_HI_RES;-REL_HWHEEL_HI_RES; diff --git a/.config/yadm/root/etc/lightdm/autorandr-change b/.config/yadm/root/etc/lightdm/autorandr-change new file mode 100755 index 0000000..f181fe8 --- /dev/null +++ b/.config/yadm/root/etc/lightdm/autorandr-change @@ -0,0 +1,5 @@ +#!/bin/sh +autorandr --change + +# make sure this script exits happily +exit 0 diff --git a/.config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf b/.config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf index 8dae65c..7ba729d 100644 --- a/.config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf +++ b/.config/yadm/root/etc/lightdm/lightdm-gtk-greeter.conf @@ -1,3 +1,8 @@ [greeter] -theme-name=Skeuos-Blue-Dark -indicators=~session;~power +font-name = Inter 9 +theme-name = adw-gtk3-dark +indicators = ~clock;~spacer;~power +hide-user-image = true +screensaver-timeout = 15 +default-session = xinitrc +clock-format = %t%H:%M diff --git a/.config/yadm/root/etc/logid.cfg b/.config/yadm/root/etc/logid.cfg new file mode 100644 index 0000000..e98e048 --- /dev/null +++ b/.config/yadm/root/etc/logid.cfg @@ -0,0 +1,13 @@ +devices: ({ + name: "MX Master 3S"; + smartshift: { + on: true; + threshold: 255; + torque: 255; + }; + hiresscroll: { + hires: false; + invert: false; + target: false; + }; +}); diff --git a/.config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf b/.config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf new file mode 100644 index 0000000..c289779 --- /dev/null +++ b/.config/yadm/root/etc/systemd/logind.conf.d/10-laptop-lid.conf @@ -0,0 +1,4 @@ +[Login] +HandleLidSwitch=suspend +HandleLidSwitchExternalPower=ignore +HandleLidSwitchDocked=ignore diff --git a/.config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb b/.config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb new file mode 100644 index 0000000..3ccaa11 --- /dev/null +++ b/.config/yadm/root/etc/udev/hwdb.d/71-logitech-mx3.hwdb @@ -0,0 +1,3 @@ +mouse:usb:v046dpc548:name:Logitech USB Receiver Mouse:* + MOUSE_WHEEL_CLICK_ANGLE=1 + MOUSE_WHEEL_CLICK_COUNT=360 diff --git a/.config/yadm/root/etc/udev/rules.d/90-backlight.rules b/.config/yadm/root/etc/udev/rules.d/90-backlight.rules new file mode 100644 index 0000000..23eedf8 --- /dev/null +++ b/.config/yadm/root/etc/udev/rules.d/90-backlight.rules @@ -0,0 +1 @@ +SUBSYSTEM=="backlight", ACTION=="add", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" diff --git a/.config/yadm/root/etc/xdg/nvim/init.vim b/.config/yadm/root/etc/xdg/nvim/init.vim new file mode 100644 index 0000000..f238fc6 --- /dev/null +++ b/.config/yadm/root/etc/xdg/nvim/init.vim @@ -0,0 +1,2 @@ +set notermguicolors +colorscheme vim diff --git a/.config/zathura/zathurarc b/.config/zathura/zathurarc new file mode 100644 index 0000000..89ae535 --- /dev/null +++ b/.config/zathura/zathurarc @@ -0,0 +1,16 @@ +set scroll-page-aware true +set scroll-full-overlap 0.01 +set scroll-step 100 +set selection-clipboard clipboard + +# recolor (dark mode) +map <C-i> recolor +set recolor true + +set recolor-reverse-video true +set recolor-keephue true +set guioptions "" +set show-recent false + +include ./colors + diff --git a/.config/zathura/zathurarc##template b/.config/zathura/zathurarc##template deleted file mode 100644 index 932d1c7..0000000 --- a/.config/zathura/zathurarc##template +++ /dev/null @@ -1,20 +0,0 @@ -set scroll-page-aware "true" -set scroll-full-overlap 0.01 -set scroll-step 100 -{% if yadm.hostname == "thoncc" %} -set font "JetBrainsMono Nerd Font 8" -{% else %} -set font "JetBrainsMono Nerd Font 9" -{% endif %} -set selection-clipboard clipboard - -# recolor (dark mode) -map <C-i> recolor -set recolor "true" - -set recolor-reverse-video "true" -set recolor-keephue "true" -set guioptions "" - -include ./colors - diff --git a/.local/share/Anki2/gldriver6 b/.local/share/Anki2/gldriver6 new file mode 100644 index 0000000..865faf1 --- /dev/null +++ b/.local/share/Anki2/gldriver6 @@ -0,0 +1 @@ +auto diff --git a/.local/share/applications/discord.desktop b/.local/share/applications/discord.desktop index 676b330..403a457 100644 --- a/.local/share/applications/discord.desktop +++ b/.local/share/applications/discord.desktop @@ -7,3 +7,4 @@ Exec=discord Icon=discord Type=Application Categories=Network;InstantMessaging; +MimeType=x-scheme-handler/betterdiscord; diff --git a/.local/share/applications/mozc-dictionary.desktop b/.local/share/applications/mozc-dictionary.desktop new file mode 100644 index 0000000..c4f6193 --- /dev/null +++ b/.local/share/applications/mozc-dictionary.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Mozc dictionary tool +Name[ja]=Mozc 辞書ツール +Name[nl]=Mozc woordenboekhulpprogramma +GenericName[ja]=日本語入力の辞書ツール +GenericName[nl]=Hulpprogramma voor woordenboek van Japanse invoer +GenericName=Japanese input method dictionary tool +Exec=/usr/lib/mozc/mozc_tool --mode=dictionary_tool +Icon=mozc +Type=Application +Categories=Settings; diff --git a/.local/share/applications/mozc-settings.desktop b/.local/share/applications/mozc-settings.desktop new file mode 100644 index 0000000..bcfde2d --- /dev/null +++ b/.local/share/applications/mozc-settings.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Mozc settings +Name[ja]=Mozc プロパティ +Name[nl]=Mozc instellingen +GenericName[ja]=日本語入力の設定 +GenericName[nl]=Instellingen voor Japanse invoermethode +GenericName=Japanese IME configuration +Exec=/usr/lib/mozc/mozc_tool --mode=config_dialog +Icon=mozc +Type=Application +Categories=Settings; diff --git a/.local/share/bin/= b/.local/share/bin/= index 59b9b45..8f3345d 100755 --- a/.local/share/bin/= +++ b/.local/share/bin/= @@ -1,2 +1,42 @@ -#!/bin/sh -python3 -c "from math import *; deg = pi / 180; print($*)" +#!/bin/python3 -- +from sys import argv as _argv +from os import environ as _environ, path as _path +from math import * + +_ans_path = _path.join(_environ["XDG_CACHE_HOME"], "calc_ans") +try: + _ans_file = open(_ans_path, "r+") +except: + _ans_file = open(_ans_path, "w+") +_exit_code = 0 + +ans = 0 +try: + _ans_str = _ans_file.read() + if "." in _ans_str: + ans = float(_ans_str) + else: + ans = int(_ans_str) +except: + pass + +deg = pi / 180 + +MIN = min +MAX = max +BIT = lambda n: 1 << n +GENMASK = lambda h, l: (BIT(MAX(h, l) + 1) - 1) ^ (BIT(MIN(h, l)) - 1) + +try: + ans = eval(" ".join(_argv[1:])) + print(ans) +except: + pass + +_ans_file.truncate(0) +_ans_file.seek(0) +_ans_file.write(str(ans)) +_ans_file.close() + +exit(_exit_code) + diff --git a/.local/share/bin/brave b/.local/share/bin/brave index 1dea360..5089377 100755 --- a/.local/share/bin/brave +++ b/.local/share/bin/brave @@ -1,8 +1,7 @@ #!/bin/sh -# the remote debugging is so brave can be hooked into by -# ~/.local/share/mode/reload.d/brave. this is probaby bad for security if -# you're not the only user on the system -# --remote-debugging-port=9222 \ +# - make brave automatically load the `mode` theme +# - don't use kwallet (i don't save passwords in chrome anyways) /usr/bin/brave \ --load-extension="$XDG_CACHE_HOME/mode/chromium" \ + --password-store=basic \ "$@" diff --git a/.local/share/bin/brightness b/.local/share/bin/brightness new file mode 100755 index 0000000..c1c6139 --- /dev/null +++ b/.local/share/bin/brightness @@ -0,0 +1,29 @@ +#!/bin/sh +case "$*" in + +*) action="+" ;; + -*) action="-" ;; + *) action="=" ;; +esac +value="$(echo "$*" | tr -dc '[[:digit:]]')" + +if [ -n "$(command -v xbacklight)" ] ; then + [ "$action" = "+" ] && action="-inc" + [ "$action" = "-" ] && action="-dec" + [ "$action" = "=" ] && action="-set" + + fork xbacklight -time 100 -fps 60 $action $value + + exit 0 + +elif [ -n "$(command -v ddcutil)" ] ; then + [ "$action" = "=" ] && action="" + + for bus in 2 3 ; do + fork ddcutil --bus="$bus" --skip-ddc-checks --noverify setvcp 10 $action $value + done + + exit 0 + +fi +exit 1 + diff --git a/.local/share/bin/ccpreview b/.local/share/bin/ccpreview index a835ab4..9f13acc 100755 --- a/.local/share/bin/ccpreview +++ b/.local/share/bin/ccpreview @@ -24,33 +24,51 @@ VIDEO_URL="av://v4l2:$VIDEO_DEVICE" RESOLUTION="${WIDTH}x${HEIGHT}" +fork() { + JOBS="$JOBS $( + "$@" > /dev/null 2> /dev/null & + echo $! + )" +} + # set capture card v4l parameters v4l2-ctl --silent --device "$VIDEO_DEVICE" \ --set-parm "$FRAMERATE" \ --set-fmt-video "width=$WIDTH,height=$HEIGHT,pixelformat=MJPG" \ --set-ctrl "brightness=0,contrast=128,saturation=128,hue=0" -# preview window -mpv \ - --msg-level=input=no --no-config --input-conf=/dev/null \ - --no-osc --no-input-default-bindings --pause=no --force-seekable=no \ - \ - --no-cache --untimed --no-correct-pts \ +_mpv() { + fork mpv \ + --quiet --msg-level=input=no \ + --no-config --input-conf=/dev/null \ + --no-osc --no-border \ + --no-input-default-bindings --pause=no --force-seekable=no \ + --cache=no \ + "$@" +} + +# audio preview +_mpv \ --no-demuxer-thread \ - --video-sync=audio \ --audio-buffer=0 \ - --vd-lavc-threads=1 \ --cache-pause=no \ --interpolation=no \ - --video-latency-hacks=yes \ --stream-buffer-size=4k \ - \ - --demuxer-lavf-o-add=fflags=+nobuffer \ - --demuxer-lavf-analyzeduration=0 \ + --profile=low-latency \ + --speed=1.001 \ + "$AUDIO_URL" + +# video preview +_mpv \ + --untimed --no-correct-pts --no-demuxer-thread \ + --profile=low-latency \ --demuxer-lavf-o-add=input_format=mjpeg \ --demuxer-lavf-o-add=framerate="$FRAMERATE" \ --demuxer-lavf-o-add=resolution="$RESOLUTION" \ --demuxer-lavf-o-add=rw_timeout=30000000 \ - \ - "$VIDEO_URL" --audio-file="$AUDIO_URL" + --speed=1.05 \ + "$VIDEO_URL" + +sleep infinity +kill -9 -- $JOBS diff --git a/.local/share/bin/dbg b/.local/share/bin/dbg new file mode 100755 index 0000000..424110b --- /dev/null +++ b/.local/share/bin/dbg @@ -0,0 +1,40 @@ +#!/bin/sh +progname="$(basename "$(readlink -f "$0")")" +die() { + ec="$1" + shift + echo "$@" + exit "$ec" +} + +GDB="arm-none-eabi-gdb" + +[ $# -lt 1 ] && die 1 "usage: $progname DEVICE [gdb args...]" +DEVICE="$1" +shift + +if [ $# -eq 0 ] ; then + # automatically add --se flag if executable can be found + exec="$(find . -maxdepth 3 -name '*.elf' | head -n1)" + [ -n "$exec" ] && set -- --se="$exec" +fi + +[ -n "$(echo "$*" | grep -i zephyr)" ] && GDB="arm-zephyr-eabi-gdb" + +fork JLinkGDBServerCLExe \ + -device "$DEVICE" \ + -select USB \ + -endian little \ + -if SWD \ + -speed auto \ + -singlerun \ + -noir \ + -nologtofile \ + -silent + +# append startup attach command to args +set -- --eval-command="target extended-remote :2331" "$@" + +# launch gdb and forward any other args to it +exec "$GDB" "$@" + diff --git a/.local/share/bin/dox-open b/.local/share/bin/dox-open new file mode 100755 index 0000000..493c435 --- /dev/null +++ b/.local/share/bin/dox-open @@ -0,0 +1,31 @@ +#!/bin/node + +import { glob, readFile } from 'node:fs/promises'; +import { spawn } from 'node:child_process'; +import { argv, chdir, cwd } from 'node:process'; +import { join } from 'node:path'; + +argv.shift(); +argv.shift(); +chdir("search"); + +var symbols = {}; +for await (const chunk of glob('all_*.js')) { + const contents = await readFile(chunk); + const searchData = eval(`${contents}; searchData`); + const here = cwd(); + + for (const [ _id, [ symbol, ...entry ] ] of searchData) { + symbols[symbol] = entry.map(e => `file://${join(here, e[0])}`); + } +} + +for (const symbol of argv) { + if (!(symbol in symbols)) { + console.error(`No doxygen index for symbol \`${symbol}\``); + continue; + } + const urls = symbols[symbol]; + spawn('xdg-open', [ urls[0], ]); +} + diff --git a/.local/share/bin/editor b/.local/share/bin/editor new file mode 100755 index 0000000..d4bf664 --- /dev/null +++ b/.local/share/bin/editor @@ -0,0 +1,2 @@ +#!/bin/sh +exec nvim -p "$@" diff --git a/.local/share/bin/fontfix b/.local/share/bin/fontfix new file mode 100755 index 0000000..1c9beaf --- /dev/null +++ b/.local/share/bin/fontfix @@ -0,0 +1,39 @@ +#!/bin/python3 + +import os +import sys +from pathlib import Path + +from fontTools import ttLib + +PROPID_FAMILY = 1 +PROPID_SUBFAMILY = 2 +PROPID_FULLNAME = 4 +PROPID_PSNAME = 6 + +PLATFORM_MS = 1 +PLATFORM_MAC = 3 + +# see +# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html +# for magic numbers + +for folder in Path(".").iterdir(): + print(f"{folder}/") + family_name = str(folder.stem) + for file in folder.glob("*.ttf"): + subfamily_name = file.stem.removeprefix(family_name).strip() + with ttLib.TTFont(file) as ttf: + nametable = ttf["name"] + full_name = f"{family_name} {subfamily_name}" + postscript_name = f"{family_name}-{subfamily_name}".replace(" ", "") + nametable.setName(family_name, PROPID_FAMILY, PLATFORM_MS, 0, 0) + nametable.setName(family_name, PROPID_FAMILY, PLATFORM_MAC, 1, 1033) + nametable.setName(subfamily_name, PROPID_SUBFAMILY, PLATFORM_MS, 0, 0) + nametable.setName(subfamily_name, PROPID_SUBFAMILY, PLATFORM_MAC, 1, 1033) + nametable.setName(full_name, PROPID_FULLNAME, PLATFORM_MS, 0, 0) + nametable.setName(full_name, PROPID_FULLNAME, PLATFORM_MAC, 1, 1033) + nametable.setName(postscript_name, PROPID_PSNAME, PLATFORM_MS, 0, 0) + nametable.setName(postscript_name, PROPID_PSNAME, PLATFORM_MAC, 1, 1033) + ttf.save(file) + print(f" {file.name}: [{family_name} :: {subfamily_name}]") diff --git a/.local/share/bin/hide b/.local/share/bin/hide new file mode 100755 index 0000000..cb49be0 --- /dev/null +++ b/.local/share/bin/hide @@ -0,0 +1,4 @@ +#!/bin/sh +for file in "$@" ; do + mv "$file" ".$file" +done diff --git a/.local/share/bin/labels2lrc b/.local/share/bin/labels2lrc index 1491dae..38630c1 100755 --- a/.local/share/bin/labels2lrc +++ b/.local/share/bin/labels2lrc @@ -1,13 +1,17 @@ -#!/bin/sh -cat "$@" |\ - awk ' +#!/bin/gawk -f BEGIN { FS = "\t" } { - seconds = $1 - minutes = int(seconds / 60) - seconds = seconds % 60 - millis = (seconds * 100) % 100 + time = $1 + time = gensub(/([0-9]+)\.([0-9]{,2})([0-9]*)/, "\\1\\2.\\3", "g", time) + time = int(time + 0.5) + + millis = time % 100 + time = int(time / 100) + + seconds = time % 60 + time = int(time / 60) + + minutes = time % 100 + printf("[%02d:%02d.%02d]%s\n", minutes, seconds, millis, $3) } -' - diff --git a/.local/share/bin/lrc2labels b/.local/share/bin/lrc2labels new file mode 100755 index 0000000..a23b299 --- /dev/null +++ b/.local/share/bin/lrc2labels @@ -0,0 +1,7 @@ +#!/bin/gawk -f +match($0, /^\[([0-9]{2}):([0-9]{2}\.[0-9]{2})\](.*)/, group) { + time = group[1] * 60 + group[2] + lyric = group[3] + + printf("%.2f\t%.2f\t%s\n", time, time, lyric) +} diff --git a/.local/share/bin/mk b/.local/share/bin/mk index ab0f586..54b6908 100755 --- a/.local/share/bin/mk +++ b/.local/share/bin/mk @@ -1,11 +1,21 @@ #!/bin/sh progname="$(basename "$0")" showmode() { + ! [ -n "$FROM_PROMPT" ] && return + ! [ -t 1 ] && return + mode=" ($1)" col=$(( $(tput cols) - $(echo "$mode" | wc -L) + 1 )) printf '\e[1A\e['$col'G\e[1;30m%s\e[0m\n' "$mode" } +mode_west() { + showmode 'west' + [ -z "$*" ] && set -- build + exec west "$@" +} +[ -e "west.yml" ] && mode_west "$@" + mode_cmake() { showmode 'cmake' builddir="build" @@ -16,11 +26,17 @@ mode_cmake() { # re-run configuration if fresh or CMakeLists was changed if [ ! -e "$builddir/build.ninja" ] || - [ "CMakeLists.txt" -nt "$builddir/build.ninja" ] ; then - cmake --log-level WARNING -B "$builddir" + [ "CMakeLists.txt" -nt "$builddir/build.ninja" ] ; then + cmake --log-level WARNING -B "$builddir" fi - exec cmake --build "$builddir" -- "$@" + # build + cmake --build "$builddir" -- "$@" || exit $? + + # generate vim tags (continue after mk exits) + ninja -C "$builddir" -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f "$builddir/tags" & + + exit 0 } [ -e "CMakeLists.txt" ] && mode_cmake "$@" diff --git a/.local/share/bin/nginx-dev b/.local/share/bin/nginx-dev new file mode 100755 index 0000000..40e73ad --- /dev/null +++ b/.local/share/bin/nginx-dev @@ -0,0 +1,86 @@ +#!/bin/sh +folder="$PWD" +port=8080 +try_files='/$uri /$uri.html /$uri/index.html =404' +access_log='/dev/stdout' +cache_control=' + proxy_store off; + proxy_cache off; + add_header Last-Modified $date_gmt; + add_header Cache-Control "private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; + if_modified_since off; + expires off; + etag off; +' + +usage() { + cat << EOF +usage: $(basename "$0") [options] [folder] + +options: + -p PORT host server on port PORT (default $port) + -t STR set try_files pattern to STR (default '$try_files') + -C enable server cache (disabled by default) + -v verbose mode (prints config before starting server) + -q quiet mode (disable access_log) + -x automatically open a browser + -h show this help +EOF +exit $1 +} + +ARGC=0 +while getopts hvp:Ct:qx OPT; do + [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND + case $OPT in + h) usage 0 ;; + p) port="$OPTARG" ;; + t) try_files="$OPTARG" ;; + v) print_config=1 ;; + C) cache_control='' ;; + q) access_log="/dev/null" ;; + x) open_browser=1 ;; + \?|*) usage 1 ;; + esac +done +shift $(( $OPTIND - 1 )) + +[ $# -ge 1 ] && folder="$(readlink -f "$1")" + +config="$(mktemp)" +pidfile="$(mktemp)" +cat << EOF > "$config" +worker_processes 1; +daemon off; +pid $pidfile; + +events { + worker_connections 1024; +} + +http { + types_hash_max_size 4096; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + $cache_control + + access_log $access_log; + + server { + listen $port; + listen [::]:$port; + + root $folder; + + location / { + try_files $try_files; + } + } +} +EOF +[ $print_config ] && cat "$config" +[ $open_browser ] && (xdg-open "http://localhost:$port" 1> /dev/null 2> /dev/null &) +nginx -c "$config" +rm -f "$config" "$pidfile" + diff --git a/.local/share/bin/now b/.local/share/bin/now deleted file mode 100755 index 8fca44f..0000000 --- a/.local/share/bin/now +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -printf '%s\n' "$(khal --color list now 1h --notstarted --day-format '' --format '({start-time}) {calendar-color}{title}{reset}')" diff --git a/.local/share/bin/preview b/.local/share/bin/preview index 0225848..141d03c 100755 --- a/.local/share/bin/preview +++ b/.local/share/bin/preview @@ -1,12 +1,26 @@ #!/bin/sh -[ $# -ne 5 ] && exit 1 -FILE="$1" -WIDTH="$2" -HEIGHT="$3" -POS_X="$4" -POS_Y="$5" +[ -n "$1" ] && FILE="$1" || { + echo "error: no input file" + exit 1 +} +[ -n "$2" ] && WIDTH="$(( "$2" - 3 ))" || WIDTH="$(tput cols)" +[ -n "$3" ] && HEIGHT="$3" || HEIGHT="$(tput lines)" +[ -n "$4" ] && POS_X="$4" || POS_X="0" +[ -n "$5" ] && POS_Y="$5" || POS_Y="0" MIMETYPE="$(file --mime-type -Lb "$FILE")" +EXT="${FILE#*.}" + +[ "$EXT" = "md" ] && [ "$MIMETYPE" = "text/plain" ] && MIMETYPE="application/markdown" +[ "$MIMETYPE" = "application/javascript" ] && MIMETYPE="text/javascript" + +render_manpage() { + exec groff -T utf8 -m man -rcR=1 -rIN=0 -rLL="${WIDTH}n" << EOF +.nr an-suppress-header-and-footer 1 +.TH +$(cat | preconv) +EOF +} case "$MIMETYPE" in image/*) @@ -27,11 +41,18 @@ case "$MIMETYPE" in application/x-tar|\ application/x-bzip|\ application/x-bzip2|\ + application/gzip|\ application/zip|\ application/x-7z-compressed|\ application/vnd.rar) bsdtar -tf "$FILE" ;; + application/markdown) + pandoc --from=gfm --to=man "$FILE" | render_manpage + ;; + application/json) + jq --color-output . "$FILE" + ;; *) echo "$MIMETYPE" file -b "$FILE" | fold --width="$WIDTH" --spaces diff --git a/.local/share/bin/rofi b/.local/share/bin/rofi index 2b2d0b6..d573764 100755 --- a/.local/share/bin/rofi +++ b/.local/share/bin/rofi @@ -1,4 +1,4 @@ #!/bin/sh [ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env" -. "$XDG_CONFIG_HOME/rofi/colors" +. "$XDG_CACHE_HOME/mode/state/vars" exec /bin/rofi -no-default-config "$@" diff --git a/.local/share/bin/screenrecord b/.local/share/bin/screenrecord index 52c6e5b..1045a6e 100755 --- a/.local/share/bin/screenrecord +++ b/.local/share/bin/screenrecord @@ -1,3 +1,8 @@ #!/bin/sh -giph -f 60 -s -b 4 -c 255,255,255 "$(date +'%Y-%m-%d_%H-%M-%S.mp4')" +exec giph "$@" \ + --framerate 60 \ + --select \ + --bordersize 4 \ + --color 255,255,255 \ + "$(date +'%Y-%m-%d_%H-%M-%S.mp4')" diff --git a/.local/share/bin/sdk10_compiledb b/.local/share/bin/sdk10_compiledb new file mode 100755 index 0000000..6e62d47 --- /dev/null +++ b/.local/share/bin/sdk10_compiledb @@ -0,0 +1,38 @@ +#!/bin/python3 + +from shlex import split, join +from sys import argv +from os import getcwd +import subprocess + +process = subprocess.run(argv[1:], stdout=subprocess.PIPE, stderr=None, env={"LANG": "C"}) + +dir_stack = [getcwd()] +expanded_output = [] + +for line in process.stdout.decode('utf-8').split('\n'): + expanded_args = [] + args = split(line) + + if line.startswith('make: Entering directory'): + dir_stack.append(args[-1]) + expanded_output.append(line) + continue + if line.startswith('make: Leaving directory'): + dir_stack.pop() + expanded_output.append(line) + continue + + for arg in args: + if not arg.startswith('@'): + expanded_args.append(arg) + continue + with open(dir_stack[-1] + '/' + arg[1:], 'r') as file: + expanded_args += split(file.read()) + expanded_output.append(subprocess.list2cmdline(expanded_args)) + +process = subprocess.Popen(["compiledb"], stdin=subprocess.PIPE, stdout=None, stderr=None, text=True) +process.stdin.write("\n".join(expanded_output)) +process.stdin.close() +process.wait() + diff --git a/.local/share/bin/set-default b/.local/share/bin/set-default new file mode 100755 index 0000000..d93f65c --- /dev/null +++ b/.local/share/bin/set-default @@ -0,0 +1,32 @@ +#!/bin/sh +SCRIPT_NAME="$(basename "$0")" + +usage() { + code=0 + if [ -z "$1" ] ; then + cat << EOF +Set desktop entry ENTRY as default application for opening files with the same +type as FILE + +EOF + else + echo "error: $1" >&2 + code=1 + fi + cat << EOF +usage: + $SCRIPT_NAME ENTRY FILE [FILE] +EOF + exit $code +} + +[ $# -eq 0 ] && usage +DESKTOP_ENTRY="$1"; shift +[ -z "$DESKTOP_ENTRY" ] && usage "no desktop entry" +[ $# -lt 1 ] && usage "no reference file(s)" + +for file in "$@" ; do + mimetype="$(xdg-mime query filetype "$file")" + xdg-mime default "$DESKTOP_ENTRY" "$mimetype" +done + diff --git a/.local/share/gnupg/gpg-agent.conf b/.local/share/gnupg/gpg-agent.conf index b747e5e..4e3bb5d 100644 --- a/.local/share/gnupg/gpg-agent.conf +++ b/.local/share/gnupg/gpg-agent.conf @@ -1,2 +1,3 @@ allow-preset-passphrase max-cache-ttl 604800 +pinentry-program /usr/bin/pinentry-gtk diff --git a/.local/share/mode/mode b/.local/share/mode/mode index 3969fa1..dc188e9 100755 --- a/.local/share/mode/mode +++ b/.local/share/mode/mode @@ -1,10 +1,11 @@ -#!/bin/sh +#!/usr/bin/env sh progname="$(basename "$0")" data="$(dirname "$(readlink -f "$0")")" export data # path to directory containing reload.d, switch.d, etc. -run_cfggen=1 +run_switch=1 run_reload=1 +no_cfg=0 theme="" # absolute path to theme # print error message and exit with error @@ -22,7 +23,8 @@ usage: $progname [-chr] action|theme options: - -c, --no-cfggen disable updating of configuration files + -s, --no-switch disable running switch.d hooks + -c, --no-cfggen disable generation of templated configuration files -h, --help display this help text -r, --no-reload disable reloading of applications after applying theme @@ -40,6 +42,24 @@ examples: EOF } +# run a module file +run_mod() { + mod_name="$1" + + # modules must be executable + ! [ -x "$mod_name" ] && return + + # parse interpreter from shebang + interpreter="$(basename "$(command -v $(head -n1 "$mod_name" | sed -n 's/^#!\(.*\)/\1/p'))")" + if [ "$interpreter" = "sh" ] ; then + # source module if interpreter is POSIX sh (makes plugin functions available) + ( . "$mod_name" ) + else + # else, just run them + "$mod_name" + fi +} + # generate config files from theme file using scripts in switch.d switch() { [ -z "$theme" ] && stupid "error: no theme selected" @@ -56,20 +76,12 @@ switch() { # load theme colors + aux variables . "$theme" - # load plugins (available to switch.d scripts only) + # load plugins (TODO: plugins aren't loaded when only reloading) for plugin in "$data"/plug.d/* ; do . "$plugin" ; done # generate new config files / snippets (in parallel) for switch_function in "$data"/switch.d/* ; do - ! [ -x "$switch_function" ] && continue - interpreter="$(basename "$(command -v $(head -n1 "$switch_function" | sed -n 's/^#!\(.*\)/\1/p'))")" - if [ "$interpreter" = "sh" ] ; then - # source scripts if they are POSIX sh (makes plugin functions available) - ( . "$switch_function" ) & - else - # else, just run them - "$switch_function" & - fi + run_mod "$switch_function" & done # join all processes started above @@ -81,8 +93,7 @@ reload() { echo "reloading programs..." for reload_function in "$data"/reload.d/* ; do - ! [ -x "$reload_function" ] && continue - "$reload_function" & + run_mod "$reload_function" & done wait $(jobs -p) @@ -96,11 +107,13 @@ for arg in "$@" ; do # help -h|--help|help) usage && exit 0 ;; # only run reload scripts - reload) run_reload=1 run_cfggen=0 ;; + reload) run_reload=1 run_switch=0 ;; # prevent reload.d scripts from running -r|--no-reload) run_reload=0 ;; # prevent switch.d scripts from running - -c|--no-cfggen) run_cfggen=0 ;; + -s|--no-switch) run_switch=0 ;; + # prevent switch.d scripts from running + -c|--no-cfggen) no_cfg=1 ;; # restore previous theme stored as symlink (see switch.d/mode) restore) theme="$(readlink -f "$XDG_CACHE_HOME/mode/state/theme")" @@ -127,6 +140,9 @@ for arg in "$@" ; do esac done -[ $run_cfggen -eq 1 ] && switch +export no_cfg + +# main +[ $run_switch -eq 1 ] && switch [ $run_reload -eq 1 ] && reload diff --git a/.local/share/mode/plug.d/10_lib b/.local/share/mode/plug.d/10_lib index 61817bc..b3a0276 100644 --- a/.local/share/mode/plug.d/10_lib +++ b/.local/share/mode/plug.d/10_lib @@ -1,5 +1,46 @@ #!/bin/sh # utility library functions hex_to_rgb_array() { pastel format rgb "$1" | cut -c4- | tr '()' '[]' ; } + mix_rgb() { pastel mix --colorspace=RGB --fraction="$3" "$1" "$2" | pastel format hex ; } +getvar() { + key="$1" + eval "printf '%s' \"\$$key\"" +} + +setvar() { + key="$1" + value="$2" + eval "$key='$(printf '%s' "$value")'" +} + +themevar() { + key="$1" + if [ $# -eq 1 ] ; then + value="$(getvar "$key")" + else + value="$2" + setvar "$key" "$value" + fi + + vars="$vars +$(printf "export %s='%s'" "$key" "$value")" + eval "export $key" +} + +mkcd() { + mkdir -p "$1" + cd "$1" +} + +respawn_daemon() { + killall -q "$1" && fork "$@" +} + +silent_fail_if_no_commmand() { + for name in "$@" ; do + [ -z "$(command -v "$name")" ] && exit + done +} + diff --git a/.local/share/mode/plug.d/20_export_colors b/.local/share/mode/plug.d/20_export_colors index 017446d..0f53d1f 100644 --- a/.local/share/mode/plug.d/20_export_colors +++ b/.local/share/mode/plug.d/20_export_colors @@ -9,7 +9,7 @@ check_color() { echo "error: color $1 is not properly formatted (#RRGGBB)" stupid && exit 1 fi - eval "export $1" + themevar "$1" } for color in $(seq 0 15 | sed 's/^/color/') bg fg ; do check_color $color diff --git a/.local/share/mode/plug.d/20_export_mode b/.local/share/mode/plug.d/20_export_mode index 78432b6..c82c4e1 100644 --- a/.local/share/mode/plug.d/20_export_mode +++ b/.local/share/mode/plug.d/20_export_mode @@ -5,5 +5,5 @@ if [ "$mode" != 'dark' ] && [ "$mode" != 'light' ] ; then [ $? -eq 0 ] && mode=dark || mode=light echo "warn: theme $theme did not define \$mode as \"light\" or \"dark\", guessed $mode" >&2 fi -export mode +themevar mode diff --git a/.local/share/mode/plug.d/20_export_vim_theme b/.local/share/mode/plug.d/20_export_vim_theme index be76b8b..12304f3 100644 --- a/.local/share/mode/plug.d/20_export_vim_theme +++ b/.local/share/mode/plug.d/20_export_vim_theme @@ -3,4 +3,4 @@ if [ "$(find "$XDG_CONFIG_HOME/nvim" -name "$vim_theme_name.vim" | wc -l)" -eq 0 ] ; then echo "warn: vim theme $vim_theme_name does not appear to be installed" >&2 fi -export vim_theme_name +themevar vim_theme_name diff --git a/.local/share/mode/plug.d/50_accent b/.local/share/mode/plug.d/50_accent index 2a8a113..ceb3209 100644 --- a/.local/share/mode/plug.d/50_accent +++ b/.local/share/mode/plug.d/50_accent @@ -4,13 +4,12 @@ # do not generate accent color if already explicitly defined by theme [ -n "$accent" ] && return -[ "$mode" = "light" ] && { - accent="$color15" - accent_text="$color0" -} -[ "$mode" = "dark" ] && { - accent="$(mix_rgb $bg $color0 0.5)" - accent_text="$fg" -} +if [ "$mode" = "light" ] ; then + themevar accent "$color15" + themevar accent_text "$color0" +fi +if [ "$mode" = "dark" ] ; then + themevar accent "$(mix_rgb $bg $color0 0.5)" + themevar accent_text "$fg" +fi -export accent accent_text diff --git a/.local/share/mode/reload.d/dunst b/.local/share/mode/reload.d/dunst index 3c09a31..430320c 100755 --- a/.local/share/mode/reload.d/dunst +++ b/.local/share/mode/reload.d/dunst @@ -1,4 +1,3 @@ #!/bin/sh -killall dunst -fork dunst +respawn_daemon dunst diff --git a/.local/share/mode/reload.d/gtk b/.local/share/mode/reload.d/gtk index a6dbb34..767969d 100644 --- a/.local/share/mode/reload.d/gtk +++ b/.local/share/mode/reload.d/gtk @@ -2,9 +2,7 @@ # this is max jank but xfsettingsd does other things besides live gtk theme # reloading, and i don't like having it running constantly because it fucks # up fcitx5 and xbindkeys -( - fork xfsettingsd --replace - sleep 1 - killall xfsettingsd -) +fork xfsettingsd --replace +sleep 1 +killall -q xfsettingsd diff --git a/.local/share/mode/reload.d/i3 b/.local/share/mode/reload.d/i3 new file mode 100755 index 0000000..96212cf --- /dev/null +++ b/.local/share/mode/reload.d/i3 @@ -0,0 +1,2 @@ +#!/bin/sh +fork i3-msg reload diff --git a/.local/share/mode/reload.d/nvim b/.local/share/mode/reload.d/nvim index 84ae847..cfabcc7 100755 --- a/.local/share/mode/reload.d/nvim +++ b/.local/share/mode/reload.d/nvim @@ -1,4 +1,5 @@ #!/bin/sh +silent_fail_if_no_commmand nvr nvr --serverlist | while read -r nvim_socket ; do fork nvr --nostart --servername "$nvim_socket" -c 'source $XDG_CONFIG_HOME/nvim/mode.vim' done diff --git a/.local/share/mode/reload.d/polybar b/.local/share/mode/reload.d/polybar index af39394..1976811 100755 --- a/.local/share/mode/reload.d/polybar +++ b/.local/share/mode/reload.d/polybar @@ -1,3 +1,3 @@ #!/bin/sh -polybar-msg cmd restart > /dev/null +fork polybar-msg cmd restart diff --git a/.local/share/mode/reload.d/term b/.local/share/mode/reload.d/term index 5f02463..b711d56 100755 --- a/.local/share/mode/reload.d/term +++ b/.local/share/mode/reload.d/term @@ -26,5 +26,5 @@ escape_msgs="$(cat << EOF | tr -d '\n' EOF )" -find /dev/pts -exec sh -c "printf \"$escape_msgs\" > {}" \; 2> /dev/null +find /dev/pts -exec sh -c "printf '$escape_msgs' > {}" \; 2> /dev/null diff --git a/.local/share/mode/switch.d/anki b/.local/share/mode/switch.d/anki index c9caf5d..7572b00 100755 --- a/.local/share/mode/switch.d/anki +++ b/.local/share/mode/switch.d/anki @@ -1,4 +1,5 @@ #!/bin/sh +[ $no_cfg -eq 1 ] && return # this generates theme files compatible with Anki-redesign: # <https://ankiweb.net/shared/info/308574457> diff --git a/.local/share/mode/switch.d/chromium b/.local/share/mode/switch.d/chromium index 9048b80..5ed07fc 100755 --- a/.local/share/mode/switch.d/chromium +++ b/.local/share/mode/switch.d/chromium @@ -1,17 +1,18 @@ #!/bin/sh -PREFIX="$XDG_CACHE_HOME/mode/chromium" +[ $no_cfg -eq 1 ] && return -mkdir -p "$PREFIX" -rm -f "$PREFIX/Cached Theme.pak" +mkcd "$XDG_CACHE_HOME/mode/chromium" -magick -size 100x100 "xc:$bg" "$PREFIX/bg.png" -bg_alt=$(mix_rgb $color7 $bg 0.20) -fg_alt=$(mix_rgb $color15 $fg 0.60) +rm -f 'Cached Theme.pak' + +magick -size 100x100 "xc:$bg" 'bg.png' +bg_alt=$(mix_rgb $bg $color0 0.65) +fg_alt=$(mix_rgb $fg $color15 0.35) bg="$(hex_to_rgb_array "$bg")" fg="$(hex_to_rgb_array "$fg")" bg_alt="$(hex_to_rgb_array "$bg_alt")" fg_alt="$(hex_to_rgb_array "$fg_alt")" -cat << EOF > "$PREFIX/manifest.json" +cat << EOF > 'manifest.json' { "description": "colorscheme generated by mode", "manifest_version": 2, diff --git a/.local/share/mode/switch.d/discord b/.local/share/mode/switch.d/discord index f656783..dd7e5e3 100755 --- a/.local/share/mode/switch.d/discord +++ b/.local/share/mode/switch.d/discord @@ -1,5 +1,8 @@ #!/bin/sh -cat << EOF > "$XDG_CONFIG_HOME/BetterDiscord/themes/mode.theme.css" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/BetterDiscord/themes" +cat << EOF > 'mode.theme.css' /** * @name mode * @author mode diff --git a/.local/share/mode/switch.d/dunst b/.local/share/mode/switch.d/dunst index d4fd8dc..d7d9a2b 100755 --- a/.local/share/mode/switch.d/dunst +++ b/.local/share/mode/switch.d/dunst @@ -1,5 +1,8 @@ #!/bin/sh -cat "$XDG_CONFIG_HOME/dunst/base" - << EOF > "$XDG_CONFIG_HOME/dunst/dunstrc" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/dunst" +cat 'base' - << EOF > 'dunstrc' frame_color = "$accent" [urgency_low] diff --git a/.local/share/mode/switch.d/fcitx5 b/.local/share/mode/switch.d/fcitx5 index 4b35478..d9d0032 100755 --- a/.local/share/mode/switch.d/fcitx5 +++ b/.local/share/mode/switch.d/fcitx5 @@ -1,5 +1,7 @@ #!/bin/sh -cd "$XDG_DATA_HOME/fcitx5/themes/default" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_DATA_HOME/fcitx5/themes/default" rounding=6 size=$(( 2 * $rounding + 4 )) margin_h=6 diff --git a/.local/share/mode/switch.d/i3 b/.local/share/mode/switch.d/i3 new file mode 100755 index 0000000..713869e --- /dev/null +++ b/.local/share/mode/switch.d/i3 @@ -0,0 +1,14 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +indicator="$color0" +mkcd "$XDG_CONFIG_HOME/i3" +cat << EOF > 'color.conf' +client.focused $fg $bg $fg $indicator $bg +client.focused_inactive $bg $bg $fg $indicator $bg +client.unfocused $bg $bg $fg $indicator $bg +client.urgent $bg $bg $fg $indicator $bg +client.placeholder $bg $bg $fg $indicator $bg +client.background $bg +EOF + diff --git a/.local/share/mode/switch.d/kitty b/.local/share/mode/switch.d/kitty new file mode 100755 index 0000000..eeb81d0 --- /dev/null +++ b/.local/share/mode/switch.d/kitty @@ -0,0 +1,27 @@ +#!/bin/sh +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/kitty" + +cat << EOF > 'color.conf' +background $bg +foreground $fg + +color0 $color0 +color1 $color1 +color2 $color2 +color3 $color3 +color4 $color4 +color5 $color5 +color6 $color6 +color7 $color7 +color8 $color8 +color9 $color9 +color10 $color10 +color11 $color11 +color12 $color12 +color13 $color13 +color14 $color14 +color15 $color15 +EOF + diff --git a/.local/share/mode/switch.d/mode b/.local/share/mode/switch.d/mode index 3b58fa6..8866486 100755 --- a/.local/share/mode/switch.d/mode +++ b/.local/share/mode/switch.d/mode @@ -1,8 +1,10 @@ #!/bin/sh -PREFIX="$XDG_CACHE_HOME/mode/state" -rm -rf "$PREFIX"/* -mkdir -p "$PREFIX" +[ $no_cfg -eq 1 ] && return -echo "$mode" > "$PREFIX/mode" -ln -sf "$theme" "$PREFIX/theme" +mkcd "$XDG_CACHE_HOME/mode/state" + +echo "$mode" > mode +rm theme +ln -sf "$theme" theme +echo "#!/bin/sh$vars" > vars diff --git a/.local/share/mode/switch.d/polybar b/.local/share/mode/switch.d/polybar index b7e752a..7087735 100755 --- a/.local/share/mode/switch.d/polybar +++ b/.local/share/mode/switch.d/polybar @@ -1,5 +1,8 @@ #!/bin/sh -cat << EOF > "$XDG_CONFIG_HOME/polybar/colors.ini" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/polybar" +cat << EOF > 'colors.ini' [color] bg = \${xrdb:background:$bg} fg = \${xrdb:foreground:$fg} diff --git a/.local/share/mode/switch.d/rofi b/.local/share/mode/switch.d/rofi deleted file mode 100755 index 19b9008..0000000 --- a/.local/share/mode/switch.d/rofi +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cat << EOF > "$XDG_CONFIG_HOME/rofi/colors" -export background="$bg" -export foreground="$fg" -export accent="$accent" -export accent_text="$accent_text" -EOF - diff --git a/.local/share/mode/switch.d/vim b/.local/share/mode/switch.d/vim index 6c83f9f..2220b1a 100755 --- a/.local/share/mode/switch.d/vim +++ b/.local/share/mode/switch.d/vim @@ -1,9 +1,10 @@ #!/bin/sh -PREFIX="$XDG_CONFIG_HOME/nvim/mode" -mkdir -p "$PREFIX" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/nvim/mode" # lightline -cat << EOF > "$PREFIX/lightline.vim" +cat << EOF > 'lightline.vim' let s:bg = [ '$bg', 'NONE' ] let s:fg = [ '$fg', 'NONE' ] let s:mode = [ '$color0', 'NONE' ] @@ -14,7 +15,7 @@ let s:test = [ '#ff00ff', 'NONE' ] let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} let s:p.normal.left = [ [ s:fg, s:mode ], [ s:faint, s:bg ] ] let s:p.normal.right = [ [ s:faint, s:bg ] ] -let s:p.normal.middle = [ [ s:none, s:none ] ] +let s:p.normal.middle = [ [ s:bg, s:bg ] ] let s:p.normal.error = [ [ s:test, s:test ] ] let s:p.normal.warning = [ [ s:test, s:test ] ] let s:p.inactive.left = copy(s:p.normal.left) @@ -32,7 +33,7 @@ let g:lightline#colorscheme#auto#palette = lightline#colorscheme#flatten(s:p) EOF # terminal colors -cat << EOF > "$PREFIX/termcolors.vim" +cat << EOF > 'termcolors.vim' let g:terminal_color_0 = '$color0' let g:terminal_color_1 = '$color1' let g:terminal_color_2 = '$color2' @@ -52,7 +53,7 @@ let g:terminal_color_15 = '$color15' EOF # color scheme -cat << EOF > "$PREFIX/colorscheme.vim" +cat << EOF > 'colorscheme.vim' colorscheme $vim_theme_name EOF diff --git a/.local/share/mode/switch.d/zathura b/.local/share/mode/switch.d/zathura index c0687df..42d6d90 100755 --- a/.local/share/mode/switch.d/zathura +++ b/.local/share/mode/switch.d/zathura @@ -1,5 +1,8 @@ #!/bin/sh -cat << EOF > "$XDG_CONFIG_HOME/zathura/colors" +[ $no_cfg -eq 1 ] && return + +mkcd "$XDG_CONFIG_HOME/zathura" +cat << EOF > 'colors' set completion-bg "$bg" set completion-fg "$fg" set completion-highlight-bg "$accent" diff --git a/.local/share/mode/themes/github-black b/.local/share/mode/themes/github-black new file mode 100644 index 0000000..34b507c --- /dev/null +++ b/.local/share/mode/themes/github-black @@ -0,0 +1,25 @@ +#!/bin/sh +mode=dark + +color0='#484f58' +color1='#ffa198' +color2='#56d364' +color3='#e3b341' +color4='#79c0ff' +color5='#d2a8ff' +color6='#56d4dd' +color7='#b1bac4' +color8='#6e7681' +color9='#ff7b72' +color10='#3fb950' +color11='#d29922' +color12='#58a6ff' +color13='#bc8cff' +color14='#39c5cf' +color15='#ffffff' + +bg='#000000' +fg='#e6edf3' + +vim_theme_name='ghdark' + diff --git a/.local/share/mode/themes/xcode-dark b/.local/share/mode/themes/xcode-dark new file mode 100644 index 0000000..eb75b80 --- /dev/null +++ b/.local/share/mode/themes/xcode-dark @@ -0,0 +1,24 @@ +#!/bin/sh +mode=dark + +color0='#43454b' +color1='#ff8a7a' +color2='#83c9bc' +color3='#d9c668' +color4='#4ec4e6' +color5='#ff85b8' +color6='#cda1ff' +color7='#ffffff' +color8='#838991' +color9='#ff8a7a' +color10='#b1faeb' +color11='#ffa14f' +color12='#6bdfff' +color13='#ff85b8' +color14='#e5cfff' +color15='#ffffff' + +bg='#1f1f24' +fg='#e6edf3' + +vim_theme_name='xcodedarkhc' diff --git a/.local/share/pass-extensions/duplicates.bash b/.local/share/pass-extensions/duplicates.bash index cb1cbbc..3ba47aa 100755 --- a/.local/share/pass-extensions/duplicates.bash +++ b/.local/share/pass-extensions/duplicates.bash @@ -5,21 +5,18 @@ pass_names="$(pass names -l)" [ $? -ne 0 ] && exit 1 pass_count="$(echo "$pass_names" | wc -l)" -if [ "$pass_count" -gt 10 ] ; then - cat << EOF >&2 -pass-duplicates needs to decrypt all your passwords one-by-one to cross-match -them. This is all done in-memory, and nothing is saved to disk. You appear to -have $pass_count passwords, so this may take some time... - -EOF -fi +pass_index=1 while read pass_name ; do hash="$(pass show "$pass_name" | head -n1 | sha1sum | cut -c1-40)" dupe_map["$pass_name"]="$hash" dupe_tally["$hash"]=$(( ${dupe_tally["$hash"]} + 1 )) + + printf '\rhashing... (%d/%d)' "$pass_index" "$pass_count" >&2 + pass_index=$(( $pass_index + 1 )) done < <(echo "$pass_names") +printf '\r\e[2K' >&2 unique_duplicates=0 total_shared=0 diff --git a/.local/share/pass-extensions/g.bash b/.local/share/pass-extensions/g.bash new file mode 100755 index 0000000..4ab3ace --- /dev/null +++ b/.local/share/pass-extensions/g.bash @@ -0,0 +1,2 @@ +#!/bin/bash +exec pass git "$@" @@ -8,7 +8,6 @@ export LANG='ja_JP.UTF-8' # aliases -alias vim='nvim' alias copy='xclip -selection clipboard' alias dnd='dragon-drop --all --and-exit' alias sl='sl -w' @@ -31,6 +30,9 @@ alias g='git' # force colorterm export COLORTERM="truecolor" +# colors +alias diff='diff --color=auto' + # xdg base directories export XDG_CONFIG_HOME="$HOME/.config" export XDG_CACHE_HOME="$HOME/.cache" @@ -42,9 +44,8 @@ export GEM_HOME="$XDG_DATA_HOME/gem/ruby/3.0.0" # script locations if [ -z "$PATH_EXTENDED" ] ; then + PATH="/opt/zephyr-sdk/arm-zephyr-eabi/bin:$PATH" PATH="$GEM_HOME/bin:$PATH" - # PATH="$HOME/.lyp/bin:$PATH" - # PATH="/opt/f4pga/xc7/conda/bin:$PATH" PATH="$HOME/.local/share/cargo/bin:$PATH" PATH="$HOME/.local/go/bin:$PATH" PATH="$HOME/.local/bin:$PATH" @@ -54,14 +55,18 @@ if [ -z "$PATH_EXTENDED" ] ; then fi # other stuff -export EDITOR="nvim -p" +export EDITOR=editor export PAGER="less" export FZF_DEFAULT_COMMAND="find . -name '.?*' -prune -o -print" -export FZF_DEFAULT_OPTS="--color=bw,fg:7,scrollbar:8,info:8 --layout=reverse --info=inline-right --no-separator --marker='*' --pointer=''" +export FZF_DEFAULT_OPTS="--color=bw,current-fg:regular:reverse,current-hl:underline:reverse,info:bright-black,hl:underline --layout=reverse --info=inline-right --no-separator --no-scrollbar --marker='' --pointer='' --highlight-line" export GOPATH="$HOME/.local/go" [ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env" export PASSWORD_STORE_ENABLE_EXTENSIONS=true export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions" +export MOZ_USE_XINPUT2=1 +export CMAKE_EXPORT_COMPILE_COMMANDS=1 +export CMAKE_GENERATOR=Ninja +export LIBVIRT_DEFAULT_URI='qemu:///system' # LS_COLORS [ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors" @@ -85,7 +90,17 @@ export CONAN_USER_HOME="$XDG_CONFIG_HOME/conan" alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"' alias gpg2="gpg2 --homedir $XDG_DATA_HOME/gnupg" export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +export NMPASS_FORMAT="net/{ssid}/passwd" export WGETRC="$XDG_CONFIG_HOME/wgetrc" +export TEXMFHOME="$XDG_DATA_HOME/texmf" +export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" +export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive/texmf-config" +alias poke="poke --quiet" + +# colors +alias diff='diff --color=auto' +alias mk='FROM_PROMPT=y mk' +alias diffstat='diffstat -C' # disable dotnet telemetry export DOTNET_CLI_TELEMETRY_OPTOUT=1 diff --git a/.ssh/config b/.ssh/config new file mode 100644 index 0000000..c070bdf --- /dev/null +++ b/.ssh/config @@ -0,0 +1,8 @@ +match user git host pipeframe.xyz + requesttty no + +host * + warnweakcrypto no + +host router.lan + user admin @@ -14,11 +14,20 @@ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*:*:*:*:*' menu select zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' special-dirs true -setopt auto_menu +setopt auto_menu # show completion menu when spamming <tab> setopt complete_in_word -setopt always_to_end +setopt always_to_end # move cursor to end of word after completion +setopt auto_cd # cd if the command is a valid path +WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS compinit -d "$ZSH_COMPDUMP" +# history +! [ -d "$XDG_DATA_HOME/zsh" ] && mkdir -p "$XDG_DATA_HOME/zsh" +export HISTFILE="$XDG_DATA_HOME/zsh/history" +export HISTSIZE=10000000 +export SAVEHIST=10000000 +setopt share_history + # keybinds bindkey -e # emacs bindings bindkey '^[[Z' reverse-menu-complete @@ -33,7 +42,7 @@ prompt_segment() { } prompt_mod_git_info() { git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null || return - prompt_segment "git $(git rev-parse --abbrev-ref HEAD)" + prompt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)" } # only display hostname in prompt if connected over SSH [ -n "$SSH_CLIENT" ] && PROMPT+="$(prompt_segment '%m')" |