Compare commits
No commits in common. "main" and "noctalia-shell" have entirely different histories.
main
...
noctalia-s
554 changed files with 7164 additions and 21326 deletions
|
|
@ -1,14 +1,7 @@
|
||||||
[general]
|
[general]
|
||||||
import = [ "gruvbox-dark.toml" ]
|
import = [
|
||||||
|
"~/.config/alacritty/gruvbox_dark.toml"
|
||||||
[window]
|
]
|
||||||
# dynamic_padding = true
|
|
||||||
padding = {x = 2, y = 2}
|
|
||||||
|
|
||||||
[font.normal]
|
[font.normal]
|
||||||
family = "monospace"
|
family = "Adwaita Mono"
|
||||||
|
|
||||||
[keyboard]
|
|
||||||
bindings = [
|
|
||||||
{ key = "Enter", mods = "Super|Shift", action = "CreateNewWindow" }
|
|
||||||
]
|
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
# [colors]
|
|
||||||
colors.line_indicator = { foreground = "#ebdbb2", background = "#504945" }
|
|
||||||
colors.footer_bar = { foreground = "#ebdbb2", background = "#504945" }
|
|
||||||
colors.selection = { text = "CellForeground", background = "#665c54" }
|
|
||||||
|
|
||||||
# Default colors
|
|
||||||
# [colors.primary]
|
|
||||||
# hard contrast background = = '#1d2021'
|
|
||||||
colors.primary.background = '#282828'
|
|
||||||
# soft contrast background = = '#32302f'
|
|
||||||
colors.primary.foreground = '#ebdbb2'
|
|
||||||
colors.primary.dim_foreground = '#d5c4a1'
|
|
||||||
colors.primary.bright_foreground = '#fbf1c7'
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
# [colors.normal]
|
|
||||||
colors.normal.black = '#282828'
|
|
||||||
colors.normal.red = '#cc241d'
|
|
||||||
colors.normal.green = '#98971a'
|
|
||||||
colors.normal.yellow = '#d79921'
|
|
||||||
colors.normal.blue = '#458588'
|
|
||||||
colors.normal.magenta = '#b16286'
|
|
||||||
colors.normal.cyan = '#689d6a'
|
|
||||||
colors.normal.white = '#a89984'
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
# [colors.bright]
|
|
||||||
colors.bright.black = '#928374'
|
|
||||||
colors.bright.red = '#fb4934'
|
|
||||||
colors.bright.green = '#b8bb26'
|
|
||||||
colors.bright.yellow = '#fabd2f'
|
|
||||||
colors.bright.blue = '#83a598'
|
|
||||||
colors.bright.magenta = '#d3869b'
|
|
||||||
colors.bright.cyan = '#8ec07c'
|
|
||||||
colors.bright.white = '#ebdbb2'
|
|
||||||
|
|
||||||
colors.dim.black = '#3c3836'
|
|
||||||
colors.dim.red = '#9d0006'
|
|
||||||
colors.dim.green = '#79740e'
|
|
||||||
colors.dim.yellow = '#b57614'
|
|
||||||
colors.dim.blue = '#076678'
|
|
||||||
colors.dim.magenta = '#8f3f71'
|
|
||||||
colors.dim.cyan = '#427b58'
|
|
||||||
colors.dim.white = '#504945'
|
|
||||||
|
|
||||||
# [colors.search]
|
|
||||||
colors.search.matches = { foreground = "#282828", background = "#fabd2f" }
|
|
||||||
colors.search.focused_match = { foreground = "#282828", background = "#fe8019" }
|
|
||||||
|
|
||||||
# [colors.hints]
|
|
||||||
colors.hints.start = { foreground = "#282828", background = "#fe8019" }
|
|
||||||
colors.hints.end = { foreground = "#282828", background = "#fabd2f" }
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
# [colors]
|
|
||||||
colors.line_indicator = { foreground = "#3c3836", background = "#d5c4a1" }
|
|
||||||
colors.footer_bar = { foreground = "#3c3836", background = "#d5c4a1" }
|
|
||||||
colors.selection = { text = "CellForeground", background = "#bdae93" }
|
|
||||||
|
|
||||||
# Default colors
|
|
||||||
# [colors.primary]
|
|
||||||
# hard contrast background = = '#1d2021'
|
|
||||||
# soft contrast background = = '#32302f'
|
|
||||||
colors.primary.background = '#fbf1c7'
|
|
||||||
colors.primary.foreground = '#3c3836'
|
|
||||||
colors.primary.dim_foreground = '#504945'
|
|
||||||
colors.primary.bright_foreground = '#282828'
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
# [colors.normal]
|
|
||||||
colors.normal.black = '#fbf1c7'
|
|
||||||
colors.normal.red = '#cc241d'
|
|
||||||
colors.normal.green = '#98971a'
|
|
||||||
colors.normal.yellow = '#d79921'
|
|
||||||
colors.normal.blue = '#458588'
|
|
||||||
colors.normal.magenta = '#b16286'
|
|
||||||
colors.normal.cyan = '#689d6a'
|
|
||||||
colors.normal.white = '#7c6f64'
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
# [colors.bright]
|
|
||||||
colors.bright.black = '#928374'
|
|
||||||
colors.bright.red = '#9d0006'
|
|
||||||
colors.bright.green = '#79740e'
|
|
||||||
colors.bright.yellow = '#b57614'
|
|
||||||
colors.bright.blue = '#076678'
|
|
||||||
colors.bright.magenta = '#8f3f71'
|
|
||||||
colors.bright.cyan = '#427b58'
|
|
||||||
colors.bright.white = '#3c3836'
|
|
||||||
|
|
||||||
colors.dim.black = '#ebdbb2'
|
|
||||||
colors.dim.red = '#fb4934'
|
|
||||||
colors.dim.green = '#b8bb26'
|
|
||||||
colors.dim.yellow = '#fabd2f'
|
|
||||||
colors.dim.blue = '#83a598'
|
|
||||||
colors.dim.magenta = '#d3869b'
|
|
||||||
colors.dim.cyan = '#8ec07c'
|
|
||||||
colors.dim.white = '#d5c4a1'
|
|
||||||
|
|
||||||
# [colors.search]
|
|
||||||
colors.search.matches = { foreground = "#fbf1c7", background = "#b57614" }
|
|
||||||
colors.search.focused_match = { foreground = "#fbf1c7", background = "#af3a03" }
|
|
||||||
|
|
||||||
# [colors.hints]
|
|
||||||
colors.hints.start = { foreground = "#fbf1c7", background = "#af3a03" }
|
|
||||||
colors.hints.end = { foreground = "#fbf1c7", background = "#b57614" }
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
/home/never/.config/alacritty/gruvbox-light.toml
|
|
||||||
30
.config/alacritty/gruvbox_dark.toml
Normal file
30
.config/alacritty/gruvbox_dark.toml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Colors (Gruvbox dark)
|
||||||
|
|
||||||
|
# Default colors
|
||||||
|
[colors.primary]
|
||||||
|
# hard contrast background = = '#1d2021'
|
||||||
|
background = '#282828'
|
||||||
|
# soft contrast background = = '#32302f'
|
||||||
|
foreground = '#ebdbb2'
|
||||||
|
|
||||||
|
# Normal colors
|
||||||
|
[colors.normal]
|
||||||
|
black = '#282828'
|
||||||
|
red = '#cc241d'
|
||||||
|
green = '#98971a'
|
||||||
|
yellow = '#d79921'
|
||||||
|
blue = '#458588'
|
||||||
|
magenta = '#b16286'
|
||||||
|
cyan = '#689d6a'
|
||||||
|
white = '#a89984'
|
||||||
|
|
||||||
|
# Bright colors
|
||||||
|
[colors.bright]
|
||||||
|
black = '#928374'
|
||||||
|
red = '#fb4934'
|
||||||
|
green = '#b8bb26'
|
||||||
|
yellow = '#fabd2f'
|
||||||
|
blue = '#83a598'
|
||||||
|
magenta = '#d3869b'
|
||||||
|
cyan = '#8ec07c'
|
||||||
|
white = '#ebdbb2'
|
||||||
1
.config/config.jsonc
Symbolic link
1
.config/config.jsonc
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
waybar/config.jsonc
|
||||||
BIN
.config/dconf/user
Normal file
BIN
.config/dconf/user
Normal file
Binary file not shown.
|
|
@ -1,63 +0,0 @@
|
||||||
(require 'package)
|
|
||||||
|
|
||||||
;; auto install all packages called by =use-package=
|
|
||||||
(require 'use-package-ensure)
|
|
||||||
(setq use-package-always-ensure t)
|
|
||||||
|
|
||||||
;; add package archives
|
|
||||||
(setq package-archives
|
|
||||||
'(("melpa" . "https://melpa.org/packages/")
|
|
||||||
("gnu" . "https://elpa.gnu.org/packages/")
|
|
||||||
("gnu-devel" . "https://elpa.gnu.org/devel/")
|
|
||||||
("nongnu" . "https://elpa.nongnu.org/nongnu/")
|
|
||||||
))
|
|
||||||
|
|
||||||
(setq inhibit-startup-message t
|
|
||||||
use-dialog-box nil)
|
|
||||||
|
|
||||||
(setq modus-themes-disable-other-themes t)
|
|
||||||
|
|
||||||
(setq modus-themes-italic-constructs t
|
|
||||||
modus-themes-bold-constructs t
|
|
||||||
modus-themes-mixed-fonts t
|
|
||||||
modus-themes-variable-pitch-ui t)
|
|
||||||
|
|
||||||
(setq modus-themes-headings
|
|
||||||
'((1 . (1.4))
|
|
||||||
(2 . (1.3))
|
|
||||||
(3 . (1.2))
|
|
||||||
(t . (1.1))))
|
|
||||||
|
|
||||||
(setq modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted))
|
|
||||||
(define-key global-map (kbd "<f5>") #'modus-themes-toggle)
|
|
||||||
|
|
||||||
(load-theme 'modus-operandi-tinted)
|
|
||||||
|
|
||||||
;; Move customization variables to a separate file and load it
|
|
||||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
|
||||||
(load custom-file 'noerror 'nomessage)
|
|
||||||
|
|
||||||
;; Revert buffers when the underlying file has changed
|
|
||||||
(setq global-auto-revert-non-file-buffers t)
|
|
||||||
(global-auto-revert-mode 1)
|
|
||||||
|
|
||||||
;; Turn off some unneeded UI elements
|
|
||||||
(menu-bar-mode 1) ; Leave this one on if you're a beginner!
|
|
||||||
(tool-bar-mode 0)
|
|
||||||
(scroll-bar-mode 0)
|
|
||||||
|
|
||||||
;; Turn on some QOL
|
|
||||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
|
||||||
;; (global-display-line-numbers-mode 1)
|
|
||||||
(global-hl-line-mode 1)
|
|
||||||
(global-visual-line-mode 1)
|
|
||||||
(blink-cursor-mode 0)
|
|
||||||
; (global-display-fill-column-indicator-mode 1)
|
|
||||||
(which-key-mode 1)
|
|
||||||
(recentf-mode 1)
|
|
||||||
(savehist-mode 1)
|
|
||||||
(save-place-mode 1)
|
|
||||||
(setq make-backup-files nil)
|
|
||||||
|
|
||||||
(use-package magit)
|
|
||||||
(use-package auctex)
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
|
||||||
# the 'fish_key_bindings' variable from its old default scope (universal)
|
|
||||||
# to its new default scope (global). We recommend you delete this file
|
|
||||||
# and configure key bindings in ~/.config/fish/config.fish if needed.
|
|
||||||
|
|
||||||
set --global fish_key_bindings fish_vi_key_bindings
|
|
||||||
|
|
||||||
# Prior to version 4.3, fish shipped an event handler that runs
|
|
||||||
# `set --universal fish_key_bindings fish_default_key_bindings`
|
|
||||||
# whenever the fish_key_bindings variable is erased.
|
|
||||||
# This means that as long as any fish < 4.3 is still running on this system,
|
|
||||||
# we cannot complete the migration.
|
|
||||||
# As a workaround, erase the universal variable at every shell startup.
|
|
||||||
set --erase --universal fish_key_bindings
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
# This file was created by fish when upgrading to version 4.3, to migrate
|
|
||||||
# theme variables from universal to global scope.
|
|
||||||
# Don't edit this file, as it will be written by the web-config tool (`fish_config`).
|
|
||||||
# To customize your theme, delete this file and see
|
|
||||||
# help interactive#syntax-highlighting
|
|
||||||
# or
|
|
||||||
# man fish-interactive | less +/^SYNTAX.HIGHLIGHTING
|
|
||||||
# for appropriate commands to add to ~/.config/fish/config.fish instead.
|
|
||||||
# See also the release notes for fish 4.3.0 (run `help relnotes`).
|
|
||||||
|
|
||||||
set --global fish_color_autosuggestion white
|
|
||||||
set --global fish_color_cancel white --bold
|
|
||||||
set --global fish_color_command brgreen --bold
|
|
||||||
set --global fish_color_comment brblack
|
|
||||||
set --global fish_color_cwd green
|
|
||||||
set --global fish_color_cwd_root red
|
|
||||||
set --global fish_color_end cyan
|
|
||||||
set --global fish_color_error red --underline=curly
|
|
||||||
set --global fish_color_escape white --bold
|
|
||||||
set --global fish_color_history_current --bold
|
|
||||||
set --global fish_color_host normal
|
|
||||||
set --global fish_color_host_remote yellow
|
|
||||||
set --global fish_color_keyword brred
|
|
||||||
set --global fish_color_match --background=brblue
|
|
||||||
set --global fish_color_normal normal
|
|
||||||
set --global fish_color_operator yellow
|
|
||||||
set --global fish_color_option brblue
|
|
||||||
set --global fish_color_param normal
|
|
||||||
set --global fish_color_quote green --italics
|
|
||||||
set --global fish_color_redirection yellow
|
|
||||||
set --global fish_color_search_match
|
|
||||||
set --global fish_color_selection --background brblack
|
|
||||||
set --global fish_color_status red
|
|
||||||
set --global fish_color_user brgreen
|
|
||||||
set --global fish_color_valid_path --underline
|
|
||||||
set --global fish_pager_color_background
|
|
||||||
set --global fish_pager_color_completion normal
|
|
||||||
set --global fish_pager_color_description yellow --italics
|
|
||||||
set --global fish_pager_color_prefix normal --bold --underline
|
|
||||||
set --global fish_pager_color_progress normal --reverse
|
|
||||||
set --global fish_pager_color_secondary_background
|
|
||||||
set --global fish_pager_color_secondary_completion
|
|
||||||
set --global fish_pager_color_secondary_description
|
|
||||||
set --global fish_pager_color_secondary_prefix
|
|
||||||
set --global fish_pager_color_selected_background --background brblue
|
|
||||||
set --global fish_pager_color_selected_completion black --bold
|
|
||||||
set --global fish_pager_color_selected_description bryellow --bold --italics
|
|
||||||
set --global fish_pager_color_selected_prefix black --bold --underline
|
|
||||||
|
|
@ -1,82 +1,12 @@
|
||||||
if status is-interactive
|
if status is-interactive
|
||||||
# Commands to run in interactive sessions can go here
|
# Commands to run in interactive sessions can go here
|
||||||
abbr --add ll ll -a
|
|
||||||
abbr --add adl album-dl.fish
|
|
||||||
abbr --add vv nvim
|
|
||||||
abbr --add tr gio trash
|
|
||||||
abbr --add --set-cursor tldr curl cheat.sh/%
|
|
||||||
|
|
||||||
function copy --description 'Copy to clipboard'
|
|
||||||
fish_clipboard_copy
|
|
||||||
end
|
|
||||||
|
|
||||||
function paste --description 'Paste from clipboard'
|
|
||||||
fish_clipboard_paste
|
|
||||||
end
|
|
||||||
|
|
||||||
function open --wraps 'xdg-open'
|
|
||||||
xdg-open $argv &>/dev/null & disown
|
|
||||||
end
|
|
||||||
|
|
||||||
function detach --description 'Detach a command from shell'
|
|
||||||
$argv &>/dev/null & disown
|
|
||||||
end
|
|
||||||
|
|
||||||
function vman --description 'Uses Neovim as a manpager'
|
|
||||||
man $argv | nvim +Man!
|
|
||||||
end
|
|
||||||
|
|
||||||
function mvi --description 'Launches mpv with mvi configuration'
|
|
||||||
mpv --config-dir=$HOME/.config/mvi/ $argv
|
|
||||||
end
|
|
||||||
|
|
||||||
set EDITOR nvim
|
|
||||||
# Colorscheme
|
|
||||||
set fish_color_normal normal
|
|
||||||
set fish_color_command brgreen --bold
|
|
||||||
set fish_color_keyword brred
|
|
||||||
set fish_color_quote green --italics
|
|
||||||
set fish_color_redirection yellow
|
|
||||||
set fish_color_end cyan
|
|
||||||
set fish_color_error red --underline=curly
|
|
||||||
set fish_color_param normal
|
|
||||||
set fish_color_comment brblack
|
|
||||||
set fish_color_selection --background brblack
|
|
||||||
set fish_color_search_match
|
|
||||||
set fish_color_history_current
|
|
||||||
set fish_color_operator yellow
|
|
||||||
set fish_color_escape white --bold
|
|
||||||
set fish_color_cwd green
|
|
||||||
set fish_color_cwd_root red
|
|
||||||
set fish_color_option brblue
|
|
||||||
set fish_color_valid_path --underline
|
|
||||||
set fish_color_autosuggestion white
|
|
||||||
set fish_color_user brgreen
|
|
||||||
set fish_color_host normal
|
|
||||||
set fish_color_host_remote yellow
|
|
||||||
set fish_color_history_current --bold
|
|
||||||
set fish_color_status red
|
|
||||||
set fish_color_cancel white --bold
|
|
||||||
set fish_pager_color_prefix normal --bold --underline
|
|
||||||
set fish_pager_color_progress normal --reverse
|
|
||||||
set fish_pager_color_completion normal
|
|
||||||
set fish_pager_color_description yellow --italics
|
|
||||||
set fish_pager_color_selected_background --background brblue
|
|
||||||
set fish_pager_color_secondary_background
|
|
||||||
set fish_pager_color_selected_completion black --bold
|
|
||||||
set fish_pager_color_background
|
|
||||||
set fish_pager_color_selected_description bryellow --bold --italics
|
|
||||||
set fish_pager_color_secondary_prefix
|
|
||||||
set fish_pager_color_secondary_description
|
|
||||||
set fish_pager_color_selected_prefix black --bold --underline
|
|
||||||
set fish_pager_color_secondary_completion
|
|
||||||
|
|
||||||
# if test $XDG_CURRENT_DESKTOP = "niri"
|
|
||||||
# dconf write /org/gnome/desktop/wm/preferences/button-layout "'appmenu'"
|
|
||||||
# else
|
|
||||||
# dconf reset /org/gnome/desktop/wm/preferences/button-layout
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# BEGIN opam configuration
|
||||||
|
# This is useful if you're using opam as it adds:
|
||||||
|
# - the correct directories to the PATH
|
||||||
|
# - auto-completion for the opam binary
|
||||||
|
# This section can be safely removed at any time if needed.
|
||||||
|
test -r '/home/never/.opam/opam-init/init.fish' && source '/home/never/.opam/opam-init/init.fish' > /dev/null 2> /dev/null; or true
|
||||||
|
# END opam configuration
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,47 @@
|
||||||
# This file contains fish universal variable definitions.
|
# This file contains fish universal variable definitions.
|
||||||
# VERSION: 3.0
|
# VERSION: 3.0
|
||||||
SETUVAR --export EDITOR:nvim
|
SETUVAR --export EDITOR:nvim
|
||||||
SETUVAR LESS:RAW\x2dCONTROL\x2dCHARS
|
SETUVAR --export MANPAGER:nvim\x20\x2bMan\x21
|
||||||
SETUVAR --export QT_QPA_PLATFORMTHEME:qt6ct
|
SETUVAR --export QT_QPA_PLATFORMTHEME:qt6ct
|
||||||
SETUVAR --export QT_QPA_PlATFORMTHEME:qt6ct
|
SETUVAR __fish_initialized:3800
|
||||||
SETUVAR __fish_initialized:4300
|
SETUVAR fish_color_autosuggestion:585858
|
||||||
|
SETUVAR fish_color_cancel:\x2d\x2dreverse
|
||||||
|
SETUVAR fish_color_command:a1b56c
|
||||||
|
SETUVAR fish_color_comment:f7ca88
|
||||||
|
SETUVAR fish_color_cwd:green
|
||||||
|
SETUVAR fish_color_cwd_root:red
|
||||||
|
SETUVAR fish_color_end:ba8baf
|
||||||
|
SETUVAR fish_color_error:ab4642
|
||||||
|
SETUVAR fish_color_escape:86c1b9
|
||||||
|
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||||
|
SETUVAR fish_color_host:normal
|
||||||
|
SETUVAR fish_color_host_remote:yellow
|
||||||
|
SETUVAR fish_color_keyword:a1b56c
|
||||||
|
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
|
||||||
|
SETUVAR fish_color_normal:normal
|
||||||
|
SETUVAR fish_color_operator:7cafc2
|
||||||
|
SETUVAR fish_color_option:d8d8d8
|
||||||
|
SETUVAR fish_color_param:d8d8d8
|
||||||
|
SETUVAR fish_color_quote:f7ca88
|
||||||
|
SETUVAR fish_color_redirection:d8d8d8
|
||||||
|
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_color_status:red
|
||||||
|
SETUVAR fish_color_user:brgreen
|
||||||
|
SETUVAR fish_color_valid_path:\x2d\x2dunderline\x3dsingle
|
||||||
SETUVAR fish_greeting:\x1d
|
SETUVAR fish_greeting:\x1d
|
||||||
SETUVAR fish_user_paths:/home/never/\x2elocal/scripts\x1e/usr/local/texlive/2025/bin/x86_64\x2dlinux\x1e/home/never/\x2ecargo/bin/
|
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||||
|
SETUVAR fish_pager_color_background:\x1d
|
||||||
|
SETUVAR fish_pager_color_completion:normal
|
||||||
|
SETUVAR fish_pager_color_description:B3A06D
|
||||||
|
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline\x3dsingle
|
||||||
|
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dcyan
|
||||||
|
SETUVAR fish_pager_color_secondary_background:\x1d
|
||||||
|
SETUVAR fish_pager_color_secondary_completion:\x1d
|
||||||
|
SETUVAR fish_pager_color_secondary_description:\x1d
|
||||||
|
SETUVAR fish_pager_color_secondary_prefix:\x1d
|
||||||
|
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack
|
||||||
|
SETUVAR fish_pager_color_selected_completion:\x1d
|
||||||
|
SETUVAR fish_pager_color_selected_description:\x1d
|
||||||
|
SETUVAR fish_pager_color_selected_prefix:\x1d
|
||||||
|
SETUVAR fish_user_paths:/usr/local/texlive/2025/bin/x86_64\x2dlinux\x1e/home/never/\x2ecargo/bin\x1e/home/never/\x2elocal/bin
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
function fish_mode_prompt --description 'Displays the current mode'
|
|
||||||
# Do nothing if not in vi mode
|
|
||||||
if test "$fish_key_bindings" = fish_vi_key_bindings
|
|
||||||
or test "$fish_key_bindings" = fish_hybrid_key_bindings
|
|
||||||
switch $fish_bind_mode
|
|
||||||
case default
|
|
||||||
set_color --bold --reverse normal
|
|
||||||
echo ' N '
|
|
||||||
case insert
|
|
||||||
set_color --bold --reverse brblue
|
|
||||||
echo ' I '
|
|
||||||
case replace_one
|
|
||||||
set_color --bold --reverse brblue
|
|
||||||
echo ' I '
|
|
||||||
case replace
|
|
||||||
set_color --bold --reverse brred
|
|
||||||
echo ' R '
|
|
||||||
case visual
|
|
||||||
set_color --bold --reverse brgreen
|
|
||||||
echo ' V '
|
|
||||||
end
|
|
||||||
set_color normal
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -2,21 +2,27 @@ function fish_prompt
|
||||||
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
|
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
|
||||||
set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
set -g VIRTUAL_ENV_DISABLE_PROMPT true
|
||||||
end
|
end
|
||||||
|
# set_color yellow
|
||||||
|
# printf '%s' $USER
|
||||||
|
# set_color normal
|
||||||
|
# printf ' at '
|
||||||
|
# set_color magenta
|
||||||
|
# echo -n (prompt_hostname)
|
||||||
|
# set_color normal
|
||||||
|
# printf ' in '
|
||||||
|
set -U fish_greeting
|
||||||
|
set_color $fish_color_cwd
|
||||||
|
printf '%s' (prompt_pwd)
|
||||||
|
|
||||||
# set_color white --background=brwhite --dim --reverse
|
set_color magenta
|
||||||
set_color brwhite
|
|
||||||
set -g __fish_git_prompt_show_informative_status true
|
set -g __fish_git_prompt_show_informative_status true
|
||||||
printf '%s' (fish_git_prompt " %s")
|
printf '%s' (fish_vcs_prompt)
|
||||||
|
set_color normal
|
||||||
# set_color black --background=white --dim --reverse
|
# Line 2
|
||||||
set_color white
|
# echo
|
||||||
printf ' %s ' (prompt_pwd -D 8)
|
|
||||||
echo
|
|
||||||
|
|
||||||
if test -n "$VIRTUAL_ENV"
|
if test -n "$VIRTUAL_ENV"
|
||||||
printf "(%s) " (set_color blue)(path basename $VIRTUAL_ENV)(set_color normal)
|
printf "(%s) " (set_color blue)(path basename $VIRTUAL_ENV)(set_color normal)
|
||||||
end
|
end
|
||||||
|
printf ' ☭ '
|
||||||
set_color normal
|
set_color normal
|
||||||
echo
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@ function fish_right_prompt -d "Write out the right prompt"
|
||||||
end
|
end
|
||||||
|
|
||||||
set_color white
|
set_color white
|
||||||
# date '+%H:%M:%S'
|
date '+%H:%M:%S'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
function menu --description 'Opens a menu of a list of Strings and writes the result to stdout'
|
|
||||||
argparse h/help p/prompt=? mesg=? placeholder=? index -- $argv
|
|
||||||
or return
|
|
||||||
|
|
||||||
if set -ql _flag_help
|
|
||||||
echo "menu [-h|--help] [-p|--prompt=?] [--placeholder] [--index] [STRING ...]"
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
set fuzzel_args
|
|
||||||
|
|
||||||
if set -ql _flag_prompt
|
|
||||||
set -a fuzzel_args "--prompt=$_flag_prompt"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_placeholder
|
|
||||||
set -a fuzzel_args "--placeholder=$_flag_placeholder"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_mesg
|
|
||||||
set -a fuzzel_args "--mesg=$_flag_mesg"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_index
|
|
||||||
set -a fuzzel_args "--index"
|
|
||||||
end
|
|
||||||
|
|
||||||
string unescape (string join -- \n $argv) | fuzzel --dmenu $fuzzel_args
|
|
||||||
end
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
function prompt --description 'Opens a menu of a list of Strings and writes the result to stdout'
|
|
||||||
argparse h/help p/prompt=? placeholder=? mesg=? password -- $argv
|
|
||||||
or return
|
|
||||||
|
|
||||||
if set -ql _flag_help
|
|
||||||
echo "menu [-h|--help] [-p|--prompt=?] [--placeholder=?] [--mesg=?] [--password] [STRING ...]"
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
set fuzzel_args
|
|
||||||
|
|
||||||
if set -ql _flag_prompt
|
|
||||||
set -a fuzzel_args "--prompt=$_flag_prompt"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_placeholder
|
|
||||||
set -a fuzzel_args "--placeholder=$_flag_placeholder"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_mesg
|
|
||||||
set -a fuzzel_args "--mesg=$_flag_mesg"
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -ql _flag_password
|
|
||||||
set -a fuzzel_args "--password"
|
|
||||||
end
|
|
||||||
|
|
||||||
string join -- \n $argv | fuzzel --dmenu --prompt-only='' $fuzzel_args
|
|
||||||
end
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
|
||||||
<fontconfig>
|
|
||||||
<alias>
|
|
||||||
<family>serif</family>
|
|
||||||
<prefer><family>Caladea</family></prefer>
|
|
||||||
</alias>
|
|
||||||
<alias>
|
|
||||||
<family>sans-serif</family>
|
|
||||||
<prefer><family>Adwaita Sans</family></prefer>
|
|
||||||
</alias>
|
|
||||||
<alias>
|
|
||||||
<family>monospace</family>
|
|
||||||
<prefer><family>Adwaita Mono</family></prefer>
|
|
||||||
</alias>
|
|
||||||
</fontconfig>
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# output=<not set>
|
# output=<not set>
|
||||||
font=monospace
|
font=Adwaita Mono
|
||||||
# dpi-aware=auto
|
# dpi-aware=auto
|
||||||
# use-bold=no
|
# use-bold=no
|
||||||
prompt=""
|
prompt=""
|
||||||
|
|
@ -8,7 +8,7 @@ placeholder="Search"
|
||||||
# icons-enabled=yes
|
# icons-enabled=yes
|
||||||
# hide-before-typing=no
|
# hide-before-typing=no
|
||||||
# fields=filename,name,generic
|
# fields=filename,name,generic
|
||||||
password-character=●
|
# password-character=*
|
||||||
# filter-desktop=no
|
# filter-desktop=no
|
||||||
# match-mode=fzf
|
# match-mode=fzf
|
||||||
# sort-result=yes
|
# sort-result=yes
|
||||||
|
|
@ -16,17 +16,17 @@ match-counter=yes
|
||||||
# delayed-filter-ms=300
|
# delayed-filter-ms=300
|
||||||
# delayed-filter-limit=20000
|
# delayed-filter-limit=20000
|
||||||
# show-actions=no
|
# show-actions=no
|
||||||
terminal=alacritty -e # Note: you cannot actually use environment variables here
|
# terminal=$TERMINAL -e # Note: you cannot actually use environment variables here
|
||||||
# launch-prefix=<not set>
|
# launch-prefix=<not set>
|
||||||
# list-executables-in-path=no
|
# list-executables-in-path=no
|
||||||
|
|
||||||
# anchor=center
|
# anchor=center
|
||||||
# x-margin=0
|
# x-margin=0
|
||||||
# y-margin=0
|
# y-margin=0
|
||||||
lines=16
|
# lines=15
|
||||||
minimal-lines=yes
|
# minimal-lines=no
|
||||||
width=64
|
width=50
|
||||||
tabs=4
|
# tabs=8
|
||||||
horizontal-pad=8
|
horizontal-pad=8
|
||||||
vertical-pad=8
|
vertical-pad=8
|
||||||
inner-pad=4
|
inner-pad=4
|
||||||
|
|
@ -50,18 +50,17 @@ inner-pad=4
|
||||||
# enable-mouse=yes
|
# enable-mouse=yes
|
||||||
|
|
||||||
[colors]
|
[colors]
|
||||||
background=191919ff
|
background=191919E5
|
||||||
text=999999ff
|
text=ffffffff
|
||||||
message=7f7f7fff
|
|
||||||
prompt=999999ff
|
prompt=999999ff
|
||||||
placeholder=505050ff
|
placeholder=505050ff
|
||||||
input=ffffffff
|
input=ffffffff
|
||||||
match=7fc8ffff
|
match=7fc8ffff
|
||||||
selection=2c2c2cff
|
selection=7f7f7f7f
|
||||||
selection-text=ffffffff
|
selection-text=ffffffff
|
||||||
selection-match=7fc8ffff
|
selection-match=7fc8ffff
|
||||||
counter=999999ff
|
counter=999999ff
|
||||||
border=7f7f7fff
|
border=7f7f7fE5
|
||||||
|
|
||||||
[border]
|
[border]
|
||||||
width=2
|
width=2
|
||||||
|
|
@ -69,7 +68,7 @@ radius=0
|
||||||
|
|
||||||
[dmenu]
|
[dmenu]
|
||||||
# mode=text # text|index
|
# mode=text # text|index
|
||||||
exit-immediately-if-empty=yes
|
# exit-immediately-if-empty=no
|
||||||
|
|
||||||
[key-bindings]
|
[key-bindings]
|
||||||
# cancel=Escape Control+g Control+c Control+bracketleft
|
# cancel=Escape Control+g Control+c Control+bracketleft
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
[user]
|
|
||||||
email = n.gude@posteo.de
|
|
||||||
name = Never Gude
|
|
||||||
[init]
|
|
||||||
defaultBranch = main
|
|
||||||
59
.config/kitty/Solarized_Light.conf
Normal file
59
.config/kitty/Solarized_Light.conf
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# vim:ft=kitty
|
||||||
|
|
||||||
|
## name: Solarized Light
|
||||||
|
## author: Ethan Schoonover
|
||||||
|
## license: MIT
|
||||||
|
## blurb: Precision colors for machines and people
|
||||||
|
|
||||||
|
# The basic colors
|
||||||
|
foreground #657b83
|
||||||
|
background #fdf6e3
|
||||||
|
selection_foreground #586e75
|
||||||
|
selection_background #eee8d5
|
||||||
|
|
||||||
|
# Cursor colors
|
||||||
|
cursor #657b83
|
||||||
|
cursor_text_color #fdf6e3
|
||||||
|
|
||||||
|
# kitty window border colors
|
||||||
|
active_border_color #cb4b16
|
||||||
|
inactive_border_color #93a1a1
|
||||||
|
|
||||||
|
# Tab bar colors
|
||||||
|
active_tab_background #fdf6e3
|
||||||
|
active_tab_foreground #657b83
|
||||||
|
inactive_tab_background #93a1a1
|
||||||
|
inactive_tab_foreground #fdf6e3
|
||||||
|
|
||||||
|
# The basic 16 colors
|
||||||
|
# black
|
||||||
|
color0 #073642
|
||||||
|
color8 #93a1a1
|
||||||
|
|
||||||
|
# red
|
||||||
|
color1 #dc322f
|
||||||
|
color9 #cb4b16
|
||||||
|
|
||||||
|
# green
|
||||||
|
color2 #859900
|
||||||
|
color10 #586e75
|
||||||
|
|
||||||
|
# yellow
|
||||||
|
color3 #b58900
|
||||||
|
color11 #657b83
|
||||||
|
|
||||||
|
# blue
|
||||||
|
color4 #268bd2
|
||||||
|
color12 #839496
|
||||||
|
|
||||||
|
# magenta
|
||||||
|
color5 #d33682
|
||||||
|
color13 #6c71c4
|
||||||
|
|
||||||
|
# cyan
|
||||||
|
color6 #2aa198
|
||||||
|
color14 #93a1a1
|
||||||
|
|
||||||
|
# white
|
||||||
|
color7 #eee8d5
|
||||||
|
color15 #fdf6e3
|
||||||
59
.config/kitty/current-theme.conf
Normal file
59
.config/kitty/current-theme.conf
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# vim:ft=kitty
|
||||||
|
|
||||||
|
## name: Solarized Dark
|
||||||
|
## author: Ethan Schoonover
|
||||||
|
## license: MIT
|
||||||
|
## blurb: Precision colors for machines and people
|
||||||
|
|
||||||
|
# The basic colors
|
||||||
|
foreground #839496
|
||||||
|
background #002b36
|
||||||
|
selection_foreground #93a1a1
|
||||||
|
selection_background #073642
|
||||||
|
|
||||||
|
# Cursor colors
|
||||||
|
cursor none
|
||||||
|
#cursor_text_color #002b36
|
||||||
|
|
||||||
|
# kitty window border colors
|
||||||
|
active_border_color #cb4b16
|
||||||
|
inactive_border_color #839496
|
||||||
|
|
||||||
|
# Tab bar colors
|
||||||
|
active_tab_background #839496
|
||||||
|
active_tab_foreground #002b36
|
||||||
|
inactive_tab_background #002b36
|
||||||
|
inactive_tab_foreground #839496
|
||||||
|
|
||||||
|
# The basic 16 colors
|
||||||
|
# black
|
||||||
|
color0 #073642
|
||||||
|
color8 #002b36
|
||||||
|
|
||||||
|
# red
|
||||||
|
color1 #dc322f
|
||||||
|
color9 #cb4b16
|
||||||
|
|
||||||
|
# green
|
||||||
|
color2 #859900
|
||||||
|
color10 #586e75
|
||||||
|
|
||||||
|
# yellow
|
||||||
|
color3 #b58900
|
||||||
|
color11 #657b83
|
||||||
|
|
||||||
|
# blue
|
||||||
|
color4 #268bd2
|
||||||
|
color12 #839496
|
||||||
|
|
||||||
|
# magenta
|
||||||
|
color5 #d33682
|
||||||
|
color13 #6c71c4
|
||||||
|
|
||||||
|
# cyan
|
||||||
|
color6 #2aa198
|
||||||
|
color14 #93a1a1
|
||||||
|
|
||||||
|
# white
|
||||||
|
color7 #eee8d5
|
||||||
|
color15 #fdf6e3
|
||||||
2798
.config/kitty/kitty.conf
Normal file
2798
.config/kitty/kitty.conf
Normal file
File diff suppressed because it is too large
Load diff
2790
.config/kitty/kitty.conf.bak
Normal file
2790
.config/kitty/kitty.conf.bak
Normal file
File diff suppressed because it is too large
Load diff
59
.config/kitty/light-theme.auto.conf
Normal file
59
.config/kitty/light-theme.auto.conf
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# vim:ft=kitty
|
||||||
|
|
||||||
|
## name: Solarized Light
|
||||||
|
## author: Ethan Schoonover
|
||||||
|
## license: MIT
|
||||||
|
## blurb: Precision colors for machines and people
|
||||||
|
|
||||||
|
# The basic colors
|
||||||
|
foreground #657b83
|
||||||
|
background #fdf6e3
|
||||||
|
selection_foreground #586e75
|
||||||
|
selection_background #eee8d5
|
||||||
|
|
||||||
|
# Cursor colors
|
||||||
|
cursor #657b83
|
||||||
|
cursor_text_color #fdf6e3
|
||||||
|
|
||||||
|
# kitty window border colors
|
||||||
|
active_border_color #cb4b16
|
||||||
|
inactive_border_color #93a1a1
|
||||||
|
|
||||||
|
# Tab bar colors
|
||||||
|
active_tab_background #fdf6e3
|
||||||
|
active_tab_foreground #657b83
|
||||||
|
inactive_tab_background #93a1a1
|
||||||
|
inactive_tab_foreground #fdf6e3
|
||||||
|
|
||||||
|
# The basic 16 colors
|
||||||
|
# black
|
||||||
|
color0 #073642
|
||||||
|
color8 #93a1a1
|
||||||
|
|
||||||
|
# red
|
||||||
|
color1 #dc322f
|
||||||
|
color9 #cb4b16
|
||||||
|
|
||||||
|
# green
|
||||||
|
color2 #859900
|
||||||
|
color10 #586e75
|
||||||
|
|
||||||
|
# yellow
|
||||||
|
color3 #b58900
|
||||||
|
color11 #657b83
|
||||||
|
|
||||||
|
# blue
|
||||||
|
color4 #268bd2
|
||||||
|
color12 #839496
|
||||||
|
|
||||||
|
# magenta
|
||||||
|
color5 #d33682
|
||||||
|
color13 #6c71c4
|
||||||
|
|
||||||
|
# cyan
|
||||||
|
color6 #2aa198
|
||||||
|
color14 #93a1a1
|
||||||
|
|
||||||
|
# white
|
||||||
|
color7 #eee8d5
|
||||||
|
color15 #fdf6e3
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
$pdf_previewer='papers %S';
|
|
||||||
|
|
||||||
$pdf_mode = 4;
|
|
||||||
$postscript_mode = $dvi_mode = 0;
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
--------------------------
|
|
||||||
-- Default luakit theme --
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
local theme = {}
|
|
||||||
|
|
||||||
-- Default settings
|
|
||||||
theme.font = "12px monospace"
|
|
||||||
theme.fg = "#ebdbb2"
|
|
||||||
theme.bg = "#282828"
|
|
||||||
|
|
||||||
-- General colours
|
|
||||||
theme.success_fg = "#98971a"
|
|
||||||
theme.loaded_fg = "#458588"
|
|
||||||
theme.error_fg = "#cc241d"
|
|
||||||
theme.error_bg = theme.bg
|
|
||||||
|
|
||||||
-- Warning colours
|
|
||||||
theme.warning_fg = "#d79921"
|
|
||||||
theme.warning_bg = theme.bg
|
|
||||||
|
|
||||||
-- Notification colours
|
|
||||||
theme.notif_fg = theme.fg
|
|
||||||
theme.notif_bg = theme.bg
|
|
||||||
|
|
||||||
-- Menu colours
|
|
||||||
theme.menu_fg = theme.fg
|
|
||||||
theme.menu_bg = theme.bg
|
|
||||||
theme.menu_selected_fg = "#282828"
|
|
||||||
theme.menu_selected_bg = "#83a598"
|
|
||||||
theme.menu_title_bg = "#504945"
|
|
||||||
theme.menu_primary_title_fg = theme.fg
|
|
||||||
theme.menu_secondary_title_fg = "#d5c4a1"
|
|
||||||
|
|
||||||
theme.menu_disabled_fg = "#928374"
|
|
||||||
theme.menu_disabled_bg = theme.menu_bg
|
|
||||||
theme.menu_enabled_fg = theme.menu_fg
|
|
||||||
theme.menu_enabled_bg = theme.menu_bg
|
|
||||||
theme.menu_active_fg = "#98971a"
|
|
||||||
theme.menu_active_bg = theme.menu_bg
|
|
||||||
|
|
||||||
-- Proxy manager
|
|
||||||
theme.proxy_active_menu_fg = theme.menu_fg
|
|
||||||
theme.proxy_active_menu_bg = theme.menu_bg
|
|
||||||
theme.proxy_inactive_menu_fg = theme.menu_disabled_fg
|
|
||||||
theme.proxy_inactive_menu_bg = theme.menu_disabled_bg
|
|
||||||
|
|
||||||
-- Statusbar specific
|
|
||||||
theme.sbar_fg = theme.fg
|
|
||||||
theme.sbar_bg = theme.bg
|
|
||||||
|
|
||||||
-- Downloadbar specific
|
|
||||||
theme.dbar_fg = theme.fg
|
|
||||||
theme.dbar_bg = theme.bg
|
|
||||||
theme.dbar_error_fg = "#cc241d"
|
|
||||||
|
|
||||||
-- Input bar specific
|
|
||||||
theme.ibar_fg = theme.fg
|
|
||||||
theme.ibar_bg = theme.bg
|
|
||||||
|
|
||||||
-- Tab label
|
|
||||||
theme.tab_fg = theme.fg
|
|
||||||
theme.tab_bg = theme.bg
|
|
||||||
theme.tab_hover_bg = "#3c3836"
|
|
||||||
theme.tab_ntheme = "#282828"
|
|
||||||
theme.selected_fg = theme.tab_fg
|
|
||||||
theme.selected_bg = "#504945"
|
|
||||||
theme.selected_ntheme = "#282828"
|
|
||||||
theme.loading_fg = "#458588"
|
|
||||||
theme.loading_bg = theme.tab_bg
|
|
||||||
|
|
||||||
theme.selected_private_tab_bg = "#d3869b"
|
|
||||||
theme.private_tab_bg = "#b16286"
|
|
||||||
|
|
||||||
-- Trusted/untrusted ssl colours
|
|
||||||
theme.trust_fg = "#98971a"
|
|
||||||
theme.notrust_fg = "#cc241d"
|
|
||||||
|
|
||||||
-- Follow mode hints
|
|
||||||
theme.hint_font = "10px monospace, courier, sans-serif"
|
|
||||||
theme.hint_fg = "#282828"
|
|
||||||
theme.hint_bg = "#fabd2f"
|
|
||||||
theme.hint_border = "1px solid #282828"
|
|
||||||
theme.hint_opacity = "0.3"
|
|
||||||
theme.hint_overlay_bg = "#fabd2f"
|
|
||||||
theme.hint_overlay_border = "1px solid #282828"
|
|
||||||
theme.hint_overlay_selected_bg = "#fe8019"
|
|
||||||
theme.hint_overlay_selected_border = theme.hint_overlay_border
|
|
||||||
|
|
||||||
-- General colour pairings
|
|
||||||
theme.ok = { fg = "#ebdbb2", bg = "#282828" }
|
|
||||||
theme.warn = { fg = "#d79921", bg = "#282828" }
|
|
||||||
theme.error = { fg = "#cc241d", bg = "#282828" }
|
|
||||||
|
|
||||||
-- Gopher page style (override defaults)
|
|
||||||
theme.gopher_light = { bg = "#fbf1c7", fg = "#3c3836", link = "#458588" }
|
|
||||||
theme.gopher_dark = { bg = "#282828", fg = "#ebdbb2", link = "#458588" }
|
|
||||||
|
|
||||||
return theme
|
|
||||||
|
|
||||||
-- vim: et:sw=4:ts=8:sts=4:tw=80
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
local select = require "select"
|
|
||||||
|
|
||||||
select.label_maker = function (s)
|
|
||||||
local chars = s.interleave("gfds", "hjkl")
|
|
||||||
return chars
|
|
||||||
end
|
|
||||||
|
|
@ -1,33 +1,11 @@
|
||||||
font=sans-serif
|
font=Adwaita Sans 10
|
||||||
|
|
||||||
default-timeout=5000
|
default-timeout=5000
|
||||||
max-history=8
|
|
||||||
max-visible=8
|
|
||||||
on-button-right=exec makoctl menu -n "$id" -- fuzzel --dmenu
|
|
||||||
on-button-middle=dismiss
|
|
||||||
|
|
||||||
layer=overlay
|
anchor=top-center
|
||||||
anchor=top-right
|
margin=16
|
||||||
outer-margin=8
|
|
||||||
margin=0,0,4
|
|
||||||
padding=8
|
padding=8
|
||||||
|
|
||||||
background-color=#191919E5
|
background-color=#191919E5
|
||||||
border-color=#505050E5
|
border-color=#505050E5
|
||||||
progress-color=source #7f7f7fE5
|
progress-color=source #909090E5
|
||||||
|
|
||||||
[urgency=low]
|
|
||||||
border-color=#2c2c2cE5
|
|
||||||
|
|
||||||
[urgency=high]
|
|
||||||
border-color=#9b0000E5
|
|
||||||
default-timeout=0
|
|
||||||
|
|
||||||
[category=status]
|
|
||||||
anchor=bottom-center
|
|
||||||
group-by=category
|
|
||||||
history=0
|
|
||||||
format=<b>%s</b> %b
|
|
||||||
default-timeout=1000
|
|
||||||
|
|
||||||
# vim: ft=conf
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
db_file "~/.local/share/mpd/database"
|
|
||||||
state_file "~/.local/state/mpd/state"
|
|
||||||
|
|
||||||
audio_output {
|
|
||||||
type "pulse"
|
|
||||||
name "Music"
|
|
||||||
}
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
This repository aggregates configurations, scripts and tips for using [mpv](https://github.com/mpv-player/mpv) as an image viewer. The affectionate nickname `mvi` is given to mpv in such case.
|
|
||||||
|
|
||||||
This README assumes basic familiarity with mpv and its configuration. The information here should be platform-agnostic for the most part.
|
|
||||||
|
|
||||||
[](https://vimeo.com/249231479)
|
|
||||||
|
|
||||||
# Why?
|
|
||||||
|
|
||||||
mpv is a competent video player and sufficiently lightweight to use comfortably to view images. It features advanced scaling algorithms and color management, which are key features in an image viewer.
|
|
||||||
It is also very extensible which allows us to compensate for some missing image viewer features easily.
|
|
||||||
It won't compete with `feh` or the likes when it comes to size or startup time, but it is still plenty fast.
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
|
|
||||||
There are several options for making an mvi configuration.
|
|
||||||
* Use the normal mpv config, and apply changes at runtime. You will need `detect-image.lua` and use [input sections](https://mpv.io/manual/master/#input-sections) and [profiles](https://mpv.io/manual/master/#profiles) to make this work.
|
|
||||||
* Or create an entirely separate `~/.config/mvi/` directory and use the alias `alias mvi='mpv --config-dir=$HOME/.config/mvi'`
|
|
||||||
|
|
||||||
The first option is more complex, the second results in essentially two separate programs.
|
|
||||||
|
|
||||||
The examples `mpv.conf` and `input.conf` in this repository are commented to highlight (un)desirable settings.
|
|
||||||
|
|
||||||
# Scripts
|
|
||||||
|
|
||||||
## image-positioning.lua
|
|
||||||
|
|
||||||
Adds several high-level commands to zoom and pan:
|
|
||||||
|
|
||||||
`drag-to-pan`: pan the image with the cursor, while keeping the same part of the image under the cursor
|
|
||||||
`pan-follows-cursor`: pan the image in the direction of the cursor
|
|
||||||
`cursor-centric-zoom`: (de)zoom the video while keeping the same part of the image under the cursor
|
|
||||||
`align-border`: align the border of the image with the border of the window
|
|
||||||
`pan-image`: pan the image in a direction, optionally ignoring the zoom or forcing the image to stay visible
|
|
||||||
`rotate-video`: rotate the image in 90 degrees increment
|
|
||||||
`reset-pan-if-visible`: reset the pan if the entire image is visible
|
|
||||||
|
|
||||||
There are no default bindings, see [`input.conf`](input.conf#L19-L67) for how to bind them.
|
|
||||||
|
|
||||||
## status-line.lua
|
|
||||||
|
|
||||||
Adds a status line that can show different properties in the corner of the window. By default it shows `filename [positon/total]` in the bottom left.
|
|
||||||
|
|
||||||
Can be activated with the commands `status-line-enable`, `status-line-disable`, `status-line-toggle` and configured through [`status_line.conf`](script-opts/status_line.conf).
|
|
||||||
|
|
||||||
## detect-image.lua
|
|
||||||
|
|
||||||
Allows you to run specific commands when images are being displayed. Does not do anything by default, needs to be configured through [`detect_image.conf`](script-opts/detect_image.conf).
|
|
||||||
|
|
||||||
For example, this makes it possible to setup bindings that are only in effect with images, like so:
|
|
||||||
```
|
|
||||||
command_on_first_image_loaded=enable-section image-viewer
|
|
||||||
command_on_non_image_loaded=disable-section image-viewer
|
|
||||||
```
|
|
||||||
Where the 'image-viewer' bindings are specified like so [`input.conf`](input.conf#L96-L99).
|
|
||||||
|
|
||||||
## minimap.lua
|
|
||||||
|
|
||||||
Adds a minimap that displays the position of the image relative to the view.
|
|
||||||
Can be activated with `minimap-enable`, `minimap-disable`, `minimap-toggle` and configured through [`minimap.conf`](script-opts/minimap.conf).
|
|
||||||
|
|
||||||
## ruler.lua
|
|
||||||
|
|
||||||
Adds a `ruler` command that lets you measure positions, distances and angles in the image.
|
|
||||||
Can be configured through [`ruler.conf`](script-opts/ruler.conf).
|
|
||||||
|
|
||||||
## freeze-window.lua
|
|
||||||
|
|
||||||
By default, mpv automatically resizes the window when the current file changes to fit its size. This script freezes the window so that this does not happen.
|
|
||||||
There is no configuration.
|
|
||||||
|
|
||||||
## Others
|
|
||||||
|
|
||||||
Some other mpv scripts work well with mvi, here are a few (feel free to send a PR for others):
|
|
||||||
|
|
||||||
[playlist-view](https://github.com/occivink/mpv-gallery-view): show all images in a grid view
|
|
||||||
[zones](https://github.com/wiiaboo/mpv-scripts/blob/master/zones.lua): send different commands depending on cursor position
|
|
||||||
[autoload](https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua): automatically load all files in the same directory. Set `videos=no` and `audio=no` in `script-opts/autoload.conf` to only autoload images.
|
|
||||||
[delete-file](https://github.com/zenyd/mpv-scripts#delete-file): delete the current file
|
|
||||||
[mpv_crop_script](https://github.com/TheAMM/mpv_crop_script): featureful screenshot tool
|
|
||||||
[auto-profiles](https://github.com/wiiaboo/mpv-scripts/blob/master/auto-profiles.lua): apply profiles conditionally. Can be used to lower settings with huge images
|
|
||||||
[crop](https://github.com/occivink/mpv-scripts#croplua): simple cropping script
|
|
||||||
[playlist-manager](https://github.com/jonniek/mpv-playlistmanager): playlist management script
|
|
||||||
[blacklist-extensions](https://github.com/occivink/mpv-scripts#blacklist-extensionslua): remove files from the playlist based on their types
|
|
||||||
|
|
||||||
# Credits
|
|
||||||
|
|
||||||
Thanks to haasn for coming up first with the [image-viewer config](https://gist.github.com/haasn/7919afd765e308fa91cbe19a64631d0f), all the mpv devs and the /mpv/ funposters.
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
This is free and unencumbered software released into the public domain.
|
|
||||||
|
|
||||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
||||||
distribute this software, either in source code form or as a compiled
|
|
||||||
binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
means.
|
|
||||||
|
|
||||||
In jurisdictions that recognize copyright laws, the author or authors
|
|
||||||
of this software dedicate any and all copyright interest in the
|
|
||||||
software to the public domain. We make this dedication for the benefit
|
|
||||||
of the public at large and to the detriment of our heirs and
|
|
||||||
successors. We intend this dedication to be an overt act of
|
|
||||||
relinquishment in perpetuity of all present and future rights to this
|
|
||||||
software under copyright law.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
For more information, please refer to <http://unlicense.org/>
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
1 change-list script-opts append image_positioning-drag_to_pan_margin=200
|
|
||||||
2 change-list script-opts append ruler-exit_bindings=8
|
|
||||||
3 change-list script-opts append ruler-line_color=FF
|
|
||||||
4 change-list script-opts append ruler-scale=25
|
|
||||||
5 change-list script-opts append ruler-max_size=20,20
|
|
||||||
|
|
||||||
SPACE repeatable playlist-next
|
|
||||||
alt+SPACE repeatable playlist-prev
|
|
||||||
|
|
||||||
UP ignore
|
|
||||||
DOWN ignore
|
|
||||||
LEFT repeatable playlist-prev
|
|
||||||
RIGHT repeatable playlist-next
|
|
||||||
|
|
||||||
# simple reminder of default bindings
|
|
||||||
#1 add contrast -1
|
|
||||||
#2 add contrast 1
|
|
||||||
#3 add brightness -1
|
|
||||||
#4 add brightness 1
|
|
||||||
#5 add gamma -1
|
|
||||||
#6 add gamma 1
|
|
||||||
#7 add saturation -1
|
|
||||||
#8 add saturation 1
|
|
||||||
|
|
||||||
# mouse-centric bindings
|
|
||||||
MBTN_RIGHT script-binding drag-to-pan
|
|
||||||
MBTN_LEFT script-binding pan-follows-cursor
|
|
||||||
MBTN_LEFT_DBL ignore
|
|
||||||
WHEEL_UP script-message cursor-centric-zoom 0.1
|
|
||||||
WHEEL_DOWN script-message cursor-centric-zoom -0.1
|
|
||||||
|
|
||||||
# panning with the keyboard:
|
|
||||||
# pan-image takes the following arguments
|
|
||||||
# pan-image AXIS AMOUNT ZOOM_INVARIANT IMAGE_CONSTRAINED
|
|
||||||
# ^ ^ ^
|
|
||||||
# x or y | |
|
|
||||||
# | |
|
|
||||||
# if yes, will pan by the same if yes, stops panning if the image
|
|
||||||
# amount regardless of zoom would go outside of the window
|
|
||||||
|
|
||||||
ctrl+down repeatable script-message pan-image y -0.1 yes yes
|
|
||||||
ctrl+up repeatable script-message pan-image y +0.1 yes yes
|
|
||||||
ctrl+right repeatable script-message pan-image x -0.1 yes yes
|
|
||||||
ctrl+left repeatable script-message pan-image x +0.1 yes yes
|
|
||||||
|
|
||||||
# now with more precision
|
|
||||||
alt+down repeatable script-message pan-image y -0.01 yes yes
|
|
||||||
alt+up repeatable script-message pan-image y +0.01 yes yes
|
|
||||||
alt+right repeatable script-message pan-image x -0.01 yes yes
|
|
||||||
alt+left repeatable script-message pan-image x +0.01 yes yes
|
|
||||||
|
|
||||||
# replace at will with h,j,k,l if you prefer vim-style bindings
|
|
||||||
|
|
||||||
# on a trackpad you may want to use these
|
|
||||||
#WHEEL_UP repeatable script-message pan-image y -0.02 yes yes
|
|
||||||
#WHEEL_DOWN repeatable script-message pan-image y +0.02 yes yes
|
|
||||||
#WHEEL_LEFT repeatable script-message pan-image x -0.02 yes yes
|
|
||||||
#WHEEL_RIGHT repeatable script-message pan-image x +0.02 yes yes
|
|
||||||
|
|
||||||
# align the border of the image to the border of the window
|
|
||||||
# align-border takes the following arguments:
|
|
||||||
# align-border ALIGN_X ALIGN_Y
|
|
||||||
# any value for ALIGN_* is accepted, -1 and 1 map to the border of the window
|
|
||||||
ctrl+shift+right script-message align-border -1 ""
|
|
||||||
ctrl+shift+left script-message align-border 1 ""
|
|
||||||
ctrl+shift+down script-message align-border "" -1
|
|
||||||
ctrl+shift+up script-message align-border "" 1
|
|
||||||
|
|
||||||
# reset the image
|
|
||||||
ctrl+0 no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0
|
|
||||||
|
|
||||||
+ add video-zoom 0.5
|
|
||||||
- add video-zoom -0.5; script-message reset-pan-if-visible
|
|
||||||
= no-osd set video-zoom 0; script-message reset-pan-if-visible
|
|
||||||
|
|
||||||
e script-message equalizer-toggle
|
|
||||||
alt+e script-message equalizer-reset
|
|
||||||
|
|
||||||
h no-osd vf toggle hflip; show-text "Horizontal flip"
|
|
||||||
v no-osd vf toggle vflip; show-text "Vertical flip"
|
|
||||||
|
|
||||||
r script-message rotate-video 90; show-text "Clockwise rotation"
|
|
||||||
R script-message rotate-video -90; show-text "Counter-clockwise rotation"
|
|
||||||
alt+r no-osd set video-rotate 0; show-text "Reset rotation"
|
|
||||||
|
|
||||||
d script-message ruler
|
|
||||||
|
|
||||||
# Toggling between pixel-exact reproduction and interpolation
|
|
||||||
a cycle-values scale nearest ewa_lanczossharp
|
|
||||||
|
|
||||||
# Toggle color management on or off
|
|
||||||
c cycle icc-profile-auto
|
|
||||||
|
|
||||||
# Screenshot of the window output
|
|
||||||
S screenshot window
|
|
||||||
|
|
||||||
# Toggle aspect ratio information on and off
|
|
||||||
A cycle-values video-aspect-override "-1" "no"
|
|
||||||
|
|
||||||
p script-message force-print-filename
|
|
||||||
|
|
||||||
# ADVANCED: you can define bindings that belong to a "section" (named "image-viewer" here) like so:
|
|
||||||
#alt+SPACE {image-viewer} repeatable playlist-prev
|
|
||||||
#SPACE {image-viewer} repeatable playlist-next
|
|
||||||
# to load them conditionally with a command. See scripts-opts/image_viewer.conf for how you can do this
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
## IMAGE
|
|
||||||
# classic opengl-hq parameter, change at will
|
|
||||||
scale=spline36
|
|
||||||
cscale=spline36
|
|
||||||
dscale=mitchell
|
|
||||||
dither-depth=auto
|
|
||||||
correct-downscaling
|
|
||||||
sigmoid-upscaling
|
|
||||||
# debanding seems rarely useful with images
|
|
||||||
#deband
|
|
||||||
# dark grey background instead of pure black
|
|
||||||
background=color
|
|
||||||
background-color=0.2
|
|
||||||
|
|
||||||
## MISC
|
|
||||||
mute=yes
|
|
||||||
# the osc is mostly useful for videos
|
|
||||||
osc=no
|
|
||||||
# don't try to autoload subtitles or audio files
|
|
||||||
sub-auto=no
|
|
||||||
audio-file-auto=no
|
|
||||||
# get rid of the useless V: 00:00:00 / 00:00:00 line
|
|
||||||
term-status-msg=
|
|
||||||
|
|
||||||
# replace mpv with mvi in the window title
|
|
||||||
title="${?media-title:${media-title}}${!media-title:No file} - mvi"
|
|
||||||
|
|
||||||
# don't slideshow by default
|
|
||||||
image-display-duration=inf
|
|
||||||
# loop files in case of webms or gifs
|
|
||||||
loop-file=inf
|
|
||||||
# and loop the whole playlist
|
|
||||||
loop-playlist=inf
|
|
||||||
|
|
||||||
# you need this if you plan to use drag-to-pan or pan-follows-cursor with MOUSE_LEFT
|
|
||||||
window-dragging=no
|
|
||||||
|
|
||||||
#according to haasn, aspect ratio info for PNG and JPG is "universally bust"
|
|
||||||
[extension.png]
|
|
||||||
video-aspect-override=no
|
|
||||||
|
|
||||||
[extension.jpg]
|
|
||||||
video-aspect-override=no
|
|
||||||
|
|
||||||
[extension.jpeg]
|
|
||||||
profile=extension.jpg
|
|
||||||
|
|
||||||
[silent]
|
|
||||||
msg-level=all=no
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
# commands to execute when a file detected as an image (1 frame, no audio) is loaded or unloaded
|
|
||||||
|
|
||||||
# an image was loaded, and the previous file was not an image (or there was no previous file)
|
|
||||||
command_on_first_image_loaded=
|
|
||||||
# an image was loaded (regardless of what the previous file was)
|
|
||||||
command_on_image_loaded=
|
|
||||||
# a non-image was loaded, and the previous file was an image
|
|
||||||
command_on_non_image_loaded=
|
|
||||||
|
|
||||||
# the purpose of these "hooks" is to let you change bindings, profiles, reset properties...
|
|
||||||
# see https://mpv.io/manual/master/#list-of-input-commands for general command information
|
|
||||||
# note that there is no such thing as "unloading a profile", to emulate this you must create an opposite profile and load that
|
|
||||||
|
|
||||||
# example possible values:
|
|
||||||
#command_on_first_image_loaded=apply-profile image; enable-section image-viewer; script-message status-line-enable
|
|
||||||
#command_on_image_loaded=no-osd set video-pan-x 0; script-message align-border "" -1
|
|
||||||
#command_on_non_image_loaded=disable-section image-viewer; no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0; script-message status-line-disable
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
# size of the margins with drag-to-pan
|
|
||||||
drag_to_pan_margin=50
|
|
||||||
drag_to_pan_move_if_full_view=no
|
|
||||||
|
|
||||||
# size of the margins with pan-follows-cursor
|
|
||||||
pan_follows_cursor_margin=50
|
|
||||||
|
|
||||||
# size of the margins with cursor-centric-zoom
|
|
||||||
cursor_centric_zoom_margin=50
|
|
||||||
# if the borders would show up, move the image
|
|
||||||
# this makes it not exactly cursor-centric in some cases
|
|
||||||
cursor_centric_zoom_auto_center=yes
|
|
||||||
# allow zooming out if the image can already fully fit in the window
|
|
||||||
cursor_centric_zoom_dezoom_if_full_view=no
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
# whether to show by default
|
|
||||||
enabled=yes
|
|
||||||
# the position of the center of the minimap, in percentage of the window (x, y)
|
|
||||||
center=92,92
|
|
||||||
# the scale of the minimap (i.e. the view rectangle is scale / 100 times the size of the window)
|
|
||||||
scale=12
|
|
||||||
# the cutoff size of the minimap (i.e. the image rectangle is clipped if it falls outside of the this zone)
|
|
||||||
max_size=16,16
|
|
||||||
# opacity of the "image" (from 00=opaque to FF=transparent)
|
|
||||||
image_opacity=88
|
|
||||||
# color of the "image" (#BBGGRR where each component rages from 00 to FF)
|
|
||||||
image_color=BBBBBB
|
|
||||||
# opacity of the "view"
|
|
||||||
view_opacity=BB
|
|
||||||
view_color=222222
|
|
||||||
# whether the view should be drawn above the image
|
|
||||||
view_above_image=yes
|
|
||||||
# whether to show the minimap if the current image is fully visible
|
|
||||||
hide_when_full_image_in_view=yes
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
# whether to show the length of the lines between the two points
|
|
||||||
show_distance=yes
|
|
||||||
# whether to show the coordinates of the two points
|
|
||||||
show_coordinates=yes
|
|
||||||
# the coordinate space of the text shown. Can be "image", "window", "both"
|
|
||||||
coordinates_space=image
|
|
||||||
# can be "degrees", "radians", "both", or "no"
|
|
||||||
show_angles=degrees
|
|
||||||
line_width=2
|
|
||||||
dots_radius=3
|
|
||||||
font_size=36
|
|
||||||
# ranges from 00 (black) to FF (white)
|
|
||||||
line_color=33
|
|
||||||
# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list
|
|
||||||
confirm_bindings=MBTN_LEFT,ENTER
|
|
||||||
# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list
|
|
||||||
exit_bindings=ESC
|
|
||||||
# if yes, the first point will be immediately set at the cursor position when calling 'ruler'
|
|
||||||
set_first_point_on_begin=no
|
|
||||||
# if yes, the ruler overlay will be immediately cleared when setting the second point
|
|
||||||
clear_on_second_point_set=no
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
# whether to show by default
|
|
||||||
enabled=yes
|
|
||||||
# its font size
|
|
||||||
size=36
|
|
||||||
# distance of the text to the borders
|
|
||||||
margin=10
|
|
||||||
# the text to be expanded
|
|
||||||
# see property expansion: https://mpv.io/manual/master/#property-expansion
|
|
||||||
# \N can be used for line breaks
|
|
||||||
# you can also use ass tags, see here: http://docs.aegisub.org/3.2/ASS_Tags/
|
|
||||||
text_top_left=
|
|
||||||
text_top_right=
|
|
||||||
text_bottom_left=${filename} [${playlist-pos-1}/${playlist-count}]
|
|
||||||
text_bottom_right=[${dwidth:X}x${dheight:X}]
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
local opts = {
|
|
||||||
command_on_first_image_loaded="",
|
|
||||||
command_on_image_loaded="",
|
|
||||||
command_on_non_image_loaded="",
|
|
||||||
}
|
|
||||||
local options = require 'mp.options'
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function() end)
|
|
||||||
|
|
||||||
function run_maybe(str)
|
|
||||||
if str ~= "" then
|
|
||||||
mp.command(str)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local was_image = false
|
|
||||||
|
|
||||||
function set_image(is_image)
|
|
||||||
if is_image and not was_image then
|
|
||||||
msg.info("First image detected")
|
|
||||||
run_maybe(opts.command_on_first_image_loaded)
|
|
||||||
end
|
|
||||||
if is_image then
|
|
||||||
msg.info("Image detected")
|
|
||||||
run_maybe(opts.command_on_image_loaded)
|
|
||||||
end
|
|
||||||
if not is_image and was_image then
|
|
||||||
msg.info("Non-image detected")
|
|
||||||
run_maybe(opts.command_on_non_image_loaded)
|
|
||||||
end
|
|
||||||
was_image = is_image
|
|
||||||
end
|
|
||||||
|
|
||||||
local properties = {}
|
|
||||||
|
|
||||||
function properties_changed()
|
|
||||||
local dwidth = properties["dwidth"]
|
|
||||||
local tracks = properties["track-list"]
|
|
||||||
local path = properties["path"]
|
|
||||||
local framecount = properties["estimated-frame-count"]
|
|
||||||
|
|
||||||
if not path or path == "" then return end
|
|
||||||
if not tracks or #tracks == 0 then return end
|
|
||||||
local audio_tracks = 0
|
|
||||||
for _, track in ipairs(tracks) do
|
|
||||||
if track.type == "audio" then
|
|
||||||
audio_tracks = audio_tracks + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- only do things when state is consistent
|
|
||||||
if not framecount and audio_tracks > 0 then
|
|
||||||
set_image(false)
|
|
||||||
elseif framecount and dwidth and dwidth > 0 then
|
|
||||||
-- png have 0 frames, jpg 1 ¯\_(ツ)_/¯
|
|
||||||
set_image((framecount == 0 or framecount == 1) and audio_tracks == 0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function observe(propname)
|
|
||||||
mp.observe_property(propname, "native", function(_, val)
|
|
||||||
if val ~= properties[propname] then
|
|
||||||
properties[propname] = val
|
|
||||||
msg.verbose("Property " .. propname .. " changed")
|
|
||||||
properties_changed()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
observe("estimated-frame-count")
|
|
||||||
observe("track-list")
|
|
||||||
observe("dwidth")
|
|
||||||
observe("path")
|
|
||||||
|
|
@ -1,176 +0,0 @@
|
||||||
local opts = {
|
|
||||||
bars = 'brightness,contrast,gamma,saturation,hue',
|
|
||||||
draw_icons = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
local assdraw = require 'mp.assdraw'
|
|
||||||
local options = require 'mp.options'
|
|
||||||
local utils = require 'mp.utils'
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function(c)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local enabled = false
|
|
||||||
local active_bars = {}
|
|
||||||
local bar_being_dragged = nil
|
|
||||||
local stale = false
|
|
||||||
|
|
||||||
function split_comma(input)
|
|
||||||
local ret = {}
|
|
||||||
for str in string.gmatch(input, "([^,]+)") do
|
|
||||||
ret[#ret + 1] = str
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
function get_position_normalized(x, y, bar)
|
|
||||||
return (x - bar.x) / bar.w, (y - bar.y) / bar.h
|
|
||||||
end
|
|
||||||
|
|
||||||
function handle_mouse_move()
|
|
||||||
if not bar_being_dragged then return end
|
|
||||||
local bar = bar_being_dragged
|
|
||||||
local mx, my = mp.get_mouse_pos()
|
|
||||||
local nx, _ = get_position_normalized(mx, my, bar)
|
|
||||||
nx = math.max(0, math.min(nx, 1))
|
|
||||||
local val = math.floor(nx * (bar.max_value - bar.min_value) + bar.min_value + 0.5)
|
|
||||||
mp.set_property_number(bar.property, val)
|
|
||||||
-- the observe_property call will take care of setting the value
|
|
||||||
end
|
|
||||||
|
|
||||||
function handle_mouse_left(table)
|
|
||||||
if table["event"] == "down" then
|
|
||||||
local mx, my = mp.get_mouse_pos()
|
|
||||||
for _, bar in ipairs(active_bars) do
|
|
||||||
local nx, ny = get_position_normalized(mx, my, bar)
|
|
||||||
if nx >= 0 and ny >= 0 and nx <= 1 and ny <= 1 then
|
|
||||||
bar_being_dragged = bar
|
|
||||||
local val = math.floor(nx * (bar.max_value - bar.min_value) + bar.min_value + 0.5)
|
|
||||||
mp.set_property_number(bar.property, val)
|
|
||||||
mp.add_forced_key_binding("mouse_move", "mouse_move", handle_mouse_move)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elseif table["event"] == "up" then
|
|
||||||
mp.remove_key_binding("mouse_move")
|
|
||||||
bar_being_dragged = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function property_changed(prop, val)
|
|
||||||
for _, bar in ipairs(active_bars) do
|
|
||||||
if bar.property == prop then
|
|
||||||
bar.value = val
|
|
||||||
stale = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function idle_handler()
|
|
||||||
if not stale then return end
|
|
||||||
stale = false
|
|
||||||
local a = assdraw.ass_new()
|
|
||||||
a:new_event()
|
|
||||||
a:append(string.format('{\\an0\\bord2\\shad0\\1a&00&\\1c&%s&}', '888888'))
|
|
||||||
a:pos(0, 0)
|
|
||||||
a:draw_start()
|
|
||||||
for _, bar in ipairs(active_bars) do
|
|
||||||
a:rect_cw(bar.x, bar.y, bar.x + bar.w, bar.y + bar.h)
|
|
||||||
end
|
|
||||||
a:new_event()
|
|
||||||
a:append(string.format('{\\an0\\bord2\\shad0\\1a&00&\\1c&%s&}', 'dddddd'))
|
|
||||||
a:pos(0, 0)
|
|
||||||
a:draw_start()
|
|
||||||
for _, bar in ipairs(active_bars) do
|
|
||||||
if bar.value > bar.min_value then
|
|
||||||
local val_norm = (bar.value - bar.min_value) / (bar.max_value - bar.min_value)
|
|
||||||
a:rect_cw(bar.x, bar.y, bar.x + val_norm * bar.w, bar.y + bar.h)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for _, bar in ipairs(active_bars) do
|
|
||||||
a:new_event()
|
|
||||||
a:append("{\\an6\\fs40\\bord2}")
|
|
||||||
a:pos(bar.x - 8, bar.y + bar.h/2 - 2)
|
|
||||||
a:append(bar.property:sub(1,1):upper() .. bar.property:sub(2,-1))
|
|
||||||
end
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
mp.set_osd_ass(ww, wh, a.text)
|
|
||||||
end
|
|
||||||
|
|
||||||
function fix_position()
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
for i, bar in ipairs(active_bars) do
|
|
||||||
bar.x = ww / 5
|
|
||||||
bar.y = wh / 2 + i * 50
|
|
||||||
bar.w = ww - 2 * (ww / 5)
|
|
||||||
bar.h = 30
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function dimensions_changed()
|
|
||||||
stale = true
|
|
||||||
fix_position()
|
|
||||||
end
|
|
||||||
|
|
||||||
function enable()
|
|
||||||
if enabled then return end
|
|
||||||
enabled = true
|
|
||||||
mp.add_forced_key_binding("MBTN_LEFT", "mouse_left", handle_mouse_left, {complex=true})
|
|
||||||
for i, prop in ipairs(split_comma(opts.bars)) do
|
|
||||||
local prop_info = mp.get_property_native("option-info/" .. prop)
|
|
||||||
if not prop_info then
|
|
||||||
msg.warn("Property \'" .. prop .. "\' does not exist")
|
|
||||||
elseif not prop_info.type == 'Integer' then
|
|
||||||
msg.warn("Property \'" .. prop .. "\' is not an integer")
|
|
||||||
else
|
|
||||||
mp.observe_property(prop, 'native', property_changed)
|
|
||||||
active_bars[#active_bars + 1] = {
|
|
||||||
property = prop,
|
|
||||||
value = mp.get_property_number(prop),
|
|
||||||
min_value = prop_info.min,
|
|
||||||
max_value = prop_info.max,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
stale = true
|
|
||||||
fix_position()
|
|
||||||
mp.observe_property("osd-dimensions", "native", dimensions_changed)
|
|
||||||
mp.register_idle(idle_handler)
|
|
||||||
end
|
|
||||||
|
|
||||||
function disable()
|
|
||||||
if not enabled then return end
|
|
||||||
enabled = false
|
|
||||||
active_bars = {}
|
|
||||||
bar_being_dragged = nil
|
|
||||||
mp.remove_key_binding("mouse_left")
|
|
||||||
mp.remove_key_binding("mouse_move")
|
|
||||||
mp.unobserve_property(property_changed)
|
|
||||||
mp.unobserve_property(dimensions_changed)
|
|
||||||
mp.unregister_idle(idle_handler)
|
|
||||||
mp.set_osd_ass(1280, 720, "")
|
|
||||||
end
|
|
||||||
|
|
||||||
function toggle()
|
|
||||||
if enabled then
|
|
||||||
disable()
|
|
||||||
else
|
|
||||||
enable()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function reset()
|
|
||||||
for _, prop in ipairs(split_comma(opts.bars)) do
|
|
||||||
local prop_info = mp.get_property_native("option-info/" .. prop)
|
|
||||||
if prop_info and prop_info["default-value"] then
|
|
||||||
mp.set_property(prop_info["name"], prop_info["default-value"])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding(nil, "equalizer-enable", enable)
|
|
||||||
mp.add_key_binding(nil, "equalizer-disable", disable)
|
|
||||||
mp.add_key_binding(nil, "equalizer-toggle", toggle)
|
|
||||||
mp.add_key_binding(nil, "equalizer-reset", reset)
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
-- credit to TheAMM
|
|
||||||
|
|
||||||
local size_changed = false
|
|
||||||
|
|
||||||
mp.register_idle(function()
|
|
||||||
if not size_changed then return end
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
if not ww or ww <= 0 or not wh or wh <= 0 then return end
|
|
||||||
mp.set_property("geometry", string.format("%dx%d", ww, wh))
|
|
||||||
size_changed = false
|
|
||||||
end)
|
|
||||||
|
|
||||||
mp.observe_property("osd-width", "native", function() size_changed = true end)
|
|
||||||
mp.observe_property("osd-height", "native", function() size_changed = true end)
|
|
||||||
|
|
@ -1,277 +0,0 @@
|
||||||
local opts = {
|
|
||||||
drag_to_pan_margin = 50,
|
|
||||||
drag_to_pan_move_if_full_view=false,
|
|
||||||
|
|
||||||
pan_follows_cursor_margin = 50,
|
|
||||||
|
|
||||||
cursor_centric_zoom_margin = 50,
|
|
||||||
cursor_centric_zoom_auto_center = true,
|
|
||||||
cursor_centric_zoom_dezoom_if_full_view = false,
|
|
||||||
}
|
|
||||||
local options = require 'mp.options'
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
local assdraw = require 'mp.assdraw'
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function() end)
|
|
||||||
|
|
||||||
function clamp(value, low, high)
|
|
||||||
if value <= low then
|
|
||||||
return low
|
|
||||||
elseif value >= high then
|
|
||||||
return high
|
|
||||||
else
|
|
||||||
return value
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local cleanup = nil -- function set up by drag-to-pan/pan-follows cursor and must be called to clean lingering state
|
|
||||||
|
|
||||||
function drag_to_pan_handler(table)
|
|
||||||
if cleanup then
|
|
||||||
cleanup()
|
|
||||||
cleanup = nil
|
|
||||||
end
|
|
||||||
if table["event"] == "down" then
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
local mouse_pos_origin, video_pan_origin = {}, {}
|
|
||||||
local moved = false
|
|
||||||
mouse_pos_origin[1], mouse_pos_origin[2] = mp.get_mouse_pos()
|
|
||||||
video_pan_origin[1] = mp.get_property_number("video-pan-x")
|
|
||||||
video_pan_origin[2] = mp.get_property_number("video-pan-y")
|
|
||||||
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
|
|
||||||
local margin = opts.drag_to_pan_margin
|
|
||||||
local move_up = true
|
|
||||||
local move_lateral = true
|
|
||||||
if not opts.drag_to_pan_move_if_full_view then
|
|
||||||
if dim.ml >= 0 and dim.mr >= 0 then
|
|
||||||
move_lateral = false
|
|
||||||
end
|
|
||||||
if dim.mt >= 0 and dim.mb >= 0 then
|
|
||||||
move_up = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not move_up and not move_lateral then return end
|
|
||||||
local idle = function()
|
|
||||||
if moved then
|
|
||||||
local mX, mY = mp.get_mouse_pos()
|
|
||||||
local pX = video_pan_origin[1]
|
|
||||||
local pY = video_pan_origin[2]
|
|
||||||
if move_lateral then
|
|
||||||
pX = video_pan_origin[1] + (mX - mouse_pos_origin[1]) / video_size[1]
|
|
||||||
if 2 * margin > dim.ml + dim.mr then
|
|
||||||
pX = clamp(pX,
|
|
||||||
(-margin + dim.w / 2) / video_size[1] - 0.5,
|
|
||||||
(margin - dim.w / 2) / video_size[1] + 0.5)
|
|
||||||
else
|
|
||||||
pX = clamp(pX,
|
|
||||||
(margin - dim.w / 2) / video_size[1] + 0.5,
|
|
||||||
(-margin + dim.w / 2) / video_size[1] - 0.5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if move_up then
|
|
||||||
pY = video_pan_origin[2] + (mY - mouse_pos_origin[2]) / video_size[2]
|
|
||||||
if 2 * margin > dim.mt + dim.mb then
|
|
||||||
pY = clamp(pY,
|
|
||||||
(-margin + dim.h / 2) / video_size[2] - 0.5,
|
|
||||||
(margin - dim.h / 2) / video_size[2] + 0.5)
|
|
||||||
else
|
|
||||||
pY = clamp(pY,
|
|
||||||
(margin - dim.h / 2) / video_size[2] + 0.5,
|
|
||||||
(-margin + dim.h / 2) / video_size[2] - 0.5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mp.command("no-osd set video-pan-x " .. clamp(pX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(pY, -3, 3))
|
|
||||||
moved = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mp.register_idle(idle)
|
|
||||||
mp.add_forced_key_binding("mouse_move", "image-viewer-mouse-move", function() moved = true end)
|
|
||||||
cleanup = function()
|
|
||||||
mp.remove_key_binding("image-viewer-mouse-move")
|
|
||||||
mp.unregister_idle(idle)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function pan_follows_cursor_handler(table)
|
|
||||||
if cleanup then
|
|
||||||
cleanup()
|
|
||||||
cleanup = nil
|
|
||||||
end
|
|
||||||
if table["event"] == "down" then
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
|
|
||||||
local moved = true
|
|
||||||
local idle = function()
|
|
||||||
if moved then
|
|
||||||
local mX, mY = mp.get_mouse_pos()
|
|
||||||
local x = math.min(1, math.max(- 2 * mX / dim.w + 1, -1))
|
|
||||||
local y = math.min(1, math.max(- 2 * mY / dim.h + 1, -1))
|
|
||||||
local command = ""
|
|
||||||
local margin = opts.pan_follows_cursor_margin
|
|
||||||
if dim.ml + dim.mr < 0 then
|
|
||||||
command = command .. "no-osd set video-pan-x " .. clamp(x * (2 * margin - dim.ml - dim.mr) / (2 * video_size[1]), -3, 3) .. ";"
|
|
||||||
elseif mp.get_property_number("video-pan-x") ~= 0 then
|
|
||||||
command = command .. "no-osd set video-pan-x " .. "0;"
|
|
||||||
end
|
|
||||||
if dim.mt + dim.mb < 0 then
|
|
||||||
command = command .. "no-osd set video-pan-y " .. clamp(y * (2 * margin - dim.mt - dim.mb) / (2 * video_size[2]), -3, 3) .. ";"
|
|
||||||
elseif mp.get_property_number("video-pan-y") ~= 0 then
|
|
||||||
command = command .. "no-osd set video-pan-y " .. "0;"
|
|
||||||
end
|
|
||||||
if command ~= "" then
|
|
||||||
mp.command(command)
|
|
||||||
end
|
|
||||||
moved = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mp.register_idle(idle)
|
|
||||||
mp.add_forced_key_binding("mouse_move", "image-viewer-mouse-move", function() moved = true end)
|
|
||||||
cleanup = function()
|
|
||||||
mp.remove_key_binding("image-viewer-mouse-move")
|
|
||||||
mp.unregister_idle(idle)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function cursor_centric_zoom_handler(amt)
|
|
||||||
local zoom_inc = tonumber(amt)
|
|
||||||
if not zoom_inc or zoom_inc == 0 then return end
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
|
|
||||||
local margin = opts.cursor_centric_zoom_margin
|
|
||||||
|
|
||||||
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
|
|
||||||
|
|
||||||
-- the size in pixels of the (in|de)crement
|
|
||||||
local diff_width = (2 ^ zoom_inc - 1) * video_size[1]
|
|
||||||
local diff_height = (2 ^ zoom_inc - 1) * video_size[2]
|
|
||||||
if not opts.cursor_centric_zoom_dezoom_if_full_view and
|
|
||||||
zoom_inc < 0 and
|
|
||||||
video_size[1] + diff_width + 2 * margin <= dim.w and
|
|
||||||
video_size[2] + diff_height + 2 * margin <= dim.h
|
|
||||||
then
|
|
||||||
-- the zoom decrement is too much, reduce it such that the full image is visible, no more, no less
|
|
||||||
-- in addition, this should take care of trying too zoom out while everything is already visible
|
|
||||||
local new_zoom_inc_x = math.log((dim.w - 2 * margin) / video_size[1]) / math.log(2)
|
|
||||||
local new_zoom_inc_y = math.log((dim.h - 2 * margin) / video_size[2]) / math.log(2)
|
|
||||||
local new_zoom_inc = math.min(0, math.min(new_zoom_inc_x, new_zoom_inc_y))
|
|
||||||
zoom_inc = new_zoom_inc
|
|
||||||
diff_width = (2 ^ zoom_inc - 1) * video_size[1]
|
|
||||||
diff_height = (2 ^ zoom_inc - 1) * video_size[2]
|
|
||||||
end
|
|
||||||
local new_width = video_size[1] + diff_width
|
|
||||||
local new_height = video_size[2] + diff_height
|
|
||||||
|
|
||||||
local mouse_pos_origin = {}
|
|
||||||
mouse_pos_origin[1], mouse_pos_origin[2] = mp.get_mouse_pos()
|
|
||||||
local new_pan_x, new_pan_y
|
|
||||||
|
|
||||||
-- some additional constraints:
|
|
||||||
-- if image can be fully visible (in either direction), set pan to 0
|
|
||||||
-- if border would show on either side, then prefer adjusting the pan even if not cursor-centric
|
|
||||||
local auto_c = opts.cursor_centric_zoom_auto_center
|
|
||||||
if auto_c and new_width <= dim.w then
|
|
||||||
new_pan_x = 0
|
|
||||||
else
|
|
||||||
local pan_x = mp.get_property("video-pan-x")
|
|
||||||
local rx = (dim.ml + video_size[1] / 2 - mouse_pos_origin[1]) / (video_size[1] / 2)
|
|
||||||
new_pan_x = (pan_x * video_size[1] + rx * diff_width / 2) / new_width
|
|
||||||
if auto_c then
|
|
||||||
new_pan_x = clamp(new_pan_x, (dim.w - 2 * margin) / (2 * new_width) - 0.5, - (dim.w - 2 * margin) / (2 * new_width) + 0.5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if auto_c and new_height <= dim.h then
|
|
||||||
new_pan_y = 0
|
|
||||||
else
|
|
||||||
local pan_y = mp.get_property("video-pan-y")
|
|
||||||
local ry = (dim.mt + video_size[2] / 2 - mouse_pos_origin[2]) / (video_size[2] / 2)
|
|
||||||
new_pan_y = (pan_y * video_size[2] + ry * diff_height / 2) / new_height
|
|
||||||
if auto_c then
|
|
||||||
new_pan_y = clamp(new_pan_y, (dim.h - 2 * margin) / (2 * new_height) - 0.5, - (dim.h - 2 * margin) / (2 * new_height) + 0.5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local zoom_origin = mp.get_property("video-zoom")
|
|
||||||
mp.command("no-osd set video-zoom " .. zoom_origin + zoom_inc .. "; no-osd set video-pan-x " .. clamp(new_pan_x, -3, 3) .. "; no-osd set video-pan-y " .. clamp(new_pan_y, -3, 3))
|
|
||||||
end
|
|
||||||
|
|
||||||
function align_border(x, y)
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
|
|
||||||
local x, y = tonumber(x), tonumber(y)
|
|
||||||
local command = ""
|
|
||||||
if x then
|
|
||||||
command = command .. "no-osd set video-pan-x " .. clamp(- x * (dim.ml + dim.mr) / (2 * video_size[1]), -3, 3) .. ";"
|
|
||||||
end
|
|
||||||
if y then
|
|
||||||
command = command .. "no-osd set video-pan-y " .. clamp(- y * (dim.mt + dim.mb) / (2 * video_size[2]), -3, 3) .. ";"
|
|
||||||
end
|
|
||||||
if command ~= "" then
|
|
||||||
mp.command(command)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function pan_image(axis, amount, zoom_invariant, image_constrained)
|
|
||||||
amount = tonumber(amount)
|
|
||||||
if not amount or amount == 0 or axis ~= "x" and axis ~= "y" then return end
|
|
||||||
if zoom_invariant == "yes" then
|
|
||||||
amount = amount / 2 ^ mp.get_property_number("video-zoom")
|
|
||||||
end
|
|
||||||
local prop = "video-pan-" .. axis
|
|
||||||
local old_pan = mp.get_property_number(prop)
|
|
||||||
if image_constrained == "yes" then
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
local margin =
|
|
||||||
(axis == "x" and amount > 0) and dim.ml
|
|
||||||
or (axis == "x" and amount < 0) and dim.mr
|
|
||||||
or (amount > 0) and dim.mt
|
|
||||||
or (amount < 0) and dim.mb
|
|
||||||
local vid_size = (axis == "x") and (dim.w - dim.ml - dim.mr) or (dim.h - dim.mt - dim.mb)
|
|
||||||
local pixels_moved = math.abs(amount) * vid_size
|
|
||||||
-- the margin is already visible, no point going further
|
|
||||||
if margin >= 0 then
|
|
||||||
return
|
|
||||||
elseif margin + pixels_moved > 0 then
|
|
||||||
amount = -(math.abs(amount) / amount) * margin / vid_size
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mp.set_property_number(prop, old_pan + amount)
|
|
||||||
end
|
|
||||||
|
|
||||||
function rotate_video(amt)
|
|
||||||
local rot = mp.get_property_number("video-rotate")
|
|
||||||
rot = (rot + amt) % 360
|
|
||||||
mp.set_property_number("video-rotate", rot)
|
|
||||||
end
|
|
||||||
|
|
||||||
function reset_pan_if_visible()
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
local command = ""
|
|
||||||
if (dim.ml + dim.mr >= 0) then
|
|
||||||
command = command .. "no-osd set video-pan-x 0" .. ";"
|
|
||||||
end
|
|
||||||
if (dim.mt + dim.mb >= 0) then
|
|
||||||
command = command .. "no-osd set video-pan-y 0" .. ";"
|
|
||||||
end
|
|
||||||
if command ~= "" then
|
|
||||||
mp.command(command)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding(nil, "drag-to-pan", drag_to_pan_handler, {complex = true})
|
|
||||||
mp.add_key_binding(nil, "pan-follows-cursor", pan_follows_cursor_handler, {complex = true})
|
|
||||||
mp.add_key_binding(nil, "cursor-centric-zoom", cursor_centric_zoom_handler)
|
|
||||||
mp.add_key_binding(nil, "align-border", align_border)
|
|
||||||
mp.add_key_binding(nil, "pan-image", pan_image)
|
|
||||||
mp.add_key_binding(nil, "rotate-video", rotate_video)
|
|
||||||
mp.add_key_binding(nil, "reset-pan-if-visible", reset_pan_if_visible)
|
|
||||||
mp.add_key_binding(nil, "force-print-filename", force_print_filename)
|
|
||||||
|
|
@ -1,201 +0,0 @@
|
||||||
local opts = {
|
|
||||||
enabled = true,
|
|
||||||
center = "92,92",
|
|
||||||
scale = 12,
|
|
||||||
max_size = "16,16",
|
|
||||||
image_opacity = "88",
|
|
||||||
image_color = "BBBBBB",
|
|
||||||
view_opacity = "BB",
|
|
||||||
view_color = "222222",
|
|
||||||
view_above_image = true,
|
|
||||||
hide_when_full_image_in_view = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
local assdraw = require 'mp.assdraw'
|
|
||||||
local options = require 'mp.options'
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function(c)
|
|
||||||
if c["enabled"] then
|
|
||||||
if opts.enabled then
|
|
||||||
enable()
|
|
||||||
else
|
|
||||||
disable()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mark_stale()
|
|
||||||
end)
|
|
||||||
|
|
||||||
function split_comma(input)
|
|
||||||
local ret = {}
|
|
||||||
for str in string.gmatch(input, "([^,]+)") do
|
|
||||||
ret[#ret + 1] = tonumber(str)
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
local active = false
|
|
||||||
local refresh = true
|
|
||||||
|
|
||||||
function draw_ass(ass)
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
mp.set_osd_ass(ww, wh, ass)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mark_stale()
|
|
||||||
refresh = true
|
|
||||||
end
|
|
||||||
|
|
||||||
function refresh_minimap()
|
|
||||||
if not refresh then return end
|
|
||||||
refresh = false
|
|
||||||
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then
|
|
||||||
draw_ass("")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local ww, wh = dim.w, dim.h
|
|
||||||
|
|
||||||
if not (ww > 0 and wh > 0) then return end
|
|
||||||
if opts.hide_when_full_image_in_view then
|
|
||||||
if dim.mt >= 0 and dim.mb >= 0 and dim.ml >= 0 and dim.mr >= 0 then
|
|
||||||
draw_ass("")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local center = split_comma(opts.center)
|
|
||||||
center[1] = center[1] * 0.01 * ww
|
|
||||||
center[2] = center[2] * 0.01 * wh
|
|
||||||
local cutoff = split_comma(opts.max_size)
|
|
||||||
cutoff[1] = cutoff[1] * 0.01 * ww * 0.5
|
|
||||||
cutoff[2] = cutoff[2] * 0.01 * wh * 0.5
|
|
||||||
|
|
||||||
local a = assdraw.ass_new()
|
|
||||||
local draw = function(x, y, w, h, opacity, color)
|
|
||||||
a:new_event()
|
|
||||||
a:pos(center[1], center[2])
|
|
||||||
a:append("{\\bord0}")
|
|
||||||
a:append("{\\shad0}")
|
|
||||||
a:append("{\\c&" .. color .. "&}")
|
|
||||||
a:append("{\\2a&HFF}")
|
|
||||||
a:append("{\\3a&HFF}")
|
|
||||||
a:append("{\\4a&HFF}")
|
|
||||||
a:append("{\\1a&H" .. opacity .. "}")
|
|
||||||
w = w * 0.5
|
|
||||||
h = h * 0.5
|
|
||||||
a:draw_start()
|
|
||||||
local rounded = {true,true,true,true} -- tl, tr, br, bl
|
|
||||||
local x0,y0,x1,y1 = x-w, y-h, x+w, y+h
|
|
||||||
if x0 < -cutoff[1] then
|
|
||||||
x0 = -cutoff[1]
|
|
||||||
rounded[4] = false
|
|
||||||
rounded[1] = false
|
|
||||||
end
|
|
||||||
if y0 < -cutoff[2] then
|
|
||||||
y0 = -cutoff[2]
|
|
||||||
rounded[1] = false
|
|
||||||
rounded[2] = false
|
|
||||||
end
|
|
||||||
if x1 > cutoff[1] then
|
|
||||||
x1 = cutoff[1]
|
|
||||||
rounded[2] = false
|
|
||||||
rounded[3] = false
|
|
||||||
end
|
|
||||||
if y1 > cutoff[2] then
|
|
||||||
y1 = cutoff[2]
|
|
||||||
rounded[3] = false
|
|
||||||
rounded[4] = false
|
|
||||||
end
|
|
||||||
|
|
||||||
local r = 3
|
|
||||||
local c = 0.551915024494 * r
|
|
||||||
if rounded[0] then
|
|
||||||
a:move_to(x0 + r, y0)
|
|
||||||
else
|
|
||||||
a:move_to(x0,y0)
|
|
||||||
end
|
|
||||||
if rounded[1] then
|
|
||||||
a:line_to(x1 - r, y0)
|
|
||||||
a:bezier_curve(x1 - r + c, y0, x1, y0 + r - c, x1, y0 + r)
|
|
||||||
else
|
|
||||||
a:line_to(x1, y0)
|
|
||||||
end
|
|
||||||
if rounded[2] then
|
|
||||||
a:line_to(x1, y1 - r)
|
|
||||||
a:bezier_curve(x1, y1 - r + c, x1 - r + c, y1, x1 - r, y1)
|
|
||||||
else
|
|
||||||
a:line_to(x1, y1)
|
|
||||||
end
|
|
||||||
if rounded[3] then
|
|
||||||
a:line_to(x0 + r, y1)
|
|
||||||
a:bezier_curve(x0 + r - c, y1, x0, y1 - r + c, x0, y1 - r)
|
|
||||||
else
|
|
||||||
a:line_to(x0, y1)
|
|
||||||
end
|
|
||||||
if rounded[4] then
|
|
||||||
a:line_to(x0, y0 + r)
|
|
||||||
a:bezier_curve(x0, y0 + r - c, x0 + r - c, y0, x0 + r, y0)
|
|
||||||
else
|
|
||||||
a:line_to(x0, y0)
|
|
||||||
end
|
|
||||||
a:draw_stop()
|
|
||||||
end
|
|
||||||
local image = function()
|
|
||||||
draw((dim.ml/2 - dim.mr/2) / opts.scale,
|
|
||||||
(dim.mt/2 - dim.mb/2) / opts.scale,
|
|
||||||
(ww - dim.ml - dim.mr) / opts.scale,
|
|
||||||
(wh - dim.mt - dim.mb) / opts.scale,
|
|
||||||
opts.image_opacity,
|
|
||||||
opts.image_color)
|
|
||||||
end
|
|
||||||
local view = function()
|
|
||||||
draw(0,
|
|
||||||
0,
|
|
||||||
ww / opts.scale,
|
|
||||||
wh / opts.scale,
|
|
||||||
opts.view_opacity,
|
|
||||||
opts.view_color)
|
|
||||||
end
|
|
||||||
if opts.view_above_image then
|
|
||||||
image()
|
|
||||||
view()
|
|
||||||
else
|
|
||||||
view()
|
|
||||||
image()
|
|
||||||
end
|
|
||||||
draw_ass(a.text)
|
|
||||||
end
|
|
||||||
|
|
||||||
function enable()
|
|
||||||
if active then return end
|
|
||||||
active = true
|
|
||||||
mp.observe_property("osd-dimensions", nil, mark_stale)
|
|
||||||
mp.register_idle(refresh_minimap)
|
|
||||||
mark_stale()
|
|
||||||
end
|
|
||||||
|
|
||||||
function disable()
|
|
||||||
if not active then return end
|
|
||||||
active = false
|
|
||||||
mp.unobserve_property(mark_stale)
|
|
||||||
mp.unregister_idle(refresh_minimap)
|
|
||||||
draw_ass("")
|
|
||||||
end
|
|
||||||
|
|
||||||
function toggle()
|
|
||||||
if active then
|
|
||||||
disable()
|
|
||||||
else
|
|
||||||
enable()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if opts.enabled then
|
|
||||||
enable()
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding(nil, "minimap-enable", enable)
|
|
||||||
mp.add_key_binding(nil, "minimap-disable", disable)
|
|
||||||
mp.add_key_binding(nil, "minimap-toggle", toggle)
|
|
||||||
|
|
@ -1,314 +0,0 @@
|
||||||
local opts = {
|
|
||||||
show_distance = true,
|
|
||||||
show_coordinates = true,
|
|
||||||
coordinates_space = "image",
|
|
||||||
show_angles = "degrees",
|
|
||||||
line_width = 2,
|
|
||||||
dots_radius = 3,
|
|
||||||
font_size = 36,
|
|
||||||
line_color = "33",
|
|
||||||
confirm_bindings = "MBTN_LEFT,ENTER",
|
|
||||||
exit_bindings = "ESC",
|
|
||||||
set_first_point_on_begin = false,
|
|
||||||
clear_on_second_point_set = false,
|
|
||||||
}
|
|
||||||
|
|
||||||
local options = require 'mp.options'
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
local assdraw = require 'mp.assdraw'
|
|
||||||
|
|
||||||
local state = 0 -- {0,1,2,3} = {inactive,setting first point,setting second point,done}
|
|
||||||
local first_point = nil -- in normalized video space coordinates
|
|
||||||
local second_point = nil -- in normalized video space coordinates
|
|
||||||
local video_dimensions_stale = false
|
|
||||||
|
|
||||||
function split(input)
|
|
||||||
local ret = {}
|
|
||||||
for str in string.gmatch(input, "([^,]+)") do
|
|
||||||
ret[#ret + 1] = str
|
|
||||||
end
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
local confirm_bindings = split(opts.confirm_bindings)
|
|
||||||
local exit_bindings = split(opts.exit_bindings)
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function()
|
|
||||||
if state ~= 0 then
|
|
||||||
remove_bindings()
|
|
||||||
end
|
|
||||||
confirm_bindings = split(opts.confirm_bindings)
|
|
||||||
exit_bindings = split(opts.exit_bindings)
|
|
||||||
if state ~= 0 then
|
|
||||||
add_bindings()
|
|
||||||
mark_stale()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function draw_ass(ass)
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
mp.set_osd_ass(ww, wh, ass)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function cursor_video_space_normalized(dim)
|
|
||||||
local mx, my = mp.get_mouse_pos()
|
|
||||||
local ret = {}
|
|
||||||
ret[1] = (mx - dim.ml) / (dim.w - dim.ml - dim.mr)
|
|
||||||
ret[2] = (my - dim.mt) / (dim.h - dim.mt - dim.mb)
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
function refresh()
|
|
||||||
if not video_dimensions_stale then return end
|
|
||||||
video_dimensions_stale = false
|
|
||||||
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
local out_params = mp.get_property_native("video-out-params")
|
|
||||||
if not dim or not out_params then
|
|
||||||
draw_ass("")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local vid_width = out_params.dw
|
|
||||||
local vid_height = out_params.dh
|
|
||||||
|
|
||||||
function video_space_normalized_to_video(point)
|
|
||||||
local ret = {}
|
|
||||||
ret[1] = point[1] * vid_width
|
|
||||||
ret[2] = point[2] * vid_height
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
function video_space_normalized_to_screen(point)
|
|
||||||
local ret = {}
|
|
||||||
ret[1] = point[1] * (dim.w - dim.ml - dim.mr) + dim.ml
|
|
||||||
ret[2] = point[2] * (dim.h - dim.mt - dim.mb) + dim.mt
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
local line_start = {}
|
|
||||||
local line_end = {}
|
|
||||||
if second_point then
|
|
||||||
line_start.image = video_space_normalized_to_video(first_point)
|
|
||||||
line_start.screen = video_space_normalized_to_screen(first_point)
|
|
||||||
line_end.image = video_space_normalized_to_video(second_point)
|
|
||||||
line_end.screen = video_space_normalized_to_screen(second_point)
|
|
||||||
elseif first_point then
|
|
||||||
line_start.image = video_space_normalized_to_video(first_point)
|
|
||||||
line_start.screen = video_space_normalized_to_screen(first_point)
|
|
||||||
line_end.image = video_space_normalized_to_video(cursor_video_space_normalized(dim))
|
|
||||||
line_end.screen = {}
|
|
||||||
line_end.screen[1], line_end.screen[2] = mp.get_mouse_pos()
|
|
||||||
else
|
|
||||||
local mx, my = mp.get_mouse_pos()
|
|
||||||
line_start.image = video_space_normalized_to_video(cursor_video_space_normalized(dim))
|
|
||||||
line_start.screen = {}
|
|
||||||
line_start.screen[1], line_start.screen[2] = mp.get_mouse_pos()
|
|
||||||
line_end = line_start
|
|
||||||
end
|
|
||||||
local distinct = (math.abs(line_start.screen[1] - line_end.screen[1]) >= 1
|
|
||||||
or math.abs(line_start.screen[2] - line_end.screen[2]) >= 1)
|
|
||||||
|
|
||||||
local a = assdraw:ass_new()
|
|
||||||
local draw_setup = function(bord)
|
|
||||||
a:new_event()
|
|
||||||
a:pos(0,0)
|
|
||||||
a:append("{\\bord" .. bord .. "}")
|
|
||||||
a:append("{\\shad0}")
|
|
||||||
local r = opts.line_color
|
|
||||||
a:append("{\\3c&H".. r .. r .. r .. "&}")
|
|
||||||
a:append("{\\1a&HFF}")
|
|
||||||
a:append("{\\2a&HFF}")
|
|
||||||
a:append("{\\3a&H00}")
|
|
||||||
a:append("{\\4a&HFF}")
|
|
||||||
a:draw_start()
|
|
||||||
end
|
|
||||||
local dot = function(pos, size)
|
|
||||||
draw_setup(size)
|
|
||||||
a:move_to(pos[1], pos[2]-0.5)
|
|
||||||
a:line_to(pos[1], pos[2]+0.5)
|
|
||||||
end
|
|
||||||
local line = function(from, to, size)
|
|
||||||
draw_setup(size)
|
|
||||||
a:move_to(from[1], from[2])
|
|
||||||
a:line_to(to[1], to[2])
|
|
||||||
end
|
|
||||||
if distinct then
|
|
||||||
dot(line_start.screen, opts.dots_radius)
|
|
||||||
line(line_start.screen, line_end.screen, opts.line_width)
|
|
||||||
dot(line_end.screen, opts.dots_radius)
|
|
||||||
else
|
|
||||||
dot(line_start.screen, opts.dots_radius)
|
|
||||||
end
|
|
||||||
|
|
||||||
local line_info = function()
|
|
||||||
if not opts.show_distance then return end
|
|
||||||
a:new_event()
|
|
||||||
a:append("{\\fs36}{\\bord1}")
|
|
||||||
a:pos((line_start.screen[1] + line_end.screen[1]) / 2, (line_start.screen[2] + line_end.screen[2]) / 2)
|
|
||||||
local an = 1
|
|
||||||
if line_start.image[1] < line_end.image[1] then an = an + 2 end
|
|
||||||
if line_start.image[2] < line_end.image[2] then an = an + 6 end
|
|
||||||
a:an(an)
|
|
||||||
local image = math.sqrt(math.pow(line_start.image[1] - line_end.image[1], 2) + math.pow(line_start.image[2] - line_end.image[2], 2))
|
|
||||||
local screen = math.sqrt(math.pow(line_start.screen[1] - line_end.screen[1], 2) + math.pow(line_start.screen[2] - line_end.screen[2], 2))
|
|
||||||
if opts.coordinates_space == "both" then
|
|
||||||
a:append(string.format("image: %.1f\\Nscreen: %.1f", image, screen))
|
|
||||||
elseif opts.coordinates_space == "image" then
|
|
||||||
a:append(string.format("%.1f", image))
|
|
||||||
elseif opts.coordinates_space == "window" then
|
|
||||||
a:append(string.format("%.1f", screen))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local dot_info = function(pos, opposite)
|
|
||||||
if not opts.show_coordinates then return end
|
|
||||||
a:new_event()
|
|
||||||
a:append("{\\fs" .. opts.font_size .."}{\\bord1}")
|
|
||||||
a:pos(pos.screen[1], pos.screen[2])
|
|
||||||
local an
|
|
||||||
if distinct then
|
|
||||||
an = 1
|
|
||||||
if line_start.image[1] > line_end.image[1] then an = an + 2 end
|
|
||||||
if line_start.image[2] < line_end.image[2] then an = an + 6 end
|
|
||||||
else
|
|
||||||
an = 7
|
|
||||||
end
|
|
||||||
if opposite then
|
|
||||||
an = 9 + 1 - an
|
|
||||||
end
|
|
||||||
a:an(an)
|
|
||||||
if opts.coordinates_space == "both" then
|
|
||||||
a:append(string.format("image: %.1f, %.1f\\Nscreen: %i, %i",
|
|
||||||
pos.image[1], pos.image[2], pos.screen[1], pos.screen[2]))
|
|
||||||
elseif opts.coordinates_space == "image" then
|
|
||||||
a:append(string.format("%.1f, %.1f", pos.image[1], pos.image[2]))
|
|
||||||
elseif opts.coordinates_space == "window" then
|
|
||||||
a:append(string.format("%i, %i", pos.screen[1], pos.screen[2]))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
dot_info(line_start, true)
|
|
||||||
if distinct then
|
|
||||||
line_info()
|
|
||||||
dot_info(line_end, false)
|
|
||||||
end
|
|
||||||
if distinct and opts.show_angles ~= "no" then
|
|
||||||
local dist = 50
|
|
||||||
local pos_from_angle = function(mult, angle)
|
|
||||||
return {
|
|
||||||
line_start.screen[1] + mult * dist * math.cos(angle),
|
|
||||||
line_start.screen[2] + mult * dist * math.sin(angle),
|
|
||||||
}
|
|
||||||
end
|
|
||||||
local extended = { line_start.screen[1], line_start.screen[2] }
|
|
||||||
if line_end.screen[1] > line_start.screen[1] then
|
|
||||||
extended[1] = extended[1] + dist
|
|
||||||
else
|
|
||||||
extended[1] = extended[1] - dist
|
|
||||||
end
|
|
||||||
line(line_start.screen, extended, math.max(0, opts.line_width-0.5))
|
|
||||||
local angle = math.atan(math.abs(line_start.image[2] - line_end.image[2]) / math.abs(line_start.image[1] - line_end.image[1]))
|
|
||||||
local fix_angle
|
|
||||||
local an
|
|
||||||
if line_end.image[2] < line_start.image[2] and line_end.image[1] > line_start.image[1] then
|
|
||||||
-- upper-right
|
|
||||||
an = 4
|
|
||||||
fix_angle = function(angle) return - angle end
|
|
||||||
elseif line_end.image[2] < line_start.image[2] then
|
|
||||||
-- upper-left
|
|
||||||
an = 6
|
|
||||||
fix_angle = function(angle) return math.pi + angle end
|
|
||||||
elseif line_end.image[1] < line_start.image[1] then
|
|
||||||
-- bottom-left
|
|
||||||
an = 6
|
|
||||||
fix_angle = function(angle) return math.pi - angle end
|
|
||||||
else
|
|
||||||
-- bottom-right
|
|
||||||
an = 4
|
|
||||||
fix_angle = function(angle) return angle end
|
|
||||||
end
|
|
||||||
-- should implement this https://math.stackexchange.com/questions/873224/calculate-control-points-of-cubic-bezier-curve-approximating-a-part-of-a-circle
|
|
||||||
local cp1 = pos_from_angle(1, fix_angle(angle*1/4))
|
|
||||||
local cp2 = pos_from_angle(1, fix_angle(angle*3/4))
|
|
||||||
local p2 = pos_from_angle(1, fix_angle(angle))
|
|
||||||
a:bezier_curve(cp1[1], cp1[2], cp2[1], cp2[2], p2[1], p2[2])
|
|
||||||
|
|
||||||
a:new_event()
|
|
||||||
a:append("{\\fs" .. opts.font_size .."}{\\bord1}")
|
|
||||||
local text_pos = pos_from_angle(1.1, fix_angle(angle*2/3)) -- you'd think /2 would make more sense, but *2/3 looks better
|
|
||||||
a:pos(text_pos[1], text_pos[2])
|
|
||||||
a:an(an)
|
|
||||||
if opts.show_angles == "both" then
|
|
||||||
a:append(string.format("%.2f\\N%.1f°", angle, angle / math.pi * 180))
|
|
||||||
elseif opts.show_angles == "degrees" then
|
|
||||||
a:append(string.format("%.1f°", angle / math.pi * 180))
|
|
||||||
elseif opts.show_angles == "radians" then
|
|
||||||
a:append(string.format("%.2f", angle))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
draw_ass(a.text)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mark_stale()
|
|
||||||
video_dimensions_stale = true
|
|
||||||
end
|
|
||||||
|
|
||||||
function add_bindings()
|
|
||||||
mp.add_forced_key_binding("mouse_move", "ruler-mouse-move", mark_stale)
|
|
||||||
for _, key in ipairs(confirm_bindings) do
|
|
||||||
mp.add_forced_key_binding(key, "ruler-next-" .. key, next_step)
|
|
||||||
end
|
|
||||||
for _, key in ipairs(exit_bindings) do
|
|
||||||
mp.add_forced_key_binding(key, "ruler-stop-" .. key, stop)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function remove_bindings()
|
|
||||||
for _, key in ipairs(confirm_bindings) do
|
|
||||||
mp.remove_key_binding("ruler-next-" .. key)
|
|
||||||
end
|
|
||||||
for _, key in ipairs(exit_bindings) do
|
|
||||||
mp.remove_key_binding("ruler-stop-" .. key)
|
|
||||||
end
|
|
||||||
mp.remove_key_binding("ruler-mouse-move")
|
|
||||||
end
|
|
||||||
|
|
||||||
function next_step()
|
|
||||||
if state == 0 then
|
|
||||||
state = 1
|
|
||||||
mp.register_idle(refresh)
|
|
||||||
mp.observe_property("osd-dimensions", nil, mark_stale)
|
|
||||||
mark_stale()
|
|
||||||
add_bindings()
|
|
||||||
if opts.set_first_point_on_begin then
|
|
||||||
next_step()
|
|
||||||
end
|
|
||||||
elseif state == 1 then
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
state = 2
|
|
||||||
first_point = cursor_video_space_normalized(dim)
|
|
||||||
elseif state == 2 then
|
|
||||||
local dim = mp.get_property_native("osd-dimensions")
|
|
||||||
if not dim then return end
|
|
||||||
state = 3
|
|
||||||
second_point = cursor_video_space_normalized(dim)
|
|
||||||
if opts.clear_on_second_point_set then
|
|
||||||
next_step()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
stop()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function stop()
|
|
||||||
if state == 0 then return end
|
|
||||||
mp.unregister_idle(refresh)
|
|
||||||
mp.unobserve_property(mark_stale)
|
|
||||||
remove_bindings()
|
|
||||||
state = 0
|
|
||||||
first_point = nil
|
|
||||||
second_point = nil
|
|
||||||
draw_ass("")
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding(nil, "ruler", next_step)
|
|
||||||
|
|
@ -1,142 +0,0 @@
|
||||||
local opts = {
|
|
||||||
enabled = true,
|
|
||||||
size = 36,
|
|
||||||
margin = 10,
|
|
||||||
text_top_left = "",
|
|
||||||
text_top_right = "",
|
|
||||||
text_bottom_left = "${filename} [${playlist-pos-1}/${playlist-count}]",
|
|
||||||
text_bottom_right = "[${dwidth:X}x${dheight:X}]",
|
|
||||||
}
|
|
||||||
|
|
||||||
local msg = require 'mp.msg'
|
|
||||||
local assdraw = require 'mp.assdraw'
|
|
||||||
local options = require 'mp.options'
|
|
||||||
|
|
||||||
options.read_options(opts, nil, function(c)
|
|
||||||
if c["enabled"] then
|
|
||||||
if opts.enabled then
|
|
||||||
enable()
|
|
||||||
else
|
|
||||||
disable()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if c["size"] or c["margin"] then
|
|
||||||
mark_stale()
|
|
||||||
end
|
|
||||||
if c["text_top_left"] or
|
|
||||||
c["text_top_right"] or
|
|
||||||
c["text_bottom_left"] or
|
|
||||||
c["text_bottom_right"]
|
|
||||||
then
|
|
||||||
observe_properties()
|
|
||||||
mark_stale()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
local stale = true
|
|
||||||
local active = false
|
|
||||||
|
|
||||||
function draw_ass(ass)
|
|
||||||
local ww, wh = mp.get_osd_size()
|
|
||||||
mp.set_osd_ass(ww, wh, ass)
|
|
||||||
end
|
|
||||||
|
|
||||||
function refresh()
|
|
||||||
if not stale then return end
|
|
||||||
stale = false
|
|
||||||
local a = assdraw:ass_new()
|
|
||||||
local draw_text = function(text, an, x, y)
|
|
||||||
if text == "" then return end
|
|
||||||
local expanded = mp.command_native({ "expand-text", text})
|
|
||||||
if not expanded then
|
|
||||||
msg.error("Error expanding status-line")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
msg.verbose("Status-line changed to: " .. expanded)
|
|
||||||
a:new_event()
|
|
||||||
a:an(an)
|
|
||||||
a:pos(x,y)
|
|
||||||
a:append("{\\fs".. opts.size.. "}{\\bord1.0}")
|
|
||||||
a:append(expanded)
|
|
||||||
end
|
|
||||||
local w,h = mp.get_osd_size()
|
|
||||||
local m = opts.margin
|
|
||||||
draw_text(opts.text_top_left, 7, m, m)
|
|
||||||
draw_text(opts.text_top_right, 9, w-m, m)
|
|
||||||
draw_text(opts.text_bottom_left, 1, m, h-m)
|
|
||||||
draw_text(opts.text_bottom_right, 3, w-m, h-m)
|
|
||||||
draw_ass(a.text)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mark_stale()
|
|
||||||
stale = true
|
|
||||||
end
|
|
||||||
|
|
||||||
function observe_properties()
|
|
||||||
mp.unobserve_property(mark_stale)
|
|
||||||
if not active then return end
|
|
||||||
for _, str in ipairs({
|
|
||||||
opts.text_top_left,
|
|
||||||
opts.text_top_right,
|
|
||||||
opts.text_bottom_left,
|
|
||||||
opts.text_bottom_right,
|
|
||||||
}) do
|
|
||||||
local start = 0
|
|
||||||
while true do
|
|
||||||
local s, e, cap = string.find(str, "%${[?!]?([%l%d-/]*)", start)
|
|
||||||
if not s then break end
|
|
||||||
msg.verbose("Observing property " .. cap)
|
|
||||||
mp.observe_property(cap, nil, mark_stale)
|
|
||||||
start = e
|
|
||||||
end
|
|
||||||
end
|
|
||||||
mp.observe_property("osd-width", nil, mark_stale)
|
|
||||||
mp.observe_property("osd-height", nil, mark_stale)
|
|
||||||
end
|
|
||||||
|
|
||||||
function enable()
|
|
||||||
if active then return end
|
|
||||||
active = true
|
|
||||||
observe_properties()
|
|
||||||
mp.register_idle(refresh)
|
|
||||||
mark_stale()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function disable()
|
|
||||||
if not active then return end
|
|
||||||
active = false
|
|
||||||
observe_properties()
|
|
||||||
mp.unregister_idle(refresh)
|
|
||||||
draw_ass("")
|
|
||||||
end
|
|
||||||
|
|
||||||
function toggle()
|
|
||||||
if active then
|
|
||||||
disable()
|
|
||||||
else
|
|
||||||
enable()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if opts.enabled then
|
|
||||||
enable()
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding(nil, "status-line-enable", enable)
|
|
||||||
mp.add_key_binding(nil, "status-line-disable", disable)
|
|
||||||
mp.add_key_binding(nil, "status-line-toggle", toggle)
|
|
||||||
|
|
||||||
-- TODO remove
|
|
||||||
mp.add_key_binding(nil, "enable-status-line", function()
|
|
||||||
msg.warn("This binding is deprecated, use 'status-line-enable' instead")
|
|
||||||
enable()
|
|
||||||
end)
|
|
||||||
mp.add_key_binding(nil, "disable-status-line", function()
|
|
||||||
msg.warn("This binding is deprecated, use 'status-line-disable' instead")
|
|
||||||
disable()
|
|
||||||
end)
|
|
||||||
mp.add_key_binding(nil, "toggle-status-line", function()
|
|
||||||
msg.warn("This binding is deprecated, use 'status-line-toggle' instead")
|
|
||||||
toggle()
|
|
||||||
end)
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,38 +0,0 @@
|
||||||
<background>
|
|
||||||
<starttime>
|
|
||||||
<year>2025</year>
|
|
||||||
<month>10</month>
|
|
||||||
<day>28</day>
|
|
||||||
<hour>8</hour>
|
|
||||||
<minute>00</minute>
|
|
||||||
<second>00</second>
|
|
||||||
</starttime>
|
|
||||||
<!-- This animation will start at 8 AM. -->
|
|
||||||
|
|
||||||
<!-- We start with day at 8 AM. It will remain up for 10 hours. -->
|
|
||||||
<static>
|
|
||||||
<duration>36000.0</duration>
|
|
||||||
<file>/usr/share/backgrounds/f43/default/f43-01-day.jxl</file>
|
|
||||||
</static>
|
|
||||||
|
|
||||||
<!-- Day ended and starts to transition to night at 6 PM. The transition lasts for 2 hours, ending at 8 PM. -->
|
|
||||||
<transition type="overlay">
|
|
||||||
<duration>7200.0</duration>
|
|
||||||
<from>/usr/share/backgrounds/f43/default/f43-01-day.jxl</from>
|
|
||||||
<to>/usr/share/backgrounds/f43/default/f43-01-night.jxl</to>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<!-- It's 8 PM, we're showing the night till 6 AM. -->
|
|
||||||
<static>
|
|
||||||
<duration>36000.0</duration>
|
|
||||||
<file>/usr/share/backgrounds/f43/default/f43-01-night.jxl</file>
|
|
||||||
</static>
|
|
||||||
|
|
||||||
<!-- It's 6 AM, and we're starting to transition to day. Transition completes at 8 AM. -->
|
|
||||||
<transition type="overlay">
|
|
||||||
<duration>7200.0</duration>
|
|
||||||
<from>/usr/share/backgrounds/f43/default/f43-01-night.jxl</from>
|
|
||||||
<to>/usr/share/backgrounds/f43/default/f43-01-day.jxl</to>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
</background>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 MiB |
|
|
@ -13,8 +13,8 @@ input {
|
||||||
// For more information, see xkeyboard-config(7).
|
// For more information, see xkeyboard-config(7).
|
||||||
|
|
||||||
// For example:
|
// For example:
|
||||||
layout "de(us)"
|
layout "de"
|
||||||
options "caps:escape"
|
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
|
||||||
|
|
||||||
// If this section is empty, niri will fetch xkb settings
|
// If this section is empty, niri will fetch xkb settings
|
||||||
// from org.freedesktop.locale1. You can control these using
|
// from org.freedesktop.locale1. You can control these using
|
||||||
|
|
@ -31,7 +31,7 @@ input {
|
||||||
touchpad {
|
touchpad {
|
||||||
// off
|
// off
|
||||||
tap
|
tap
|
||||||
dwt
|
// dwt
|
||||||
// dwtp
|
// dwtp
|
||||||
// drag false
|
// drag false
|
||||||
// drag-lock
|
// drag-lock
|
||||||
|
|
@ -88,7 +88,7 @@ output "eDP-1" {
|
||||||
// mode "1920x1080@120.030"
|
// mode "1920x1080@120.030"
|
||||||
|
|
||||||
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
||||||
scale 1.66
|
scale 1.5
|
||||||
|
|
||||||
// Transform allows to rotate the output counter-clockwise, valid values are:
|
// Transform allows to rotate the output counter-clockwise, valid values are:
|
||||||
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
||||||
|
|
@ -103,11 +103,7 @@ output "eDP-1" {
|
||||||
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
||||||
// If the position is unset or results in an overlap, the output is instead placed
|
// If the position is unset or results in an overlap, the output is instead placed
|
||||||
// automatically.
|
// automatically.
|
||||||
position x=320 y=1441
|
position x=1280 y=0
|
||||||
}
|
|
||||||
|
|
||||||
output "ViewSonic Corporation VX2758A-2K XLK245220057" {
|
|
||||||
position x=0 y=0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings that influence how windows are positioned and sized.
|
// Settings that influence how windows are positioned and sized.
|
||||||
|
|
@ -115,7 +111,7 @@ output "ViewSonic Corporation VX2758A-2K XLK245220057" {
|
||||||
// https://yalter.github.io/niri/Configuration:-Layout
|
// https://yalter.github.io/niri/Configuration:-Layout
|
||||||
layout {
|
layout {
|
||||||
// Set gaps around windows in logical pixels.
|
// Set gaps around windows in logical pixels.
|
||||||
gaps 4
|
gaps 8
|
||||||
|
|
||||||
//background-color "#351e4c"
|
//background-color "#351e4c"
|
||||||
// When to center a column when changing focus, options are:
|
// When to center a column when changing focus, options are:
|
||||||
|
|
@ -161,10 +157,10 @@ layout {
|
||||||
// You can change how the focus ring looks.
|
// You can change how the focus ring looks.
|
||||||
focus-ring {
|
focus-ring {
|
||||||
// Uncomment this line to disable the focus ring.
|
// Uncomment this line to disable the focus ring.
|
||||||
off
|
on
|
||||||
|
|
||||||
// How many logical pixels the ring extends out from the windows.
|
// How many logical pixels the ring extends out from the windows.
|
||||||
width 2
|
width 4
|
||||||
|
|
||||||
// Colors can be set in a variety of ways:
|
// Colors can be set in a variety of ways:
|
||||||
// - CSS named colors: "red"
|
// - CSS named colors: "red"
|
||||||
|
|
@ -200,11 +196,10 @@ layout {
|
||||||
border {
|
border {
|
||||||
// The settings are the same as for the focus ring.
|
// The settings are the same as for the focus ring.
|
||||||
// If you enable the border, you probably want to disable the focus ring.
|
// If you enable the border, you probably want to disable the focus ring.
|
||||||
on
|
off
|
||||||
|
|
||||||
width 2
|
width 4
|
||||||
// active-color "#ffc87f"
|
active-color "#ffc87f"
|
||||||
active-color "#7fc8ff"
|
|
||||||
inactive-color "#505050"
|
inactive-color "#505050"
|
||||||
|
|
||||||
// Color of the border around windows that request your attention.
|
// Color of the border around windows that request your attention.
|
||||||
|
|
@ -255,13 +250,6 @@ layout {
|
||||||
color "#0007"
|
color "#0007"
|
||||||
}
|
}
|
||||||
|
|
||||||
tab-indicator {
|
|
||||||
on
|
|
||||||
place-within-column
|
|
||||||
gap 3
|
|
||||||
width 4
|
|
||||||
}
|
|
||||||
|
|
||||||
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
|
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
|
||||||
// You can think of them as a kind of outer gaps. They are set in logical pixels.
|
// You can think of them as a kind of outer gaps. They are set in logical pixels.
|
||||||
// Left and right struts will cause the next window to the side to always be visible.
|
// Left and right struts will cause the next window to the side to always be visible.
|
||||||
|
|
@ -288,7 +276,7 @@ layout {
|
||||||
|
|
||||||
hotkey-overlay {
|
hotkey-overlay {
|
||||||
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
|
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
|
||||||
skip-at-startup
|
// skip-at-startup
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
||||||
|
|
@ -297,6 +285,7 @@ hotkey-overlay {
|
||||||
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
||||||
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
||||||
prefer-no-csd
|
prefer-no-csd
|
||||||
|
|
||||||
// You can change the path where screenshots are saved.
|
// You can change the path where screenshots are saved.
|
||||||
// A ~ at the front will be expanded to the home directory.
|
// A ~ at the front will be expanded to the home directory.
|
||||||
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
||||||
|
|
@ -339,29 +328,9 @@ window-rule {
|
||||||
open-floating true
|
open-floating true
|
||||||
}
|
}
|
||||||
|
|
||||||
window-rule {
|
|
||||||
match app-id=r#"ipe$"# title="^Ipe: waiting$"
|
|
||||||
open-floating true
|
|
||||||
open-focused false
|
|
||||||
default-floating-position x=8 y=8 relative-to="bottom-left"
|
|
||||||
max-width 169
|
|
||||||
max-height 37
|
|
||||||
}
|
|
||||||
|
|
||||||
// window-rule {
|
|
||||||
// match app-id=r#"ipe$"# title="^Create text object$"
|
|
||||||
// open-floating false
|
|
||||||
// default-column-width { proportion 0.2; }
|
|
||||||
// }
|
|
||||||
|
|
||||||
window-rule {
|
|
||||||
match is-floating=true
|
|
||||||
baba-is-float false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Example: block out two password managers from screen capture.
|
// Example: block out two password managers from screen capture.
|
||||||
// (This example rule is commented out with a "/-" in front.)
|
// (This example rule is commented out with a "/-" in front.)
|
||||||
window-rule {
|
/-window-rule {
|
||||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
||||||
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
||||||
|
|
||||||
|
|
@ -394,14 +363,10 @@ binds {
|
||||||
Mod+Shift+0 { show-hotkey-overlay; }
|
Mod+Shift+0 { show-hotkey-overlay; }
|
||||||
|
|
||||||
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
||||||
Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn-sh "alacritty msg create-window"; }
|
Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn "alacritty"; }
|
||||||
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
||||||
Mod+Shift+D hotkey-overlay-title="Switch to Window: fuzzel" { spawn "windowmenu.fish"; }
|
|
||||||
Mod+B hotkey-overlay-title="Search the Web: fuzzel" { spawn "browserprompt.fish"; }
|
|
||||||
Mod+E hotkey-overlay-title="Open Email Client: evolution" { spawn "evolution"; }
|
|
||||||
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
||||||
Mod+P hotkey-overlay-title="Show the Power menu: fuzzel" { spawn "powermenu.fish"; }
|
|
||||||
Mod+A hotkey-overlay-title="Show the Action menu: fuzzel" { spawn "actionmenu.fish"; }
|
|
||||||
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc.
|
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc.
|
||||||
// Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`.
|
// Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`.
|
||||||
// For example, this is a standard bind to toggle the screen reader (orca).
|
// For example, this is a standard bind to toggle the screen reader (orca).
|
||||||
|
|
@ -410,20 +375,16 @@ binds {
|
||||||
// Example volume keys mappings for PipeWire & WirePlumber.
|
// Example volume keys mappings for PipeWire & WirePlumber.
|
||||||
// The allow-when-locked=true property makes them work even when the session is locked.
|
// The allow-when-locked=true property makes them work even when the session is locked.
|
||||||
// Using spawn-sh allows to pass multiple arguments together with the command.
|
// Using spawn-sh allows to pass multiple arguments together with the command.
|
||||||
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 0.05+ && volumenotify.fish"; }
|
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
|
||||||
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 0.05- && volumenotify.fish"; }
|
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
|
||||||
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && volumenotify.fish"; }
|
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
|
||||||
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
|
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
|
||||||
|
|
||||||
XF86AudioPlay allow-when-locked=true { spawn-sh "mpc toggle"; }
|
|
||||||
XF86AudioPrev allow-when-locked=true { spawn-sh "mpc prev"; }
|
|
||||||
XF86AudioNext allow-when-locked=true { spawn-sh "mpc next"; }
|
|
||||||
// Example brightness key mappings for brightnessctl.
|
// Example brightness key mappings for brightnessctl.
|
||||||
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
|
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
|
||||||
// but you need to manually put each argument in separate "" quotes.
|
// but you need to manually put each argument in separate "" quotes.
|
||||||
XF86MonBrightnessUp allow-when-locked=true { spawn-sh "brightnessctl --class=backlight set +5% && brightnessnotify.fish"; }
|
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
|
||||||
XF86MonBrightnessDown allow-when-locked=true { spawn-sh "brightnessctl --class=backlight set 5%- && brightnessnotify.fish"; }
|
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
|
||||||
|
|
||||||
|
|
||||||
// Open/close the Overview: a zoomed-out view of workspaces and windows.
|
// Open/close the Overview: a zoomed-out view of workspaces and windows.
|
||||||
// You can also move the mouse into the top-left hot corner,
|
// You can also move the mouse into the top-left hot corner,
|
||||||
|
|
@ -574,8 +535,8 @@ binds {
|
||||||
// The following binds move the focused window in and out of a column.
|
// The following binds move the focused window in and out of a column.
|
||||||
// If the window is alone, they will consume it into the nearby column to the side.
|
// If the window is alone, they will consume it into the nearby column to the side.
|
||||||
// If the window is already in a column, they will expel it out.
|
// If the window is already in a column, they will expel it out.
|
||||||
Mod+Ctrl+Y { consume-or-expel-window-left; }
|
Mod+BracketLeft { consume-or-expel-window-left; }
|
||||||
Mod+Ctrl+O { consume-or-expel-window-right; }
|
Mod+BracketRight { consume-or-expel-window-right; }
|
||||||
|
|
||||||
// Consume one window from the right to the bottom of the focused column.
|
// Consume one window from the right to the bottom of the focused column.
|
||||||
Mod+Comma { consume-window-into-column; }
|
Mod+Comma { consume-window-into-column; }
|
||||||
|
|
@ -608,11 +569,11 @@ binds {
|
||||||
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
||||||
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
||||||
Mod+Minus { set-column-width "-10%"; }
|
Mod+Minus { set-column-width "-10%"; }
|
||||||
Mod+Equal { set-column-width "+10%"; }
|
Mod+Plus { set-column-width "+10%"; }
|
||||||
|
|
||||||
// Finer height adjustments when in column with other windows.
|
// Finer height adjustments when in column with other windows.
|
||||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
Mod+Shift+Minus { set-window-height "-10%"; }
|
||||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
Mod+Shift+Plus { set-window-height "+10%"; }
|
||||||
|
|
||||||
// Move the focused window between the floating and the tiling layout.
|
// Move the focused window between the floating and the tiling layout.
|
||||||
Mod+V { toggle-window-floating; }
|
Mod+V { toggle-window-floating; }
|
||||||
|
|
|
||||||
|
|
@ -1,662 +0,0 @@
|
||||||
// This config is in the KDL format: https://kdl.dev
|
|
||||||
// "/-" comments out the following node.
|
|
||||||
// Check the wiki for a full description of the configuration:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Introduction
|
|
||||||
|
|
||||||
// Input device configuration.
|
|
||||||
// Find the full list of options on the wiki:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Input
|
|
||||||
input {
|
|
||||||
keyboard {
|
|
||||||
xkb {
|
|
||||||
// You can set rules, model, layout, variant and options.
|
|
||||||
// For more information, see xkeyboard-config(7).
|
|
||||||
|
|
||||||
// For example:
|
|
||||||
layout "de(us)"
|
|
||||||
options "caps:escape"
|
|
||||||
|
|
||||||
// If this section is empty, niri will fetch xkb settings
|
|
||||||
// from org.freedesktop.locale1. You can control these using
|
|
||||||
// localectl set-x11-keymap.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable numlock on startup, omitting this setting disables it.
|
|
||||||
numlock
|
|
||||||
}
|
|
||||||
|
|
||||||
// Next sections include libinput settings.
|
|
||||||
// Omitting settings disables them, or leaves them at their default values.
|
|
||||||
// All commented-out settings here are examples, not defaults.
|
|
||||||
touchpad {
|
|
||||||
// off
|
|
||||||
tap
|
|
||||||
dwt
|
|
||||||
// dwtp
|
|
||||||
// drag false
|
|
||||||
// drag-lock
|
|
||||||
natural-scroll
|
|
||||||
// accel-speed 0.2
|
|
||||||
// accel-profile "flat"
|
|
||||||
// scroll-method "two-finger"
|
|
||||||
// disabled-on-external-mouse
|
|
||||||
}
|
|
||||||
|
|
||||||
mouse {
|
|
||||||
// off
|
|
||||||
// natural-scroll
|
|
||||||
// accel-speed 0.2
|
|
||||||
// accel-profile "flat"
|
|
||||||
// scroll-method "no-scroll"
|
|
||||||
}
|
|
||||||
|
|
||||||
trackpoint {
|
|
||||||
// off
|
|
||||||
// natural-scroll
|
|
||||||
// accel-speed 0.2
|
|
||||||
// accel-profile "flat"
|
|
||||||
// scroll-method "on-button-down"
|
|
||||||
// scroll-button 273
|
|
||||||
// scroll-button-lock
|
|
||||||
// middle-emulation
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uncomment this to make the mouse warp to the center of newly focused windows.
|
|
||||||
// warp-mouse-to-focus
|
|
||||||
|
|
||||||
// Focus windows and outputs automatically when moving the mouse into them.
|
|
||||||
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
|
|
||||||
// focus-follows-mouse max-scroll-amount="0%"
|
|
||||||
}
|
|
||||||
|
|
||||||
// You can configure outputs by their name, which you can find
|
|
||||||
// by running `niri msg outputs` while inside a niri instance.
|
|
||||||
// The built-in laptop monitor is usually called "eDP-1".
|
|
||||||
// Find more information on the wiki:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Outputs
|
|
||||||
// Remember to uncomment the node by removing "/-"!
|
|
||||||
output "eDP-1" {
|
|
||||||
// Uncomment this line to disable this output.
|
|
||||||
// off
|
|
||||||
|
|
||||||
// Resolution and, optionally, refresh rate of the output.
|
|
||||||
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
|
|
||||||
// If the refresh rate is omitted, niri will pick the highest refresh rate
|
|
||||||
// for the resolution.
|
|
||||||
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
|
|
||||||
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
|
|
||||||
// mode "1920x1080@120.030"
|
|
||||||
|
|
||||||
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
|
|
||||||
scale 1.66
|
|
||||||
|
|
||||||
// Transform allows to rotate the output counter-clockwise, valid values are:
|
|
||||||
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
|
|
||||||
transform "normal"
|
|
||||||
|
|
||||||
// Position of the output in the global coordinate space.
|
|
||||||
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
|
|
||||||
// The cursor can only move between directly adjacent outputs.
|
|
||||||
// Output scale and rotation has to be taken into account for positioning:
|
|
||||||
// outputs are sized in logical, or scaled, pixels.
|
|
||||||
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
|
|
||||||
// so to put another output directly adjacent to it on the right, set its x to 1920.
|
|
||||||
// If the position is unset or results in an overlap, the output is instead placed
|
|
||||||
// automatically.
|
|
||||||
position x=320 y=1441
|
|
||||||
}
|
|
||||||
|
|
||||||
output "ViewSonic Corporation VX2758A-2K XLK245220057" {
|
|
||||||
position x=0 y=0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Settings that influence how windows are positioned and sized.
|
|
||||||
// Find more information on the wiki:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Layout
|
|
||||||
layout {
|
|
||||||
// Set gaps around windows in logical pixels.
|
|
||||||
gaps 4
|
|
||||||
|
|
||||||
//background-color "#351e4c"
|
|
||||||
// When to center a column when changing focus, options are:
|
|
||||||
// - "never", default behavior, focusing an off-screen column will keep at the left
|
|
||||||
// or right edge of the screen.
|
|
||||||
// - "always", the focused column will always be centered.
|
|
||||||
// - "on-overflow", focusing a column will center it if it doesn't fit
|
|
||||||
// together with the previously focused column.
|
|
||||||
center-focused-column "never"
|
|
||||||
|
|
||||||
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
|
|
||||||
preset-column-widths {
|
|
||||||
// Proportion sets the width as a fraction of the output width, taking gaps into account.
|
|
||||||
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
|
|
||||||
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
|
|
||||||
proportion 0.33333
|
|
||||||
proportion 0.5
|
|
||||||
proportion 0.66667
|
|
||||||
|
|
||||||
// Fixed sets the width in logical pixels exactly.
|
|
||||||
// fixed 1920
|
|
||||||
}
|
|
||||||
|
|
||||||
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
|
|
||||||
// preset-window-heights { }
|
|
||||||
|
|
||||||
// You can change the default width of the new windows.
|
|
||||||
default-column-width { proportion 0.5; }
|
|
||||||
// If you leave the brackets empty, the windows themselves will decide their initial width.
|
|
||||||
// default-column-width {}
|
|
||||||
|
|
||||||
// By default focus ring and border are rendered as a solid background rectangle
|
|
||||||
// behind windows. That is, they will show up through semitransparent windows.
|
|
||||||
// This is because windows using client-side decorations can have an arbitrary shape.
|
|
||||||
//
|
|
||||||
// If you don't like that, you should uncomment `prefer-no-csd` below.
|
|
||||||
// Niri will draw focus ring and border *around* windows that agree to omit their
|
|
||||||
// client-side decorations.
|
|
||||||
//
|
|
||||||
// Alternatively, you can override it with a window rule called
|
|
||||||
// `draw-border-with-background`.
|
|
||||||
|
|
||||||
// You can change how the focus ring looks.
|
|
||||||
focus-ring {
|
|
||||||
// Uncomment this line to disable the focus ring.
|
|
||||||
off
|
|
||||||
|
|
||||||
// How many logical pixels the ring extends out from the windows.
|
|
||||||
width 2
|
|
||||||
|
|
||||||
// Colors can be set in a variety of ways:
|
|
||||||
// - CSS named colors: "red"
|
|
||||||
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
|
|
||||||
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
|
|
||||||
|
|
||||||
// Color of the ring on the active monitor.
|
|
||||||
active-color "#7fc8ff"
|
|
||||||
|
|
||||||
// Color of the ring on inactive monitors.
|
|
||||||
//
|
|
||||||
// The focus ring only draws around the active window, so the only place
|
|
||||||
// where you can see its inactive-color is on other monitors.
|
|
||||||
inactive-color "#505050"
|
|
||||||
|
|
||||||
// You can also use gradients. They take precedence over solid colors.
|
|
||||||
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
|
|
||||||
// The angle is the same as in linear-gradient, and is optional,
|
|
||||||
// defaulting to 180 (top-to-bottom gradient).
|
|
||||||
// You can use any CSS linear-gradient tool on the web to set these up.
|
|
||||||
// Changing the color space is also supported, check the wiki for more info.
|
|
||||||
//
|
|
||||||
// active-gradient from="#80c8ff" to="#c7ff7f" angle=45
|
|
||||||
|
|
||||||
// You can also color the gradient relative to the entire view
|
|
||||||
// of the workspace, rather than relative to just the window itself.
|
|
||||||
// To do that, set relative-to="workspace-view".
|
|
||||||
//
|
|
||||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
|
||||||
}
|
|
||||||
|
|
||||||
// You can also add a border. It's similar to the focus ring, but always visible.
|
|
||||||
border {
|
|
||||||
// The settings are the same as for the focus ring.
|
|
||||||
// If you enable the border, you probably want to disable the focus ring.
|
|
||||||
on
|
|
||||||
|
|
||||||
width 2
|
|
||||||
// active-color "#ffc87f"
|
|
||||||
active-color "#7fc8ff"
|
|
||||||
inactive-color "#505050"
|
|
||||||
|
|
||||||
// Color of the border around windows that request your attention.
|
|
||||||
urgent-color "#9b0000"
|
|
||||||
|
|
||||||
// Gradients can use a few different interpolation color spaces.
|
|
||||||
// For example, this is a pastel rainbow gradient via in="oklch longer hue".
|
|
||||||
//
|
|
||||||
// active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue"
|
|
||||||
|
|
||||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
|
||||||
}
|
|
||||||
|
|
||||||
// You can enable drop shadows for windows.
|
|
||||||
shadow {
|
|
||||||
// Uncomment the next line to enable shadows.
|
|
||||||
on
|
|
||||||
|
|
||||||
// By default, the shadow draws only around its window, and not behind it.
|
|
||||||
// Uncomment this setting to make the shadow draw behind its window.
|
|
||||||
//
|
|
||||||
// Note that niri has no way of knowing about the CSD window corner
|
|
||||||
// radius. It has to assume that windows have square corners, leading to
|
|
||||||
// shadow artifacts inside the CSD rounded corners. This setting fixes
|
|
||||||
// those artifacts.
|
|
||||||
//
|
|
||||||
// However, instead you may want to set prefer-no-csd and/or
|
|
||||||
// geometry-corner-radius. Then, niri will know the corner radius and
|
|
||||||
// draw the shadow correctly, without having to draw it behind the
|
|
||||||
// window. These will also remove client-side shadows if the window
|
|
||||||
// draws any.
|
|
||||||
//
|
|
||||||
// draw-behind-window true
|
|
||||||
|
|
||||||
// You can change how shadows look. The values below are in logical
|
|
||||||
// pixels and match the CSS box-shadow properties.
|
|
||||||
|
|
||||||
// Softness controls the shadow blur radius.
|
|
||||||
softness 30
|
|
||||||
|
|
||||||
// Spread expands the shadow.
|
|
||||||
spread 5
|
|
||||||
|
|
||||||
// Offset moves the shadow relative to the window.
|
|
||||||
offset x=0 y=5
|
|
||||||
|
|
||||||
// You can also change the shadow color and opacity.
|
|
||||||
color "#0007"
|
|
||||||
}
|
|
||||||
|
|
||||||
tab-indicator {
|
|
||||||
on
|
|
||||||
place-within-column
|
|
||||||
gap 3
|
|
||||||
width 4
|
|
||||||
}
|
|
||||||
|
|
||||||
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
|
|
||||||
// You can think of them as a kind of outer gaps. They are set in logical pixels.
|
|
||||||
// Left and right struts will cause the next window to the side to always be visible.
|
|
||||||
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
|
|
||||||
// layer-shell panels and regular gaps.
|
|
||||||
struts {
|
|
||||||
// left 64
|
|
||||||
// right 64
|
|
||||||
// top 64
|
|
||||||
// bottom 64
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add lines like this to spawn processes at startup.
|
|
||||||
// Note that running niri as a session supports xdg-desktop-autostart,
|
|
||||||
// which may be more convenient to use.
|
|
||||||
// See the binds section below for more spawn examples.
|
|
||||||
|
|
||||||
// This line starts waybar, a commonly used bar for Wayland compositors.
|
|
||||||
// spawn-at-startup "waybar"
|
|
||||||
|
|
||||||
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
|
|
||||||
// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell"
|
|
||||||
|
|
||||||
hotkey-overlay {
|
|
||||||
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
|
|
||||||
skip-at-startup
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
|
|
||||||
// If the client will specifically ask for CSD, the request will be honored.
|
|
||||||
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
|
||||||
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
|
||||||
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
|
||||||
prefer-no-csd
|
|
||||||
// You can change the path where screenshots are saved.
|
|
||||||
// A ~ at the front will be expanded to the home directory.
|
|
||||||
// The path is formatted with strftime(3) to give you the screenshot date and time.
|
|
||||||
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
|
|
||||||
|
|
||||||
// You can also set this to null to disable saving screenshots to disk.
|
|
||||||
// screenshot-path null
|
|
||||||
|
|
||||||
// Animation settings.
|
|
||||||
// The wiki explains how to configure individual animations:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Animations
|
|
||||||
animations {
|
|
||||||
// Uncomment to turn off all animations.
|
|
||||||
// off
|
|
||||||
|
|
||||||
// Slow down all animations by this factor. Values below 1 speed them up instead.
|
|
||||||
// slowdown 3.0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Window rules let you adjust behavior for individual windows.
|
|
||||||
// Find more information on the wiki:
|
|
||||||
// https://yalter.github.io/niri/Configuration:-Window-Rules
|
|
||||||
|
|
||||||
// Work around WezTerm's initial configure bug
|
|
||||||
// by setting an empty default-column-width.
|
|
||||||
window-rule {
|
|
||||||
// This regular expression is intentionally made as specific as possible,
|
|
||||||
// since this is the default config, and we want no false positives.
|
|
||||||
// You can get away with just app-id="wezterm" if you want.
|
|
||||||
match app-id=r#"^org\.wezfurlong\.wezterm$"#
|
|
||||||
default-column-width {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the Firefox picture-in-picture player as floating by default.
|
|
||||||
window-rule {
|
|
||||||
// This app-id regular expression will work for both:
|
|
||||||
// - host Firefox (app-id is "firefox")
|
|
||||||
// - Flatpak Firefox (app-id is "org.mozilla.firefox")
|
|
||||||
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
|
|
||||||
open-floating true
|
|
||||||
}
|
|
||||||
|
|
||||||
window-rule {
|
|
||||||
match app-id=r#"ipe$"# title="^Ipe: waiting$"
|
|
||||||
open-floating true
|
|
||||||
open-focused false
|
|
||||||
default-floating-position x=8 y=8 relative-to="bottom-left"
|
|
||||||
max-width 169
|
|
||||||
max-height 37
|
|
||||||
}
|
|
||||||
|
|
||||||
// window-rule {
|
|
||||||
// match app-id=r#"ipe$"# title="^Create text object$"
|
|
||||||
// open-floating false
|
|
||||||
// default-column-width { proportion 0.2; }
|
|
||||||
// }
|
|
||||||
|
|
||||||
window-rule {
|
|
||||||
match is-floating=true
|
|
||||||
baba-is-float false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Example: block out two password managers from screen capture.
|
|
||||||
// (This example rule is commented out with a "/-" in front.)
|
|
||||||
window-rule {
|
|
||||||
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
|
|
||||||
match app-id=r#"^org\.gnome\.World\.Secrets$"#
|
|
||||||
|
|
||||||
block-out-from "screen-capture"
|
|
||||||
|
|
||||||
// Use this instead if you want them visible on third-party screenshot tools.
|
|
||||||
// block-out-from "screencast"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Example: enable rounded corners for all windows.
|
|
||||||
// (This example rule is commented out with a "/-" in front.)
|
|
||||||
/-window-rule {
|
|
||||||
geometry-corner-radius 12
|
|
||||||
clip-to-geometry true
|
|
||||||
}
|
|
||||||
|
|
||||||
spawn-at-startup "cosmic-ext-alternative-startup"
|
|
||||||
|
|
||||||
binds {
|
|
||||||
// Keys consist of modifiers separated by + signs, followed by an XKB key name
|
|
||||||
// in the end. To find an XKB name for a particular key, you may use a program
|
|
||||||
// like wev.
|
|
||||||
//
|
|
||||||
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
|
|
||||||
// when running as a winit window.
|
|
||||||
//
|
|
||||||
// Most actions that you can bind here can also be invoked programmatically with
|
|
||||||
// `niri msg action do-something`.
|
|
||||||
|
|
||||||
// Mod-Shift-/, which is usually the same as Mod-?,
|
|
||||||
// shows a list of important hotkeys.
|
|
||||||
Mod+Shift+0 { show-hotkey-overlay; }
|
|
||||||
|
|
||||||
// Suggested binds for running programs: terminal, app launcher, screen locker.
|
|
||||||
Mod+Return hotkey-overlay-title="Open a Terminal: alacritty" { spawn-sh "alacritty msg create-window"; }
|
|
||||||
Mod+T hotkey-overlay-title="Open a Terminal: alacritty" { spawn "cosmic-term"; }
|
|
||||||
// Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "fuzzel"; }
|
|
||||||
Mod+D hotkey-overlay-title="Run an Application: fuzzel" { spawn "cosmic-launcher"; }
|
|
||||||
// Mod+Shift+D hotkey-overlay-title="Switch to Window: fuzzel" { spawn "windowmenu.fish"; }
|
|
||||||
Mod+Shift+D hotkey-overlay-title="Switch to Window: fuzzel" { spawn "cosmic-app-library"; }
|
|
||||||
Mod+B hotkey-overlay-title="Search the Web: fuzzel" { spawn "browserprompt.fish"; }
|
|
||||||
Mod+E hotkey-overlay-title="Open Email Client: evolution" { spawn "evolution"; }
|
|
||||||
// Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
|
||||||
// Mod+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; }
|
|
||||||
Mod+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "cosmic-greeter"; }
|
|
||||||
Mod+P hotkey-overlay-title="Show the Power menu: fuzzel" { spawn "powermenu.fish"; }
|
|
||||||
Mod+A hotkey-overlay-title="Show the Action menu: fuzzel" { spawn "actionmenu.fish"; }
|
|
||||||
// Use spawn-sh to run a shell command. Do this if you need pipes, multiple commands, etc.
|
|
||||||
// Note: the entire command goes as a single argument. It's passed verbatim to `sh -c`.
|
|
||||||
// For example, this is a standard bind to toggle the screen reader (orca).
|
|
||||||
Super+Alt+S allow-when-locked=true hotkey-overlay-title=null { spawn-sh "pkill orca || exec orca"; }
|
|
||||||
|
|
||||||
// Example volume keys mappings for PipeWire & WirePlumber.
|
|
||||||
// The allow-when-locked=true property makes them work even when the session is locked.
|
|
||||||
// Using spawn-sh allows to pass multiple arguments together with the command.
|
|
||||||
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.05+ && volumenotify.fish"; }
|
|
||||||
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.05- && volumenotify.fish"; }
|
|
||||||
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && volumenotify.fish"; }
|
|
||||||
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
|
|
||||||
|
|
||||||
XF86AudioPlay allow-when-locked=true { spawn-sh "mpc toggle"; }
|
|
||||||
XF86AudioPrev allow-when-locked=true { spawn-sh "mpc prev"; }
|
|
||||||
XF86AudioNext allow-when-locked=true { spawn-sh "mpc next"; }
|
|
||||||
// Example brightness key mappings for brightnessctl.
|
|
||||||
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
|
|
||||||
// but you need to manually put each argument in separate "" quotes.
|
|
||||||
XF86MonBrightnessUp allow-when-locked=true { spawn-sh "brightnessctl --class=backlight set +5% && brightnessnotify.fish"; }
|
|
||||||
XF86MonBrightnessDown allow-when-locked=true { spawn-sh "brightnessctl --class=backlight set 5%- && brightnessnotify.fish"; }
|
|
||||||
|
|
||||||
|
|
||||||
// Open/close the Overview: a zoomed-out view of workspaces and windows.
|
|
||||||
// You can also move the mouse into the top-left hot corner,
|
|
||||||
// or do a four-finger swipe up on a touchpad.
|
|
||||||
Mod+O repeat=false { toggle-overview; }
|
|
||||||
|
|
||||||
Mod+Q repeat=false { close-window; }
|
|
||||||
|
|
||||||
Mod+Left { focus-column-left; }
|
|
||||||
Mod+Down { focus-window-down; }
|
|
||||||
Mod+Up { focus-window-up; }
|
|
||||||
Mod+Right { focus-column-right; }
|
|
||||||
Mod+H { focus-column-left; }
|
|
||||||
Mod+J { focus-window-down; }
|
|
||||||
Mod+K { focus-window-up; }
|
|
||||||
Mod+L { focus-column-right; }
|
|
||||||
|
|
||||||
Mod+Ctrl+Left { move-column-left; }
|
|
||||||
Mod+Ctrl+Down { move-window-down; }
|
|
||||||
Mod+Ctrl+Up { move-window-up; }
|
|
||||||
Mod+Ctrl+Right { move-column-right; }
|
|
||||||
Mod+Ctrl+H { move-column-left; }
|
|
||||||
Mod+Ctrl+J { move-window-down; }
|
|
||||||
Mod+Ctrl+K { move-window-up; }
|
|
||||||
Mod+Ctrl+L { move-column-right; }
|
|
||||||
|
|
||||||
// Alternative commands that move across workspaces when reaching
|
|
||||||
// the first or last window in a column.
|
|
||||||
// Mod+J { focus-window-or-workspace-down; }
|
|
||||||
// Mod+K { focus-window-or-workspace-up; }
|
|
||||||
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
|
|
||||||
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
|
|
||||||
|
|
||||||
Mod+Home { focus-column-first; }
|
|
||||||
Mod+End { focus-column-last; }
|
|
||||||
Mod+Ctrl+Home { move-column-to-first; }
|
|
||||||
Mod+Ctrl+End { move-column-to-last; }
|
|
||||||
|
|
||||||
Mod+Shift+Left { focus-monitor-left; }
|
|
||||||
Mod+Shift+Down { focus-monitor-down; }
|
|
||||||
Mod+Shift+Up { focus-monitor-up; }
|
|
||||||
Mod+Shift+Right { focus-monitor-right; }
|
|
||||||
Mod+Shift+H { focus-monitor-left; }
|
|
||||||
Mod+Shift+J { focus-monitor-down; }
|
|
||||||
Mod+Shift+K { focus-monitor-up; }
|
|
||||||
Mod+Shift+L { focus-monitor-right; }
|
|
||||||
|
|
||||||
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
|
||||||
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
|
||||||
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
|
||||||
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
|
||||||
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
|
||||||
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
|
||||||
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
|
||||||
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
|
||||||
|
|
||||||
// Alternatively, there are commands to move just a single window:
|
|
||||||
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
|
|
||||||
// ...
|
|
||||||
|
|
||||||
// And you can also move a whole workspace to another monitor:
|
|
||||||
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
|
|
||||||
// ...
|
|
||||||
|
|
||||||
Mod+Page_Down { focus-workspace-down; }
|
|
||||||
Mod+Page_Up { focus-workspace-up; }
|
|
||||||
Mod+U { focus-workspace-down; }
|
|
||||||
Mod+I { focus-workspace-up; }
|
|
||||||
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
|
|
||||||
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
|
|
||||||
Mod+Ctrl+U { move-column-to-workspace-down; }
|
|
||||||
Mod+Ctrl+I { move-column-to-workspace-up; }
|
|
||||||
|
|
||||||
// Alternatively, there are commands to move just a single window:
|
|
||||||
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
|
|
||||||
// ...
|
|
||||||
|
|
||||||
Mod+Shift+Page_Down { move-workspace-down; }
|
|
||||||
Mod+Shift+Page_Up { move-workspace-up; }
|
|
||||||
Mod+Shift+U { move-workspace-down; }
|
|
||||||
Mod+Shift+I { move-workspace-up; }
|
|
||||||
|
|
||||||
// You can bind mouse wheel scroll ticks using the following syntax.
|
|
||||||
// These binds will change direction based on the natural-scroll setting.
|
|
||||||
//
|
|
||||||
// To avoid scrolling through workspaces really fast, you can use
|
|
||||||
// the cooldown-ms property. The bind will be rate-limited to this value.
|
|
||||||
// You can set a cooldown on any bind, but it's most useful for the wheel.
|
|
||||||
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
|
|
||||||
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
|
|
||||||
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
|
|
||||||
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
|
|
||||||
|
|
||||||
Mod+WheelScrollRight { focus-column-right; }
|
|
||||||
Mod+WheelScrollLeft { focus-column-left; }
|
|
||||||
Mod+Ctrl+WheelScrollRight { move-column-right; }
|
|
||||||
Mod+Ctrl+WheelScrollLeft { move-column-left; }
|
|
||||||
|
|
||||||
// Usually scrolling up and down with Shift in applications results in
|
|
||||||
// horizontal scrolling; these binds replicate that.
|
|
||||||
Mod+Shift+WheelScrollDown { focus-column-right; }
|
|
||||||
Mod+Shift+WheelScrollUp { focus-column-left; }
|
|
||||||
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
|
|
||||||
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
|
|
||||||
|
|
||||||
// Similarly, you can bind touchpad scroll "ticks".
|
|
||||||
// Touchpad scrolling is continuous, so for these binds it is split into
|
|
||||||
// discrete intervals.
|
|
||||||
// These binds are also affected by touchpad's natural-scroll, so these
|
|
||||||
// example binds are "inverted", since we have natural-scroll enabled for
|
|
||||||
// touchpads by default.
|
|
||||||
// Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; }
|
|
||||||
// Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; }
|
|
||||||
|
|
||||||
// You can refer to workspaces by index. However, keep in mind that
|
|
||||||
// niri is a dynamic workspace system, so these commands are kind of
|
|
||||||
// "best effort". Trying to refer to a workspace index bigger than
|
|
||||||
// the current workspace count will instead refer to the bottommost
|
|
||||||
// (empty) workspace.
|
|
||||||
//
|
|
||||||
// For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
|
|
||||||
// will all refer to the 3rd workspace.
|
|
||||||
Mod+1 { focus-workspace 1; }
|
|
||||||
Mod+2 { focus-workspace 2; }
|
|
||||||
Mod+3 { focus-workspace 3; }
|
|
||||||
Mod+4 { focus-workspace 4; }
|
|
||||||
Mod+5 { focus-workspace 5; }
|
|
||||||
Mod+6 { focus-workspace 6; }
|
|
||||||
Mod+7 { focus-workspace 7; }
|
|
||||||
Mod+8 { focus-workspace 8; }
|
|
||||||
Mod+9 { focus-workspace 9; }
|
|
||||||
Mod+Ctrl+1 { move-column-to-workspace 1; }
|
|
||||||
Mod+Ctrl+2 { move-column-to-workspace 2; }
|
|
||||||
Mod+Ctrl+3 { move-column-to-workspace 3; }
|
|
||||||
Mod+Ctrl+4 { move-column-to-workspace 4; }
|
|
||||||
Mod+Ctrl+5 { move-column-to-workspace 5; }
|
|
||||||
Mod+Ctrl+6 { move-column-to-workspace 6; }
|
|
||||||
Mod+Ctrl+7 { move-column-to-workspace 7; }
|
|
||||||
Mod+Ctrl+8 { move-column-to-workspace 8; }
|
|
||||||
Mod+Ctrl+9 { move-column-to-workspace 9; }
|
|
||||||
|
|
||||||
// Alternatively, there are commands to move just a single window:
|
|
||||||
// Mod+Ctrl+1 { move-window-to-workspace 1; }
|
|
||||||
|
|
||||||
// Switches focus between the current and the previous workspace.
|
|
||||||
// Mod+Tab { focus-workspace-previous; }
|
|
||||||
|
|
||||||
// The following binds move the focused window in and out of a column.
|
|
||||||
// If the window is alone, they will consume it into the nearby column to the side.
|
|
||||||
// If the window is already in a column, they will expel it out.
|
|
||||||
Mod+Ctrl+Y { consume-or-expel-window-left; }
|
|
||||||
Mod+Ctrl+O { consume-or-expel-window-right; }
|
|
||||||
|
|
||||||
// Consume one window from the right to the bottom of the focused column.
|
|
||||||
Mod+Comma { consume-window-into-column; }
|
|
||||||
// Expel the bottom window from the focused column to the right.
|
|
||||||
Mod+Period { expel-window-from-column; }
|
|
||||||
|
|
||||||
Mod+R { switch-preset-column-width; }
|
|
||||||
// Cycling through the presets in reverse order is also possible.
|
|
||||||
// Mod+R { switch-preset-column-width-back; }
|
|
||||||
Mod+Shift+R { switch-preset-window-height; }
|
|
||||||
Mod+Ctrl+R { reset-window-height; }
|
|
||||||
Mod+F { maximize-column; }
|
|
||||||
Mod+Shift+F { fullscreen-window; }
|
|
||||||
|
|
||||||
// Expand the focused column to space not taken up by other fully visible columns.
|
|
||||||
// Makes the column "fill the rest of the space".
|
|
||||||
Mod+Ctrl+F { expand-column-to-available-width; }
|
|
||||||
|
|
||||||
Mod+C { center-column; }
|
|
||||||
|
|
||||||
// Center all fully visible columns on screen.
|
|
||||||
Mod+Ctrl+C { center-visible-columns; }
|
|
||||||
|
|
||||||
// Finer width adjustments.
|
|
||||||
// This command can also:
|
|
||||||
// * set width in pixels: "1000"
|
|
||||||
// * adjust width in pixels: "-5" or "+5"
|
|
||||||
// * set width as a percentage of screen width: "25%"
|
|
||||||
// * adjust width as a percentage of screen width: "-10%" or "+10%"
|
|
||||||
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
|
|
||||||
// set-column-width "100" will make the column occupy 200 physical screen pixels.
|
|
||||||
Mod+Minus { set-column-width "-10%"; }
|
|
||||||
Mod+Equal { set-column-width "+10%"; }
|
|
||||||
|
|
||||||
// Finer height adjustments when in column with other windows.
|
|
||||||
Mod+Shift+Minus { set-window-height "-10%"; }
|
|
||||||
Mod+Shift+Equal { set-window-height "+10%"; }
|
|
||||||
|
|
||||||
// Move the focused window between the floating and the tiling layout.
|
|
||||||
Mod+V { toggle-window-floating; }
|
|
||||||
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
|
|
||||||
|
|
||||||
// Toggle tabbed column display mode.
|
|
||||||
// Windows in this column will appear as vertical tabs,
|
|
||||||
// rather than stacked on top of each other.
|
|
||||||
Mod+W { toggle-column-tabbed-display; }
|
|
||||||
|
|
||||||
// Actions to switch layouts.
|
|
||||||
// Note: if you uncomment these, make sure you do NOT have
|
|
||||||
// a matching layout switch hotkey configured in xkb options above.
|
|
||||||
// Having both at once on the same hotkey will break the switching,
|
|
||||||
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
|
|
||||||
// Mod+Space { switch-layout "next"; }
|
|
||||||
// Mod+Shift+Space { switch-layout "prev"; }
|
|
||||||
|
|
||||||
Print { screenshot; }
|
|
||||||
Ctrl+Print { screenshot-screen; }
|
|
||||||
Alt+Print { screenshot-window; }
|
|
||||||
|
|
||||||
// Applications such as remote-desktop clients and software KVM switches may
|
|
||||||
// request that niri stops processing the keyboard shortcuts defined here
|
|
||||||
// so they may, for example, forward the key presses as-is to a remote machine.
|
|
||||||
// It's a good idea to bind an escape hatch to toggle the inhibitor,
|
|
||||||
// so a buggy application can't hold your session hostage.
|
|
||||||
//
|
|
||||||
// The allow-inhibiting=false property can be applied to other binds as well,
|
|
||||||
// which ensures niri always processes them, even when an inhibitor is active.
|
|
||||||
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
|
|
||||||
|
|
||||||
// The quit action will show a confirmation dialog to avoid accidental exits.
|
|
||||||
Mod+Shift+E { quit; }
|
|
||||||
Ctrl+Alt+Delete { quit; }
|
|
||||||
|
|
||||||
// Powers off the monitors. To turn them back on, do any input like
|
|
||||||
// moving the mouse or pressing any other key.
|
|
||||||
Mod+Shift+P { power-off-monitors; }
|
|
||||||
}
|
|
||||||
16
.config/noctalia/colors.json
Normal file
16
.config/noctalia/colors.json
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"mError": "#ff4c4c",
|
||||||
|
"mOnError": "#ffffff",
|
||||||
|
"mOnPrimary": "#000000",
|
||||||
|
"mOnSecondary": "#ffffff",
|
||||||
|
"mOnSurface": "#ffffff",
|
||||||
|
"mOnSurfaceVariant": "#ffffff",
|
||||||
|
"mOnTertiary": "#ffffff",
|
||||||
|
"mOutline": "#4c4c4c",
|
||||||
|
"mPrimary": "#7fccff",
|
||||||
|
"mSecondary": "#4c4c4c",
|
||||||
|
"mShadow": "#000000",
|
||||||
|
"mSurface": "#191919",
|
||||||
|
"mSurfaceVariant": "#191919",
|
||||||
|
"mTertiary": "#2c2c2c"
|
||||||
|
}
|
||||||
225
.config/noctalia/settings.json
Normal file
225
.config/noctalia/settings.json
Normal file
|
|
@ -0,0 +1,225 @@
|
||||||
|
{
|
||||||
|
"appLauncher": {
|
||||||
|
"backgroundOpacity": 1,
|
||||||
|
"enableClipboardHistory": true,
|
||||||
|
"pinnedExecs": [
|
||||||
|
],
|
||||||
|
"position": "center",
|
||||||
|
"sortByMostUsed": true,
|
||||||
|
"useApp2Unit": false
|
||||||
|
},
|
||||||
|
"audio": {
|
||||||
|
"cavaFrameRate": 30,
|
||||||
|
"mprisBlacklist": [
|
||||||
|
],
|
||||||
|
"preferredPlayer": "",
|
||||||
|
"visualizerType": "linear",
|
||||||
|
"volumeStep": 5
|
||||||
|
},
|
||||||
|
"bar": {
|
||||||
|
"backgroundOpacity": 1,
|
||||||
|
"density": "default",
|
||||||
|
"floating": false,
|
||||||
|
"marginHorizontal": 0.25,
|
||||||
|
"marginVertical": 0.25,
|
||||||
|
"monitors": [
|
||||||
|
"eDP-1",
|
||||||
|
"HDMI-A-1"
|
||||||
|
],
|
||||||
|
"position": "top",
|
||||||
|
"showCapsule": false,
|
||||||
|
"widgets": {
|
||||||
|
"center": [
|
||||||
|
{
|
||||||
|
"hideWhenZero": true,
|
||||||
|
"id": "NotificationHistory",
|
||||||
|
"showUnreadBadge": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"formatHorizontal": "HH:mm ddd, MMM dd",
|
||||||
|
"formatVertical": "HH mm - dd MM",
|
||||||
|
"id": "Clock",
|
||||||
|
"useMonospacedFont": true,
|
||||||
|
"usePrimaryColor": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"left": [
|
||||||
|
{
|
||||||
|
"hideUnoccupied": false,
|
||||||
|
"id": "Workspace",
|
||||||
|
"labelMode": "none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "MediaMini",
|
||||||
|
"showAlbumArt": true,
|
||||||
|
"showVisualizer": false,
|
||||||
|
"visualizerType": "linear"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ActiveWindow",
|
||||||
|
"showIcon": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"right": [
|
||||||
|
{
|
||||||
|
"id": "ScreenRecorderIndicator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Tray"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "WiFi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Bluetooth"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"displayMode": "onhover",
|
||||||
|
"id": "Battery",
|
||||||
|
"warningThreshold": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"displayMode": "onhover",
|
||||||
|
"id": "Volume"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"displayMode": "onhover",
|
||||||
|
"id": "Brightness"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "NightLight"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "noctalia",
|
||||||
|
"id": "SidePanelToggle",
|
||||||
|
"useDistroLogo": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"brightness": {
|
||||||
|
"brightnessStep": 1
|
||||||
|
},
|
||||||
|
"colorSchemes": {
|
||||||
|
"darkMode": true,
|
||||||
|
"predefinedScheme": "Niri",
|
||||||
|
"useWallpaperColors": false
|
||||||
|
},
|
||||||
|
"dock": {
|
||||||
|
"autoHide": false,
|
||||||
|
"backgroundOpacity": 1,
|
||||||
|
"exclusive": true,
|
||||||
|
"floatingRatio": 1,
|
||||||
|
"monitors": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"general": {
|
||||||
|
"animationSpeed": 1,
|
||||||
|
"avatarImage": "/home/never/.face",
|
||||||
|
"dimDesktop": false,
|
||||||
|
"forceBlackScreenCorners": false,
|
||||||
|
"radiusRatio": 0,
|
||||||
|
"screenRadiusRatio": 1,
|
||||||
|
"showScreenCorners": false
|
||||||
|
},
|
||||||
|
"hooks": {
|
||||||
|
"darkModeChange": "",
|
||||||
|
"enabled": false,
|
||||||
|
"wallpaperChange": ""
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"name": "Würzburg",
|
||||||
|
"showWeekNumberInCalendar": false,
|
||||||
|
"use12hourFormat": false,
|
||||||
|
"useFahrenheit": false
|
||||||
|
},
|
||||||
|
"matugen": {
|
||||||
|
"enableUserTemplates": false,
|
||||||
|
"foot": false,
|
||||||
|
"fuzzel": false,
|
||||||
|
"ghostty": false,
|
||||||
|
"gtk3": false,
|
||||||
|
"gtk4": false,
|
||||||
|
"kitty": false,
|
||||||
|
"pywalfox": false,
|
||||||
|
"qt5": false,
|
||||||
|
"qt6": false,
|
||||||
|
"vesktop": false
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
"bluetoothEnabled": true,
|
||||||
|
"wifiEnabled": true
|
||||||
|
},
|
||||||
|
"nightLight": {
|
||||||
|
"autoSchedule": true,
|
||||||
|
"dayTemp": "6500",
|
||||||
|
"enabled": true,
|
||||||
|
"forced": false,
|
||||||
|
"manualSunrise": "06:30",
|
||||||
|
"manualSunset": "18:30",
|
||||||
|
"nightTemp": "4000"
|
||||||
|
},
|
||||||
|
"notifications": {
|
||||||
|
"criticalUrgencyDuration": 15,
|
||||||
|
"doNotDisturb": true,
|
||||||
|
"lastSeenTs": 1759063307000,
|
||||||
|
"lowUrgencyDuration": 3,
|
||||||
|
"monitors": [
|
||||||
|
"eDP-1"
|
||||||
|
],
|
||||||
|
"normalUrgencyDuration": 8
|
||||||
|
},
|
||||||
|
"screenRecorder": {
|
||||||
|
"audioCodec": "opus",
|
||||||
|
"audioSource": "default_output",
|
||||||
|
"colorRange": "limited",
|
||||||
|
"directory": "~/Videos",
|
||||||
|
"frameRate": 60,
|
||||||
|
"quality": "very_high",
|
||||||
|
"showCursor": true,
|
||||||
|
"videoCodec": "h264",
|
||||||
|
"videoSource": "portal"
|
||||||
|
},
|
||||||
|
"settingsVersion": 1,
|
||||||
|
"ui": {
|
||||||
|
"fontBillboard": "Inter Display",
|
||||||
|
"fontDefault": "Adwaita Sans",
|
||||||
|
"fontFixed": "Adwaita Mono",
|
||||||
|
"idleInhibitorEnabled": false,
|
||||||
|
"monitorsScaling": [
|
||||||
|
{
|
||||||
|
"name": "eDP-1",
|
||||||
|
"scale": 0.7999999999999999
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "HDMI-A-1",
|
||||||
|
"scale": 0.7999999999999999
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"wallpaper": {
|
||||||
|
"directory": "/home/never/.local/share/wallpapers/",
|
||||||
|
"enableMultiMonitorDirectories": true,
|
||||||
|
"enabled": true,
|
||||||
|
"fillColor": "#000000",
|
||||||
|
"fillMode": "crop",
|
||||||
|
"monitors": [
|
||||||
|
{
|
||||||
|
"directory": "/home/never/.local/share/wallpapers/",
|
||||||
|
"name": "eDP-1",
|
||||||
|
"wallpaper": "/home/never/.local/share/wallpapers//scarlet-tree-dark.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"directory": "/home/never/.local/share/wallpapers/",
|
||||||
|
"name": "HDMI-A-1",
|
||||||
|
"wallpaper": "/home/never/.local/share/wallpapers//scarlet-tree-dark.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"randomEnabled": false,
|
||||||
|
"randomIntervalSec": 300,
|
||||||
|
"setWallpaperOnAllMonitors": true,
|
||||||
|
"transitionDuration": 1500,
|
||||||
|
"transitionEdgeSmoothness": 0.05,
|
||||||
|
"transitionType": "random"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
.config/nvim
Submodule
1
.config/nvim
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 75457315b297fd854da4c58be924588013414477
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
require("gruvbox").load()
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
vim.treesitter.start()
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
vim.treesitter.start()
|
|
||||||
|
|
||||||
vim.opt.spelllang = "de"
|
|
||||||
vim.opt.spell = true
|
|
||||||
|
|
||||||
-- vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
|
||||||
-- vim.wo[0][0].foldmethod = 'expr'
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>tb', ':LspTexlabBuild<CR>',
|
|
||||||
{ desc = 'Build using LuaLaTeX'})
|
|
||||||
vim.keymap.set('n', '<leader>ts', ':LspTexlabForward<CR>',
|
|
||||||
{ desc = 'Forward search'})
|
|
||||||
vim.keymap.set('n', '<leader>tc', ':LspTexlabCancelBuild<CR>',
|
|
||||||
{ desc = 'Cancel build'})
|
|
||||||
vim.keymap.set('n', '<leader>tdr', ':LspTexlabCleanArtifacts<CR>',
|
|
||||||
{ desc = 'Clean artifacts'})
|
|
||||||
vim.keymap.set('n', '<leader>tdx', ':LspTexlabCleanAuxiliary<CR>',
|
|
||||||
{ desc = 'Clean auxiliary'})
|
|
||||||
vim.keymap.set('n', '<leader>tes', ':LspTexlabFindEnvironments<CR>',
|
|
||||||
{ desc = 'Find environments'})
|
|
||||||
vim.keymap.set('n', '<leader>tec', ':LspTexlabChangeEnvironment<CR>',
|
|
||||||
{ desc = 'Change environment'})
|
|
||||||
|
|
@ -1,343 +0,0 @@
|
||||||
-- Set <space> as the leader key
|
|
||||||
-- See `:help mapleader`
|
|
||||||
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
vim.o.guifont = "Adwaita Mono:h12"
|
|
||||||
|
|
||||||
-- Disable mouse input
|
|
||||||
vim.o.mouse = ""
|
|
||||||
|
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
|
||||||
vim.o.scrolloff = 10
|
|
||||||
|
|
||||||
-- Highlight the line where the cursor is on
|
|
||||||
vim.o.cursorline = true
|
|
||||||
|
|
||||||
-- Column at 80 characters
|
|
||||||
vim.o.colorcolumn = "80"
|
|
||||||
|
|
||||||
-- Set default tabstop and shiftwidth
|
|
||||||
vim.o.tabstop = 4
|
|
||||||
vim.o.shiftwidth = 4
|
|
||||||
vim.o.expandtab = false
|
|
||||||
|
|
||||||
-- Show <tab> and trailing spaces
|
|
||||||
vim.o.list = true
|
|
||||||
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
|
||||||
|
|
||||||
-- Configure line wrap
|
|
||||||
vim.o.linebreak = true
|
|
||||||
vim.o.breakindent = true
|
|
||||||
vim.o.showbreak = "↪ "
|
|
||||||
|
|
||||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
|
||||||
vim.o.ignorecase = true
|
|
||||||
vim.o.smartcase = true
|
|
||||||
|
|
||||||
-- Use undofile to preserve actions over restarts
|
|
||||||
vim.o.undofile = true
|
|
||||||
|
|
||||||
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
|
||||||
-- instead raise a dialog asking if you wish to save the current file(s) See `:help 'confirm'`
|
|
||||||
vim.o.confirm = true
|
|
||||||
|
|
||||||
-- local toggle_background = function (obj)
|
|
||||||
-- print(string.find(obj.stdout, "prefer-light"))
|
|
||||||
-- if string.find(obj.stdout, "prefer-light") then
|
|
||||||
-- print('light')
|
|
||||||
-- else
|
|
||||||
-- print('dark')
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- vim.o.background = 'light'
|
|
||||||
-- vim.system({"dconf", "read", "/org/gnome/desktop/interface/color-scheme"}, toggle_background)
|
|
||||||
|
|
||||||
vim.cmd.colorscheme("gruvbox")
|
|
||||||
|
|
||||||
-- [[ Set up keymaps ]] See `:h vim.keymap.set()`, `:h mapping`, `:h keycodes`
|
|
||||||
|
|
||||||
-- Use <Esc> to exit terminal mode
|
|
||||||
vim.keymap.set("t", "<A-Esc>", "<C-\\><C-n>")
|
|
||||||
|
|
||||||
-- Map <A-j>, <A-k>, <A-h>, <A-l> to navigate between windows in any modes
|
|
||||||
vim.keymap.set({ "t", "i" }, "<A-h>", "<C-\\><C-n><C-w>h")
|
|
||||||
vim.keymap.set({ "t", "i" }, "<A-j>", "<C-\\><C-n><C-w>j")
|
|
||||||
vim.keymap.set({ "t", "i" }, "<A-k>", "<C-\\><C-n><C-w>k")
|
|
||||||
vim.keymap.set({ "t", "i" }, "<A-l>", "<C-\\><C-n><C-w>l")
|
|
||||||
vim.keymap.set({ "n" }, "<A-h>", "<C-w>h")
|
|
||||||
vim.keymap.set({ "n" }, "<A-j>", "<C-w>j")
|
|
||||||
vim.keymap.set({ "n" }, "<A-k>", "<C-w>k")
|
|
||||||
vim.keymap.set({ "n" }, "<A-l>", "<C-w>l")
|
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]].
|
|
||||||
-- See `:h lua-guide-autocommands`, `:h autocmd`, `:h nvim_create_autocmd()`
|
|
||||||
-- Highlight when yanking (copying) text.
|
|
||||||
-- Try it with `yap` in normal mode. See `:h vim.hl.on_yank()`
|
|
||||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
|
||||||
desc = "Highlight when yanking (copying) text",
|
|
||||||
callback = function()
|
|
||||||
vim.hl.on_yank()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Sync clipboard between OS and Neovim. Schedule the setting after `UiEnter` because it can
|
|
||||||
-- increase startup-time. Remove this option if you want your OS clipboard to remain independent.
|
|
||||||
-- See `:help 'clipboard'`
|
|
||||||
vim.api.nvim_create_autocmd("UIEnter", {
|
|
||||||
callback = function()
|
|
||||||
vim.o.clipboard = "unnamedplus"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Print the line number in front of each line
|
|
||||||
vim.o.number = true
|
|
||||||
vim.o.relativenumber = true
|
|
||||||
|
|
||||||
-- [[ Create user commands ]]
|
|
||||||
-- See `:h nvim_create_user_command()` and `:h user-commands`
|
|
||||||
|
|
||||||
-- Create a command `:GitBlameLine` that print the git blame for the current line
|
|
||||||
vim.api.nvim_create_user_command("GitBlameLine", function()
|
|
||||||
local line_number = vim.fn.line(".") -- Get the current line number. See `:h line()`
|
|
||||||
local filename = vim.api.nvim_buf_get_name(0)
|
|
||||||
print(vim.fn.system({ "git", "blame", "-L", line_number .. ",+1", filename }))
|
|
||||||
end, { desc = "Print the git blame for the current line" })
|
|
||||||
|
|
||||||
-- [[ Add optional packages ]]
|
|
||||||
-- Nvim comes bundled with a set of packages that are not enabled by
|
|
||||||
-- default. You can enable any of them by using the `:packadd` command.
|
|
||||||
|
|
||||||
-- For example, to add the "nohlsearch" package to automatically turn off search highlighting after
|
|
||||||
-- 'updatetime' and when going to insert mode
|
|
||||||
vim.cmd("packadd! nohlsearch")
|
|
||||||
|
|
||||||
-- [[ Language Setup ]]
|
|
||||||
|
|
||||||
-- Treat Ipe stylesheets as xml code
|
|
||||||
vim.filetype.add({
|
|
||||||
extension = {
|
|
||||||
isy = "xml",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Install nvim-treesitter
|
|
||||||
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
|
|
||||||
require("nvim-treesitter").install({ 'fish', 'java', 'latex', 'make', 'python' })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = { '<filetype>' },
|
|
||||||
callback = function()
|
|
||||||
vim.treesitter.start()
|
|
||||||
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
|
||||||
vim.wo[0][0].foldmethod = 'expr'
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.pack.add({ "https://github.com/mason-org/mason.nvim" })
|
|
||||||
require("mason").setup()
|
|
||||||
|
|
||||||
vim.lsp.enable({ 'lua_ls', 'texlab', 'clangd', 'jdtls', 'fish_lsp', 'html', 'cssls', 'lemminx', 'pyright' })
|
|
||||||
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>lf', vim.lsp.buf.format,
|
|
||||||
{ desc = 'Formats a buffer using the attached language server clients' })
|
|
||||||
vim.keymap.set('n', '<leader>lh', vim.lsp.buf.hover,
|
|
||||||
{ desc = 'Displays hover information about the symbol' })
|
|
||||||
vim.keymap.set('n', '<leader>lr', vim.lsp.buf.rename,
|
|
||||||
{ desc = 'Renames all references to the symbol' })
|
|
||||||
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition,
|
|
||||||
{ desc = 'Jumps to the definition of the symbol' })
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
signs = {
|
|
||||||
text = {
|
|
||||||
[vim.diagnostic.severity.ERROR] = "W ",
|
|
||||||
[vim.diagnostic.severity.WARN] = "w ",
|
|
||||||
[vim.diagnostic.severity.INFO] = "I ",
|
|
||||||
[vim.diagnostic.severity.HINT] = "H ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
virtual_text = true, -- Show inline diagnostics
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>dn", "]d", { desc = "Jump to next diagnostic" })
|
|
||||||
vim.keymap.set("n", "<leader>dp", "[d", { desc = "Jump to previous diagnostic" })
|
|
||||||
vim.keymap.set("n", "<leader>dN", "]D", { desc = "Jump to last diagnostic" })
|
|
||||||
vim.keymap.set("n", "<leader>dP", "[D", { desc = "Jump to first diagnostic" })
|
|
||||||
vim.keymap.set("n", "<leader>ds", "<C-w>d", { desc = "Display diagnostic on current line" })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = { 'c', 'cpp', 'rust' },
|
|
||||||
callback = function()
|
|
||||||
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap", "https://github.com/theHamsta/nvim-dap-virtual-text" })
|
|
||||||
local dap = require("dap")
|
|
||||||
local dap_widgets = require("dap.ui.widgets")
|
|
||||||
local dap_sidebar_s = dap_widgets.sidebar(dap_widgets.scopes)
|
|
||||||
local dap_sidebar_f = dap_widgets.sidebar(dap_widgets.frames)
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>bb", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
|
||||||
vim.keymap.set("n", "<leader>bc", dap.continue, { desc = "Continue execution" })
|
|
||||||
dap.listeners.on_session["debug"] = function()
|
|
||||||
vim.keymap.set("n", "<leader>bs", dap_sidebar_s.toggle, { desc = "Toggle scopes" })
|
|
||||||
vim.keymap.set("n", "<leader>bf", dap_sidebar_f.toggle, { desc = "Toggle frames" })
|
|
||||||
vim.keymap.set("n", "<leader>br", dap.repl.toggle, { desc = "Toggle REPL" })
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<Left>", dap.step_out, { desc = "Step out" })
|
|
||||||
vim.keymap.set("n", "<Right>", dap.step_into, { desc = "Step into" })
|
|
||||||
vim.keymap.set("n", "<Down>", dap.step_over, { desc = "Step over" })
|
|
||||||
vim.keymap.set("n", "<Up>", dap.restart_frame, { desc = "Restart frame" })
|
|
||||||
end
|
|
||||||
|
|
||||||
dap.adapters.gdb = {
|
|
||||||
type = "executable",
|
|
||||||
command = "gdb",
|
|
||||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.c = {
|
|
||||||
{
|
|
||||||
name = "Launch",
|
|
||||||
type = "gdb",
|
|
||||||
request = "launch",
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
||||||
end,
|
|
||||||
args = {}, -- provide arguments if needed
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
stopAtBeginningOfMainSubprogram = false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = "Select and attach to process",
|
|
||||||
type = "gdb",
|
|
||||||
request = "attach",
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
||||||
end,
|
|
||||||
pid = function()
|
|
||||||
local name = vim.fn.input('Executable name (filter): ')
|
|
||||||
return require("dap.utils").pick_process({ filter = name })
|
|
||||||
end,
|
|
||||||
cwd = '${workspaceFolder}'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'Attach to gdbserver :1234',
|
|
||||||
type = 'gdb',
|
|
||||||
request = 'attach',
|
|
||||||
target = 'localhost:1234',
|
|
||||||
program = function()
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
||||||
end,
|
|
||||||
cwd = '${workspaceFolder}'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.cpp = dap.configurations.c
|
|
||||||
dap.configurations.rust = dap.configurations.c
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
--
|
|
||||||
-- [[ UI Configuration ]]
|
|
||||||
vim.pack.add({ "https://github.com/nvim-mini/mini.nvim" })
|
|
||||||
|
|
||||||
vim.o.winborder = "none"
|
|
||||||
|
|
||||||
-- Use mini.completion
|
|
||||||
require("mini.completion").setup()
|
|
||||||
|
|
||||||
local imap_expr = function(lhs, rhs)
|
|
||||||
vim.keymap.set('i', lhs, rhs, { expr = true })
|
|
||||||
end
|
|
||||||
imap_expr('<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]])
|
|
||||||
imap_expr('<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]])
|
|
||||||
|
|
||||||
-- Snippet integration for mini.completion
|
|
||||||
-- require("mini.snippets").setup()
|
|
||||||
|
|
||||||
-- Icons for statusline and completion
|
|
||||||
require("mini.icons").setup()
|
|
||||||
|
|
||||||
-- Use mini.statusline instead of native showmode
|
|
||||||
require("mini.statusline").setup()
|
|
||||||
vim.o.showmode = false
|
|
||||||
|
|
||||||
-- Git integration for statusline and Command mode
|
|
||||||
require("mini.git").setup()
|
|
||||||
|
|
||||||
-- Show git diff in linenumbers
|
|
||||||
require("mini.diff").setup()
|
|
||||||
|
|
||||||
-- Use mini.notify
|
|
||||||
-- require("mini.notify").setup()
|
|
||||||
|
|
||||||
-- Use and configure mini.clue
|
|
||||||
local clue = require("mini.clue")
|
|
||||||
clue.setup({
|
|
||||||
triggers = {
|
|
||||||
-- Leader triggers
|
|
||||||
{ mode = { "n", "x" }, keys = "<Leader>" },
|
|
||||||
|
|
||||||
-- `[` and `]` keys
|
|
||||||
{ mode = "n", keys = "[" },
|
|
||||||
{ mode = "n", keys = "]" },
|
|
||||||
|
|
||||||
-- Built-in completion
|
|
||||||
{ mode = "i", keys = "<C-x>" },
|
|
||||||
|
|
||||||
-- `g` key
|
|
||||||
{ mode = { "n", "x" }, keys = "g" },
|
|
||||||
|
|
||||||
-- Marks
|
|
||||||
{ mode = { "n", "x" }, keys = "'" },
|
|
||||||
{ mode = { "n", "x" }, keys = "`" },
|
|
||||||
|
|
||||||
-- Registers
|
|
||||||
{ mode = { "n", "x" }, keys = '"' },
|
|
||||||
{ mode = { "i", "c" }, keys = "<C-r>" },
|
|
||||||
|
|
||||||
-- Window commands
|
|
||||||
{ mode = "n", keys = "<C-w>" },
|
|
||||||
|
|
||||||
-- `z` key
|
|
||||||
{ mode = { "n", "x" }, keys = "z" },
|
|
||||||
|
|
||||||
-- `i/a` key
|
|
||||||
{ mode = { "n", "x" }, keys = "i" },
|
|
||||||
},
|
|
||||||
|
|
||||||
clues = {
|
|
||||||
-- Enhance this by adding descriptions for <Leader> mapping groups
|
|
||||||
clue.gen_clues.square_brackets(),
|
|
||||||
clue.gen_clues.builtin_completion(),
|
|
||||||
clue.gen_clues.g(),
|
|
||||||
clue.gen_clues.marks(),
|
|
||||||
clue.gen_clues.registers(),
|
|
||||||
clue.gen_clues.windows(),
|
|
||||||
clue.gen_clues.z(),
|
|
||||||
},
|
|
||||||
|
|
||||||
window = {
|
|
||||||
delay = 200,
|
|
||||||
config = {
|
|
||||||
width = 'auto',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- Use and configure mini.hipatterns
|
|
||||||
-- local hipatterns = require('mini.hipatterns')
|
|
||||||
-- hipatterns.setup({
|
|
||||||
-- highlighters = {
|
|
||||||
-- -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
|
||||||
-- fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
|
|
||||||
-- hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' },
|
|
||||||
-- todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
|
|
||||||
-- note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' },
|
|
||||||
--
|
|
||||||
-- -- Highlight hex color strings (`#rrggbb`) using that color
|
|
||||||
-- hex_color = hipatterns.gen_highlighter.hex_color(),
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/AdaCore/ada_language_server
|
|
||||||
---
|
|
||||||
--- Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install).
|
|
||||||
---
|
|
||||||
--- Workspace-specific [settings](https://github.com/AdaCore/ada_language_server/blob/master/doc/settings.md) such as `projectFile` can be provided in a `.als.json` file at the root of the workspace.
|
|
||||||
--- Alternatively, configuration may be passed as a "settings" object to `vim.lsp.config('ada_ls', {})`:
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.lsp.config('ada_ls', {
|
|
||||||
--- settings = {
|
|
||||||
--- ada = {
|
|
||||||
--- projectFile = "project.gpr";
|
|
||||||
--- scenarioVariables = { ... };
|
|
||||||
--- }
|
|
||||||
--- }
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'ada_language_server' },
|
|
||||||
filetypes = { 'ada' },
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
|
||||||
on_dir(util.root_pattern('Makefile', '.git', 'alire.toml', '*.gpr', '*.adc')(fname))
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/agda/agda-language-server
|
|
||||||
---
|
|
||||||
--- Language Server for Agda.
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'als' },
|
|
||||||
filetypes = { 'agda' },
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
|
||||||
on_dir(util.root_pattern('.git', '*.agda-lib')(fname))
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/aiken-lang/aiken
|
|
||||||
---
|
|
||||||
--- A language server for Aiken Programming Language.
|
|
||||||
--- [Installation](https://aiken-lang.org/installation-instructions)
|
|
||||||
---
|
|
||||||
--- It can be i
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'aiken', 'lsp' },
|
|
||||||
filetypes = { 'aiken' },
|
|
||||||
root_markers = { 'aiken.toml', '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/posit-dev/air
|
|
||||||
---
|
|
||||||
--- Air is an R formatter and language server, written in Rust.
|
|
||||||
---
|
|
||||||
--- Refer to the [documentation](https://posit-dev.github.io/air/editors.html) for more details.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'air', 'language-server' },
|
|
||||||
filetypes = { 'r' },
|
|
||||||
root_markers = { 'air.toml', '.air.toml', '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/AlloyTools/org.alloytools.alloy
|
|
||||||
---
|
|
||||||
--- Alloy is a formal specification language for describing structures and a tool for exploring them.
|
|
||||||
---
|
|
||||||
--- You may also need to configure the filetype for Alloy (*.als) files:
|
|
||||||
---
|
|
||||||
--- ```
|
|
||||||
--- autocmd BufNewFile,BufRead *.als set filetype=alloy
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- or
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.filetype.add({
|
|
||||||
--- pattern = {
|
|
||||||
--- ['.*/*.als'] = 'alloy',
|
|
||||||
--- },
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Alternatively, you may use a syntax plugin like https://github.com/runoshun/vim-alloy.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'alloy', 'lsp' },
|
|
||||||
filetypes = { 'alloy' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://pypi.org/project/anakin-language-server/
|
|
||||||
---
|
|
||||||
--- `anakin-language-server` is yet another Jedi Python language server.
|
|
||||||
---
|
|
||||||
--- Available options:
|
|
||||||
---
|
|
||||||
--- * Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option
|
|
||||||
--- * Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'anakinls' },
|
|
||||||
filetypes = { 'python' },
|
|
||||||
root_markers = {
|
|
||||||
'pyproject.toml',
|
|
||||||
'setup.py',
|
|
||||||
'setup.cfg',
|
|
||||||
'requirements.txt',
|
|
||||||
'Pipfile',
|
|
||||||
'.git',
|
|
||||||
},
|
|
||||||
settings = {
|
|
||||||
anakinls = {
|
|
||||||
pyflakes_errors = {
|
|
||||||
-- Full list: https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py
|
|
||||||
|
|
||||||
'ImportStarNotPermitted',
|
|
||||||
|
|
||||||
'UndefinedExport',
|
|
||||||
'UndefinedLocal',
|
|
||||||
'UndefinedName',
|
|
||||||
|
|
||||||
'DuplicateArgument',
|
|
||||||
'MultiValueRepeatedKeyLiteral',
|
|
||||||
'MultiValueRepeatedKeyVariable',
|
|
||||||
|
|
||||||
'FutureFeatureNotDefined',
|
|
||||||
'LateFutureImport',
|
|
||||||
|
|
||||||
'ReturnOutsideFunction',
|
|
||||||
'YieldOutsideFunction',
|
|
||||||
'ContinueOutsideLoop',
|
|
||||||
'BreakOutsideLoop',
|
|
||||||
|
|
||||||
'TwoStarredExpressions',
|
|
||||||
'TooManyExpressionsInStarredAssignment',
|
|
||||||
|
|
||||||
'ForwardAnnotationSyntaxError',
|
|
||||||
'RaiseNotImplemented',
|
|
||||||
|
|
||||||
'StringDotFormatExtraPositionalArguments',
|
|
||||||
'StringDotFormatExtraNamedArguments',
|
|
||||||
'StringDotFormatMissingArgument',
|
|
||||||
'StringDotFormatMixingAutomatic',
|
|
||||||
'StringDotFormatInvalidFormat',
|
|
||||||
|
|
||||||
'PercentFormatInvalidFormat',
|
|
||||||
'PercentFormatMixedPositionalAndNamed',
|
|
||||||
'PercentFormatUnsupportedFormat',
|
|
||||||
'PercentFormatPositionalCountMismatch',
|
|
||||||
'PercentFormatExtraNamedArguments',
|
|
||||||
'PercentFormatMissingArgument',
|
|
||||||
'PercentFormatExpectedMapping',
|
|
||||||
'PercentFormatExpectedSequence',
|
|
||||||
'PercentFormatStarRequiresSequence',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/angular/vscode-ng-language-service
|
|
||||||
--- `angular-language-server` can be installed via npm `npm install -g @angular/language-server`.
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- local project_library_path = "/path/to/project/lib"
|
|
||||||
--- local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path}
|
|
||||||
---
|
|
||||||
--- vim.lsp.config('angularls', {
|
|
||||||
--- cmd = cmd,
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
-- Angular requires a node_modules directory to probe for @angular/language-service and typescript
|
|
||||||
-- in order to use your projects configured versions.
|
|
||||||
local fs, fn, uv = vim.fs, vim.fn, vim.uv
|
|
||||||
|
|
||||||
--- Recursively solve for the original ngserver path on Windows
|
|
||||||
-- For a given ngserver path:
|
|
||||||
-- - If it is not a CMD wrapper, return the path;
|
|
||||||
-- - Or else, extract the path from the CMD wrapper.
|
|
||||||
--
|
|
||||||
-- @param cmd_path (string) path for the ngserver executable or its CMD wrapper.
|
|
||||||
-- @return (string) the original executable path for ngserver
|
|
||||||
-- @usage
|
|
||||||
-- -- Base case: cmd_path already points to ngserver (expected behavior on Linux)
|
|
||||||
-- resolve_cmd_shim('/home/user/project/node_modules/@angular/language-server/bin/ngserver')
|
|
||||||
-- => '/home/user/project/node_modules/@angular/language-server/bin/ngserver'
|
|
||||||
--
|
|
||||||
-- -- Recursive case: cmd_path points to a CMD wrapper (Windows)
|
|
||||||
-- resolve_cmd_shim('C:/Users/user/project/node_modules/.bin/ngserver.cmd')
|
|
||||||
-- => 'C:/Users/user/project/node_modules/@angular/language-server/bin/ngserver'
|
|
||||||
local function resolve_cmd_shim(cmd_path)
|
|
||||||
if not cmd_path:lower():match('%ngserver.cmd$') then
|
|
||||||
return cmd_path
|
|
||||||
end
|
|
||||||
|
|
||||||
local ok, content = pcall(fn.readblob, cmd_path)
|
|
||||||
if not ok or not content then
|
|
||||||
return cmd_path
|
|
||||||
end
|
|
||||||
|
|
||||||
local target = content:match('%s%"%%dp0%%\\([^\r\n]-ngserver[^\r\n]-)%"')
|
|
||||||
if not target then
|
|
||||||
return cmd_path
|
|
||||||
end
|
|
||||||
|
|
||||||
local full = fs.normalize(fs.joinpath(fs.dirname(cmd_path), target))
|
|
||||||
|
|
||||||
return resolve_cmd_shim(full)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function collect_node_modules(root_dir)
|
|
||||||
local results = {}
|
|
||||||
|
|
||||||
local project_node = fs.joinpath(root_dir, 'node_modules')
|
|
||||||
if uv.fs_stat(project_node) then
|
|
||||||
table.insert(results, project_node)
|
|
||||||
end
|
|
||||||
|
|
||||||
local ngserver_exe = fn.exepath('ngserver')
|
|
||||||
if ngserver_exe and #ngserver_exe > 0 then
|
|
||||||
local realpath = uv.fs_realpath(ngserver_exe) or ngserver_exe
|
|
||||||
realpath = resolve_cmd_shim(realpath)
|
|
||||||
local candidate = fs.normalize(fs.joinpath(fs.dirname(realpath), '../../..'))
|
|
||||||
if uv.fs_stat(candidate) then
|
|
||||||
table.insert(results, candidate)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return results
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_angular_core_version(root_dir)
|
|
||||||
local package_json = fs.joinpath(root_dir, 'package.json')
|
|
||||||
if not uv.fs_stat(package_json) then
|
|
||||||
return ''
|
|
||||||
end
|
|
||||||
|
|
||||||
local ok, content = pcall(fn.readblob, package_json)
|
|
||||||
if not ok or not content then
|
|
||||||
return ''
|
|
||||||
end
|
|
||||||
|
|
||||||
local json = vim.json.decode(content) or {}
|
|
||||||
|
|
||||||
local version = (json.dependencies or {})['@angular/core'] or ''
|
|
||||||
return version:match('%d+%.%d+%.%d+') or ''
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = function(dispatchers, config)
|
|
||||||
local root_dir = (config and config.root_dir) or fn.getcwd()
|
|
||||||
local node_paths = collect_node_modules(root_dir)
|
|
||||||
|
|
||||||
local ts_probe = table.concat(node_paths, ',')
|
|
||||||
local ng_probe = table.concat(
|
|
||||||
vim
|
|
||||||
.iter(node_paths)
|
|
||||||
:map(function(p)
|
|
||||||
return fs.joinpath(p, '@angular/language-server/node_modules')
|
|
||||||
end)
|
|
||||||
:totable(),
|
|
||||||
','
|
|
||||||
)
|
|
||||||
local cmd = {
|
|
||||||
'ngserver',
|
|
||||||
'--stdio',
|
|
||||||
'--tsProbeLocations',
|
|
||||||
ts_probe,
|
|
||||||
'--ngProbeLocations',
|
|
||||||
ng_probe,
|
|
||||||
'--angularCoreVersion',
|
|
||||||
get_angular_core_version(root_dir),
|
|
||||||
}
|
|
||||||
return vim.lsp.rpc.start(cmd, dispatchers)
|
|
||||||
end,
|
|
||||||
|
|
||||||
filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx', 'htmlangular' },
|
|
||||||
root_markers = { 'angular.json', 'nx.json' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/ansible/vscode-ansible
|
|
||||||
---
|
|
||||||
--- Language server for the ansible configuration management tool.
|
|
||||||
---
|
|
||||||
--- `ansible-language-server` can be installed via `npm`:
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g @ansible/ansible-language-server
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'ansible-language-server', '--stdio' },
|
|
||||||
settings = {
|
|
||||||
ansible = {
|
|
||||||
python = {
|
|
||||||
interpreterPath = 'python',
|
|
||||||
},
|
|
||||||
ansible = {
|
|
||||||
path = 'ansible',
|
|
||||||
},
|
|
||||||
executionEnvironment = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
validation = {
|
|
||||||
enabled = true,
|
|
||||||
lint = {
|
|
||||||
enabled = true,
|
|
||||||
path = 'ansible-lint',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = { 'yaml.ansible' },
|
|
||||||
root_markers = { 'ansible.cfg', '.ansible-lint' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://www.npmjs.com/package/antlers-language-server
|
|
||||||
---
|
|
||||||
--- `antlersls` can be installed via `npm`:
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g antlers-language-server
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'antlersls', '--stdio' },
|
|
||||||
filetypes = { 'html', 'antlers' },
|
|
||||||
root_markers = { 'composer.json' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
--- @brief
|
|
||||||
---
|
|
||||||
--- https://github.com/forcedotcom/salesforcedx-vscode
|
|
||||||
---
|
|
||||||
--- Language server for Apex.
|
|
||||||
---
|
|
||||||
--- For manual installation, download the JAR file from the [VSCode
|
|
||||||
--- extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex) and adjust the `apex_jar_path` appropriately.
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.lsp.config('apex_ls', {
|
|
||||||
--- apex_jar_path = '/path/to/apex-jorje-lsp.jar',
|
|
||||||
--- apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors
|
|
||||||
--- apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage
|
|
||||||
--- }
|
|
||||||
---```
|
|
||||||
---
|
|
||||||
--- Example configuration using Mason:
|
|
||||||
---
|
|
||||||
---```lua
|
|
||||||
--- vim.lsp.config('apex_ls', {
|
|
||||||
--- apex_jar_path = vim.fn.stdpath('data') .. '/mason/share/apex-language-server/apex-jorje-lsp.jar',
|
|
||||||
--- }
|
|
||||||
---```
|
|
||||||
---
|
|
||||||
--- For a complete experience, you may need to ensure the treesitter parsers for 'apex' are installed (:TSInstall apex) as well as configure the filetype for apex (*.cls) files:
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.filetype.add({
|
|
||||||
--- pattern = {
|
|
||||||
--- ['.*/*.cls'] = 'apex',
|
|
||||||
--- },
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = function(dispatchers, config)
|
|
||||||
---@diagnostic disable: undefined-field
|
|
||||||
local local_cmd = {
|
|
||||||
vim.env.JAVA_HOME and (vim.env.JAVA_HOME .. '/bin/java') or 'java',
|
|
||||||
'-cp',
|
|
||||||
config.apex_jar_path,
|
|
||||||
'-Ddebug.internal.errors=true',
|
|
||||||
'-Ddebug.semantic.errors=' .. tostring(config.apex_enable_semantic_errors or false),
|
|
||||||
'-Ddebug.completion.statistics=' .. tostring(config.apex_enable_completion_statistics or false),
|
|
||||||
'-Dlwc.typegeneration.disabled=true',
|
|
||||||
}
|
|
||||||
if config.apex_jvm_max_heap then
|
|
||||||
table.insert(local_cmd, '-Xmx' .. config.apex_jvm_max_heap)
|
|
||||||
end
|
|
||||||
---@diagnostic enable: undefined-field
|
|
||||||
table.insert(local_cmd, 'apex.jorje.lsp.ApexLanguageServerLauncher')
|
|
||||||
|
|
||||||
return vim.lsp.rpc.start(local_cmd, dispatchers)
|
|
||||||
end,
|
|
||||||
filetypes = { 'apex', 'apexcode' },
|
|
||||||
root_markers = {
|
|
||||||
'sfdx-project.json',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/arduino/arduino-language-server
|
|
||||||
---
|
|
||||||
--- Language server for Arduino
|
|
||||||
---
|
|
||||||
--- The `arduino-language-server` can be installed by running:
|
|
||||||
---
|
|
||||||
--- ```
|
|
||||||
--- go install github.com/arduino/arduino-language-server@latest
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- The `arduino-cli` tool must also be installed. Follow [these
|
|
||||||
--- installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for
|
|
||||||
--- your platform.
|
|
||||||
---
|
|
||||||
--- After installing `arduino-cli`, follow [these
|
|
||||||
--- instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file)
|
|
||||||
--- for generating a configuration file if you haven't done so already, and make
|
|
||||||
--- sure you [install any relevant platforms
|
|
||||||
--- libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board).
|
|
||||||
---
|
|
||||||
--- The language server also requires `clangd` to be installed. Follow [these
|
|
||||||
--- installation instructions](https://clangd.llvm.org/installation) for your
|
|
||||||
--- platform.
|
|
||||||
---
|
|
||||||
--- If you don't have a sketch yet create one.
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- $ arduino-cli sketch new test
|
|
||||||
--- $ cd test
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file by using the following commands.
|
|
||||||
---
|
|
||||||
---
|
|
||||||
--- First gather some information about your board. Make sure your board is connected and run the following:
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- $ arduino-cli board list
|
|
||||||
--- Port Protocol Type Board Name FQBN Core
|
|
||||||
--- /dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Then generate the file:
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- The resulting file should look like this:
|
|
||||||
---
|
|
||||||
--- ```yaml
|
|
||||||
--- default_fqbn: arduino:avr:uno
|
|
||||||
--- default_port: /dev/ttyACM0
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Your folder structure should look like this:
|
|
||||||
---
|
|
||||||
--- ```
|
|
||||||
--- .
|
|
||||||
--- ├── test.ino
|
|
||||||
--- └── sketch.yaml
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- For further instructions about configuration options, run `arduino-language-server --help`.
|
|
||||||
---
|
|
||||||
--- Note that an upstream bug makes keywords in some cases become undefined by the language server.
|
|
||||||
--- Ref: https://github.com/arduino/arduino-ide/issues/159
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
filetypes = { 'arduino' },
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
|
||||||
on_dir(util.root_pattern('*.ino')(fname))
|
|
||||||
end,
|
|
||||||
cmd = {
|
|
||||||
'arduino-language-server',
|
|
||||||
},
|
|
||||||
capabilities = {
|
|
||||||
textDocument = {
|
|
||||||
---@diagnostic disable-next-line: assign-type-mismatch
|
|
||||||
semanticTokens = vim.NIL,
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
---@diagnostic disable-next-line: assign-type-mismatch
|
|
||||||
semanticTokens = vim.NIL,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/bergercookie/asm-lsp
|
|
||||||
---
|
|
||||||
--- Language Server for NASM/GAS/GO Assembly
|
|
||||||
---
|
|
||||||
--- `asm-lsp` can be installed via cargo:
|
|
||||||
--- cargo install asm-lsp
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'asm-lsp' },
|
|
||||||
filetypes = { 'asm', 'vmasm' },
|
|
||||||
root_markers = { '.asm-lsp.toml', '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://ast-grep.github.io/
|
|
||||||
---
|
|
||||||
--- ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale.
|
|
||||||
--- ast-grep LSP only works in projects that have `sgconfig.y[a]ml` in their root directories.
|
|
||||||
--- ```sh
|
|
||||||
--- npm install [-g] @ast-grep/cli
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'ast-grep', 'lsp' },
|
|
||||||
workspace_required = true,
|
|
||||||
reuse_client = function(client, config)
|
|
||||||
config.cmd_cwd = config.root_dir
|
|
||||||
return client.config.cmd_cwd == config.cmd_cwd
|
|
||||||
end,
|
|
||||||
filetypes = { -- https://ast-grep.github.io/reference/languages.html
|
|
||||||
'bash',
|
|
||||||
'c',
|
|
||||||
'cpp',
|
|
||||||
'cs',
|
|
||||||
'css',
|
|
||||||
'elixir',
|
|
||||||
'go',
|
|
||||||
'haskell',
|
|
||||||
'html',
|
|
||||||
'java',
|
|
||||||
'javascript',
|
|
||||||
'javascriptreact',
|
|
||||||
'json',
|
|
||||||
'kotlin',
|
|
||||||
'lua',
|
|
||||||
'nix',
|
|
||||||
'php',
|
|
||||||
'python',
|
|
||||||
'ruby',
|
|
||||||
'rust',
|
|
||||||
'scala',
|
|
||||||
'solidity',
|
|
||||||
'swift',
|
|
||||||
'typescript',
|
|
||||||
'typescriptreact',
|
|
||||||
'yaml',
|
|
||||||
},
|
|
||||||
root_markers = { 'sgconfig.yaml', 'sgconfig.yml' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/withastro/language-tools/tree/main/packages/language-server
|
|
||||||
---
|
|
||||||
--- `astro-ls` can be installed via `npm`:
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g @astrojs/language-server
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'astro-ls', '--stdio' },
|
|
||||||
filetypes = { 'astro' },
|
|
||||||
root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' },
|
|
||||||
init_options = {
|
|
||||||
typescript = {},
|
|
||||||
},
|
|
||||||
before_init = function(_, config)
|
|
||||||
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
|
|
||||||
config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/ariga/atlas
|
|
||||||
---
|
|
||||||
--- Language server for Atlas config and schema files.
|
|
||||||
---
|
|
||||||
--- You may also need to configure the filetype for *.hcl files:
|
|
||||||
---
|
|
||||||
--- ```vim
|
|
||||||
--- autocmd BufNewFile,BufRead atlas.hcl set filetype=atlas-config
|
|
||||||
--- autocmd BufNewFile,BufRead *.my.hcl set filetype=atlas-schema-mysql
|
|
||||||
--- autocmd BufNewFile,BufRead *.pg.hcl set filetype=atlas-schema-postgresql
|
|
||||||
--- autocmd BufNewFile,BufRead *.lt.hcl set filetype=atlas-schema-sqlite
|
|
||||||
--- autocmd BufNewFile,BufRead *.ch.hcl set filetype=atlas-schema-clickhouse
|
|
||||||
--- autocmd BufNewFile,BufRead *.ms.hcl set filetype=atlas-schema-mssql
|
|
||||||
--- autocmd BufNewFile,BufRead *.rs.hcl set filetype=atlas-schema-redshift
|
|
||||||
--- autocmd BufNewFile,BufRead *.test.hcl set filetype=atlas-test
|
|
||||||
--- autocmd BufNewFile,BufRead *.plan.hcl set filetype=atlas-plan
|
|
||||||
--- autocmd BufNewFile,BufRead *.rule.hcl set filetype=atlas-rule
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- or
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.filetype.add({
|
|
||||||
--- filename = {
|
|
||||||
--- ['atlas.hcl'] = 'atlas-config',
|
|
||||||
--- },
|
|
||||||
--- pattern = {
|
|
||||||
--- ['.*/*.my.hcl'] = 'atlas-schema-mysql',
|
|
||||||
--- ['.*/*.pg.hcl'] = 'atlas-schema-postgresql',
|
|
||||||
--- ['.*/*.lt.hcl'] = 'atlas-schema-sqlite',
|
|
||||||
--- ['.*/*.ch.hcl'] = 'atlas-schema-clickhouse',
|
|
||||||
--- ['.*/*.ms.hcl'] = 'atlas-schema-mssql',
|
|
||||||
--- ['.*/*.rs.hcl'] = 'atlas-schema-redshift',
|
|
||||||
--- ['.*/*.test.hcl'] = 'atlas-test',
|
|
||||||
--- ['.*/*.plan.hcl'] = 'atlas-plan',
|
|
||||||
--- ['.*/*.rule.hcl'] = 'atlas-rule',
|
|
||||||
--- },
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Optionally, tell treesitter to treat Atlas filetypes as HCL for better syntax highlighting:
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-config')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-mysql')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-postgresql')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-sqlite')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-clickhouse')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-mssql')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-schema-redshift')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-test')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-plan')
|
|
||||||
--- vim.treesitter.language.register('hcl', 'atlas-rule')
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'atlas', 'tool', 'lsp', '--stdio' },
|
|
||||||
filetypes = {
|
|
||||||
'atlas-*',
|
|
||||||
},
|
|
||||||
root_markers = { 'atlas.hcl' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://atopile.io/
|
|
||||||
---
|
|
||||||
--- A language server for atopile Programming Language.
|
|
||||||
---
|
|
||||||
--- It comes with the atopile compiler, for installation see: [Installing atopile](https://docs.atopile.io/atopile/guides/install)
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'ato', 'lsp', 'start' },
|
|
||||||
filetypes = { 'ato' },
|
|
||||||
root_markers = { 'ato.yaml', '.ato', '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/thqby/vscode-autohotkey2-lsp
|
|
||||||
---
|
|
||||||
--- AutoHotkey v2.0 LSP implementation
|
|
||||||
---
|
|
||||||
--- NOTE: AutoHotkey is Windows-only.
|
|
||||||
|
|
||||||
local function get_autohotkey_path()
|
|
||||||
local path = vim.fn.exepath('autohotkey.exe')
|
|
||||||
return #path > 0 and path or ''
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'autohotkey_lsp', '--stdio' },
|
|
||||||
filetypes = { 'autohotkey' },
|
|
||||||
root_markers = { 'package.json' },
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
flags = { debounce_text_changes = 500 },
|
|
||||||
--capabilities = capabilities,
|
|
||||||
--on_attach = custom_attach,
|
|
||||||
init_options = {
|
|
||||||
locale = 'en-us',
|
|
||||||
InterpreterPath = get_autohotkey_path(),
|
|
||||||
AutoLibInclude = 'All',
|
|
||||||
CommentTags = '^;;\\s*(?<tag>.+)',
|
|
||||||
CompleteFunctionParens = false,
|
|
||||||
SymbolFoldinFromOpenBrace = false,
|
|
||||||
Diagnostics = {
|
|
||||||
ClassStaticMemberCheck = true,
|
|
||||||
ParamsCheck = true,
|
|
||||||
},
|
|
||||||
ActionWhenV1IsDetected = 'Continue',
|
|
||||||
FormatOptions = {
|
|
||||||
array_style = 'expand',
|
|
||||||
break_chained_methods = false,
|
|
||||||
ignore_comment = false,
|
|
||||||
indent_string = '\t',
|
|
||||||
max_preserve_newlines = 2,
|
|
||||||
brace_style = 'One True Brace',
|
|
||||||
object_style = 'none',
|
|
||||||
preserve_newlines = true,
|
|
||||||
space_after_double_colon = true,
|
|
||||||
space_before_conditional = true,
|
|
||||||
space_in_empty_paren = false,
|
|
||||||
space_in_other = true,
|
|
||||||
space_in_paren = false,
|
|
||||||
wrap_line_length = 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/Freed-Wu/autotools-language-server
|
|
||||||
---
|
|
||||||
--- `autotools-language-server` can be installed via `pip`:
|
|
||||||
--- ```sh
|
|
||||||
--- pip install autotools-language-server
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Language server for autoconf, automake and make using tree sitter in python.
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
local root_files = { 'configure.ac', 'Makefile', 'Makefile.am', '*.mk' }
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'autotools-language-server' },
|
|
||||||
filetypes = { 'config', 'automake', 'make' },
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
|
||||||
on_dir(util.root_pattern(unpack(root_files))(fname))
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/Beaglefoot/awk-language-server/
|
|
||||||
---
|
|
||||||
--- `awk-language-server` can be installed via `npm`:
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g awk-language-server
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'awk-language-server' },
|
|
||||||
filetypes = { 'awk' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/microsoft/azure-pipelines-language-server
|
|
||||||
---
|
|
||||||
--- An Azure Pipelines language server
|
|
||||||
---
|
|
||||||
--- `azure-pipelines-ls` can be installed via `npm`:
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g azure-pipelines-language-server
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so:
|
|
||||||
--- ```lua
|
|
||||||
--- vim.lsp.config('azure_pipelines_ls', {
|
|
||||||
--- ... -- other configuration
|
|
||||||
--- settings = {
|
|
||||||
--- yaml = {
|
|
||||||
--- schemas = {
|
|
||||||
--- ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = {
|
|
||||||
--- "/azure-pipeline*.y*l",
|
|
||||||
--- "/*.azure*",
|
|
||||||
--- "Azure-Pipelines/**/*.y*l",
|
|
||||||
--- "Pipelines/*.y*l",
|
|
||||||
--- },
|
|
||||||
--- },
|
|
||||||
--- },
|
|
||||||
--- },
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
--- The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'azure-pipelines-language-server', '--stdio' },
|
|
||||||
filetypes = { 'yaml' },
|
|
||||||
root_markers = { 'azure-pipelines.yml' },
|
|
||||||
settings = {},
|
|
||||||
}
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/crisidev/bacon-ls
|
|
||||||
---
|
|
||||||
--- A Language Server Protocol wrapper for [bacon](https://dystroy.org/bacon/).
|
|
||||||
--- It offers textDocument/diagnostic and workspace/diagnostic capabilities for Rust
|
|
||||||
--- workspaces using the Bacon export locations file.
|
|
||||||
---
|
|
||||||
--- It requires `bacon` and `bacon-ls` to be installed on the system using
|
|
||||||
--- [mason.nvim](https://github.com/williamboman/mason.nvim) or manually
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- $ cargo install --locked bacon bacon-ls
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Settings can be changed using the `init_options` dictionary:util
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- init_options = {
|
|
||||||
--- -- Bacon export filename (default: .bacon-locations).
|
|
||||||
--- locationsFile = ".bacon-locations",
|
|
||||||
--- -- Try to update diagnostics every time the file is saved (default: true).
|
|
||||||
--- updateOnSave = true,
|
|
||||||
--- -- How many milliseconds to wait before updating diagnostics after a save (default: 1000).
|
|
||||||
--- updateOnSaveWaitMillis = 1000,
|
|
||||||
--- -- Try to update diagnostics every time the file changes (default: true).
|
|
||||||
--- updateOnChange = true,
|
|
||||||
--- -- Try to validate that bacon preferences are setup correctly to work with bacon-ls (default: true).
|
|
||||||
--- validateBaconPreferences = true,
|
|
||||||
--- -- f no bacon preferences file is found, create a new preferences file with the bacon-ls job definition (default: true).
|
|
||||||
--- createBaconPreferencesFile = true,
|
|
||||||
--- -- Run bacon in background for the bacon-ls job (default: true)
|
|
||||||
--- runBaconInBackground = true,
|
|
||||||
--- -- Command line arguments to pass to bacon running in background (default "--headless -j bacon-ls")
|
|
||||||
--- runBaconInBackgroundCommandArguments = "--headless -j bacon-ls",
|
|
||||||
--- -- How many milliseconds to wait between background diagnostics check to synchronize all open files (default: 2000).
|
|
||||||
--- synchronizeAllOpenFilesWaitMillis = 2000,
|
|
||||||
--- }
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bacon-ls' },
|
|
||||||
filetypes = { 'rust' },
|
|
||||||
root_markers = { '.bacon-locations', 'Cargo.toml' },
|
|
||||||
init_options = {},
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- Ballerina language server
|
|
||||||
---
|
|
||||||
--- The Ballerina language's CLI tool comes with its own language server implementation.
|
|
||||||
--- The `bal` command line tool must be installed and available in your system's PATH.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bal', 'start-language-server' },
|
|
||||||
filetypes = { 'ballerina' },
|
|
||||||
root_markers = { 'Ballerina.toml' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://detachhead.github.io/basedpyright
|
|
||||||
---
|
|
||||||
--- `basedpyright`, a static type checker and language server for python
|
|
||||||
|
|
||||||
local function set_python_path(command)
|
|
||||||
local path = command.args
|
|
||||||
local clients = vim.lsp.get_clients {
|
|
||||||
bufnr = vim.api.nvim_get_current_buf(),
|
|
||||||
name = 'basedpyright',
|
|
||||||
}
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
if client.settings then
|
|
||||||
---@diagnostic disable-next-line: param-type-mismatch
|
|
||||||
client.settings.python = vim.tbl_deep_extend('force', client.settings.python or {}, { pythonPath = path })
|
|
||||||
else
|
|
||||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
|
||||||
end
|
|
||||||
client:notify('workspace/didChangeConfiguration', { settings = nil })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'basedpyright-langserver', '--stdio' },
|
|
||||||
filetypes = { 'python' },
|
|
||||||
root_markers = {
|
|
||||||
'pyrightconfig.json',
|
|
||||||
'pyproject.toml',
|
|
||||||
'setup.py',
|
|
||||||
'setup.cfg',
|
|
||||||
'requirements.txt',
|
|
||||||
'Pipfile',
|
|
||||||
'.git',
|
|
||||||
},
|
|
||||||
settings = {
|
|
||||||
basedpyright = {
|
|
||||||
analysis = {
|
|
||||||
autoSearchPaths = true,
|
|
||||||
useLibraryCodeForTypes = true,
|
|
||||||
diagnosticMode = 'openFilesOnly',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
|
||||||
local params = {
|
|
||||||
command = 'basedpyright.organizeimports',
|
|
||||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Using client.request() directly because "basedpyright.organizeimports" is private
|
|
||||||
-- (not advertised via capabilities), which client:exec_cmd() refuses to call.
|
|
||||||
-- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030
|
|
||||||
---@diagnostic disable-next-line: param-type-mismatch
|
|
||||||
client.request('workspace/executeCommand', params, nil, bufnr)
|
|
||||||
end, {
|
|
||||||
desc = 'Organize Imports',
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
|
||||||
desc = 'Reconfigure basedpyright with the provided python path',
|
|
||||||
nargs = 1,
|
|
||||||
complete = 'file',
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/bash-lsp/bash-language-server
|
|
||||||
---
|
|
||||||
--- `bash-language-server` can be installed via `npm`:
|
|
||||||
--- ```sh
|
|
||||||
--- npm i -g bash-language-server
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Language server for bash, written using tree sitter in typescript.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bash-language-server', 'start' },
|
|
||||||
settings = {
|
|
||||||
bashIde = {
|
|
||||||
-- Glob pattern for finding and parsing shell script files in the workspace.
|
|
||||||
-- Used by the background analysis features across files.
|
|
||||||
|
|
||||||
-- Prevent recursive scanning which will cause issues when opening a file
|
|
||||||
-- directly in the home directory (e.g. ~/foo.sh).
|
|
||||||
--
|
|
||||||
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
|
|
||||||
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = { 'bash', 'sh' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/antonk52/basics-language-server/
|
|
||||||
---
|
|
||||||
--- Buffer, path, and snippet completion
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g basics-language-server
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'basics-language-server' },
|
|
||||||
settings = {
|
|
||||||
buffer = {
|
|
||||||
enable = true,
|
|
||||||
minCompletionLength = 4,
|
|
||||||
},
|
|
||||||
path = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
enable = false,
|
|
||||||
sources = {},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/salesforce-misc/bazelrc-lsp
|
|
||||||
---
|
|
||||||
--- `bazelrc-lsp` is a LSP for `.bazelrc` configuration files.
|
|
||||||
---
|
|
||||||
--- The `.bazelrc` file type is not detected automatically, you can register it manually (see below) or override the filetypes:
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- vim.filetype.add {
|
|
||||||
--- pattern = {
|
|
||||||
--- ['.*.bazelrc'] = 'bazelrc',
|
|
||||||
--- },
|
|
||||||
--- }
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bazelrc-lsp', 'lsp' },
|
|
||||||
filetypes = { 'bazelrc' },
|
|
||||||
root_markers = { 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/polarmutex/beancount-language-server#installation
|
|
||||||
---
|
|
||||||
--- See https://github.com/polarmutex/beancount-language-server#configuration for configuration options
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'beancount-language-server', '--stdio' },
|
|
||||||
filetypes = { 'beancount', 'bean' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
init_options = {},
|
|
||||||
}
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/azure/bicep
|
|
||||||
--- Bicep language server
|
|
||||||
---
|
|
||||||
--- Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases).
|
|
||||||
---
|
|
||||||
--- Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed.
|
|
||||||
---
|
|
||||||
--- Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server.
|
|
||||||
---
|
|
||||||
--- Filetype detection can be added via an autocmd:
|
|
||||||
--- ```lua
|
|
||||||
--- vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]]
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- **By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary.
|
|
||||||
---
|
|
||||||
--- ```lua
|
|
||||||
--- local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll"
|
|
||||||
--- vim.lsp.config('bicep', {
|
|
||||||
--- cmd = { "dotnet", bicep_lsp_bin };
|
|
||||||
--- ...
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- To download the latest release and place in /usr/local/bin/bicep-langserver:
|
|
||||||
--- ```bash
|
|
||||||
--- (cd $(mktemp -d) \
|
|
||||||
--- && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \
|
|
||||||
--- && rm -rf /usr/local/bin/bicep-langserver \
|
|
||||||
--- && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip)
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
filetypes = { 'bicep', 'bicep-params' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
init_options = {},
|
|
||||||
}
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
---@brief
|
|
||||||
--- https://biomejs.dev
|
|
||||||
---
|
|
||||||
--- Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome).
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- npm install [-g] @biomejs/biome
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- ### Monorepo support
|
|
||||||
---
|
|
||||||
--- `biome` supports monorepos by default. It will automatically find the `biome.json` corresponding to the package you are working on, as described in the [documentation](https://biomejs.dev/guides/big-projects/#monorepo). This works without the need of spawning multiple instances of `biome`, saving memory.
|
|
||||||
|
|
||||||
local util = require 'lspconfig.util'
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = function(dispatchers, config)
|
|
||||||
local cmd = 'biome'
|
|
||||||
local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/biome'
|
|
||||||
if local_cmd and vim.fn.executable(local_cmd) == 1 then
|
|
||||||
cmd = local_cmd
|
|
||||||
end
|
|
||||||
return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers)
|
|
||||||
end,
|
|
||||||
filetypes = {
|
|
||||||
'astro',
|
|
||||||
'css',
|
|
||||||
'graphql',
|
|
||||||
'html',
|
|
||||||
'javascript',
|
|
||||||
'javascriptreact',
|
|
||||||
'json',
|
|
||||||
'jsonc',
|
|
||||||
'svelte',
|
|
||||||
'typescript',
|
|
||||||
'typescript.tsx',
|
|
||||||
'typescriptreact',
|
|
||||||
'vue',
|
|
||||||
},
|
|
||||||
workspace_required = true,
|
|
||||||
root_dir = function(bufnr, on_dir)
|
|
||||||
-- The project root is where the LSP can be started from
|
|
||||||
-- As stated in the documentation above, this LSP supports monorepos and simple projects.
|
|
||||||
-- We select then from the project root, which is identified by the presence of a package
|
|
||||||
-- manager lock file.
|
|
||||||
local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' }
|
|
||||||
-- Give the root markers equal priority by wrapping them in a table
|
|
||||||
root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, { '.git' } }
|
|
||||||
or vim.list_extend(root_markers, { '.git' })
|
|
||||||
|
|
||||||
-- exclude deno
|
|
||||||
if vim.fs.root(bufnr, { 'deno.json', 'deno.jsonc', 'deno.lock' }) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- We fallback to the current working directory if no project root is found
|
|
||||||
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
|
|
||||||
|
|
||||||
-- We know that the buffer is using Biome if it has a config file
|
|
||||||
-- in its directory tree.
|
|
||||||
local filename = vim.api.nvim_buf_get_name(bufnr)
|
|
||||||
local biome_config_files = { 'biome.json', 'biome.jsonc' }
|
|
||||||
biome_config_files = util.insert_package_json(biome_config_files, 'biomejs', filename)
|
|
||||||
local is_buffer_using_biome = vim.fs.find(biome_config_files, {
|
|
||||||
path = filename,
|
|
||||||
type = 'file',
|
|
||||||
limit = 1,
|
|
||||||
upward = true,
|
|
||||||
stop = vim.fs.dirname(project_root),
|
|
||||||
})[1]
|
|
||||||
if not is_buffer_using_biome then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
on_dir(project_root)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/Freed-Wu/bitbake-language-server
|
|
||||||
---
|
|
||||||
--- `bitbake-language-server` can be installed via `pip`:
|
|
||||||
--- ```sh
|
|
||||||
--- pip install bitbake-language-server
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- Language server for bitbake.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bitbake-language-server' },
|
|
||||||
filetypes = { 'bitbake' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://gitlab.gnome.org/jwestman/blueprint-compiler
|
|
||||||
---
|
|
||||||
--- `blueprint-compiler` can be installed via your system package manager.
|
|
||||||
---
|
|
||||||
--- Language server for the blueprint markup language, written in python and part
|
|
||||||
--- of the blueprint-compiler.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'blueprint-compiler', 'lsp' },
|
|
||||||
cmd_env = {
|
|
||||||
-- Prevent recursive scanning which will cause issues when opening a file
|
|
||||||
-- directly in the home directory (e.g. ~/foo.sh).
|
|
||||||
--
|
|
||||||
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
|
|
||||||
GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.blp)',
|
|
||||||
},
|
|
||||||
filetypes = { 'blueprint' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/kitagry/bqls
|
|
||||||
---
|
|
||||||
--- The `bqls` BigQuery language server can be installed by running:
|
|
||||||
---
|
|
||||||
--- ```sh
|
|
||||||
--- $ go install github.com/kitagry/bqls@latest
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bqls' },
|
|
||||||
filetypes = { 'sql' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
settings = {},
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/RokuCommunity/brighterscript
|
|
||||||
---
|
|
||||||
--- `brightscript` can be installed via `npm`:
|
|
||||||
--- ```sh
|
|
||||||
--- npm install -g brighterscript
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bsc', '--lsp', '--stdio' },
|
|
||||||
filetypes = { 'brs' },
|
|
||||||
root_markers = { 'makefile', 'Makefile', '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/brioche-dev/brioche
|
|
||||||
---
|
|
||||||
--- `Brioche Language Server`.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'brioche', 'lsp' },
|
|
||||||
filetypes = { 'brioche' },
|
|
||||||
root_markers = { 'project.bri' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/1c-syntax/bsl-language-server
|
|
||||||
---
|
|
||||||
--- Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
filetypes = { 'bsl', 'os' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/facebook/buck2
|
|
||||||
---
|
|
||||||
--- Build system, successor to Buck
|
|
||||||
---
|
|
||||||
--- To better detect Buck2 project files, the following can be added:
|
|
||||||
---
|
|
||||||
--- ```
|
|
||||||
--- vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]]
|
|
||||||
--- ```
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'buck2', 'lsp' },
|
|
||||||
filetypes = { 'bzl' },
|
|
||||||
root_markers = { '.buckconfig' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server
|
|
||||||
--- The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server,
|
|
||||||
--- supporting new dialects defined in buddy-mlir.
|
|
||||||
--- `buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir)
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'buddy-lsp-server' },
|
|
||||||
filetypes = { 'mlir' },
|
|
||||||
root_markers = { '.git' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
--- @brief
|
|
||||||
--- https://github.com/bufbuild/buf
|
|
||||||
---
|
|
||||||
--- buf lsp included in the cli itself
|
|
||||||
---
|
|
||||||
--- buf lsp is a Protobuf language server compatible with Buf modules and workspaces
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'buf', 'lsp', 'serve', '--log-format=text' },
|
|
||||||
filetypes = { 'proto' },
|
|
||||||
root_markers = { 'buf.yaml', '.git' },
|
|
||||||
reuse_client = function(client, config)
|
|
||||||
-- `buf lsp serve` is meant to be used with multiple workspaces.
|
|
||||||
return client.name == config.name
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://bzl.io/
|
|
||||||
---
|
|
||||||
--- https://docs.stack.build/docs/cli/installation
|
|
||||||
---
|
|
||||||
--- https://docs.stack.build/docs/vscode/starlark-language-server
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'bzl', 'lsp', 'serve' },
|
|
||||||
filetypes = { 'bzl' },
|
|
||||||
-- https://docs.bazel.build/versions/5.4.1/build-ref.html#workspace
|
|
||||||
root_markers = { 'WORKSPACE', 'WORKSPACE.bazel' },
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
---@brief
|
|
||||||
---
|
|
||||||
--- https://github.com/pherrymason/c3-lsp
|
|
||||||
---
|
|
||||||
--- Language Server for c3.
|
|
||||||
|
|
||||||
---@type vim.lsp.Config
|
|
||||||
return {
|
|
||||||
cmd = { 'c3lsp' },
|
|
||||||
root_markers = { 'project.json', 'manifest.json', '.git' },
|
|
||||||
filetypes = { 'c3', 'c3i' },
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue