Merge branch 'main' of ssh://git.trivernis.net:22321/Trivernis/dotfiles-silo

main
trivernis 5 months ago
commit 777b3743ab
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 7E6D18B61C8D2F4B

@ -0,0 +1,50 @@
Config(
// Position/size fields use an enum for the value, it can be either:
// Absolute(n): The absolute value in pixels
// Fraction(n): A fraction of the width or height of the full screen (depends on exclusive zones and the settings related to them) window respectively
// The horizontal position, adjusted so that Relative(0.5) always centers the runner
x: Fraction(0.5),
// The vertical position, works the same as `x`
y: Fraction(0.25),
// The width of the runner
width: Absolute(800),
// The minimum height of the runner, the runner will expand to fit all the entries
height: Absolute(0),
// Hide match and plugin info icons
hide_icons: false,
// ignore exclusive zones, f.e. Waybar
ignore_exclusive_zones: false,
// Layer shell layer: Background, Bottom, Top, Overlay
layer: Overlay,
// Hide the plugin info panel
hide_plugin_info: false,
// Close window when a click outside the main box is received
close_on_click: false,
// Show search results immediately when Anyrun starts
show_results_immediately: false,
// Limit amount of entries shown in total
max_entries: None,
// List of plugins to be loaded by default, can be specified with a relative path to be loaded from the
// `<anyrun config dir>/plugins` directory or with an absolute path to just load the file the path points to.
plugins: [
"libapplications.so",
"libsymbols.so",
"libshell.so",
"libtranslate.so",
"librink.so",
"libstdin.so",
"libshell.so",
],
)

@ -2,12 +2,13 @@ theme = "dracula-purple"
[editor] [editor]
rulers = [120] rulers = [120]
shell = ["nu", "--stdin", "-c"] shell = ["nu", "--stdin", "--no-newline", "-c"]
true-color = true true-color = true
cursorline = true cursorline = true
color-modes = true color-modes = true
bufferline = "always" bufferline = "always"
line-number = "relative" line-number = "relative"
auto-save = true
[editor.cursor-shape] [editor.cursor-shape]
insert = "bar" insert = "bar"
@ -39,11 +40,17 @@ nbsp = "all"
esc = ["collapse_selection", "keep_primary_selection"] esc = ["collapse_selection", "keep_primary_selection"]
C-j = ["half_page_down", "goto_window_center", "align_view_center"] C-j = ["half_page_down", "goto_window_center", "align_view_center"]
C-k = ["half_page_up", "goto_window_center", "align_view_center"] C-k = ["half_page_up", "goto_window_center", "align_view_center"]
A-w = [":sh use ide.nu; ide write-here miw"]
A-W = [":sh use ide.nu; ide write-here miW"]
D = [":sh use ide.nu; ide write-here \"2y%d\"2p"]
[keys.select] [keys.select]
esc = ["collapse_selection", "keep_primary_selection", "normal_mode"] esc = ["collapse_selection", "keep_primary_selection", "normal_mode"]
C-j = ["half_page_down", "goto_window_center"] C-j = ["half_page_down", "goto_window_center"]
C-k = ["half_page_up", "goto_window_center"] C-k = ["half_page_up", "goto_window_center"]
A-w = [":sh use ide.nu; ide write-here miw"]
A-W = [":sh use ide.nu; ide write-here miW"]
D = [":sh use ide.nu; ide write-here \"9y%d\"9p"]
[keys.normal."A-/"] [keys.normal."A-/"]
j = ["goto_line_start", ":insert-output use ide.nu; ide doc-comment java-style", ":format", "normal_mode", "move_visual_line_up", "insert_at_line_end"] j = ["goto_line_start", ":insert-output use ide.nu; ide doc-comment java-style", ":format", "normal_mode", "move_visual_line_up", "insert_at_line_end"]

@ -21,6 +21,11 @@ disableSuggestions = true
command = "nu" command = "nu"
args = ["-I", "~/.config/nushell/scripts", "--lsp"] args = ["-I", "~/.config/nushell/scripts", "--lsp"]
[language-server.pug-lsp]
command = "pug-lsp"
args = []
# languages # languages
[[language]] [[language]]
@ -108,3 +113,31 @@ name = "markdown"
# formatter = { command = "comrak", args = ["-t", "commonmark", "--gfm", "--unsafe", "-e", "table"] } # formatter = { command = "comrak", args = ["-t", "commonmark", "--gfm", "--unsafe", "-e", "table"] }
formatter = { command = "prettier", args = ["--stdin-filepath=source.md"] } formatter = { command = "prettier", args = ["--stdin-filepath=source.md"] }
[[language]]
name = "kdl"
auto-format = true
formatter = { command = "kdlfmt" }
[[language]]
name = "pug"
language-servers = ["pug-lsp"]
auto-format = true
indent = { tab-width = 4, unit = " " }
file-types = ["pug"]
scope = "source.pug"
comment-token = "//"
roots = []
grammar = "pug"
[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
[[grammar]]
name = "pug"
source = { git = "https://github.com/zealot128/tree-sitter-pug", rev = "a7ff31a38908df9b9f34828d21d6ca5e12413e18" }

@ -0,0 +1,54 @@
(comment) @comment
(tag_name) @constant
(
(tag_name) @constant.builtin
; https://www.script-example.com/html-tag-liste
(#any-of? @constant.builtin
"head" "title" "base" "link" "meta" "style"
"body" "article" "section" "nav" "aside" "h1" "h2" "h3" "h4" "h5" "h6" "hgroup" "header" "footer" "address"
"p" "hr" "pre" "blockquote" "ol" "ul" "menu" "li" "dl" "dt" "dd" "figure" "figcaption" "main" "div"
"a" "em" "strong" "small" "s" "cite" "q" "dfn" "abbr" "ruby" "rt" "rp" "data" "time" "code" "var" "samp" "kbd" "sub" "sup" "i" "b" "u" "mark" "bdi" "bdo" "span" "br" "wbr"
"ins" "del"
"picture" "source" "img" "iframe" "embed" "object" "param" "video" "audio" "track" "map" "area"
"table" "caption" "colgroup" "col" "tbody" "thead" "tfoot" "tr" "td" "th"
"form" "label" "input" "button" "select" "datalist" "optgroup" "option" "textarea" "output" "progress" "meter" "fieldset" "legend"
"details" "summary" "dialog"
"script" "noscript" "template" "slot" "canvas")
)
(content) @none
(id) @attribute
(class) @attribute
(quoted_attribute_value) @string
(attribute_name) @symbol
(
(attribute_name) @keyword
(#match? @keyword "^(\\(.*\\)|\\[.*\\]|\\*.*)$")
) @keyword
(attributes (attribute ("=")@operator))
(buffered_code ("=")@operator)
[
":"
"{{"
"}}"
"+"
"|"
] @punctuation.delimiter
(keyword) @keyword
((keyword) @include (#eq? @include "include"))
((keyword) @repeat (#any-of? @repeat "for" "each" "of" "in" "while"))
((keyword) @conditional (#any-of? @conditional "if" "else" "else if" "unless"))
((keyword) @keyword.function (#any-of? @keyword.function "block" "mixin"))
(doctype) @keyword
(doctype_name) @variable.parameter
(filter_name) @method.call
(mixin_use (mixin_name) @method.call)
(mixin_definition (mixin_name) @function)

@ -0,0 +1,2 @@
((javascript) @injection.content
(#set! injection.language "javascript"))

@ -12,6 +12,7 @@
"string.regexp" = { fg = "red" } "string.regexp" = { fg = "red" }
"tag" = { fg = "pink" } "tag" = { fg = "pink" }
"attribute" = { fg = "cyan" } "attribute" = { fg = "cyan" }
"symbol" = { fg = "cyan" }
"type" = { fg = "cyan", modifiers = ["italic"] } "type" = { fg = "cyan", modifiers = ["italic"] }
"type.enum.variant" = { fg = "foreground", modifiers = ["italic"] } "type.enum.variant" = { fg = "foreground", modifiers = ["italic"] }
"variable" = { fg = "foreground" } "variable" = { fg = "foreground" }

@ -129,6 +129,34 @@ $env.config = {
buffer_editor: "hx" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL buffer_editor: "hx" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
use_ansi_coloring: true use_ansi_coloring: true
edit_mode: emacs # emacs, vi edit_mode: emacs # emacs, vi
shell_integration: {
# osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
osc2: true
# osc7 is a way to communicate the path to the terminal, this is helpful for spawning new tabs in the same directory
osc7: true
# osc8 is also implemented as the deprecated setting ls.show_clickable_links, it shows clickable links in ls output if your terminal supports it. show_clickable_links is deprecated in favor of osc8
osc8: true
# osc9_9 is from ConEmu and is starting to get wider support. It's similar to osc7 in that it communicates the path to the terminal
osc9_9: false
# osc133 is several escapes invented by Final Term which include the supported ones below.
# 133;A - Mark prompt start
# 133;B - Mark prompt end
# 133;C - Mark pre-execution
# 133;D;exit - Mark execution finished with exit code
# This is used to enable terminals to know where the prompt is, the command is, where the command finishes, and where the output of the command is
osc133: true
# osc633 is closely related to osc133 but only exists in visual studio code (vscode) and supports their shell integration features
# 633;A - Mark prompt start
# 633;B - Mark prompt end
# 633;C - Mark pre-execution
# 633;D;exit - Mark execution finished with exit code
# 633;E - NOT IMPLEMENTED - Explicitly set the command line with an optional nonce
# 633;P;Cwd=<path> - Mark the current working directory and communicate it to the terminal
# and also helps with the run recent menu in vscode
osc633: true
# reset_application_mode is escape \x1b[?1l and was added to help ssh work better
reset_application_mode: true
} # enables terminal markers and a workaround to arrow keys stop working issue
# disable_table_indexes: false # set to true to remove the index column from tables # disable_table_indexes: false # set to true to remove the index column from tables
# settings for the ls command # settings for the ls command
ls: { ls: {

@ -80,6 +80,10 @@ export def `doc-comment rust-style` [] {
print `/// ` print `/// `
} }
export def write-here [...chars: string] {
zellij ac write-chars ...$chars
}
def open-editor [path: string] { def open-editor [path: string] {
zellij ac move-focus right zellij ac move-focus right
zellij ac write-chars $":open ($path)\r" zellij ac write-chars $":open ($path)\r"

@ -70,3 +70,29 @@ export def --env dotenv [file=".env"] {
| load-env $in | load-env $in
) )
} }
export def brute-force [
closure: closure, # closure to execute
--delay(-d): duration = 1sec, # delay between trys
--max-trys: number # maximum number of trys. Default unlimited
--print-errors, # print errors to stderr
] {
mut count = 0;
loop {
$count += 1
let iteration = $count
try {
return (do -c $closure)
} catch {|e|
if $print_errors {
print -e $e.msg
}
if $max_trys != null and $iteration >= $max_trys {
error make $e
}
sleep $delay
}
}
}

@ -25,6 +25,7 @@ config:needs("git", "nushell/scripts/git.nu")
config:needs("pueue", "pueue") config:needs("pueue", "pueue")
config:needs("pueue", "nushell/scripts/task.nu") config:needs("pueue", "nushell/scripts/task.nu")
config:needs("pueue", "systemd/user/pueued.service") config:needs("pueue", "systemd/user/pueued.service")
config:needs("anyrun", "anyrun")
config:needs("npm", "nushell/completions/npm-completions.nu") config:needs("npm", "nushell/completions/npm-completions.nu")

@ -112,7 +112,7 @@ config.keys = {
}, },
{ {
key = 'w', key = 'w',
mods = 'CTRL', mods = 'SHIFT | CTRL',
action = act.CloseCurrentTab { confirm = true } action = act.CloseCurrentTab { confirm = true }
}, },
{ {

@ -12,7 +12,6 @@ layout {
format_center "{command_notify}" format_center "{command_notify}"
format_space "" format_space ""
hide_frame_for_single_pane "true"
tab_normal "#[fg=#181825,bg=#4C4C59] #[fg=#000000,bg=#4C4C59]{index}  {name} #[fg=#4C4C59,bg=#181825]" tab_normal "#[fg=#181825,bg=#4C4C59] #[fg=#000000,bg=#4C4C59]{index}  {name} #[fg=#4C4C59,bg=#181825]"
tab_normal_fullscreen "#[fg=#6C7086,bg=#181825] {index} {name} [] " tab_normal_fullscreen "#[fg=#6C7086,bg=#181825] {index} {name} [] "
@ -60,7 +59,7 @@ layout {
name "Terminal" name "Terminal"
size "30%" size "30%"
command "nu" command "nu"
args "-e" "clear; onefetch --no-art --no-color-palette --text-colors 7 10 11 12 7 15 --type programming markup prose data" args "-e" "clear; onefetch --no-art --no-color-palette --text-colors 7 10 11 12 7 15 --type programming markup prose"
} }
} }
} }

@ -0,0 +1,140 @@
#!/bin/bash
# Usage: ww -f "window class filter" -c "run if not found"
# Usage: ww -fa "window title filter" -c "run if not found"
TOGGLE="false"
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-c | --command)
COMMAND="$2"
shift # past argument
shift # past value
;;
-f | --filter)
FILTERBY="$2"
shift # past argument
shift # past value
;;
-fa | --filter-alternative)
FILTERALT="$2"
shift # past argument
shift # past value
;;
-t | --toggle)
TOGGLE="true"
shift # past argument
;;
-h | --help)
HELP="1"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ -n "$HELP" ]; then
cat << EOF
ww. Utility to raise or jump an applications in KDE. It interacts with KWin using KWin scripts and it is compatible with X11 and Wayland
Paramaters:
-h --help show this help
-f --filter filter by window class
-fa --filter-alternative filter by window title (caption)
-t --toggle also minimize the window if it is already active
-c --command command to check if running and run if no process is found
EOF
exit 0
fi
SCRIPT_TEMPLATE=$(
cat << EOF
function kwinactivateclient(clientClass, clientCaption, toggle) {
var clients = workspace.clientList();
var compareToCaption = new RegExp(clientCaption || '', 'i');
var compareToClass = clientClass;
var isCompareToClass = clientClass.length > 0
for (var i=0; i<clients.length; i++) {
var client = clients[i];
var classCompare = (isCompareToClass && client.resourceClass == compareToClass)
var captionCompare = (!isCompareToClass && compareToCaption.exec(client.caption))
if (classCompare || captionCompare) {
if (workspace.activeClient != client) {
workspace.activeClient = client;
} else if (toggle) {
client.minimized = true;
}
break;
}
}
}
kwinactivateclient('CLASS_NAME', 'CAPTION_NAME', TOGGLE);
EOF
)
CURRENT_SCRIPT_NAME=$(basename "$0")
# ensure the script file exists
function ensure_script {
if [ ! -f SCRIPT_PATH ]; then
if [ ! -d "$SCRIPT_FOLDER" ]; then
mkdir -p "$SCRIPT_FOLDER"
fi
SCRIPT_CONTENT=${SCRIPT_TEMPLATE/CLASS_NAME/$1}
SCRIPT_CONTENT=${SCRIPT_CONTENT/CAPTION_NAME/$2}
SCRIPT_CONTENT=${SCRIPT_CONTENT/TOGGLE/$3}
#if [ "$1" == "class" ]; then
#SCRIPT_CONTENT=${SCRIPT_CLASS_NAME/REPLACE_ME/$2}
#else
#SCRIPT_CONTENT=${SCRIPT_CAPTION/REPLACE_ME/$2}
#fi
echo "$SCRIPT_CONTENT" > "$SCRIPT_PATH"
fi
}
if [ -z "$FILTERBY" ] && [ -z "$FILTERALT" ]; then
echo You need to specify a window filter. Either by class -f or by title -fa
exit 1
fi
IS_RUNNING=$(pgrep -o -a -f "$COMMAND" | grep -v "$CURRENT_SCRIPT_NAME")
if [ -n "$IS_RUNNING" ] || [ -n "$FILTERALT" ]; then
# trying for XDG_CONFIG_HOME first
SCRIPT_FOLDER_ROOT=$XDG_CONFIG_HOME
if [[ -z $SCRIPT_FOLDER_ROOT ]]; then
# fallback to the home folder
SCRIPT_FOLDER_ROOT=$HOME
fi
SCRIPT_FOLDER="$SCRIPT_FOLDER_ROOT/.wwscripts/"
SCRIPT_NAME=$(echo "$FILTERBY$FILTERALT" | md5sum | head -c 32)
SCRIPT_PATH="$SCRIPT_FOLDER$SCRIPT_NAME"
ensure_script "$FILTERBY" "$FILTERALT" "$TOGGLE"
SCRIPT_NAME="ww$RANDOM"
#SCRIPT_NAME=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# install the script
ID=$(dbus-send --session --dest=org.kde.KWin --print-reply=literal /Scripting org.kde.kwin.Scripting.loadScript "string:$SCRIPT_PATH" "string:$SCRIPT_NAME" | awk '{print $2}')
# run it - some KDEs version use Script.run others Scripting.run
dbus-send --session --dest=org.kde.KWin --print-reply=literal "/$ID" org.kde.kwin.Scripting.run > /dev/null 2>&1
dbus-send --session --dest=org.kde.KWin --print-reply=literal "/$ID" org.kde.kwin.Script.run > /dev/null 2>&1
# stop it - some KDEs version use Script.run others Scripting.run
dbus-send --session --dest=org.kde.KWin --print-reply=literal "/$ID" org.kde.kwin.Scripting.stop > /dev/null 2>&1
dbus-send --session --dest=org.kde.KWin --print-reply=literal "/$ID" org.kde.kwin.Script.stop > /dev/null 2>&1
# uninstall it
dbus-send --session --dest=org.kde.KWin --print-reply=literal /Scripting org.kde.kwin.Scripting.unloadScript "string:$SCRIPT_NAME" > /dev/null 2>&1
elif [ -n "$COMMAND" ]; then
$COMMAND &
fi

@ -66,6 +66,8 @@ config.modules = {
'plantuml', 'plantuml',
'websocat', 'websocat',
'pandoc', 'pandoc',
'anyrun',
'taplo',
}, },
gui = mod { gui = mod {
'kdePackages.breeze-icons', 'kdePackages.breeze-icons',
@ -73,6 +75,7 @@ config.modules = {
'breeze-qt5', 'breeze-qt5',
'vscode', 'vscode',
'insomnia', 'insomnia',
'drawio',
}, },
fonts = default_mod { fonts = default_mod {
'fontconfig', 'fontconfig',
@ -84,6 +87,7 @@ config.modules = {
'librewolf', 'librewolf',
'spotify', 'spotify',
'libsForQt5.plasma-browser-integration', 'libsForQt5.plasma-browser-integration',
'vale',
}, },
docker = mod { docker = mod {
'docker', 'docker',
@ -116,6 +120,10 @@ config.modules = {
'cargo-release', 'cargo-release',
'cargo-lambda', 'cargo-lambda',
}, },
go = mod {
'go',
'gopls',
},
lua = mod { lua = mod {
'lua-language-server', 'lua-language-server',
'lua5', 'lua5',

Loading…
Cancel
Save