From 78faa96e1ff7ab27609d1c0156e921b81bdb494b Mon Sep 17 00:00:00 2001 From: Never Gude Date: Sun, 8 Mar 2026 23:06:13 +0100 Subject: [PATCH] stuff --- .config/fish/fish_variables | 2 +- .config/fish/functions/fish_prompt.fish | 1 - .config/fish/functions/menu.fish | 2 +- .config/fish/functions/prompt.fish | 14 +- .config/fuzzel/fuzzel.ini | 5 +- .config/niri/config.kdl | 2 +- .config/nvim/init.lua | 1 + .config/sioyek/keys_user.config | 0 .config/sioyek/prefs_user.config | 277 ++++++++++++++++++++++++ .local/scripts/actionmenu.fish | 2 +- .local/scripts/browserprompt.fish | 28 ++- 11 files changed, 313 insertions(+), 21 deletions(-) create mode 100644 .config/sioyek/keys_user.config create mode 100644 .config/sioyek/prefs_user.config diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables index bad456c..1919273 100644 --- a/.config/fish/fish_variables +++ b/.config/fish/fish_variables @@ -2,7 +2,7 @@ # VERSION: 3.0 SETUVAR --export EDITOR:nvim SETUVAR LESS:RAW\x2dCONTROL\x2dCHARS -SETUVAR QT_QPA_PLATFORMTHEME:qt6ct +SETUVAR --export QT_QPA_PLATFORMTHEME:qt6ct SETUVAR __fish_initialized:3800 SETUVAR fish_color_autosuggestion:white SETUVAR fish_color_cancel:white\x1e\x2d\x2dbold diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish index ff26ac0..ef5cf96 100644 --- a/.config/fish/functions/fish_prompt.fish +++ b/.config/fish/functions/fish_prompt.fish @@ -9,7 +9,6 @@ function fish_prompt set_color white --background 3c3836 printf ' %s ' (prompt_pwd -D 8) - echo if test -n "$VIRTUAL_ENV" diff --git a/.config/fish/functions/menu.fish b/.config/fish/functions/menu.fish index a81aada..04df272 100644 --- a/.config/fish/functions/menu.fish +++ b/.config/fish/functions/menu.fish @@ -21,5 +21,5 @@ function menu --description 'Opens a menu of a list of Strings and writes the re set -a fuzzel_args "--index" end - string join -- \n $argv | fuzzel --dmenu -l (count $argv) $fuzzel_args || exit 0 + string join -- \n $argv | fuzzel --dmenu $fuzzel_args end diff --git a/.config/fish/functions/prompt.fish b/.config/fish/functions/prompt.fish index 95d769f..fd54a1e 100644 --- a/.config/fish/functions/prompt.fish +++ b/.config/fish/functions/prompt.fish @@ -1,9 +1,9 @@ function prompt --description 'Opens a menu of a list of Strings and writes the result to stdout' - argparse h/help p/prompt=? placeholder=? password -- $argv + argparse h/help p/prompt=? placeholder=? mesg=? password -- $argv or return if set -ql _flag_help - echo "menu [-h|--help] [-p|--prompt=?] [--placeholder=?] [--password] [STRING ...]" + echo "menu [-h|--help] [-p|--prompt=?] [--placeholder=?] [--mesg=?] [--password] [STRING ...]" return 0 end @@ -17,9 +17,13 @@ function prompt --description 'Opens a menu of a list of Strings and writes the set -a fuzzel_args "--placeholder=$_flag_placeholder" end - if set -ql _flag_password - set -a fuzzel_args "--password=●" + if set -ql _flag_mesg + set -a fuzzel_args "--mesg=$_flag_mesg" end - string join -- \n $argv | fuzzel --dmenu --prompt-only='' $fuzzel_args || exit 0 + if set -ql _flag_password + set -a fuzzel_args "--password" + end + + string join -- \n $argv | fuzzel --dmenu --prompt-only='' $fuzzel_args end diff --git a/.config/fuzzel/fuzzel.ini b/.config/fuzzel/fuzzel.ini index 4d1e06d..d9fce01 100644 --- a/.config/fuzzel/fuzzel.ini +++ b/.config/fuzzel/fuzzel.ini @@ -8,7 +8,7 @@ placeholder="Search" # icons-enabled=yes # hide-before-typing=no # fields=filename,name,generic -# password-character=* +password-character=● # filter-desktop=no # match-mode=fzf # sort-result=yes @@ -24,7 +24,7 @@ match-counter=yes # x-margin=0 # y-margin=0 lines=16 -# minimal-lines=no +minimal-lines=yes width=64 # tabs=8 horizontal-pad=8 @@ -52,6 +52,7 @@ inner-pad=4 [colors] background=191919E5 text=ffffffff +message=999999ff prompt=999999ff placeholder=505050ff input=ffffffff diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index 0902001..d2a18cb 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -88,7 +88,7 @@ output "eDP-1" { // mode "1920x1080@120.030" // You can use integer or fractional scale, for example use 1.5 for 150% scale. - scale 1.5 + scale 1.33 // Transform allows to rotate the output counter-clockwise, valid values are: // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3567b7c..852d64a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -19,6 +19,7 @@ vim.o.colorcolumn = "80" -- Set default tabstop and shiftwidth vim.o.tabstop = 4 vim.o.shiftwidth = 4 +vim.o.expandtab = true -- Show and trailing spaces vim.o.list = true diff --git a/.config/sioyek/keys_user.config b/.config/sioyek/keys_user.config new file mode 100644 index 0000000..e69de29 diff --git a/.config/sioyek/prefs_user.config b/.config/sioyek/prefs_user.config new file mode 100644 index 0000000..661ec54 --- /dev/null +++ b/.config/sioyek/prefs_user.config @@ -0,0 +1,277 @@ +# For more information see the documentation at https://sioyek-documentation.readthedocs.io/ + +# (can be 0 or 1) if set, shows a notification on startup if a new version of sioyek is available +check_for_updates_on_startup 0 + +# Use old keybind parsing method (only for backwards compatibility) +use_legacy_keybinds 0 + +# The color with which the screen is cleared before rendering the pdf (this is the background color of the application and not the PDF file) +background_color 0.97 0.97 0.97 +dark_mode_background_color 0.0 0.0 0.0 + +# Showing full white text on black background can be irritating for the eye, we can dim the whites a little bit using the contrast option +dark_mode_contrast 0.8 + +# Highlight color when text is selected using mouse +text_highlight_color 1.0 1.0 0.0 + +# The color of highlight ruler which is displayed when right click is pressed +visual_mark_color 0.0 0.0 0.0 0.1 + +# Highlight color when text is a search match +search_highlight_color 0.0 1.0 0.0 + +# Hihglight color for PDF links (note that highlight is off by default +# and can only be seen by performing a toggle_highlight command. See keys.config for more details) +link_highlight_color 0.0 0.0 1.0 + +# Hihglight color for synctex forward search highlights +synctex_highlight_color 1.0 0.0 1.0 + +# Urls to use when executing external_search commands +search_url_s https://scholar.google.com/scholar?q= +search_url_g https://www.google.com/search?q= + +# Which search url to choose when middle clicking or shift middle clicking on text (the values are the letters of corresponding search_url_* ) +# for example if i set `middle_click_search_engine s`, then we use the url associated with `search_url_s` to handle middle click searches +middle_click_search_engine s +shift_middle_click_search_engine l + +# The factor by which we increase/decrease zoom when performing zoom_in or zoom_out +zoom_inc_factor 1.2 + +# How many inches we move vertically/horizontally when performing move_* commands +vertical_move_amount 1.0 +horizontal_move_amount 1.0 + +# When performing screen_down/screen_up we usually don't move a full screen because it causes the user to lose context +# Here we specify the fraction of the screen width by which we move when performing these commands +move_screen_ratio 0.5 + +# If 0, Table of Contents is shown in a hierarchial tree, otherwise it is a flat list (can improve performance for extremely large table of contents) +flat_toc 0 + +# If it is 1, when launching the application if we detect multiple monitors, we automatically launch the helper window in second monitor +should_use_multiple_monitors 0 + +# If the last opened document is empty, load the tutorial pdf instead +should_load_tutorial_when_no_other_file 1 + +# (deprecated, use `should_launch_new_window` instead) If it is 0, then we use the previous instance of sioyek when launching a new file. +# otherwise a new instance is launched every time we open a new file. +should_launch_new_instance 0 + +# If set, we open a new sioyek window when a new file is opened, otherwise we open the file in the previous window +should_launch_new_window 0 + +# The command to use when trying to do inverse search into a LaTeX document. Uncomment and provide your own command. +# %1 expands to the name of the file and %2 expans to the line number. +#inverse_search_command "C:\path\to\vscode\Code.exe" -r -g %1:%2 + +# you can specify the exact highlight color for each of 26 different highlight types + +# When moving to the next line using visual marker, this setting specifies the distance of the market to the top of the screen in fractions of screen size (center of the screen is zero, top of the screen is one) +visual_mark_next_page_fraction 0.75 + +# When moving to the next line using visual marker, this setting determines at which point we move the screen (center of the screen is one, bottom of the screen is zero) +visual_mark_next_page_threshold 0.25 + +# If set, we display a checkerboard pattern for unrendered pages (by default we display nothing) +should_draw_unrendered_pages 0 + +# If 0, we use the previous renders for overview window which may cause it to be blurry +# if it is 1, we rerender with the proper resolution for overview window which looks better +# but may increase power consumption +rerender_overview 1 + +## Size of the overview window (1 being as large as the window, valid range is [0, 1]) +# overview_size 0.5 0.5 + +## Offset of the center of the overview window ((0,0) being the center of the screen and valid raneg is [-1, 1]) +# overview_offset 0.5 0.5 + +# Use linear texture filtering instead of nearest-neighbor +# Can improve appearance in very high-resolution screens +# linear_filter 0 + +# Use dark mode by default (deprecated, better add `toggle_dark_mode` to `startup_commands` ) +default_dark_mode 0 + +# If set, we sort the bookmarks by their location instead of their creation time +sort_bookmarks_by_location 1 + +## Path to shared.db database file. If not set, we use the default path. +## you can set this to be a file in a synced folder (e.g. dropbox folder) to automatically sync +## sioyek across multiple computers +#shared_database_path /some/path/shared.db + +## Name of the font to use for UI text +#ui_font Some Font Name +## Size of the UI font +#font_size 20 + +## Semicolon-separated list of command to execute upon sioyek startup +#startup_commands toggle_visual_scroll;toggle_dark_mode + +## Background color to use when executing `toggle_custom_color` +custom_background_color 0.180 0.204 0.251 +## Text color to use when executing `toggle_custom_color` +custom_text_color 0.847 0.871 0.914 + +# Normally mouse wheel zooms in on the middle of the screen, but if this is set to 1, we zoom in on the cursor +wheel_zoom_on_cursor 0 + +## Color of status bar background +#status_bar_color 0 0 0 +## Color of status bar text +#status_bar_text_color 1 1 1 +## Font size of the status bar text +#status_bar_font_size 20 + +## The default size of main window when helper window is closed +#single_main_window_size 800 600 +#single_main_window_move 100 100 + +## The default size/offset of main/helper window when helper window is opened. You can copy the value of this config using `copy_window_size_config` command +#main_window_size 800 600 +#main_window_move 100 100 +#helper_window_size 800 600 +#helper_window_move 100 100 + +## Touchpad/scrollwhell sensitivity +#touchpad_sensitivity 1.0 + +## Configure the appearance of page separator +#page_separator_width 2 +#page_separator_color 0.9 0.9 0.9 + +# Ratio of page width to use for `fit_to_page_width_ratio` command +fit_to_page_width_ratio 0.75 + +# If set, we initially collapse table of content entries +collapsed_toc 0 + +# If set, we highlight the current line in visual_scroll_mode by masking above and below the current line +# if not set, we only mask below the line +ruler_mode 1 + +# Additional ruler padding +ruler_padding 1.0 +ruler_x_padding 5.0 + +## We use mupdf to determine lines for visual mark. However, we do have a custom algorithm for image documents +## if `force_custom_line_algorithm` is 1, then we use our custom algorithm instead of mupdf even for documents +## that have lines. +#force_custom_line_algorithm 0 + +# A directory which sioyek watches for new papers. If a new paper added to this directory +# while we are creating a portal from another document, this new document will automatically +# be used as the destination of the portal. +#paper_folder_path /some/path + +# Enable some experimental features, might not be stable +#enable_experimental_features 0 + +# Automatically create a table of contents for the document if it doesn't already have one +create_table_of_contents_if_not_exists 1 + +# Limits the maximum size of created table of contents +max_created_toc_size 5000 + +# Warn the user on the command line only when redefining keys inside +# the same file. When set to 1, sioyek will warn when redefining keys +# from other files also +should_warn_about_user_key_override 1 + +# Use double clicks to select entire words and single clicks for character-based selection +single_click_selects_words 0 + +# A prefix to prepend to items in lists (e.g. bookmark lists) +#item_list_prefix > + +## In presentation mode, ignore whitespace when trying to determine the size of a page +#ignore_whitespace_in_presentation_mode 0 + +## In list of recent documents, show the entire document path rather than just the name +#show_doc_path 0 + +# Show long menu items in multiple lines instead of truncating the string, can reduce performance for +#very large lists +multiline_menus 1 + +# While in present mode, prerender the next page to avoid flickering +prerender_next_page_presentation 1 + +## Custom commands to run when clicking or right clicking when modifier keys are pressed +## the command can be any built-in sioyek command (e.g. overview_under_cursor) or user-defined +## commands defined using `new_command` +# shift_click_command some_command +# control_click_command some_command +# alt_click_command some_command +# shift_right_click_command some_command +# control_right_click_command some_command +# alt_right_click_command some_command + +# Highlight on middle clicks when text is selected and no preview is open +#highlight_middle_click 1 + +# Use a super fast index for search instead of the mupdf's implementation +#super_fast_search 1 + +# Use case-insensitive search +#case_sensitive_search 0 + +#Amethyst +highlight_color_a 0.94 0.64 1.00 +#Blue +highlight_color_b 0.00 0.46 0.86 +#Caramel +highlight_color_c 0.60 0.25 0.00 +#Damson +highlight_color_d 0.30 0.00 0.36 +#Ebony +highlight_color_e 0.10 0.10 0.10 +#Forest +highlight_color_f 0.00 0.36 0.19 +#Green +highlight_color_g 0.17 0.81 0.28 +#Honeydew +highlight_color_h 1.00 0.80 0.60 +#Iron +highlight_color_i 0.50 0.50 0.50 +#Jade +highlight_color_j 0.58 1.00 0.71 +#Khaki +highlight_color_k 0.56 0.49 0.00 +#Lime +highlight_color_l 0.62 0.80 0.00 +#Mallow +highlight_color_m 0.76 0.00 0.53 +#Navy +highlight_color_n 0.00 0.20 0.50 +#Orpiment +highlight_color_o 1.00 0.64 0.02 +#Pink +highlight_color_p 1.00 0.66 0.73 +#Quagmire +highlight_color_q 0.26 0.40 0.00 +#Red +highlight_color_r 1.00 0.00 0.06 +#Sky +highlight_color_s 0.37 0.95 0.95 +#Turquoise +highlight_color_t 0.00 0.60 0.56 +#Uranium +highlight_color_u 0.88 1.00 0.40 +#Violet +highlight_color_v 0.45 0.04 1.00 +#Wine +highlight_color_w 0.60 0.00 0.00 +#Xanthin +highlight_color_x 1.00 1.00 0.50 +#Yellow +highlight_color_y 1.00 1.00 0.00 +#Zinnia +highlight_color_z 1.00 0.31 0.02 + diff --git a/.local/scripts/actionmenu.fish b/.local/scripts/actionmenu.fish index 05c8bfe..7a2fe4e 100755 --- a/.local/scripts/actionmenu.fish +++ b/.local/scripts/actionmenu.fish @@ -46,7 +46,7 @@ end function audio_source set dump (string trim -c '"' (pw-dump | jq '.[] | select(.info.props."media.class" == "Audio/Source")' | jq '.id, .info.props."node.description"')) - + set ids set names diff --git a/.local/scripts/browserprompt.fish b/.local/scripts/browserprompt.fish index 7e229c5..b979666 100755 --- a/.local/scripts/browserprompt.fish +++ b/.local/scripts/browserprompt.fish @@ -1,14 +1,24 @@ #!/usr/bin/env fish -set default "https://marginalia-search.com/search?query=" -set ddg "https://duckduckgo.com/?q=" +set engines \ + "d DuckDuckGo https://duckduckgo.com/?q=" \ + "m Marginalia https://marginalia-search.com/search?query=" \ + "w Wikipedia https://wikipedia.org/w/index.php?search=" \ + "wa WolframAlpha https://www.wolframalpha.com/input?i=" -set input (prompt) -set split_input (string split -m 1 ":" $input) +set bindings (string split --field 1 ' ' $engines) +set names (string split --fields 2 ' ' $engines) +set urls (string split --fields 3 ' ' $engines) -switch $split_input[1] - case "d" - xdg-open "$ddg$split_input[2]" - case "*" - xdg-open "$default$input" +function search + set input (prompt --mesg=$names[$argv[1]]) + + if contains $input $bindings + search (contains -i $input $bindings) + exit + end + + xdg-open "$urls[$argv[1]]$input" end + +search 1