├── .gitignore ├── README.md ├── files ├── environment │ └── .config │ │ └── environment.d │ │ └── envvars.conf ├── git │ └── .gitconfig ├── helix │ └── .config │ │ └── helix │ │ ├── config.toml │ │ ├── languages.toml │ │ └── themes │ │ └── everforest_light_modded.toml ├── kitty │ └── .config │ │ └── kitty │ │ ├── current-theme.conf │ │ └── kitty.conf ├── shell │ ├── .bashrc │ └── .shellrc.alias ├── sway │ └── .config │ │ └── sway │ │ ├── config │ │ └── screenshot ├── swaync │ └── .config │ │ └── swaync │ │ └── style.css ├── tmux │ └── .tmux.conf ├── tofi │ └── .config │ │ └── tofi │ │ └── config ├── vim │ └── .vimrc └── waybar │ └── .config │ └── waybar │ ├── config │ ├── conservation-toggle.sh │ ├── conservation.sh │ └── style.css ├── stow.sh └── templates ├── flakes └── typst.flake.nix ├── howto.md ├── sage.nix ├── tex.nix └── typst.nix /.gitignore: -------------------------------------------------------------------------------- 1 | runtime/ 2 | files/helix/.config/helix/runtime 3 | kitty.conf.bak 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # my dotfiles 2 | 3 | Everything is managed via `stow(1)`: 4 | 5 | ```bash 6 | $ ./stow.sh 7 | Use ./stow.sh --stow to deploy configuration 8 | Use ./stow.sh --unstow to remove configuration 9 | ``` 10 | 11 | ### Quirks 12 | - Install based on Fedora Workstation with GNOME 13 | - Font: [JetBrains Mono](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/JetBrainsMono.zip) 14 | - Keyboard Layout: EurKey 15 | - Keepass should use `/run/user/1000/keyring/ssh` as SSH Auth Socket 16 | - Keyring provided by GNOME and started with sway 17 | - Environment Vairables exported using systemd in [envvars.conf](files/environment/.config/environment.d/envvars.conf) 18 | - Lenovo Conservation Mode without root 19 | ```bash 20 | %wheel ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/bus/platform/drivers/ideapad_acpi/VPC????\:??/conservation_mode 21 | ``` 22 | - Brave Flags for Wayland 23 | ```bash 24 | /usr/bin/brave-browser-stable --enable-features=UseOzonePlatform --ozone-platform=wayland --gtk-version=4 --enable-wayland-ime --enable-features=TouchpadOverscrollHistoryNavigation 25 | ``` 26 | - Remove Client Side Decorations 27 | ```bash 28 | $ gsettings get org.gnome.desktop.wm.preferences button-layout 29 | 'icon:close' 30 | $ gsettings set org.gnome.desktop.wm.preferences button-layout '' 31 | ``` 32 | 33 | ### Software via dnf 34 | 35 | ``` 36 | sudo dnf install \ 37 | kitty git vim tmux ripgrep fd-find fzf stow \ 38 | brave \ 39 | sway waybar \ 40 | brightnessctl wireplumber pasystray blueman \ 41 | network-manager network-manager-applet \ 42 | fcitx5 fcitx5-configtool fcitx5-anthy fcitx5-* \ 43 | nextcloud keepassxc 44 | ``` 45 | 46 | ### Software via GitHub 47 | 48 | - [sway fork - swayfx](https://github.com/WillPower3309/swayfx) 49 | - [notification daemon + popup - swaync](https://github.com/ErikReider/SwayNotificationCenter) 50 | - [application launcher - tofi](https://github.com/philj56/tofi) 51 | - [screenshot tool](https://github.com/moverest/sway-interactive-screenshot) (checked in [here](files/sway/.config/sway/screenshot)) 52 | - [screen mirror for live presentations](https://github.com/Ferdi265/wl-mirror) 53 | -------------------------------------------------------------------------------- /files/environment/.config/environment.d/envvars.conf: -------------------------------------------------------------------------------- 1 | PATH=$HOME/.dots/scripts:$HOME/.cargo/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$HOME/.cabal/bin:$PATH 2 | EDITOR=hx 3 | VISUAL=hx 4 | SSH_AUTH_SOCK=/run/user/1000/keyring/ssh 5 | _JAVA_AWT_WM_NONREPARENTING=1 6 | 7 | # XXX: render shadow on wayland 8 | # KITTY_DISABLE_WAYLAND=1 9 | # KITTY_ENABLE_WAYLAND=1 10 | 11 | # support jp input in gnome 12 | GTK_IM_MODULE=ibus 13 | QT_IM_MODULE=ibus 14 | XMODIFIERS=@im=ibus 15 | SDL_IM_MODULE=ibus 16 | GLFW_IM_MODULE=ibus 17 | 18 | # sway - fcitx5 fcitx5-configtool-gtk fcitx5-anthy 19 | # GTK_IM_MODULE=fcitx 20 | # QT_IM_MODULE=fcitx 21 | # XMODIFIERS=@im=fcitx 22 | # SDL_IM_MODULE=fcitx 23 | # GLFW_IM_MODULE=fcitx 24 | -------------------------------------------------------------------------------- /files/git/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Marco Thomas 3 | email = github@marcothms.de 4 | [includeIf "gitdir:~/dev/lrz-gitlab/**"] 5 | path = "~/dev/lrz-gitlab/.gitconfig" 6 | [alias] 7 | a = add 8 | aa = add . 9 | b = branch 10 | bl = blame 11 | c = commit -v 12 | ca = commit -v --amend 13 | cm = commit -v -m 14 | co = checkout 15 | cp = cherry-pick 16 | d = diff 17 | nuke = clean -df 18 | lg = log --oneline --decorate --graph 19 | lgp = lg -p 20 | pl = pull --rebase 21 | ps = push 22 | r = rebase 23 | rh = reset HEAD 24 | sh = show 25 | st = status -s 26 | wt = worktree 27 | [blame] 28 | date = relative 29 | [grep] 30 | lineNumber = true 31 | [init] 32 | defaultBranch = main 33 | -------------------------------------------------------------------------------- /files/helix/.config/helix/config.toml: -------------------------------------------------------------------------------- 1 | theme = "everforest_light_modded" 2 | 3 | [editor] 4 | line-number = "relative" 5 | cursor-shape.insert = "bar" 6 | insert-final-newline = false 7 | rulers = [80, 100] 8 | # Minimum severity to show a diagnostic after the end of a line 9 | end-of-line-diagnostics = "hint" 10 | 11 | [editor.whitespace.render] 12 | tab = "all" 13 | space = "all" 14 | 15 | [editor.indent-guides] 16 | render = true 17 | 18 | [editor.lsp] 19 | display-inlay-hints = true 20 | 21 | [editor.inline-diagnostics] 22 | # Minimum severity to show a diagnostic on the primary cursor's line. 23 | cursor-line = "error" 24 | 25 | [keys.normal] 26 | "_" = ["extend_line_up", "extend_to_line_bounds"] 27 | "+" = ["extend_line_down", "extend_to_line_bounds"] 28 | 29 | -------------------------------------------------------------------------------- /files/helix/.config/helix/languages.toml: -------------------------------------------------------------------------------- 1 | [[language]] 2 | name = "bibtex" 3 | auto-format = false 4 | 5 | [language-server.typst-lsp.config] 6 | exportPdf = "never" 7 | 8 | [[language]] 9 | name = "c" 10 | indent = { tab-width = 8, unit = " " } 11 | 12 | [[language]] 13 | name = "cpp" 14 | indent = { tab-width = 8, unit = " " } 15 | -------------------------------------------------------------------------------- /files/helix/.config/helix/themes/everforest_light_modded.toml: -------------------------------------------------------------------------------- 1 | # Everforest (Light Medium) 2 | # Authors: CptPotato, WindSoilder, basbebe 3 | 4 | # Original Author: 5 | # URL: https://github.com/sainnhe/everforest 6 | # Filename: colors/everforest.vim 7 | # Author: sainnhe 8 | # Email: sainnhe@gmail.com 9 | # License: MIT License 10 | 11 | "type" = "yellow" 12 | "constant" = "fg" 13 | "constant.builtin" = { fg = "purple", modifiers = ["italic"] } 14 | "constant.builtin.boolean" = "purple" 15 | "constant.numeric" = "purple" 16 | "constant.character.escape" = "green" 17 | "string" = "aqua" 18 | "string.regexp" = "green" 19 | "string.special" = "yellow" 20 | "comment" = { fg = "grey1", modifiers = ["italic"] } 21 | "variable" = "fg" 22 | "variable.builtin" = { fg = "purple", modifiers = ["italic"] } 23 | "variable.parameter" = "fg" 24 | "variable.other.member" = "blue" 25 | "label" = "orange" 26 | "punctuation" = "grey2" 27 | "punctuation.delimiter" = "grey1" 28 | "punctuation.bracket" = "fg" 29 | "punctuation.special" = "blue" 30 | "keyword" = "red" 31 | "keyword.operator" = "orange" 32 | "keyword.directive" = "purple" 33 | "keyword.storage" = "red" 34 | "operator" = "orange" 35 | "function" = "green" 36 | "function.macro" = "green" 37 | "tag" = "orange" 38 | "namespace" = { fg = "yellow", modifiers = ["italic"] } 39 | "attribute" = { fg = "purple", modifiers = ["italic"] } 40 | "constructor" = "green" 41 | "module" = "yellow" 42 | "special" = "blue" 43 | 44 | "markup.heading.marker" = "grey1" 45 | "markup.heading.1" = { fg = "red", modifiers = ["bold"] } 46 | "markup.heading.2" = { fg = "orange", modifiers = ["bold"] } 47 | "markup.heading.3" = { fg = "yellow", modifiers = ["bold"] } 48 | "markup.heading.4" = { fg = "green", modifiers = ["bold"] } 49 | "markup.heading.5" = { fg = "blue", modifiers = ["bold"] } 50 | "markup.heading.6" = { fg = "purple", modifiers = ["bold"] } 51 | "markup.list" = "red" 52 | "markup.bold" = { modifiers = ["bold"] } 53 | "markup.italic" = { modifiers = ["italic"] } 54 | "markup.strikethrough" = { modifiers = ["crossed_out"] } 55 | "markup.link.url" = { fg = "blue", underline = { style = "line" } } 56 | "markup.link.label" = "orange" 57 | "markup.link.text" = "purple" 58 | "markup.quote" = "grey1" 59 | "markup.raw.inline" = "green" 60 | "markup.raw.block" = "aqua" 61 | 62 | "diff.plus" = "green" 63 | "diff.delta" = "blue" 64 | "diff.minus" = "red" 65 | 66 | "ui.background" = { bg = "bg0" } 67 | "ui.background.separator" = "grey0" 68 | "ui.cursor" = { fg = "bg1", bg = "grey2" } 69 | "ui.cursor.insert" = { fg = "bg0", bg = "grey1" } 70 | "ui.cursor.select" = { fg = "bg0", bg = "blue" } 71 | "ui.cursor.match" = { bg = "bg4", modifiers = ["bold"] } 72 | "ui.cursor.primary" = { fg = "bg0", bg = "fg" } 73 | "ui.cursorline.primary" = { bg = "bg1" } 74 | "ui.cursorline.secondary" = { bg = "bg2" } 75 | "ui.selection" = { bg = "bg3" } 76 | "ui.linenr" = "grey0" 77 | "ui.linenr.selected" = "grey2" 78 | "ui.statusline" = { fg = "grey2", bg = "bg3" } 79 | "ui.statusline.inactive" = { fg = "grey0", bg = "bg1" } 80 | "ui.statusline.normal" = { fg = "bg0", bg = "statusline1", modifiers = [ 81 | "bold", 82 | ] } 83 | "ui.statusline.insert" = { fg = "bg0", bg = "statusline2", modifiers = [ 84 | "bold", 85 | ] } 86 | "ui.statusline.select" = { fg = "bg0", bg = "blue", modifiers = ["bold"] } 87 | "ui.bufferline" = { fg = "grey2", bg = "bg3" } 88 | "ui.bufferline.active" = { fg = "bg0", bg = "statusline1", modifiers = [ 89 | "bold", 90 | ] } 91 | "ui.popup" = { fg = "grey2", bg = "bg2" } 92 | "ui.picker.header" = { modifiers = ["bold", "underlined"] } 93 | "ui.window" = { fg = "bg4", bg = "bg_dim" } 94 | "ui.help" = { fg = "fg", bg = "bg2" } 95 | "ui.text" = "fg" 96 | "ui.text.directory" = { fg = "green" } 97 | "ui.text.focus" = "fg" 98 | "ui.menu" = { fg = "fg", bg = "bg3" } 99 | "ui.menu.selected" = { fg = "bg0", bg = "green" } 100 | "ui.virtual.ruler" = { bg = "bg3" } 101 | "ui.virtual.jump-label" = { modifiers = ["reversed"] } 102 | "ui.virtual.whitespace" = { fg = "bg4" } 103 | "ui.virtual.indent-guide" = { fg = "bg4" } 104 | "ui.virtual.inlay-hint" = { fg = "grey0" } 105 | "ui.virtual.wrap" = { fg = "grey0" } 106 | 107 | "hint" = "green" 108 | "info" = "blue" 109 | "warning" = "yellow" 110 | "error" = "red" 111 | 112 | "diagnostic.hint" = { underline = { color = "green", style = "curl" } } 113 | "diagnostic.info" = { underline = { color = "blue", style = "curl" } } 114 | "diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } 115 | "diagnostic.error" = { underline = { color = "red", style = "curl" } } 116 | "diagnostic.unnecessary" = { modifiers = ["dim"] } 117 | "diagnostic.deprecated" = { modifiers = ["crossed_out"] } 118 | 119 | [palette] 120 | 121 | bg_dim = "#efebd4" 122 | bg0 = "#fdf6e3" 123 | bg1 = "#f4f0d9" 124 | bg2 = "#efebd4" 125 | bg3 = "#e6e2cc" 126 | bg4 = "#e0dcc7" 127 | bg5 = "#bdc3af" 128 | bg_red = "#fbe3da" 129 | bg_visual = "#eaedc8" 130 | bg_yellow = "#faedcd" 131 | bg_green = "#f0f1d2" 132 | bg_blue = "#e9f0e9" 133 | 134 | fg = "#5c6a72" 135 | red = "#f85552" 136 | orange = "#f57d26" 137 | yellow = "#dfa000" 138 | green = "#8da101" 139 | blue = "#3a94c5" 140 | aqua = "#35a77c" 141 | purple = "#df69ba" 142 | 143 | grey0 = "#a6b0a0" 144 | grey1 = "#939f91" 145 | grey2 = "#829181" 146 | statusline1 = "#93b259" 147 | statusline2 = "#708089" 148 | statusline3 = "#e66868" 149 | -------------------------------------------------------------------------------- /files/kitty/.config/kitty/current-theme.conf: -------------------------------------------------------------------------------- 1 | # vim:ft=kitty 2 | ## name: Everforest Light Medium 3 | ## author: Sainnhe Park 4 | ## license: MIT 5 | ## upstream: https://github.com/ewal/kitty-everforest/blob/master/themes/everforest_light_medium.conf 6 | ## blurb: A green based color scheme designed to be warm and soft 7 | 8 | foreground #5c6a72 9 | background #fdf6e3 10 | selection_foreground #829181 11 | selection_background #eaedc8 12 | 13 | cursor #5c6a72 14 | cursor_text_color #f4f0d9 15 | 16 | url_color #3a94c5 17 | 18 | active_border_color #8da101 19 | inactive_border_color #bdc3af 20 | bell_border_color #f57d26 21 | visual_bell_color none 22 | 23 | wayland_titlebar_color system 24 | macos_titlebar_color system 25 | 26 | active_tab_background #fdf6e3 27 | active_tab_foreground #5c6a72 28 | inactive_tab_background #fdf6e3 29 | inactive_tab_foreground #939f91 30 | tab_bar_background #fdf6e3 31 | tab_bar_margin_color none 32 | 33 | mark1_foreground #fdf6e3 34 | mark1_background #3a94c5 35 | mark2_foreground #fdf6e3 36 | mark2_background #d3c6aa 37 | mark3_foreground #fdf6e3 38 | mark3_background #df69ba 39 | 40 | #: black 41 | color0 #708089 42 | color8 #829181 43 | 44 | #: red 45 | color1 #f85552 46 | color9 #e66868 47 | 48 | #: green 49 | color2 #8da101 50 | color10 #93b259 51 | 52 | #: yellow 53 | color3 #dfa000 54 | color11 #dfa000 55 | 56 | #: blue 57 | color4 #3a94c5 58 | color12 #3a94c5 59 | 60 | #: magenta 61 | color5 #df69ba 62 | color13 #df69ba 63 | 64 | #: cyan 65 | color6 #35a77c 66 | color14 #35a77c 67 | 68 | #: white 69 | color7 #939f91 70 | color15 #a6b0a0 71 | -------------------------------------------------------------------------------- /files/kitty/.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:foldmethod=marker 2 | 3 | #: Fonts {{{ 4 | 5 | #: kitty has very powerful font management. You can configure 6 | #: individual font faces and even specify special fonts for particular 7 | #: characters. 8 | 9 | # kitty +list-fonts 10 | font_family JetBrainsMono NFM Bold 11 | bold_font JetBrainsMono NFM ExtraBold 12 | italic_font JetBrainsMono NFM Bold Italic 13 | bold_italic_font JetBrainsMono NFM ExtraBold Italic 14 | 15 | font_size 10 16 | 17 | #: Font size (in pts) 18 | 19 | # force_ltr no 20 | 21 | #: kitty does not support BIDI (bidirectional text), however, for RTL 22 | #: scripts, words are automatically displayed in RTL. That is to say, 23 | #: in an RTL script, the words "HELLO WORLD" display in kitty as 24 | #: "WORLD HELLO", and if you try to select a substring of an RTL- 25 | #: shaped string, you will get the character that would be there had 26 | #: the the string been LTR. For example, assuming the Hebrew word 27 | #: ירושלים, selecting the character that on the screen appears to be ם 28 | #: actually writes into the selection buffer the character י. kitty's 29 | #: default behavior is useful in conjunction with a filter to reverse 30 | #: the word order, however, if you wish to manipulate RTL glyphs, it 31 | #: can be very challenging to work with, so this option is provided to 32 | #: turn it off. Furthermore, this option can be used with the command 33 | #: line program GNU FriBidi 34 | #: to get BIDI 35 | #: support, because it will force kitty to always treat the text as 36 | #: LTR, which FriBidi expects for terminals. 37 | 38 | # symbol_map 39 | 40 | #: E.g. symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols 41 | 42 | #: Map the specified Unicode codepoints to a particular font. Useful 43 | #: if you need special rendering for some symbols, such as for 44 | #: Powerline. Avoids the need for patched fonts. Each Unicode code 45 | #: point is specified in the form `U+`. You 46 | #: can specify multiple code points, separated by commas and ranges 47 | #: separated by hyphens. This option can be specified multiple times. 48 | #: The syntax is:: 49 | 50 | #: symbol_map codepoints Font Family Name 51 | 52 | # narrow_symbols 53 | 54 | #: E.g. narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1 55 | 56 | #: Usually, for Private Use Unicode characters and some symbol/dingbat 57 | #: characters, if the character is followed by one or more spaces, 58 | #: kitty will use those extra cells to render the character larger, if 59 | #: the character in the font has a wide aspect ratio. Using this 60 | #: option you can force kitty to restrict the specified code points to 61 | #: render in the specified number of cells (defaulting to one cell). 62 | #: This option can be specified multiple times. The syntax is:: 63 | 64 | #: narrow_symbols codepoints [optionally the number of cells] 65 | 66 | disable_ligatures cursor 67 | 68 | #: Choose how you want to handle multi-character ligatures. The 69 | #: default is to always render them. You can tell kitty to not render 70 | #: them when the cursor is over them by using cursor to make editing 71 | #: easier, or have kitty never render them at all by using always, if 72 | #: you don't like them. The ligature strategy can be set per-window 73 | #: either using the kitty remote control facility or by defining 74 | #: shortcuts for it in kitty.conf, for example:: 75 | 76 | #: map alt+1 disable_ligatures_in active always 77 | #: map alt+2 disable_ligatures_in all never 78 | #: map alt+3 disable_ligatures_in tab cursor 79 | 80 | #: Note that this refers to programming ligatures, typically 81 | #: implemented using the calt OpenType feature. For disabling general 82 | #: ligatures, use the font_features option. 83 | 84 | font_features +calt +liga 85 | 86 | #: E.g. font_features none 87 | 88 | #: Choose exactly which OpenType features to enable or disable. This 89 | #: is useful as some fonts might have features worthwhile in a 90 | #: terminal. For example, Fira Code includes a discretionary feature, 91 | #: zero, which in that font changes the appearance of the zero (0), to 92 | #: make it more easily distinguishable from Ø. Fira Code also includes 93 | #: other discretionary features known as Stylistic Sets which have the 94 | #: tags ss01 through ss20. 95 | 96 | #: For the exact syntax to use for individual features, see the 97 | #: HarfBuzz documentation . 99 | 100 | #: Note that this code is indexed by PostScript name, and not the font 101 | #: family. This allows you to define very precise feature settings; 102 | #: e.g. you can disable a feature in the italic font but not in the 103 | #: regular font. 104 | 105 | #: On Linux, font features are first read from the FontConfig database 106 | #: and then this option is applied, so they can be configured in a 107 | #: single, central place. 108 | 109 | #: To get the PostScript name for a font, use `kitty +list-fonts 110 | #: --psnames`: 111 | 112 | #: .. code-block:: sh 113 | 114 | #: $ kitty +list-fonts --psnames | grep Fira 115 | #: Fira Code 116 | #: Fira Code Bold (FiraCode-Bold) 117 | #: Fira Code Light (FiraCode-Light) 118 | #: Fira Code Medium (FiraCode-Medium) 119 | #: Fira Code Regular (FiraCode-Regular) 120 | #: Fira Code Retina (FiraCode-Retina) 121 | 122 | #: The part in brackets is the PostScript name. 123 | 124 | #: Enable alternate zero and oldstyle numerals:: 125 | 126 | #: font_features FiraCode-Retina +zero +onum 127 | 128 | #: Enable only alternate zero in the bold font:: 129 | 130 | #: font_features FiraCode-Bold +zero 131 | 132 | #: Disable the normal ligatures, but keep the calt feature which (in 133 | #: this font) breaks up monotony:: 134 | 135 | #: font_features TT2020StyleB-Regular -liga +calt 136 | 137 | #: In conjunction with force_ltr, you may want to disable Arabic 138 | #: shaping entirely, and only look at their isolated forms if they 139 | #: show up in a document. You can do this with e.g.:: 140 | 141 | #: font_features UnifontMedium +isol -medi -fina -init 142 | 143 | # modify_font 144 | 145 | #: Modify font characteristics such as the position or thickness of 146 | #: the underline and strikethrough. The modifications can have the 147 | #: suffix px for pixels or % for percentage of original value. No 148 | #: suffix means use pts. For example:: 149 | 150 | #: modify_font underline_position -2 151 | #: modify_font underline_thickness 150% 152 | #: modify_font strikethrough_position 2px 153 | 154 | #: Additionally, you can modify the size of the cell in which each 155 | #: font glyph is rendered and the baseline at which the glyph is 156 | #: placed in the cell. For example:: 157 | 158 | #: modify_font cell_width 80% 159 | #: modify_font cell_height -2px 160 | #: modify_font baseline 3 161 | 162 | #: Note that modifying the baseline will automatically adjust the 163 | #: underline and strikethrough positions by the same amount. 164 | #: Increasing the baseline raises glyphs inside the cell and 165 | #: decreasing it lowers them. Decreasing the cell size might cause 166 | #: rendering artifacts, so use with care. 167 | 168 | # box_drawing_scale 0.001, 1, 1.5, 2 169 | 170 | #: The sizes of the lines used for the box drawing Unicode characters. 171 | #: These values are in pts. They will be scaled by the monitor DPI to 172 | #: arrive at a pixel value. There must be four values corresponding to 173 | #: thin, normal, thick, and very thick lines. 174 | 175 | # undercurl_style thin-sparse 176 | 177 | #: The style with which undercurls are rendered. This option takes the 178 | #: form (thin|thick)-(sparse|dense). Thin and thick control the 179 | #: thickness of the undercurl. Sparse and dense control how often the 180 | #: curl oscillates. With sparse the curl will peak once per character, 181 | #: with dense twice. 182 | 183 | # text_composition_strategy 3 184 | 185 | #: Control how kitty composites text glyphs onto the background color. 186 | #: The default value of platform tries for text rendering as close to 187 | #: "native" for the platform kitty is running on as possible. 188 | 189 | #: A value of legacy uses the old (pre kitty 0.28) strategy for how 190 | #: glyphs are composited. This will make dark text on light 191 | #: backgrounds look thicker and light text on dark backgrounds 192 | #: thinner. It might also make some text appear like the strokes are 193 | #: uneven. 194 | 195 | #: You can fine tune the actual contrast curve used for glyph 196 | #: composition by specifying up to two space-separated numbers for 197 | #: this setting. 198 | 199 | #: The first number is the gamma adjustment, which controls the 200 | #: thickness of dark text on light backgrounds. Increasing the value 201 | #: will make text appear thicker. The default value for this is 1.0 on 202 | #: Linux and 1.7 on macOS. Valid values are 0.01 and above. The result 203 | #: is scaled based on the luminance difference between the background 204 | #: and the foreground. Dark text on light backgrounds receives the 205 | #: full impact of the curve while light text on dark backgrounds is 206 | #: affected very little. 207 | 208 | #: The second number is an additional multiplicative contrast. It is 209 | #: percentage ranging from 0 to 100. The default value is 0 on Linux 210 | #: and 30 on macOS. 211 | 212 | #: If you wish to achieve similar looking thickness in light and dark 213 | #: themes, a good way to experiment is start by setting the value to 214 | #: 1.0 0 and use a dark theme. Then adjust the second parameter until 215 | #: it looks good. Then switch to a light theme and adjust the first 216 | #: parameter until the perceived thickness matches the dark theme. 217 | 218 | # text_fg_override_threshold 0 219 | 220 | #: The minimum accepted difference in luminance between the foreground 221 | #: and background color, below which kitty will override the 222 | #: foreground color. It is percentage ranging from 0 to 100. If the 223 | #: difference in luminance of the foreground and background is below 224 | #: this threshold, the foreground color will be set to white if the 225 | #: background is dark or black if the background is light. The default 226 | #: value is 0, which means no overriding is performed. Useful when 227 | #: working with applications that use colors that do not contrast well 228 | #: with your preferred color scheme. 229 | 230 | #: }}} 231 | 232 | #: Cursor customization {{{ 233 | 234 | # cursor #cccccc 235 | 236 | #: Default cursor color. If set to the special value none the cursor 237 | #: will be rendered with a "reverse video" effect. It's color will be 238 | #: the color of the text in the cell it is over and the text will be 239 | #: rendered with the background color of the cell. Note that if the 240 | #: program running in the terminal sets a cursor color, this takes 241 | #: precedence. Also, the cursor colors are modified if the cell 242 | #: background and foreground colors have very low contrast. 243 | 244 | # cursor_text_color #111111 245 | 246 | #: The color of text under the cursor. If you want it rendered with 247 | #: the background color of the cell underneath instead, use the 248 | #: special keyword: background. Note that if cursor is set to none 249 | #: then this option is ignored. 250 | 251 | # cursor_shape block 252 | 253 | #: The cursor shape can be one of block, beam, underline. Note that 254 | #: when reloading the config this will be changed only if the cursor 255 | #: shape has not been set by the program running in the terminal. This 256 | #: sets the default cursor shape, applications running in the terminal 257 | #: can override it. In particular, shell integration 258 | #: in kitty sets 259 | #: the cursor shape to beam at shell prompts. You can avoid this by 260 | #: setting shell_integration to no-cursor. 261 | 262 | # cursor_beam_thickness 1.5 263 | 264 | #: The thickness of the beam cursor (in pts). 265 | 266 | # cursor_underline_thickness 2.0 267 | 268 | #: The thickness of the underline cursor (in pts). 269 | 270 | cursor_blink_interval 0 271 | 272 | #: The interval to blink the cursor (in seconds). Set to zero to 273 | #: disable blinking. Negative values mean use system default. Note 274 | #: that the minimum interval will be limited to repaint_delay. 275 | 276 | # cursor_stop_blinking_after 15.0 277 | 278 | #: Stop blinking cursor after the specified number of seconds of 279 | #: keyboard inactivity. Set to zero to never stop blinking. 280 | 281 | #: }}} 282 | 283 | #: Scrollback {{{ 284 | 285 | # scrollback_lines 2000 286 | 287 | #: Number of lines of history to keep in memory for scrolling back. 288 | #: Memory is allocated on demand. Negative numbers are (effectively) 289 | #: infinite scrollback. Note that using very large scrollback is not 290 | #: recommended as it can slow down performance of the terminal and 291 | #: also use large amounts of RAM. Instead, consider using 292 | #: scrollback_pager_history_size. Note that on config reload if this 293 | #: is changed it will only affect newly created windows, not existing 294 | #: ones. 295 | 296 | # scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER 297 | 298 | #: Program with which to view scrollback in a new window. The 299 | #: scrollback buffer is passed as STDIN to this program. If you change 300 | #: it, make sure the program you use can handle ANSI escape sequences 301 | #: for colors and text formatting. INPUT_LINE_NUMBER in the command 302 | #: line above will be replaced by an integer representing which line 303 | #: should be at the top of the screen. Similarly CURSOR_LINE and 304 | #: CURSOR_COLUMN will be replaced by the current cursor position or 305 | #: set to 0 if there is no cursor, for example, when showing the last 306 | #: command output. 307 | 308 | # scrollback_pager_history_size 0 309 | 310 | #: Separate scrollback history size (in MB), used only for browsing 311 | #: the scrollback buffer with pager. This separate buffer is not 312 | #: available for interactive scrolling but will be piped to the pager 313 | #: program when viewing scrollback buffer in a separate window. The 314 | #: current implementation stores the data in UTF-8, so approximately 315 | #: 10000 lines per megabyte at 100 chars per line, for pure ASCII, 316 | #: unformatted text. A value of zero or less disables this feature. 317 | #: The maximum allowed size is 4GB. Note that on config reload if this 318 | #: is changed it will only affect newly created windows, not existing 319 | #: ones. 320 | 321 | # scrollback_fill_enlarged_window no 322 | 323 | #: Fill new space with lines from the scrollback buffer after 324 | #: enlarging a window. 325 | 326 | # wheel_scroll_multiplier 5.0 327 | 328 | #: Multiplier for the number of lines scrolled by the mouse wheel. 329 | #: Note that this is only used for low precision scrolling devices, 330 | #: not for high precision scrolling devices on platforms such as macOS 331 | #: and Wayland. Use negative numbers to change scroll direction. See 332 | #: also wheel_scroll_min_lines. 333 | 334 | # wheel_scroll_min_lines 1 335 | 336 | #: The minimum number of lines scrolled by the mouse wheel. The scroll 337 | #: multiplier wheel_scroll_multiplier only takes effect after it 338 | #: reaches this number. Note that this is only used for low precision 339 | #: scrolling devices like wheel mice that scroll by very small amounts 340 | #: when using the wheel. With a negative number, the minimum number of 341 | #: lines will always be added. 342 | 343 | # touch_scroll_multiplier 1.0 344 | 345 | #: Multiplier for the number of lines scrolled by a touchpad. Note 346 | #: that this is only used for high precision scrolling devices on 347 | #: platforms such as macOS and Wayland. Use negative numbers to change 348 | #: scroll direction. 349 | 350 | #: }}} 351 | 352 | #: Mouse {{{ 353 | 354 | # mouse_hide_wait 3.0 355 | 356 | #: Hide mouse cursor after the specified number of seconds of the 357 | #: mouse not being used. Set to zero to disable mouse cursor hiding. 358 | #: Set to a negative value to hide the mouse cursor immediately when 359 | #: typing text. Disabled by default on macOS as getting it to work 360 | #: robustly with the ever-changing sea of bugs that is Cocoa is too 361 | #: much effort. 362 | 363 | # url_color #0087bd 364 | # url_style curly 365 | 366 | #: The color and style for highlighting URLs on mouse-over. url_style 367 | #: can be one of: none, straight, double, curly, dotted, dashed. 368 | 369 | # open_url_with default 370 | 371 | #: The program to open clicked URLs. The special value default with 372 | #: first look for any URL handlers defined via the open_actions 373 | #: facility and if non 374 | #: are found, it will use the Operating System's default URL handler 375 | #: (open on macOS and xdg-open on Linux). 376 | 377 | # url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh 378 | 379 | #: The set of URL prefixes to look for when detecting a URL under the 380 | #: mouse cursor. 381 | 382 | # detect_urls yes 383 | 384 | #: Detect URLs under the mouse. Detected URLs are highlighted with an 385 | #: underline and the mouse cursor becomes a hand over them. Even if 386 | #: this option is disabled, URLs are still clickable. 387 | 388 | # url_excluded_characters 389 | 390 | #: Additional characters to be disallowed from URLs, when detecting 391 | #: URLs under the mouse cursor. By default, all characters that are 392 | #: legal in URLs are allowed. Additionally, newlines are allowed (but 393 | #: stripped). This is to accommodate programs such as mutt that add 394 | #: hard line breaks even for continued lines. \n can be added to this 395 | #: option to disable this behavior. Special characters can be 396 | #: specified using backslash escapes, to specify a backslash use a 397 | #: double backslash. 398 | 399 | # show_hyperlink_targets no 400 | 401 | #: When the mouse hovers over a terminal hyperlink, show the actual 402 | #: URL that will be activated when the hyperlink is clicked. 403 | 404 | # copy_on_select no 405 | 406 | #: Copy to clipboard or a private buffer on select. With this set to 407 | #: clipboard, selecting text with the mouse will cause the text to be 408 | #: copied to clipboard. Useful on platforms such as macOS that do not 409 | #: have the concept of primary selection. You can instead specify a 410 | #: name such as a1 to copy to a private kitty buffer. Map a shortcut 411 | #: with the paste_from_buffer action to paste from this private 412 | #: buffer. For example:: 413 | 414 | #: copy_on_select a1 415 | #: map shift+cmd+v paste_from_buffer a1 416 | 417 | #: Note that copying to the clipboard is a security risk, as all 418 | #: programs, including websites open in your browser can read the 419 | #: contents of the system clipboard. 420 | 421 | # paste_actions quote-urls-at-prompt 422 | 423 | #: A comma separated list of actions to take when pasting text into 424 | #: the terminal. The supported paste actions are: 425 | 426 | #: quote-urls-at-prompt: 427 | #: If the text being pasted is a URL and the cursor is at a shell prompt, 428 | #: automatically quote the URL (needs shell_integration). 429 | #: confirm: 430 | #: Confirm the paste if bracketed paste mode is not active or there is 431 | #: a large amount of text being pasted. 432 | #: filter: 433 | #: Run the filter_paste() function from the file paste-actions.py in 434 | #: the kitty config directory on the pasted text. The text returned by the 435 | #: function will be actually pasted. 436 | 437 | # strip_trailing_spaces never 438 | 439 | #: Remove spaces at the end of lines when copying to clipboard. A 440 | #: value of smart will do it when using normal selections, but not 441 | #: rectangle selections. A value of always will always do it. 442 | 443 | # select_by_word_characters @-./_~?&=%+# 444 | 445 | #: Characters considered part of a word when double clicking. In 446 | #: addition to these characters any character that is marked as an 447 | #: alphanumeric character in the Unicode database will be matched. 448 | 449 | # select_by_word_characters_forward 450 | 451 | #: Characters considered part of a word when extending the selection 452 | #: forward on double clicking. In addition to these characters any 453 | #: character that is marked as an alphanumeric character in the 454 | #: Unicode database will be matched. 455 | 456 | #: If empty (default) select_by_word_characters will be used for both 457 | #: directions. 458 | 459 | # click_interval -1.0 460 | 461 | #: The interval between successive clicks to detect double/triple 462 | #: clicks (in seconds). Negative numbers will use the system default 463 | #: instead, if available, or fallback to 0.5. 464 | 465 | # focus_follows_mouse no 466 | 467 | #: Set the active window to the window under the mouse when moving the 468 | #: mouse around. 469 | 470 | # pointer_shape_when_grabbed arrow 471 | 472 | #: The shape of the mouse pointer when the program running in the 473 | #: terminal grabs the mouse. Valid values are: arrow, beam and hand. 474 | 475 | # default_pointer_shape beam 476 | 477 | #: The default shape of the mouse pointer. Valid values are: arrow, 478 | #: beam and hand. 479 | 480 | # pointer_shape_when_dragging beam 481 | 482 | #: The default shape of the mouse pointer when dragging across text. 483 | #: Valid values are: arrow, beam and hand. 484 | 485 | #: Mouse actions {{{ 486 | 487 | #: Mouse buttons can be mapped to perform arbitrary actions. The 488 | #: syntax is: 489 | 490 | #: .. code-block:: none 491 | 492 | #: mouse_map button-name event-type modes action 493 | 494 | #: Where button-name is one of left, middle, right, b1 ... b8 with 495 | #: added keyboard modifiers. For example: ctrl+shift+left refers to 496 | #: holding the Ctrl+Shift keys while clicking with the left mouse 497 | #: button. The value b1 ... b8 can be used to refer to up to eight 498 | #: buttons on a mouse. 499 | 500 | #: event-type is one of press, release, doublepress, triplepress, 501 | #: click, doubleclick. modes indicates whether the action is performed 502 | #: when the mouse is grabbed by the program running in the terminal, 503 | #: or not. The values are grabbed or ungrabbed or a comma separated 504 | #: combination of them. grabbed refers to when the program running in 505 | #: the terminal has requested mouse events. Note that the click and 506 | #: double click events have a delay of click_interval to disambiguate 507 | #: from double and triple presses. 508 | 509 | #: You can run kitty with the kitty --debug-input command line option 510 | #: to see mouse events. See the builtin actions below to get a sense 511 | #: of what is possible. 512 | 513 | #: If you want to unmap an action, map it to no_op. For example, to 514 | #: disable opening of URLs with a plain click:: 515 | 516 | #: mouse_map left click ungrabbed no_op 517 | 518 | #: See all the mappable actions including mouse actions here 519 | #: . 520 | 521 | #: .. note:: 522 | #: Once a selection is started, releasing the button that started it will 523 | #: automatically end it and no release event will be dispatched. 524 | 525 | # clear_all_mouse_actions no 526 | 527 | #: Remove all mouse action definitions up to this point. Useful, for 528 | #: instance, to remove the default mouse actions. 529 | 530 | #: Click the link under the mouse or move the cursor 531 | 532 | # mouse_map left click ungrabbed mouse_handle_click selection link prompt 533 | 534 | #:: First check for a selection and if one exists do nothing. Then 535 | #:: check for a link under the mouse cursor and if one exists, click 536 | #:: it. Finally check if the click happened at the current shell 537 | #:: prompt and if so, move the cursor to the click location. Note 538 | #:: that this requires shell integration 539 | #:: to work. 540 | 541 | #: Click the link under the mouse or move the cursor even when grabbed 542 | 543 | # mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt 544 | 545 | #:: Same as above, except that the action is performed even when the 546 | #:: mouse is grabbed by the program running in the terminal. 547 | 548 | #: Click the link under the mouse cursor 549 | 550 | # mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link 551 | 552 | #:: Variant with Ctrl+Shift is present because the simple click based 553 | #:: version has an unavoidable delay of click_interval, to 554 | #:: disambiguate clicks from double clicks. 555 | 556 | #: Discard press event for link click 557 | 558 | # mouse_map ctrl+shift+left press grabbed discard_event 559 | 560 | #:: Prevent this press event from being sent to the program that has 561 | #:: grabbed the mouse, as the corresponding release event is used to 562 | #:: open a URL. 563 | 564 | #: Paste from the primary selection 565 | 566 | # mouse_map middle release ungrabbed paste_from_selection 567 | 568 | #: Start selecting text 569 | 570 | # mouse_map left press ungrabbed mouse_selection normal 571 | 572 | #: Start selecting text in a rectangle 573 | 574 | # mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle 575 | 576 | #: Select a word 577 | 578 | # mouse_map left doublepress ungrabbed mouse_selection word 579 | 580 | #: Select a line 581 | 582 | # mouse_map left triplepress ungrabbed mouse_selection line 583 | 584 | #: Select line from point 585 | 586 | # mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point 587 | 588 | #:: Select from the clicked point to the end of the line. 589 | 590 | #: Extend the current selection 591 | 592 | # mouse_map right press ungrabbed mouse_selection extend 593 | 594 | #:: If you want only the end of the selection to be moved instead of 595 | #:: the nearest boundary, use move-end instead of extend. 596 | 597 | #: Paste from the primary selection even when grabbed 598 | 599 | # mouse_map shift+middle release ungrabbed,grabbed paste_selection 600 | # mouse_map shift+middle press grabbed discard_event 601 | 602 | #: Start selecting text even when grabbed 603 | 604 | # mouse_map shift+left press ungrabbed,grabbed mouse_selection normal 605 | 606 | #: Start selecting text in a rectangle even when grabbed 607 | 608 | # mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle 609 | 610 | #: Select a word even when grabbed 611 | 612 | # mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word 613 | 614 | #: Select a line even when grabbed 615 | 616 | # mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line 617 | 618 | #: Select line from point even when grabbed 619 | 620 | # mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point 621 | 622 | #:: Select from the clicked point to the end of the line even when 623 | #:: grabbed. 624 | 625 | #: Extend the current selection even when grabbed 626 | 627 | # mouse_map shift+right press ungrabbed,grabbed mouse_selection extend 628 | 629 | #: Show clicked command output in pager 630 | 631 | # mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output 632 | 633 | #:: Requires shell integration 634 | #:: to work. 635 | 636 | #: }}} 637 | 638 | #: }}} 639 | 640 | #: Performance tuning {{{ 641 | 642 | # repaint_delay 10 643 | 644 | #: Delay between screen updates (in milliseconds). Decreasing it, 645 | #: increases frames-per-second (FPS) at the cost of more CPU usage. 646 | #: The default value yields ~100 FPS which is more than sufficient for 647 | #: most uses. Note that to actually achieve 100 FPS, you have to 648 | #: either set sync_to_monitor to no or use a monitor with a high 649 | #: refresh rate. Also, to minimize latency when there is pending input 650 | #: to be processed, this option is ignored. 651 | 652 | # input_delay 3 653 | 654 | #: Delay before input from the program running in the terminal is 655 | #: processed (in milliseconds). Note that decreasing it will increase 656 | #: responsiveness, but also increase CPU usage and might cause flicker 657 | #: in full screen programs that redraw the entire screen on each loop, 658 | #: because kitty is so fast that partial screen updates will be drawn. 659 | 660 | # sync_to_monitor yes 661 | 662 | #: Sync screen updates to the refresh rate of the monitor. This 663 | #: prevents screen tearing 664 | #: when scrolling. 665 | #: However, it limits the rendering speed to the refresh rate of your 666 | #: monitor. With a very high speed mouse/high keyboard repeat rate, 667 | #: you may notice some slight input latency. If so, set this to no. 668 | 669 | #: }}} 670 | 671 | #: Terminal bell {{{ 672 | 673 | enable_audio_bell no 674 | 675 | #: The audio bell. Useful to disable it in environments that require 676 | #: silence. 677 | 678 | # visual_bell_duration 0.0 679 | 680 | #: The visual bell duration (in seconds). Flash the screen when a bell 681 | #: occurs for the specified number of seconds. Set to zero to disable. 682 | 683 | # visual_bell_color none 684 | 685 | #: The color used by visual bell. Set to none will fall back to 686 | #: selection background color. If you feel that the visual bell is too 687 | #: bright, you can set it to a darker color. 688 | 689 | window_alert_on_bell no 690 | 691 | #: Request window attention on bell. Makes the dock icon bounce on 692 | #: macOS or the taskbar flash on linux. 693 | 694 | # bell_on_tab "🔔 " 695 | 696 | #: Some text or a Unicode symbol to show on the tab if a window in the 697 | #: tab that does not have focus has a bell. If you want to use leading 698 | #: or trailing spaces, surround the text with quotes. See 699 | #: tab_title_template for how this is rendered. 700 | 701 | #: For backwards compatibility, values of yes, y and true are 702 | #: converted to the default bell symbol and no, n, false and none are 703 | #: converted to the empty string. 704 | 705 | # command_on_bell none 706 | 707 | #: Program to run when a bell occurs. The environment variable 708 | #: KITTY_CHILD_CMDLINE can be used to get the program running in the 709 | #: window in which the bell occurred. 710 | 711 | # bell_path none 712 | 713 | #: Path to a sound file to play as the bell sound. If set to none, the 714 | #: system default bell sound is used. Must be in a format supported by 715 | #: the operating systems sound API, such as WAV or OGA on Linux 716 | #: (libcanberra) or AIFF, MP3 or WAV on macOS (NSSound) 717 | 718 | # linux_bell_theme __custom 719 | 720 | #: The XDG Sound Theme kitty will use to play the bell sound. Defaults 721 | #: to the custom theme name used by GNOME and Budgie, falling back to 722 | #: the default freedesktop theme if it does not exist. This option may 723 | #: be removed if Linux ever provides desktop-agnostic support for 724 | #: setting system sound themes. 725 | 726 | #: }}} 727 | 728 | #: Window layout {{{ 729 | 730 | remember_window_size no 731 | initial_window_width 100c 732 | initial_window_height 30c 733 | 734 | #: If enabled, the OS Window size will be remembered so that new 735 | #: instances of kitty will have the same size as the previous 736 | #: instance. If disabled, the OS Window will initially have size 737 | #: configured by initial_window_width/height, in pixels. You can use a 738 | #: suffix of "c" on the width/height values to have them interpreted 739 | #: as number of cells instead of pixels. 740 | 741 | # enabled_layouts * 742 | 743 | #: The enabled window layouts. A comma separated list of layout names. 744 | #: The special value all means all layouts. The first listed layout 745 | #: will be used as the startup layout. Default configuration is all 746 | #: layouts in alphabetical order. For a list of available layouts, see 747 | #: the layouts . 748 | 749 | # window_resize_step_cells 2 750 | # window_resize_step_lines 2 751 | 752 | #: The step size (in units of cell width/cell height) to use when 753 | #: resizing kitty windows in a layout with the shortcut 754 | #: start_resizing_window. The cells value is used for horizontal 755 | #: resizing, and the lines value is used for vertical resizing. 756 | 757 | # window_border_width 0.5pt 758 | 759 | #: The width of window borders. Can be either in pixels (px) or pts 760 | #: (pt). Values in pts will be rounded to the nearest number of pixels 761 | #: based on screen resolution. If not specified, the unit is assumed 762 | #: to be pts. Note that borders are displayed only when more than one 763 | #: window is visible. They are meant to separate multiple windows. 764 | 765 | # draw_minimal_borders yes 766 | 767 | #: Draw only the minimum borders needed. This means that only the 768 | #: borders that separate the window from a neighbor are drawn. Note 769 | #: that setting a non-zero window_margin_width overrides this and 770 | #: causes all borders to be drawn. 771 | 772 | # window_margin_width 0 773 | 774 | #: The window margin (in pts) (blank area outside the border). A 775 | #: single value sets all four sides. Two values set the vertical and 776 | #: horizontal sides. Three values set top, horizontal and bottom. Four 777 | #: values set top, right, bottom and left. 778 | 779 | # single_window_margin_width -1 780 | 781 | #: The window margin to use when only a single window is visible (in 782 | #: pts). Negative values will cause the value of window_margin_width 783 | #: to be used instead. A single value sets all four sides. Two values 784 | #: set the vertical and horizontal sides. Three values set top, 785 | #: horizontal and bottom. Four values set top, right, bottom and left. 786 | 787 | window_padding_width 10 788 | 789 | #: The window padding (in pts) (blank area between the text and the 790 | #: window border). A single value sets all four sides. Two values set 791 | #: the vertical and horizontal sides. Three values set top, horizontal 792 | #: and bottom. Four values set top, right, bottom and left. 793 | 794 | # placement_strategy center 795 | 796 | #: When the window size is not an exact multiple of the cell size, the 797 | #: cell area of the terminal window will have some extra padding on 798 | #: the sides. You can control how that padding is distributed with 799 | #: this option. Using a value of center means the cell area will be 800 | #: placed centrally. A value of top-left means the padding will be 801 | #: only at the bottom and right edges. 802 | 803 | # active_border_color #00ff00 804 | 805 | #: The color for the border of the active window. Set this to none to 806 | #: not draw borders around the active window. 807 | 808 | # inactive_border_color #cccccc 809 | 810 | #: The color for the border of inactive windows. 811 | 812 | # bell_border_color #ff5a00 813 | 814 | #: The color for the border of inactive windows in which a bell has 815 | #: occurred. 816 | 817 | # inactive_text_alpha 1.0 818 | 819 | #: Fade the text in inactive windows by the specified amount (a number 820 | #: between zero and one, with zero being fully faded). 821 | 822 | hide_window_decorations yes 823 | 824 | #: Hide the window decorations (title-bar and window borders) with 825 | #: yes. On macOS, titlebar-only and titlebar-and-corners can be used 826 | #: to only hide the titlebar and the rounded corners. Whether this 827 | #: works and exactly what effect it has depends on the window 828 | #: manager/operating system. Note that the effects of changing this 829 | #: option when reloading config are undefined. When using titlebar- 830 | #: only, it is useful to also set window_margin_width and 831 | #: placement_strategy to prevent the rounded corners from clipping 832 | #: text. Or use titlebar-and-corners. 833 | 834 | # window_logo_path none 835 | 836 | #: Path to a logo image. Must be in PNG format. Relative paths are 837 | #: interpreted relative to the kitty config directory. The logo is 838 | #: displayed in a corner of every kitty window. The position is 839 | #: controlled by window_logo_position. Individual windows can be 840 | #: configured to have different logos either using the launch action 841 | #: or the remote control facility. 843 | 844 | # window_logo_position bottom-right 845 | 846 | #: Where to position the window logo in the window. The value can be 847 | #: one of: top-left, top, top-right, left, center, right, bottom-left, 848 | #: bottom, bottom-right. 849 | 850 | # window_logo_alpha 0.5 851 | 852 | #: The amount the logo should be faded into the background. With zero 853 | #: being fully faded and one being fully opaque. 854 | 855 | # resize_debounce_time 0.1 0.5 856 | 857 | #: The time to wait before redrawing the screen during a live resize 858 | #: of the OS window, when no new resize events have been received, 859 | #: i.e. when resizing is either paused or finished. On platforms such 860 | #: as macOS, where the operating system sends events corresponding to 861 | #: the start and end of a live resize, the second number is used for 862 | #: redraw-after-pause since kitty can distinguish between a pause and 863 | #: end of resizing. On such systems the first number is ignored and 864 | #: redraw is immediate after end of resize. On other systems the 865 | #: first number is used so that kitty is "ready" quickly after the end 866 | #: of resizing, while not also continuously redrawing, to save energy. 867 | 868 | # resize_in_steps no 869 | 870 | #: Resize the OS window in steps as large as the cells, instead of 871 | #: with the usual pixel accuracy. Combined with initial_window_width 872 | #: and initial_window_height in number of cells, this option can be 873 | #: used to keep the margins as small as possible when resizing the OS 874 | #: window. Note that this does not currently work on Wayland. 875 | 876 | # visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 877 | 878 | #: The list of characters for visual window selection. For example, 879 | #: for selecting a window to focus on with focus_visible_window. The 880 | #: value should be a series of unique numbers or alphabets, case 881 | #: insensitive, from the set [0-9A-Z]. Specify your preference as a 882 | #: string of characters. 883 | 884 | confirm_os_window_close 0 885 | 886 | #: Ask for confirmation when closing an OS window or a tab with at 887 | #: least this number of kitty windows in it by window manager (e.g. 888 | #: clicking the window close button or pressing the operating system 889 | #: shortcut to close windows) or by the close_tab action. A value of 890 | #: zero disables confirmation. This confirmation also applies to 891 | #: requests to quit the entire application (all OS windows, via the 892 | #: quit action). Negative values are converted to positive ones, 893 | #: however, with shell_integration enabled, using negative values 894 | #: means windows sitting at a shell prompt are not counted, only 895 | #: windows where some command is currently running. Note that if you 896 | #: want confirmation when closing individual windows, you can map the 897 | #: close_window_with_confirmation action. 898 | 899 | #: }}} 900 | 901 | #: Tab bar {{{ 902 | 903 | tab_bar_edge bottom 904 | 905 | #: The edge to show the tab bar on, top or bottom. 906 | 907 | # tab_bar_margin_width 5.0 908 | 909 | #: The margin to the left and right of the tab bar (in pts). 910 | 911 | tab_bar_margin_height 5.0 0.0 912 | 913 | #: The margin above and below the tab bar (in pts). The first number 914 | #: is the margin between the edge of the OS Window and the tab bar. 915 | #: The second number is the margin between the tab bar and the 916 | #: contents of the current tab. 917 | 918 | # tab_bar_style slant 919 | 920 | #: The tab bar style, can be one of: 921 | 922 | #: fade 923 | #: Each tab's edges fade into the background color. (See also tab_fade) 924 | #: slant 925 | #: Tabs look like the tabs in a physical file. 926 | #: separator 927 | #: Tabs are separated by a configurable separator. (See also 928 | #: tab_separator) 929 | #: powerline 930 | #: Tabs are shown as a continuous line with "fancy" separators. 931 | #: (See also tab_powerline_style) 932 | #: custom 933 | #: A user-supplied Python function called draw_tab is loaded from the file 934 | #: tab_bar.py in the kitty config directory. For examples of how to 935 | #: write such a function, see the functions named draw_tab_with_* in 936 | #: kitty's source code: kitty/tab_bar.py. See also 937 | #: this discussion 938 | #: for examples from kitty users. 939 | #: hidden 940 | #: The tab bar is hidden. If you use this, you might want to create 941 | #: a mapping for the select_tab action which presents you with a list of 942 | #: tabs and allows for easy switching to a tab. 943 | 944 | # tab_bar_align left 945 | 946 | #: The horizontal alignment of the tab bar, can be one of: left, 947 | #: center, right. 948 | 949 | # tab_bar_min_tabs 2 950 | 951 | #: The minimum number of tabs that must exist before the tab bar is 952 | #: shown. 953 | 954 | # tab_switch_strategy previous 955 | 956 | #: The algorithm to use when switching to a tab when the current tab 957 | #: is closed. The default of previous will switch to the last used 958 | #: tab. A value of left will switch to the tab to the left of the 959 | #: closed tab. A value of right will switch to the tab to the right of 960 | #: the closed tab. A value of last will switch to the right-most tab. 961 | 962 | # tab_fade 0.25 0.5 0.75 1 963 | 964 | #: Control how each tab fades into the background when using fade for 965 | #: the tab_bar_style. Each number is an alpha (between zero and one) 966 | #: that controls how much the corresponding cell fades into the 967 | #: background, with zero being no fade and one being full fade. You 968 | #: can change the number of cells used by adding/removing entries to 969 | #: this list. 970 | 971 | # tab_separator " ┇" 972 | 973 | #: The separator between tabs in the tab bar when using separator as 974 | #: the tab_bar_style. 975 | 976 | # tab_powerline_style angled 977 | 978 | #: The powerline separator style between tabs in the tab bar when 979 | #: using powerline as the tab_bar_style, can be one of: angled, 980 | #: slanted, round. 981 | 982 | # tab_activity_symbol none 983 | 984 | #: Some text or a Unicode symbol to show on the tab if a window in the 985 | #: tab that does not have focus has some activity. If you want to use 986 | #: leading or trailing spaces, surround the text with quotes. See 987 | #: tab_title_template for how this is rendered. 988 | 989 | # tab_title_max_length 0 990 | 991 | #: The maximum number of cells that can be used to render the text in 992 | #: a tab. A value of zero means that no limit is applied. 993 | 994 | # tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}" 995 | 996 | #: A template to render the tab title. The default just renders the 997 | #: title with optional symbols for bell and activity. If you wish to 998 | #: include the tab-index as well, use something like: {index}:{title}. 999 | #: Useful if you have shortcuts mapped for goto_tab N. If you prefer 1000 | #: to see the index as a superscript, use {sup.index}. All data 1001 | #: available is: 1002 | 1003 | #: title 1004 | #: The current tab title. 1005 | #: index 1006 | #: The tab index usable with goto_tab N goto_tab shortcuts. 1007 | #: layout_name 1008 | #: The current layout name. 1009 | #: num_windows 1010 | #: The number of windows in the tab. 1011 | #: num_window_groups 1012 | #: The number of window groups (a window group is a window and all of its overlay windows) in the tab. 1013 | #: tab.active_wd 1014 | #: The working directory of the currently active window in the tab 1015 | #: (expensive, requires syscall). Use active_oldest_wd to get 1016 | #: the directory of the oldest foreground process rather than the newest. 1017 | #: tab.active_exe 1018 | #: The name of the executable running in the foreground of the currently 1019 | #: active window in the tab (expensive, requires syscall). Use 1020 | #: active_oldest_exe for the oldest foreground process. 1021 | #: max_title_length 1022 | #: The maximum title length available. 1023 | 1024 | #: Note that formatting is done by Python's string formatting 1025 | #: machinery, so you can use, for instance, {layout_name[:2].upper()} 1026 | #: to show only the first two letters of the layout name, upper-cased. 1027 | #: If you want to style the text, you can use styling directives, for 1028 | #: example: 1029 | #: `{fmt.fg.red}red{fmt.fg.tab}normal{fmt.bg._00FF00}greenbg{fmt.bg.tab}`. 1030 | #: Similarly, for bold and italic: 1031 | #: `{fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}`. 1032 | #: Note that for backward compatibility, if {bell_symbol} or 1033 | #: {activity_symbol} are not present in the template, they are 1034 | #: prepended to it. 1035 | 1036 | # active_tab_title_template none 1037 | 1038 | #: Template to use for active tabs. If not specified falls back to 1039 | #: tab_title_template. 1040 | 1041 | # active_tab_foreground #000 1042 | # active_tab_background #000 1043 | # active_tab_font_style bold-italic 1044 | # inactive_tab_foreground #444 1045 | # inactive_tab_background #999 1046 | # inactive_tab_font_style normal 1047 | 1048 | #: Tab bar colors and styles. 1049 | 1050 | # tab_bar_background none 1051 | 1052 | #: Background color for the tab bar. Defaults to using the terminal 1053 | #: background color. 1054 | 1055 | # tab_bar_margin_color none 1056 | 1057 | #: Color for the tab bar margin area. Defaults to using the terminal 1058 | #: background color for margins above and below the tab bar. For side 1059 | #: margins the default color is chosen to match the background color 1060 | #: of the neighboring tab. 1061 | 1062 | #: }}} 1063 | 1064 | #: Color scheme {{{ 1065 | 1066 | # foreground #dddddd 1067 | # background #000000 1068 | 1069 | #: The foreground and background colors. 1070 | 1071 | # background_opacity 1.0 1072 | 1073 | #: The opacity of the background. A number between zero and one, where 1074 | #: one is opaque and zero is fully transparent. This will only work if 1075 | #: supported by the OS (for instance, when using a compositor under 1076 | #: X11). Note that it only sets the background color's opacity in 1077 | #: cells that have the same background color as the default terminal 1078 | #: background, so that things like the status bar in vim, powerline 1079 | #: prompts, etc. still look good. But it means that if you use a color 1080 | #: theme with a background color in your editor, it will not be 1081 | #: rendered as transparent. Instead you should change the default 1082 | #: background color in your kitty config and not use a background 1083 | #: color in the editor color scheme. Or use the escape codes to set 1084 | #: the terminals default colors in a shell script to launch your 1085 | #: editor. Be aware that using a value less than 1.0 is a (possibly 1086 | #: significant) performance hit. When using a low value for this 1087 | #: setting, it is desirable that you set the background color to a 1088 | #: color the matches the general color of the desktop background, for 1089 | #: best text rendering. If you want to dynamically change 1090 | #: transparency of windows, set dynamic_background_opacity to yes 1091 | #: (this is off by default as it has a performance cost). Changing 1092 | #: this option when reloading the config will only work if 1093 | #: dynamic_background_opacity was enabled in the original config. 1094 | 1095 | # background_blur 0 1096 | 1097 | #: Set to a positive value to enable background blur (blurring of the 1098 | #: visuals behind a transparent window) on platforms that support it. 1099 | #: Only takes effect when background_opacity is less than one. On 1100 | #: macOS, this will also control the blur radius (amount of blurring). 1101 | #: Setting it to too high a value will cause severe performance issues 1102 | #: and/or rendering artifacts. Usually, values up to 64 work well. 1103 | #: Note that this might cause performance issues, depending on how the 1104 | #: platform implements it, so use with care. Currently supported on 1105 | #: macOS and KDE/X11. 1106 | 1107 | # background_image none 1108 | 1109 | #: Path to a background image. Must be in PNG format. 1110 | 1111 | # background_image_layout tiled 1112 | 1113 | #: Whether to tile, scale or clamp the background image. The value can 1114 | #: be one of tiled, mirror-tiled, scaled, clamped, centered or 1115 | #: cscaled. The scaled and cscaled values scale the image to the 1116 | #: window size, with cscaled preserving the image aspect ratio. 1117 | 1118 | # background_image_linear no 1119 | 1120 | #: When background image is scaled, whether linear interpolation 1121 | #: should be used. 1122 | 1123 | # dynamic_background_opacity no 1124 | 1125 | #: Allow changing of the background_opacity dynamically, using either 1126 | #: keyboard shortcuts (increase_background_opacity and 1127 | #: decrease_background_opacity) or the remote control facility. 1128 | #: Changing this option by reloading the config is not supported. 1129 | 1130 | # background_tint 0.0 1131 | 1132 | #: How much to tint the background image by the background color. This 1133 | #: option makes it easier to read the text. Tinting is done using the 1134 | #: current background color for each window. This option applies only 1135 | #: if background_opacity is set and transparent windows are supported 1136 | #: or background_image is set. 1137 | 1138 | # background_tint_gaps 1.0 1139 | 1140 | #: How much to tint the background image at the window gaps by the 1141 | #: background color, after applying background_tint. Since this is 1142 | #: multiplicative with background_tint, it can be used to lighten the 1143 | #: tint over the window gaps for a *separated* look. 1144 | 1145 | # dim_opacity 0.4 1146 | 1147 | #: How much to dim text that has the DIM/FAINT attribute set. One 1148 | #: means no dimming and zero means fully dimmed (i.e. invisible). 1149 | 1150 | # selection_foreground #000000 1151 | # selection_background #fffacd 1152 | 1153 | #: The foreground and background colors for text selected with the 1154 | #: mouse. Setting both of these to none will cause a "reverse video" 1155 | #: effect for selections, where the selection will be the cell text 1156 | #: color and the text will become the cell background color. Setting 1157 | #: only selection_foreground to none will cause the foreground color 1158 | #: to be used unchanged. Note that these colors can be overridden by 1159 | #: the program running in the terminal. 1160 | 1161 | #: The color table {{{ 1162 | 1163 | #: The 256 terminal colors. There are 8 basic colors, each color has a 1164 | #: dull and bright version, for the first 16 colors. You can set the 1165 | #: remaining 240 colors as color16 to color255. 1166 | 1167 | # color0 #000000 1168 | # color8 #767676 1169 | 1170 | #: black 1171 | 1172 | # color1 #cc0403 1173 | # color9 #f2201f 1174 | 1175 | #: red 1176 | 1177 | # color2 #19cb00 1178 | # color10 #23fd00 1179 | 1180 | #: green 1181 | 1182 | # color3 #cecb00 1183 | # color11 #fffd00 1184 | 1185 | #: yellow 1186 | 1187 | # color4 #0d73cc 1188 | # color12 #1a8fff 1189 | 1190 | #: blue 1191 | 1192 | # color5 #cb1ed1 1193 | # color13 #fd28ff 1194 | 1195 | #: magenta 1196 | 1197 | # color6 #0dcdcd 1198 | # color14 #14ffff 1199 | 1200 | #: cyan 1201 | 1202 | # color7 #dddddd 1203 | # color15 #ffffff 1204 | 1205 | #: white 1206 | 1207 | # mark1_foreground black 1208 | 1209 | #: Color for marks of type 1 1210 | 1211 | # mark1_background #98d3cb 1212 | 1213 | #: Color for marks of type 1 (light steel blue) 1214 | 1215 | # mark2_foreground black 1216 | 1217 | #: Color for marks of type 2 1218 | 1219 | # mark2_background #f2dcd3 1220 | 1221 | #: Color for marks of type 1 (beige) 1222 | 1223 | # mark3_foreground black 1224 | 1225 | #: Color for marks of type 3 1226 | 1227 | # mark3_background #f274bc 1228 | 1229 | #: Color for marks of type 3 (violet) 1230 | 1231 | #: }}} 1232 | 1233 | #: }}} 1234 | 1235 | #: Advanced {{{ 1236 | 1237 | # shell . 1238 | 1239 | #: The shell program to execute. The default value of . means to use 1240 | #: whatever shell is set as the default shell for the current user. 1241 | #: Note that on macOS if you change this, you might need to add 1242 | #: --login and --interactive to ensure that the shell starts in 1243 | #: interactive mode and reads its startup rc files. 1244 | 1245 | # editor . 1246 | 1247 | #: The terminal based text editor (such as vim or nano) to use when 1248 | #: editing the kitty config file or similar tasks. 1249 | 1250 | #: The default value of . means to use the environment variables 1251 | #: VISUAL and EDITOR in that order. If these variables aren't set, 1252 | #: kitty will run your shell ($SHELL -l -i -c env) to see if your 1253 | #: shell startup rc files set VISUAL or EDITOR. If that doesn't work, 1254 | #: kitty will cycle through various known editors (vim, emacs, etc.) 1255 | #: and take the first one that exists on your system. 1256 | 1257 | # close_on_child_death no 1258 | 1259 | #: Close the window when the child process (shell) exits. With the 1260 | #: default value no, the terminal will remain open when the child 1261 | #: exits as long as there are still processes outputting to the 1262 | #: terminal (for example disowned or backgrounded processes). When 1263 | #: enabled with yes, the window will close as soon as the child 1264 | #: process exits. Note that setting it to yes means that any 1265 | #: background processes still using the terminal can fail silently 1266 | #: because their stdout/stderr/stdin no longer work. 1267 | 1268 | # remote_control_password 1269 | 1270 | #: Allow other programs to control kitty using passwords. This option 1271 | #: can be specified multiple times to add multiple passwords. If no 1272 | #: passwords are present kitty will ask the user for permission if a 1273 | #: program tries to use remote control with a password. A password can 1274 | #: also *optionally* be associated with a set of allowed remote 1275 | #: control actions. For example:: 1276 | 1277 | #: remote_control_password "my passphrase" get-colors set-colors focus-window focus-tab 1278 | 1279 | #: Only the specified actions will be allowed when using this 1280 | #: password. Glob patterns can be used too, for example:: 1281 | 1282 | #: remote_control_password "my passphrase" set-tab-* resize-* 1283 | 1284 | #: To get a list of available actions, run:: 1285 | 1286 | #: kitty @ --help 1287 | 1288 | #: A set of actions to be allowed when no password is sent can be 1289 | #: specified by using an empty password. For example:: 1290 | 1291 | #: remote_control_password "" *-colors 1292 | 1293 | #: Finally, the path to a python module can be specified that provides 1294 | #: a function is_cmd_allowed that is used to check every remote 1295 | #: control command. For example:: 1296 | 1297 | #: remote_control_password "my passphrase" my_rc_command_checker.py 1298 | 1299 | #: Relative paths are resolved from the kitty configuration directory. 1300 | #: See rc_custom_auth for details. 1302 | 1303 | # allow_remote_control no 1304 | 1305 | #: Allow other programs to control kitty. If you turn this on, other 1306 | #: programs can control all aspects of kitty, including sending text 1307 | #: to kitty windows, opening new windows, closing windows, reading the 1308 | #: content of windows, etc. Note that this even works over SSH 1309 | #: connections. The default setting of no prevents any form of remote 1310 | #: control. The meaning of the various values are: 1311 | 1312 | #: password 1313 | #: Remote control requests received over both the TTY device and the socket 1314 | #: are confirmed based on passwords, see remote_control_password. 1315 | 1316 | #: socket-only 1317 | #: Remote control requests received over a socket are accepted 1318 | #: unconditionally. Requests received over the TTY are denied. 1319 | #: See listen_on. 1320 | 1321 | #: socket 1322 | #: Remote control requests received over a socket are accepted 1323 | #: unconditionally. Requests received over the TTY are confirmed based on 1324 | #: password. 1325 | 1326 | #: no 1327 | #: Remote control is completely disabled. 1328 | 1329 | #: yes 1330 | #: Remote control requests are always accepted. 1331 | 1332 | # listen_on none 1333 | 1334 | #: Listen to the specified UNIX socket for remote control connections. 1335 | #: Note that this will apply to all kitty instances. It can be 1336 | #: overridden by the kitty --listen-on command line option, which also 1337 | #: supports listening on a TCP socket. This option accepts only UNIX 1338 | #: sockets, such as unix:${TEMP}/mykitty or unix:@mykitty (on Linux). 1339 | #: Environment variables are expanded and relative paths are resolved 1340 | #: with respect to the temporary directory. If {kitty_pid} is present, 1341 | #: then it is replaced by the PID of the kitty process, otherwise the 1342 | #: PID of the kitty process is appended to the value, with a hyphen. 1343 | #: See the help for kitty --listen-on for more details. Note that this 1344 | #: will be ignored unless allow_remote_control is set to either: yes, 1345 | #: socket or socket-only. Changing this option by reloading the config 1346 | #: is not supported. 1347 | 1348 | # env 1349 | 1350 | #: Specify the environment variables to be set in all child processes. 1351 | #: Using the name with an equal sign (e.g. env VAR=) will set it to 1352 | #: the empty string. Specifying only the name (e.g. env VAR) will 1353 | #: remove the variable from the child process' environment. Note that 1354 | #: environment variables are expanded recursively, for example:: 1355 | 1356 | #: env VAR1=a 1357 | #: env VAR2=${HOME}/${VAR1}/b 1358 | 1359 | #: The value of VAR2 will be /a/b. 1360 | 1361 | # watcher 1362 | 1363 | #: Path to python file which will be loaded for watchers 1364 | #: . Can be 1365 | #: specified more than once to load multiple watchers. The watchers 1366 | #: will be added to every kitty window. Relative paths are resolved 1367 | #: relative to the kitty config directory. Note that reloading the 1368 | #: config will only affect windows created after the reload. 1369 | 1370 | # exe_search_path 1371 | 1372 | #: Control where kitty finds the programs to run. The default search 1373 | #: order is: First search the system wide PATH, then ~/.local/bin and 1374 | #: ~/bin. If still not found, the PATH defined in the login shell 1375 | #: after sourcing all its startup files is tried. Finally, if present, 1376 | #: the PATH specified by the env option is tried. 1377 | 1378 | #: This option allows you to prepend, append, or remove paths from 1379 | #: this search order. It can be specified multiple times for multiple 1380 | #: paths. A simple path will be prepended to the search order. A path 1381 | #: that starts with the + sign will be append to the search order, 1382 | #: after ~/bin above. A path that starts with the - sign will be 1383 | #: removed from the entire search order. For example:: 1384 | 1385 | #: exe_search_path /some/prepended/path 1386 | #: exe_search_path +/some/appended/path 1387 | #: exe_search_path -/some/excluded/path 1388 | 1389 | # update_check_interval 24 1390 | 1391 | #: The interval to periodically check if an update to kitty is 1392 | #: available (in hours). If an update is found, a system notification 1393 | #: is displayed informing you of the available update. The default is 1394 | #: to check every 24 hours, set to zero to disable. Update checking is 1395 | #: only done by the official binary builds. Distro packages or source 1396 | #: builds do not do update checking. Changing this option by reloading 1397 | #: the config is not supported. 1398 | 1399 | # startup_session none 1400 | 1401 | #: Path to a session file to use for all kitty instances. Can be 1402 | #: overridden by using the kitty --session =none command line option 1403 | #: for individual instances. See sessions 1404 | #: in the kitty 1405 | #: documentation for details. Note that relative paths are interpreted 1406 | #: with respect to the kitty config directory. Environment variables 1407 | #: in the path are expanded. Changing this option by reloading the 1408 | #: config is not supported. 1409 | 1410 | # clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask 1411 | 1412 | #: Allow programs running in kitty to read and write from the 1413 | #: clipboard. You can control exactly which actions are allowed. The 1414 | #: possible actions are: write-clipboard, read-clipboard, write- 1415 | #: primary, read-primary, read-clipboard-ask, read-primary-ask. The 1416 | #: default is to allow writing to the clipboard and primary selection 1417 | #: and to ask for permission when a program tries to read from the 1418 | #: clipboard. Note that disabling the read confirmation is a security 1419 | #: risk as it means that any program, even the ones running on a 1420 | #: remote server via SSH can read your clipboard. See also 1421 | #: clipboard_max_size. 1422 | 1423 | # clipboard_max_size 512 1424 | 1425 | #: The maximum size (in MB) of data from programs running in kitty 1426 | #: that will be stored for writing to the system clipboard. A value of 1427 | #: zero means no size limit is applied. See also clipboard_control. 1428 | 1429 | # file_transfer_confirmation_bypass 1430 | 1431 | #: The password that can be supplied to the file transfer kitten 1432 | #: to skip the 1433 | #: transfer confirmation prompt. This should only be used when 1434 | #: initiating transfers from trusted computers, over trusted networks 1435 | #: or encrypted transports, as it allows any programs running on the 1436 | #: remote machine to read/write to the local filesystem, without 1437 | #: permission. 1438 | 1439 | # allow_hyperlinks yes 1440 | 1441 | #: Process hyperlink escape sequences (OSC 8). If disabled OSC 8 1442 | #: escape sequences are ignored. Otherwise they become clickable 1443 | #: links, that you can click with the mouse or by using the hints 1444 | #: kitten . The 1445 | #: special value of ask means that kitty will ask before opening the 1446 | #: link when clicked. 1447 | 1448 | shell_integration no-cursor 1449 | 1450 | #: Enable shell integration on supported shells. This enables features 1451 | #: such as jumping to previous prompts, browsing the output of the 1452 | #: previous command in a pager, etc. on supported shells. Set to 1453 | #: disabled to turn off shell integration, completely. It is also 1454 | #: possible to disable individual features, set to a space separated 1455 | #: list of these values: no-rc, no-cursor, no-title, no-cwd, no- 1456 | #: prompt-mark, no-complete. See Shell integration 1457 | #: for details. 1458 | 1459 | # allow_cloning ask 1460 | 1461 | #: Control whether programs running in the terminal can request new 1462 | #: windows to be created. The canonical example is clone-in-kitty 1463 | #: . 1464 | #: By default, kitty will ask for permission for each clone request. 1465 | #: Allowing cloning unconditionally gives programs running in the 1466 | #: terminal (including over SSH) permission to execute arbitrary code, 1467 | #: as the user who is running the terminal, on the computer that the 1468 | #: terminal is running on. 1469 | 1470 | # clone_source_strategies venv,conda,env_var,path 1471 | 1472 | #: Control what shell code is sourced when running clone-in-kitty in 1473 | #: the newly cloned window. The supported strategies are: 1474 | 1475 | #: venv 1476 | #: Source the file $VIRTUAL_ENV/bin/activate. This is used by the 1477 | #: Python stdlib venv module and allows cloning venvs automatically. 1478 | #: conda 1479 | #: Run conda activate $CONDA_DEFAULT_ENV. This supports the virtual 1480 | #: environments created by conda. 1481 | #: env_var 1482 | #: Execute the contents of the environment variable 1483 | #: KITTY_CLONE_SOURCE_CODE with eval. 1484 | #: path 1485 | #: Source the file pointed to by the environment variable 1486 | #: KITTY_CLONE_SOURCE_PATH. 1487 | 1488 | #: This option must be a comma separated list of the above values. 1489 | #: This only source the first valid one in the above order. 1490 | 1491 | term xterm-256color 1492 | 1493 | #: The value of the TERM environment variable to set. Changing this 1494 | #: can break many terminal programs, only change it if you know what 1495 | #: you are doing, not because you read some advice on "Stack Overflow" 1496 | #: to change it. The TERM variable is used by various programs to get 1497 | #: information about the capabilities and behavior of the terminal. If 1498 | #: you change it, depending on what programs you run, and how 1499 | #: different the terminal you are changing it to is, various things 1500 | #: from key-presses, to colors, to various advanced features may not 1501 | #: work. Changing this option by reloading the config will only affect 1502 | #: newly created windows. 1503 | 1504 | #: }}} 1505 | 1506 | #: OS specific tweaks {{{ 1507 | 1508 | # wayland_titlebar_color system 1509 | 1510 | #: The color of the kitty window's titlebar on Wayland systems with 1511 | #: client side window decorations such as GNOME. A value of system 1512 | #: means to use the default system color, a value of background means 1513 | #: to use the background color of the currently active window and 1514 | #: finally you can use an arbitrary color, such as #12af59 or red. 1515 | 1516 | # macos_titlebar_color system 1517 | 1518 | #: The color of the kitty window's titlebar on macOS. A value of 1519 | #: system means to use the default system color, light or dark can 1520 | #: also be used to set it explicitly. A value of background means to 1521 | #: use the background color of the currently active window and finally 1522 | #: you can use an arbitrary color, such as #12af59 or red. WARNING: 1523 | #: This option works by using a hack when arbitrary color (or 1524 | #: background) is configured, as there is no proper Cocoa API for it. 1525 | #: It sets the background color of the entire window and makes the 1526 | #: titlebar transparent. As such it is incompatible with 1527 | #: background_opacity. If you want to use both, you are probably 1528 | #: better off just hiding the titlebar with hide_window_decorations. 1529 | 1530 | # macos_option_as_alt no 1531 | 1532 | #: Use the Option key as an Alt key on macOS. With this set to no, 1533 | #: kitty will use the macOS native Option+Key to enter Unicode 1534 | #: character behavior. This will break any Alt+Key keyboard shortcuts 1535 | #: in your terminal programs, but you can use the macOS Unicode input 1536 | #: technique. You can use the values: left, right or both to use only 1537 | #: the left, right or both Option keys as Alt, instead. Note that 1538 | #: kitty itself always treats Option the same as Alt. This means you 1539 | #: cannot use this option to configure different kitty shortcuts for 1540 | #: Option+Key vs. Alt+Key. Also, any kitty shortcuts using 1541 | #: Option/Alt+Key will take priority, so that any such key presses 1542 | #: will not be passed to terminal programs running inside kitty. 1543 | #: Changing this option by reloading the config is not supported. 1544 | 1545 | # macos_hide_from_tasks no 1546 | 1547 | #: Hide the kitty window from running tasks on macOS (⌘+Tab and the 1548 | #: Dock). Changing this option by reloading the config is not 1549 | #: supported. 1550 | 1551 | # macos_quit_when_last_window_closed no 1552 | 1553 | #: Have kitty quit when all the top-level windows are closed on macOS. 1554 | #: By default, kitty will stay running, even with no open windows, as 1555 | #: is the expected behavior on macOS. 1556 | 1557 | # macos_window_resizable yes 1558 | 1559 | #: Disable this if you want kitty top-level OS windows to not be 1560 | #: resizable on macOS. 1561 | 1562 | # macos_thicken_font 0 1563 | 1564 | #: Draw an extra border around the font with the given width, to 1565 | #: increase legibility at small font sizes on macOS. For example, a 1566 | #: value of 0.75 will result in rendering that looks similar to sub- 1567 | #: pixel antialiasing at common font sizes. Note that in modern kitty, 1568 | #: this option is obsolete (although still supported). Consider using 1569 | #: text_composition_strategy instead. 1570 | 1571 | # macos_traditional_fullscreen no 1572 | 1573 | #: Use the macOS traditional full-screen transition, that is faster, 1574 | #: but less pretty. 1575 | 1576 | # macos_show_window_title_in all 1577 | 1578 | #: Control where the window title is displayed on macOS. A value of 1579 | #: window will show the title of the currently active window at the 1580 | #: top of the macOS window. A value of menubar will show the title of 1581 | #: the currently active window in the macOS global menu bar, making 1582 | #: use of otherwise wasted space. A value of all will show the title 1583 | #: in both places, and none hides the title. See 1584 | #: macos_menubar_title_max_length for how to control the length of the 1585 | #: title in the menu bar. 1586 | 1587 | # macos_menubar_title_max_length 0 1588 | 1589 | #: The maximum number of characters from the window title to show in 1590 | #: the macOS global menu bar. Values less than one means that there is 1591 | #: no maximum limit. 1592 | 1593 | # macos_custom_beam_cursor no 1594 | 1595 | #: Use a custom mouse cursor for macOS that is easier to see on both 1596 | #: light and dark backgrounds. Nowadays, the default macOS cursor 1597 | #: already comes with a white border. WARNING: this might make your 1598 | #: mouse cursor invisible on dual GPU machines. Changing this option 1599 | #: by reloading the config is not supported. 1600 | 1601 | # macos_colorspace srgb 1602 | 1603 | #: The colorspace in which to interpret terminal colors. The default 1604 | #: of srgb will cause colors to match those seen in web browsers. The 1605 | #: value of default will use whatever the native colorspace of the 1606 | #: display is. The value of displayp3 will use Apple's special 1607 | #: snowflake display P3 color space, which will result in over 1608 | #: saturated (brighter) colors with some color shift. Reloading 1609 | #: configuration will change this value only for newly created OS 1610 | #: windows. 1611 | 1612 | # linux_display_server auto 1613 | 1614 | #: Choose between Wayland and X11 backends. By default, an appropriate 1615 | #: backend based on the system state is chosen automatically. Set it 1616 | #: to x11 or wayland to force the choice. Changing this option by 1617 | #: reloading the config is not supported. 1618 | 1619 | #: }}} 1620 | 1621 | #: Keyboard shortcuts {{{ 1622 | 1623 | #: Keys are identified simply by their lowercase Unicode characters. 1624 | #: For example: a for the A key, [ for the left square bracket key, 1625 | #: etc. For functional keys, such as Enter or Escape, the names are 1626 | #: present at Functional key definitions 1627 | #: . 1628 | #: For modifier keys, the names are ctrl (control, ⌃), shift (⇧), alt 1629 | #: (opt, option, ⌥), super (cmd, command, ⌘). See also: GLFW mods 1630 | #: 1631 | 1632 | #: On Linux you can also use XKB key names to bind keys that are not 1633 | #: supported by GLFW. See XKB keys 1634 | #: for a list of key names. The name to use is the part 1636 | #: after the XKB_KEY_ prefix. Note that you can only use an XKB key 1637 | #: name for keys that are not known as GLFW keys. 1638 | 1639 | #: Finally, you can use raw system key codes to map keys, again only 1640 | #: for keys that are not known as GLFW keys. To see the system key 1641 | #: code for a key, start kitty with the kitty --debug-input option, 1642 | #: kitty will output some debug text for every key event. In that text 1643 | #: look for native_code, the value of that becomes the key name in the 1644 | #: shortcut. For example: 1645 | 1646 | #: .. code-block:: none 1647 | 1648 | #: on_key_input: glfw key: 0x61 native_code: 0x61 action: PRESS mods: none text: 'a' 1649 | 1650 | #: Here, the key name for the A key is 0x61 and you can use it with:: 1651 | 1652 | #: map ctrl+0x61 something 1653 | 1654 | #: to map Ctrl+A to something. 1655 | 1656 | #: You can use the special action no_op to unmap a keyboard shortcut 1657 | #: that is assigned in the default configuration:: 1658 | 1659 | #: map kitty_mod+space no_op 1660 | 1661 | #: If you would like kitty to completely ignore a key event, not even 1662 | #: sending it to the program running in the terminal, map it to 1663 | #: discard_event:: 1664 | 1665 | #: map kitty_mod+f1 discard_event 1666 | 1667 | #: You can combine multiple actions to be triggered by a single 1668 | #: shortcut with combine action, using the syntax below:: 1669 | 1670 | #: map key combine action1 action2 action3 ... 1671 | 1672 | #: For example:: 1673 | 1674 | #: map kitty_mod+e combine : new_window : next_layout 1675 | 1676 | #: This will create a new window and switch to the next available 1677 | #: layout. 1678 | 1679 | #: You can use multi-key shortcuts with the syntax shown below:: 1680 | 1681 | #: map key1>key2>key3 action 1682 | 1683 | #: For example:: 1684 | 1685 | #: map ctrl+f>2 set_font_size 20 1686 | 1687 | #: The full list of actions that can be mapped to key presses is 1688 | #: available here . 1689 | 1690 | # kitty_mod ctrl+shift 1691 | 1692 | #: Special modifier key alias for default shortcuts. You can change 1693 | #: the value of this option to alter all default shortcuts that use 1694 | #: kitty_mod. 1695 | 1696 | # clear_all_shortcuts no 1697 | 1698 | #: Remove all shortcut definitions up to this point. Useful, for 1699 | #: instance, to remove the default shortcuts. 1700 | 1701 | # action_alias 1702 | 1703 | #: E.g. action_alias launch_tab launch --type=tab --cwd=current 1704 | 1705 | #: Define action aliases to avoid repeating the same options in 1706 | #: multiple mappings. Aliases can be defined for any action and will 1707 | #: be expanded recursively. For example, the above alias allows you to 1708 | #: create mappings to launch a new tab in the current working 1709 | #: directory without duplication:: 1710 | 1711 | #: map f1 launch_tab vim 1712 | #: map f2 launch_tab emacs 1713 | 1714 | #: Similarly, to alias kitten invocation:: 1715 | 1716 | #: action_alias hints kitten hints --hints-offset=0 1717 | 1718 | # kitten_alias 1719 | 1720 | #: E.g. kitten_alias hints hints --hints-offset=0 1721 | 1722 | #: Like action_alias above, but specifically for kittens. Generally, 1723 | #: prefer to use action_alias. This option is a legacy version, 1724 | #: present for backwards compatibility. It causes all invocations of 1725 | #: the aliased kitten to be substituted. So the example above will 1726 | #: cause all invocations of the hints kitten to have the --hints- 1727 | #: offset=0 option applied. 1728 | 1729 | #: Clipboard {{{ 1730 | 1731 | #: Copy to clipboard 1732 | 1733 | # map kitty_mod+c copy_to_clipboard 1734 | # map cmd+c copy_to_clipboard 1735 | 1736 | #:: There is also a copy_or_interrupt action that can be optionally 1737 | #:: mapped to Ctrl+C. It will copy only if there is a selection and 1738 | #:: send an interrupt otherwise. Similarly, 1739 | #:: copy_and_clear_or_interrupt will copy and clear the selection or 1740 | #:: send an interrupt if there is no selection. 1741 | 1742 | #: Paste from clipboard 1743 | 1744 | # map kitty_mod+v paste_from_clipboard 1745 | # map cmd+v paste_from_clipboard 1746 | 1747 | #: Paste from selection 1748 | 1749 | # map kitty_mod+s paste_from_selection 1750 | # map shift+insert paste_from_selection 1751 | 1752 | #: Pass selection to program 1753 | 1754 | # map kitty_mod+o pass_selection_to_program 1755 | 1756 | #:: You can also pass the contents of the current selection to any 1757 | #:: program with pass_selection_to_program. By default, the system's 1758 | #:: open program is used, but you can specify your own, the selection 1759 | #:: will be passed as a command line argument to the program. For 1760 | #:: example:: 1761 | 1762 | #:: map kitty_mod+o pass_selection_to_program firefox 1763 | 1764 | #:: You can pass the current selection to a terminal program running 1765 | #:: in a new kitty window, by using the @selection placeholder:: 1766 | 1767 | #:: map kitty_mod+y new_window less @selection 1768 | 1769 | #: }}} 1770 | 1771 | #: Scrolling {{{ 1772 | 1773 | #: Scroll line up 1774 | 1775 | # map kitty_mod+up scroll_line_up 1776 | # map kitty_mod+k scroll_line_up 1777 | # map opt+cmd+page_up scroll_line_up 1778 | # map cmd+up scroll_line_up 1779 | 1780 | #: Scroll line down 1781 | 1782 | # map kitty_mod+down scroll_line_down 1783 | # map kitty_mod+j scroll_line_down 1784 | # map opt+cmd+page_down scroll_line_down 1785 | # map cmd+down scroll_line_down 1786 | 1787 | #: Scroll page up 1788 | 1789 | # map kitty_mod+page_up scroll_page_up 1790 | # map cmd+page_up scroll_page_up 1791 | 1792 | #: Scroll page down 1793 | 1794 | # map kitty_mod+page_down scroll_page_down 1795 | # map cmd+page_down scroll_page_down 1796 | 1797 | #: Scroll to top 1798 | 1799 | # map kitty_mod+home scroll_home 1800 | # map cmd+home scroll_home 1801 | 1802 | #: Scroll to bottom 1803 | 1804 | # map kitty_mod+end scroll_end 1805 | # map cmd+end scroll_end 1806 | 1807 | #: Scroll to previous shell prompt 1808 | 1809 | # map kitty_mod+z scroll_to_prompt -1 1810 | 1811 | #:: Use a parameter of 0 for scroll_to_prompt to scroll to the last 1812 | #:: jumped to or the last clicked position. Requires shell 1813 | #:: integration 1814 | #:: to work. 1815 | 1816 | #: Scroll to next shell prompt 1817 | 1818 | # map kitty_mod+x scroll_to_prompt 1 1819 | 1820 | #: Browse scrollback buffer in pager 1821 | 1822 | # map kitty_mod+h show_scrollback 1823 | 1824 | #:: You can pipe the contents of the current screen and history 1825 | #:: buffer as STDIN to an arbitrary program using launch --stdin- 1826 | #:: source. For example, the following opens the scrollback buffer in 1827 | #:: less in an overlay window:: 1828 | 1829 | #:: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R 1830 | 1831 | #:: For more details on piping screen and buffer contents to external 1832 | #:: programs, see launch . 1833 | 1834 | #: Browse output of the last shell command in pager 1835 | 1836 | # map kitty_mod+g show_last_command_output 1837 | 1838 | #:: You can also define additional shortcuts to get the command 1839 | #:: output. For example, to get the first command output on screen:: 1840 | 1841 | #:: map f1 show_first_command_output_on_screen 1842 | 1843 | #:: To get the command output that was last accessed by a keyboard 1844 | #:: action or mouse action:: 1845 | 1846 | #:: map f1 show_last_visited_command_output 1847 | 1848 | #:: You can pipe the output of the last command run in the shell 1849 | #:: using the launch action. For example, the following opens the 1850 | #:: output in less in an overlay window:: 1851 | 1852 | #:: map f1 launch --stdin-source=@last_cmd_output --stdin-add-formatting --type=overlay less +G -R 1853 | 1854 | #:: To get the output of the first command on the screen, use 1855 | #:: @first_cmd_output_on_screen. To get the output of the last jumped 1856 | #:: to command, use @last_visited_cmd_output. 1857 | 1858 | #:: Requires shell integration 1859 | #:: to work. 1860 | 1861 | #: }}} 1862 | 1863 | #: Window management {{{ 1864 | 1865 | #: New window 1866 | 1867 | # map kitty_mod+enter new_window 1868 | # map cmd+enter new_window 1869 | 1870 | #:: You can open a new kitty window running an arbitrary program, for 1871 | #:: example:: 1872 | 1873 | #:: map kitty_mod+y launch mutt 1874 | 1875 | #:: You can open a new window with the current working directory set 1876 | #:: to the working directory of the current window using:: 1877 | 1878 | #:: map ctrl+alt+enter launch --cwd=current 1879 | 1880 | #:: You can open a new window that is allowed to control kitty via 1881 | #:: the kitty remote control facility with launch --allow-remote- 1882 | #:: control. Any programs running in that window will be allowed to 1883 | #:: control kitty. For example:: 1884 | 1885 | #:: map ctrl+enter launch --allow-remote-control some_program 1886 | 1887 | #:: You can open a new window next to the currently active window or 1888 | #:: as the first window, with:: 1889 | 1890 | #:: map ctrl+n launch --location=neighbor 1891 | #:: map ctrl+f launch --location=first 1892 | 1893 | #:: For more details, see launch 1894 | #:: . 1895 | 1896 | #: New OS window 1897 | 1898 | # map kitty_mod+n new_os_window 1899 | # map cmd+n new_os_window 1900 | 1901 | #:: Works like new_window above, except that it opens a top-level OS 1902 | #:: window. In particular you can use new_os_window_with_cwd to open 1903 | #:: a window with the current working directory. 1904 | 1905 | #: Close window 1906 | 1907 | # map kitty_mod+w close_window 1908 | # map shift+cmd+d close_window 1909 | 1910 | #: Next window 1911 | 1912 | # map kitty_mod+] next_window 1913 | 1914 | #: Previous window 1915 | 1916 | # map kitty_mod+[ previous_window 1917 | 1918 | #: Move window forward 1919 | 1920 | # map kitty_mod+f move_window_forward 1921 | 1922 | #: Move window backward 1923 | 1924 | # map kitty_mod+b move_window_backward 1925 | 1926 | #: Move window to top 1927 | 1928 | # map kitty_mod+` move_window_to_top 1929 | 1930 | #: Start resizing window 1931 | 1932 | # map kitty_mod+r start_resizing_window 1933 | # map cmd+r start_resizing_window 1934 | 1935 | #: First window 1936 | 1937 | # map kitty_mod+1 first_window 1938 | # map cmd+1 first_window 1939 | 1940 | #: Second window 1941 | 1942 | # map kitty_mod+2 second_window 1943 | # map cmd+2 second_window 1944 | 1945 | #: Third window 1946 | 1947 | # map kitty_mod+3 third_window 1948 | # map cmd+3 third_window 1949 | 1950 | #: Fourth window 1951 | 1952 | # map kitty_mod+4 fourth_window 1953 | # map cmd+4 fourth_window 1954 | 1955 | #: Fifth window 1956 | 1957 | # map kitty_mod+5 fifth_window 1958 | # map cmd+5 fifth_window 1959 | 1960 | #: Sixth window 1961 | 1962 | # map kitty_mod+6 sixth_window 1963 | # map cmd+6 sixth_window 1964 | 1965 | #: Seventh window 1966 | 1967 | # map kitty_mod+7 seventh_window 1968 | # map cmd+7 seventh_window 1969 | 1970 | #: Eighth window 1971 | 1972 | # map kitty_mod+8 eighth_window 1973 | # map cmd+8 eighth_window 1974 | 1975 | #: Ninth window 1976 | 1977 | # map kitty_mod+9 ninth_window 1978 | # map cmd+9 ninth_window 1979 | 1980 | #: Tenth window 1981 | 1982 | # map kitty_mod+0 tenth_window 1983 | 1984 | #: Visually select and focus window 1985 | 1986 | # map kitty_mod+f7 focus_visible_window 1987 | 1988 | #:: Display overlay numbers and alphabets on the window, and switch 1989 | #:: the focus to the window when you press the key. When there are 1990 | #:: only two windows, the focus will be switched directly without 1991 | #:: displaying the overlay. You can change the overlay characters and 1992 | #:: their order with option visual_window_select_characters. 1993 | 1994 | #: Visually swap window with another 1995 | 1996 | # map kitty_mod+f8 swap_with_window 1997 | 1998 | #:: Works like focus_visible_window above, but swaps the window. 1999 | 2000 | #: }}} 2001 | 2002 | #: Tab management {{{ 2003 | 2004 | #: Next tab 2005 | 2006 | # map kitty_mod+right next_tab 2007 | # map shift+cmd+] next_tab 2008 | # map ctrl+tab next_tab 2009 | 2010 | #: Previous tab 2011 | 2012 | # map kitty_mod+left previous_tab 2013 | # map shift+cmd+[ previous_tab 2014 | # map ctrl+shift+tab previous_tab 2015 | 2016 | #: New tab 2017 | 2018 | # map kitty_mod+t new_tab 2019 | # map cmd+t new_tab 2020 | 2021 | #: Close tab 2022 | 2023 | # map kitty_mod+q close_tab 2024 | # map cmd+w close_tab 2025 | 2026 | #: Close OS window 2027 | 2028 | # map shift+cmd+w close_os_window 2029 | 2030 | #: Move tab forward 2031 | 2032 | # map kitty_mod+. move_tab_forward 2033 | 2034 | #: Move tab backward 2035 | 2036 | # map kitty_mod+, move_tab_backward 2037 | 2038 | #: Set tab title 2039 | 2040 | # map kitty_mod+alt+t set_tab_title 2041 | # map shift+cmd+i set_tab_title 2042 | 2043 | 2044 | #: You can also create shortcuts to go to specific tabs, with 1 being 2045 | #: the first tab, 2 the second tab and -1 being the previously active 2046 | #: tab, and any number larger than the last tab being the last tab:: 2047 | 2048 | #: map ctrl+alt+1 goto_tab 1 2049 | #: map ctrl+alt+2 goto_tab 2 2050 | 2051 | #: Just as with new_window above, you can also pass the name of 2052 | #: arbitrary commands to run when using new_tab and new_tab_with_cwd. 2053 | #: Finally, if you want the new tab to open next to the current tab 2054 | #: rather than at the end of the tabs list, use:: 2055 | 2056 | #: map ctrl+t new_tab !neighbor [optional cmd to run] 2057 | #: }}} 2058 | 2059 | #: Layout management {{{ 2060 | 2061 | #: Next layout 2062 | 2063 | # map kitty_mod+l next_layout 2064 | 2065 | 2066 | #: You can also create shortcuts to switch to specific layouts:: 2067 | 2068 | #: map ctrl+alt+t goto_layout tall 2069 | #: map ctrl+alt+s goto_layout stack 2070 | 2071 | #: Similarly, to switch back to the previous layout:: 2072 | 2073 | #: map ctrl+alt+p last_used_layout 2074 | 2075 | #: There is also a toggle_layout action that switches to the named 2076 | #: layout or back to the previous layout if in the named layout. 2077 | #: Useful to temporarily "zoom" the active window by switching to the 2078 | #: stack layout:: 2079 | 2080 | #: map ctrl+alt+z toggle_layout stack 2081 | #: }}} 2082 | 2083 | #: Font sizes {{{ 2084 | 2085 | #: You can change the font size for all top-level kitty OS windows at 2086 | #: a time or only the current one. 2087 | 2088 | #: Increase font size 2089 | 2090 | # map kitty_mod+equal change_font_size all +2.0 2091 | # map kitty_mod+plus change_font_size all +2.0 2092 | # map kitty_mod+kp_add change_font_size all +2.0 2093 | # map cmd+plus change_font_size all +2.0 2094 | # map cmd+equal change_font_size all +2.0 2095 | # map shift+cmd+equal change_font_size all +2.0 2096 | 2097 | #: Decrease font size 2098 | 2099 | # map kitty_mod+minus change_font_size all -2.0 2100 | # map kitty_mod+kp_subtract change_font_size all -2.0 2101 | # map cmd+minus change_font_size all -2.0 2102 | # map shift+cmd+minus change_font_size all -2.0 2103 | 2104 | #: Reset font size 2105 | 2106 | # map kitty_mod+backspace change_font_size all 0 2107 | # map cmd+0 change_font_size all 0 2108 | 2109 | 2110 | #: To setup shortcuts for specific font sizes:: 2111 | 2112 | #: map kitty_mod+f6 change_font_size all 10.0 2113 | 2114 | #: To setup shortcuts to change only the current OS window's font 2115 | #: size:: 2116 | 2117 | #: map kitty_mod+f6 change_font_size current 10.0 2118 | #: }}} 2119 | 2120 | #: Select and act on visible text {{{ 2121 | 2122 | #: Use the hints kitten to select text and either pass it to an 2123 | #: external program or insert it into the terminal or copy it to the 2124 | #: clipboard. 2125 | 2126 | #: Open URL 2127 | 2128 | # map kitty_mod+e open_url_with_hints 2129 | 2130 | #:: Open a currently visible URL using the keyboard. The program used 2131 | #:: to open the URL is specified in open_url_with. 2132 | 2133 | #: Insert selected path 2134 | 2135 | # map kitty_mod+p>f kitten hints --type path --program - 2136 | 2137 | #:: Select a path/filename and insert it into the terminal. Useful, 2138 | #:: for instance to run git commands on a filename output from a 2139 | #:: previous git command. 2140 | 2141 | #: Open selected path 2142 | 2143 | # map kitty_mod+p>shift+f kitten hints --type path 2144 | 2145 | #:: Select a path/filename and open it with the default open program. 2146 | 2147 | #: Insert selected line 2148 | 2149 | # map kitty_mod+p>l kitten hints --type line --program - 2150 | 2151 | #:: Select a line of text and insert it into the terminal. Useful for 2152 | #:: the output of things like: `ls -1`. 2153 | 2154 | #: Insert selected word 2155 | 2156 | # map kitty_mod+p>w kitten hints --type word --program - 2157 | 2158 | #:: Select words and insert into terminal. 2159 | 2160 | #: Insert selected hash 2161 | 2162 | # map kitty_mod+p>h kitten hints --type hash --program - 2163 | 2164 | #:: Select something that looks like a hash and insert it into the 2165 | #:: terminal. Useful with git, which uses SHA1 hashes to identify 2166 | #:: commits. 2167 | 2168 | #: Open the selected file at the selected line 2169 | 2170 | # map kitty_mod+p>n kitten hints --type linenum 2171 | 2172 | #:: Select something that looks like filename:linenum and open it in 2173 | #:: vim at the specified line number. 2174 | 2175 | #: Open the selected hyperlink 2176 | 2177 | # map kitty_mod+p>y kitten hints --type hyperlink 2178 | 2179 | #:: Select a hyperlink (i.e. a URL that has been marked as such by 2180 | #:: the terminal program, for example, by `ls --hyperlink=auto`). 2181 | 2182 | 2183 | #: The hints kitten has many more modes of operation that you can map 2184 | #: to different shortcuts. For a full description see hints kitten 2185 | #: . 2186 | #: }}} 2187 | 2188 | #: Miscellaneous {{{ 2189 | 2190 | #: Show documentation 2191 | 2192 | # map kitty_mod+f1 show_kitty_doc overview 2193 | 2194 | #: Toggle fullscreen 2195 | 2196 | # map kitty_mod+f11 toggle_fullscreen 2197 | # map ctrl+cmd+f toggle_fullscreen 2198 | 2199 | #: Toggle maximized 2200 | 2201 | # map kitty_mod+f10 toggle_maximized 2202 | 2203 | #: Toggle macOS secure keyboard entry 2204 | 2205 | # map opt+cmd+s toggle_macos_secure_keyboard_entry 2206 | 2207 | #: Unicode input 2208 | 2209 | # map kitty_mod+u kitten unicode_input 2210 | # map ctrl+cmd+space kitten unicode_input 2211 | 2212 | #: Edit config file 2213 | 2214 | # map kitty_mod+f2 edit_config_file 2215 | # map cmd+, edit_config_file 2216 | 2217 | #: Open the kitty command shell 2218 | 2219 | # map kitty_mod+escape kitty_shell window 2220 | 2221 | #:: Open the kitty shell in a new window / tab / overlay / os_window 2222 | #:: to control kitty using commands. 2223 | 2224 | #: Increase background opacity 2225 | 2226 | # map kitty_mod+a>m set_background_opacity +0.1 2227 | 2228 | #: Decrease background opacity 2229 | 2230 | # map kitty_mod+a>l set_background_opacity -0.1 2231 | 2232 | #: Make background fully opaque 2233 | 2234 | # map kitty_mod+a>1 set_background_opacity 1 2235 | 2236 | #: Reset background opacity 2237 | 2238 | # map kitty_mod+a>d set_background_opacity default 2239 | 2240 | #: Reset the terminal 2241 | 2242 | # map kitty_mod+delete clear_terminal reset active 2243 | # map opt+cmd+r clear_terminal reset active 2244 | 2245 | #:: You can create shortcuts to clear/reset the terminal. For 2246 | #:: example:: 2247 | 2248 | #:: # Reset the terminal 2249 | #:: map f1 clear_terminal reset active 2250 | #:: # Clear the terminal screen by erasing all contents 2251 | #:: map f1 clear_terminal clear active 2252 | #:: # Clear the terminal scrollback by erasing it 2253 | #:: map f1 clear_terminal scrollback active 2254 | #:: # Scroll the contents of the screen into the scrollback 2255 | #:: map f1 clear_terminal scroll active 2256 | #:: # Clear everything up to the line with the cursor 2257 | #:: map f1 clear_terminal to_cursor active 2258 | 2259 | #:: If you want to operate on all kitty windows instead of just the 2260 | #:: current one, use all instead of active. 2261 | 2262 | #:: Some useful functions that can be defined in the shell rc files 2263 | #:: to perform various kinds of clearing of the current window: 2264 | 2265 | #:: .. code-block:: sh 2266 | 2267 | #:: clear-only-screen() { 2268 | #:: printf "\e[H\e[2J" 2269 | #:: } 2270 | 2271 | #:: clear-screen-and-scrollback() { 2272 | #:: printf "\e[H\e[3J" 2273 | #:: } 2274 | 2275 | #:: clear-screen-saving-contents-in-scrollback() { 2276 | #:: printf "\e[H\e[22J" 2277 | #:: } 2278 | 2279 | #:: For instance, using these escape codes, it is possible to remap 2280 | #:: Ctrl+L to both scroll the current screen contents into the 2281 | #:: scrollback buffer and clear the screen, instead of just clearing 2282 | #:: the screen. For ZSH, in ~/.zshrc, add: 2283 | 2284 | #:: .. code-block:: zsh 2285 | 2286 | #:: ctrl_l() { 2287 | #:: builtin print -rn -- $'\r\e[0J\e[H\e[22J' >"$TTY" 2288 | #:: builtin zle .reset-prompt 2289 | #:: builtin zle -R 2290 | #:: } 2291 | #:: zle -N ctrl_l 2292 | #:: bindkey '^l' ctrl_l 2293 | 2294 | #: Clear up to cursor line 2295 | 2296 | # map cmd+k clear_terminal to_cursor active 2297 | 2298 | #: Reload kitty.conf 2299 | 2300 | # map kitty_mod+f5 load_config_file 2301 | # map ctrl+cmd+, load_config_file 2302 | 2303 | #:: Reload kitty.conf, applying any changes since the last time it 2304 | #:: was loaded. Note that a handful of options cannot be dynamically 2305 | #:: changed and require a full restart of kitty. Particularly, when 2306 | #:: changing shortcuts for actions located on the macOS global menu 2307 | #:: bar, a full restart is needed. You can also map a keybinding to 2308 | #:: load a different config file, for example:: 2309 | 2310 | #:: map f5 load_config /path/to/alternative/kitty.conf 2311 | 2312 | #:: Note that all options from the original kitty.conf are discarded, 2313 | #:: in other words the new configuration *replace* the old ones. 2314 | 2315 | #: Debug kitty configuration 2316 | 2317 | # map kitty_mod+f6 debug_config 2318 | # map opt+cmd+, debug_config 2319 | 2320 | #:: Show details about exactly what configuration kitty is running 2321 | #:: with and its host environment. Useful for debugging issues. 2322 | 2323 | #: Send arbitrary text on key presses 2324 | 2325 | #:: E.g. map ctrl+shift+alt+h send_text all Hello World 2326 | 2327 | #:: You can tell kitty to send arbitrary (UTF-8) encoded text to the 2328 | #:: client program when pressing specified shortcut keys. For 2329 | #:: example:: 2330 | 2331 | #:: map ctrl+alt+a send_text all Special text 2332 | 2333 | #:: This will send "Special text" when you press the Ctrl+Alt+A key 2334 | #:: combination. The text to be sent decodes ANSI C escapes 2335 | #:: so you can use escapes like \e to send control 2337 | #:: codes or \u21fb to send Unicode characters (or you can just input 2338 | #:: the Unicode characters directly as UTF-8 text). You can use 2339 | #:: `kitty +kitten show_key` to get the key escape codes you want to 2340 | #:: emulate. 2341 | 2342 | #:: The first argument to send_text is the keyboard modes in which to 2343 | #:: activate the shortcut. The possible values are normal, 2344 | #:: application, kitty or a comma separated combination of them. The 2345 | #:: modes normal and application refer to the DECCKM cursor key mode 2346 | #:: for terminals, and kitty refers to the kitty extended keyboard 2347 | #:: protocol. The special value all means all of them. 2348 | 2349 | #:: Some more examples:: 2350 | 2351 | #:: # Output a word and move the cursor to the start of the line (like typing and pressing Home) 2352 | #:: map ctrl+alt+a send_text normal Word\e[H 2353 | #:: map ctrl+alt+a send_text application Word\eOH 2354 | #:: # Run a command at a shell prompt (like typing the command and pressing Enter) 2355 | #:: map ctrl+alt+a send_text normal,application some command with arguments\r 2356 | 2357 | #: Open kitty Website 2358 | 2359 | # map shift+cmd+/ open_url https://sw.kovidgoyal.net/kitty/ 2360 | 2361 | #: Hide macOS kitty application 2362 | 2363 | # map cmd+h hide_macos_app 2364 | 2365 | #: Hide macOS other applications 2366 | 2367 | # map opt+cmd+h hide_macos_other_apps 2368 | 2369 | #: Minimize macOS window 2370 | 2371 | # map cmd+m minimize_macos_window 2372 | 2373 | #: Quit kitty 2374 | 2375 | # map cmd+q quit 2376 | 2377 | #: }}} 2378 | 2379 | #: }}} 2380 | 2381 | # Tab management 2382 | map ctrl+t launch --cwd=current --type=tab 2383 | map ctrl+shift+t launch --type=tab 2384 | 2385 | # map alt+1 goto_tab 1 2386 | # map alt+2 goto_tab 2 2387 | # map alt+3 goto_tab 3 2388 | # map alt+4 goto_tab 4 2389 | # map alt+5 goto_tab 5 2390 | # map alt+6 goto_tab 6 2391 | # map alt+7 goto_tab 7 2392 | # map alt+8 goto_tab 8 2393 | # map alt+9 goto_tab 8 2394 | # map alt+0 goto_tab 0 2395 | 2396 | # # Window management 2397 | # map ctrl+enter new_window_with_cwd 2398 | # # switch with ctrl+shift+l 2399 | # enabled_layouts tall,fat,stack 2400 | # map alt+f toggle_layout stack 2401 | 2402 | # map alt+shift+k move_window up 2403 | # map alt+shift+h move_window left 2404 | # map alt+shift+l move_window right 2405 | # map alt+shift+j move_window down 2406 | 2407 | # map alt+k neighboring_window up 2408 | # map alt+h neighboring_window left 2409 | # map alt+l neighboring_window right 2410 | # map alt+j neighboring_window down 2411 | 2412 | # map ctrl+left resize_window narrower 2413 | # map ctrl+right resize_window wider 2414 | # map ctrl+up resize_window taller 2415 | # map ctrl+down resize_window shorter 2416 | 2417 | # map ctrl+backspace resize_window reset 2418 | 2419 | # BEGIN_KITTY_THEME 2420 | # Everforest Light Medium 2421 | include current-theme.conf 2422 | # END_KITTY_THEME 2423 | -------------------------------------------------------------------------------- /files/shell/.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc 2 | # 3 | # M. Thomas 4 | 5 | # if not running interactively, don't do anything 6 | case $- in 7 | *i*) ;; 8 | *) return ;; 9 | esac 10 | 11 | # ============================== Prompt 12 | git_branch() { 13 | if $(git rev-parse --git-dir > /dev/null 2>&1); then 14 | local branch_name=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') 15 | echo "${branch_name} " 16 | fi 17 | } 18 | 19 | nix_env() { 20 | if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then 21 | echo "(nix)" 22 | fi 23 | } 24 | 25 | HOST="\[\033[0;33m\]\h\[\033[m\]" 26 | GIT_NIX="\[\033[0;31m\]\$(git_branch)\$(nix_env)\[\033[m\]" 27 | DIR="\[\033[0;34m\]\w\[\033[m\]" 28 | NEWLINE=$'\n' 29 | 30 | PROMPT_COMMAND=__prompt_command 31 | __prompt_command() { 32 | local EXIT="$?" 33 | 34 | # Shorten $PWD, if it's too long 35 | if [ $COLUMNS -lt 80 ]; then 36 | export PROMPT_DIRTRIM=1 37 | else 38 | export PROMPT_DIRTRIM=0 39 | fi 40 | 41 | export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}" 42 | 43 | if [ $EXIT != 0 ] 44 | then 45 | PS1+='\[\033[0;31m\]$\[\033[00m\] ' 46 | else 47 | PS1+='\[\033[0;32m\]$\[\033[00m\] ' 48 | fi 49 | } 50 | 51 | # ============================== Auto Complete 52 | 53 | # Press Tab to auto complete like zsh 54 | bind 'set show-all-if-ambiguous on' 55 | bind 'TAB:menu-complete' 56 | bind '"\e[Z":menu-complete-backward' 57 | 58 | # Auto complete ssh hosts 59 | _ssh() 60 | { 61 | local cur prev opts 62 | COMPREPLY=() 63 | cur="${COMP_WORDS[COMP_CWORD]}" 64 | prev="${COMP_WORDS[COMP_CWORD-1]}" 65 | opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-) 66 | 67 | COMPREPLY=( $(compgen -W "$opts" -- ${cur}) ) 68 | return 0 69 | } 70 | complete -F _ssh ssh 71 | complete -F _ssh s 72 | 73 | # ============================== Jump Words 74 | stty -ixon # enable forward search with C-s 75 | bind '"\en": forward-word' 76 | bind '"\ep": backward-word' 77 | 78 | # ============================== Source other definitions 79 | [ -f ~/.shellrc.alias ] && source ~/.shellrc.alias 80 | [ -f ~/.shellrc.local ] && source ~/.shellrc.local 81 | -------------------------------------------------------------------------------- /files/shell/.shellrc.alias: -------------------------------------------------------------------------------- 1 | ### System Utility 2 | alias cdt='mkdir /tmp/$(cat /proc/sys/kernel/random/uuid); cd $_' 3 | alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"' 4 | alias fixagent='eval $(tmux show-env -s | grep "^SSH_")' 5 | alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash' 6 | alias whatsmyip='curl https://ipinfo.io/ip; echo' 7 | alias mirror='wl-mirror eDP-1' 8 | 9 | ### zfs (just saved commands) 10 | # zfs send pool/path/to/zvol@snapshot| gzip -c >/mnt/some/location/zvol@20230302.gz 11 | # gzip -dc /mnt/some/location/zvol@20230302.gz | zfs receive pool/path/to/zvol 12 | 13 | ### Always ask first when moving files 14 | alias cp='cp -i' 15 | alias mv='mv -i' 16 | alias rm='rm -i' 17 | 18 | ### fzf 19 | # basics 20 | alias f='fzf --reverse' 21 | alias c='cd $(fd --type d | fzf --reverse)' 22 | 23 | # git 24 | alias gbl='git show $(git ls-files | fzf -e --reverse --bind "enter:become(git blame {1} | fzf -e --ansi --reverse | cut -f 1 -d \" \")")' 25 | gg() { 26 | git grep --color=always $1 | fzf --reverse --ansi --bind "enter:become($EDITOR {1} +{2})" --delimiter : 27 | } 28 | glg() { 29 | git log --graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | fzf --ansi --no-sort --reverse --tiebreak=index --toggle-sort=\` --bind "ctrl-m:execute: echo {} | grep -o '[a-f0-9]\{7\}' | head -1 | xargs -I % sh -c 'git show --color=always % | less -R'"; 30 | } 31 | 32 | # nix 33 | alias nd="nix develop ." 34 | alias ns="nix-shell" 35 | alias nu="nix-channel --update" 36 | alias nt="cp $HOME/.dots/templates/typst.nix . && echo 'Copied typst.nix'" 37 | 38 | tw() { 39 | typst watch $1 --open 40 | } 41 | 42 | # ripgrep 43 | rf() { 44 | rg $1 --line-number --color=always | fzf --reverse --ansi --bind "enter:become($EDITOR {1} +{2})" --delimiter : 45 | } 46 | 47 | ### Abbreviations 48 | alias d='docker' 49 | alias dc='docker compose' 50 | alias dcr='dc down && dc up -d && dc logs -f' 51 | alias dh1='du . -h -d1' 52 | alias dhs='du . -hs' 53 | alias diff_dir='diff -qr' 54 | alias g='git' 55 | alias l='ls --color --hyperlink' 56 | alias nssh='SSH_AUTH_SOCK= ssh' 57 | alias s='kitten ssh' 58 | alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE` 59 | t() { 60 | tmux new-session -A -s ${1:-dev} 61 | } 62 | 63 | ### nmcli(1) 64 | alias con='nmcli con' 65 | alias conup='nmcli con up id' 66 | alias condown='nmcli con down id' 67 | alias conscan='nmcli dev wifi' 68 | alias conedit='nm-connection-editor' 69 | 70 | # password hash (sed needed when using in docker-compose) 71 | pwhash() { 72 | name=$1 73 | if [ -z $name ]; then 74 | echo "Please enter a username." 75 | return 76 | fi 77 | echo $(htpasswd -nB ${name}) | sed -e s/\\$/\\$\\$/g 78 | } 79 | 80 | # ocr 81 | ocr() { 82 | file=$1 83 | if [ -z $file ]; then 84 | echo "Please input a file." 85 | return 86 | fi 87 | name=${file%%.*} 88 | ocrmypdf -l deu+eng --output-type pdf $file ${name}.ocr.pdf 89 | } 90 | 91 | ### laptop acpi magic 92 | 93 | conservation() { 94 | location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode' 95 | if [ -z $1 ]; then 96 | cat $location 97 | elif [ $1 = '0' ] || [ $1 = '1' ]; then 98 | echo $1 | sudo tee $location 99 | else 100 | echo 'Invalid option' 101 | fi 102 | } 103 | 104 | power() { 105 | location='/sys/firmware/acpi/platform_profile' 106 | if [ -z $1 ]; then 107 | echo "Current:" $(cat $location) 108 | echo "Can be one of:" $(cat /sys/firmware/acpi/platform_profile_choices) 109 | elif [ $1 = 'low-power' ] || [ $1 = 'balanced' ] || [ $1 = 'performance' ]; then 110 | echo $1 | sudo tee $location 111 | else 112 | echo 'Invalid option' 113 | fi 114 | } 115 | -------------------------------------------------------------------------------- /files/sway/.config/sway/config: -------------------------------------------------------------------------------- 1 | ### Variables 2 | set $mod Mod4 3 | floating_modifier $mod normal 4 | 5 | ### Output configuration (swaymsg -t get_output) 6 | # output * bg ~/cloud/images/wallpaper/wallpaper.png fit 7 | output * bg ~/downloads/wallpaper.png fill 8 | # output eDP-1 scale 2 9 | 10 | # monitor setup at home 11 | output 'AOC U34G2G1 0x00000254' mode 3440x1440@99.982Hz position 0,0 12 | output 'Acer Technologies XF270HU T78EE0048521' mode 2560x1440@143.856Hz position 440,1440 13 | bindsym $mod+p exec wdisplays 14 | 15 | # disable laptop when closed 16 | set $laptop eDP-1 17 | bindswitch --reload --locked lid:on output $laptop disable 18 | bindswitch --reload --locked lid:off output $laptop enable 19 | 20 | workspace_layout default 21 | 22 | # exec_always --no-startup-id convert -scale 10% -blur 0x2.5 -resize 1000% ~/cloud/images/wallpaper/wallpaper.png ~/cloud/images/wallpaper/lock.png 23 | # set $lock swaylock -f -i ~/cloud/images/wallpaper/lock.png 24 | set $lock swaylock -f -i ~/cloud/images/wallpaper/win_lock.png -u -s stretch 25 | exec swayidle -w \ 26 | timeout 600 '$lock' \ 27 | timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ 28 | timeout 1200 'systemctl suspend' \ 29 | before-sleep '$lock' 30 | 31 | ### Input configuration 32 | 33 | input "type:keyboard" { 34 | xkb_layout eu 35 | xkb_options caps:escape 36 | repeat_delay 250 37 | repeat_rate 100 38 | } 39 | 40 | input "type:pointer" { 41 | accel_profile flat 42 | } 43 | 44 | bindgesture swipe:3:right workspace next 45 | bindgesture swipe:3:left workspace prev 46 | 47 | bindgesture swipe:4:right focus right 48 | bindgesture swipe:4:left focus left 49 | 50 | ### Key bindings 51 | 52 | # System 53 | bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- 54 | bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ 55 | 56 | bindsym --locked XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle 57 | bindsym --locked XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.2 58 | bindsym --locked XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.2 59 | 60 | bindsym $mod+BackSpace exec $lock 61 | bindsym $mod+Control+BackSpace exec systemctl suspend 62 | 63 | bindsym $mod+Shift+s exec ~/.config/sway/screenshot -s region 64 | bindsym $mod+Ctrl+Shift+s exec ~/.config/sway/screenshot -s focused-window 65 | 66 | bindsym $mod+Ctrl+c reload 67 | bindsym $mod+Ctrl+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' 68 | 69 | bindsym $mod+Shift+q kill 70 | 71 | # Run applications 72 | bindsym $mod+Return exec kitty 73 | bindsym $mod+d exec tofi-drun | xargs swaymsg exec -- 74 | bindsym $mod+Shift+d exec tofi-run | xargs swaymsg exec -- 75 | bindsym $mod+e exec nautilus 76 | 77 | # Moving around 78 | set $left h 79 | set $down j 80 | set $up k 81 | set $right l 82 | # Move your focus around 83 | bindsym $mod+$left focus left 84 | bindsym $mod+$down focus down 85 | bindsym $mod+$up focus up 86 | bindsym $mod+$right focus right 87 | 88 | bindsym $mod+Tab focus right 89 | bindsym $mod+Shift+Tab focus left 90 | 91 | # Move the focused window with the same, but add Shift 92 | bindsym $mod+Shift+$left move left 93 | bindsym $mod+Shift+$down move down 94 | bindsym $mod+Shift+$up move up 95 | bindsym $mod+Shift+$right move right 96 | 97 | bindsym $mod+greater move workspace to output right 98 | bindsym $mod+less move workspace to output left 99 | 100 | # Workspaces 101 | # Switch to workspace 102 | bindsym $mod+1 workspace number 1 103 | bindsym $mod+2 workspace number 2 104 | bindsym $mod+3 workspace number 3 105 | bindsym $mod+4 workspace number 4 106 | bindsym $mod+5 workspace number 5 107 | bindsym $mod+6 workspace number 6 108 | bindsym $mod+7 workspace number 7 109 | bindsym $mod+8 workspace number 8 110 | bindsym $mod+9 workspace number 9 111 | bindsym $mod+0 workspace number 10 112 | # Move focused container to workspace 113 | bindsym $mod+Shift+1 move container to workspace number 1 114 | bindsym $mod+Shift+2 move container to workspace number 2 115 | bindsym $mod+Shift+3 move container to workspace number 3 116 | bindsym $mod+Shift+4 move container to workspace number 4 117 | bindsym $mod+Shift+5 move container to workspace number 5 118 | bindsym $mod+Shift+6 move container to workspace number 6 119 | bindsym $mod+Shift+7 move container to workspace number 7 120 | bindsym $mod+Shift+8 move container to workspace number 8 121 | bindsym $mod+Shift+9 move container to workspace number 9 122 | bindsym $mod+Shift+0 move container to workspace number 10 123 | 124 | # Scratchpad 125 | bindsym $mod+minus move scratchpad 126 | bindsym $mod+equal scratchpad show, border pixel none 127 | 128 | # Layout stuff 129 | bindsym $mod+f fullscreen 130 | bindsym $mod+Shift+space floating toggle; \ 131 | [tiling con_id=__focused__] border pixel none; \ 132 | [floating con_id=__focused__] border pixel none 133 | 134 | ### Theming 135 | 136 | # title bar 137 | font pango: JetBrainsMono Nerd Font Mono 10 138 | for_window [title="."] title_format "%app_id" 139 | 140 | # border 141 | hide_edge_borders --i3 smart 142 | default_border pixel none 143 | default_floating_border pixel none 144 | 145 | # inactive 146 | default_dim_inactive 0.1 147 | 148 | # gaps 149 | gaps inner 6 150 | smart_gaps off 151 | 152 | # swayfx start 153 | blur enable 154 | shadows enable 155 | corner_radius 6 156 | layer_effects "waybar" blur enable; shadows enable; corner_radius 6 157 | layer_effects "launcher" blur enable; shadows enable 158 | # swayfx end 159 | 160 | bar { 161 | swaybar_command waybar 162 | } 163 | 164 | client.focused #A7C080 #A7C080 #2D353B #A7C080 #A7C080 165 | client.focused_inactive #3D484D #2D353B #859289 #3D484D #3D484D 166 | client.unfocused #3D484D #2D353B #859289 #3D484D #3D484D 167 | client.urgent #E67E80 #E67E80 #2D353B #E67E80 #E67E80 168 | client.placeholder #2D353B #2D353B #859289 #2D353B #2D353B 169 | client.background #2D353B 170 | 171 | ### Autostart 172 | 173 | # SSH - SSH_AUTH_SOCK must be exported as env 174 | exec gnome-keyring-daemon --start 175 | 176 | # Programs 177 | exec trayscale --hide-window 178 | exec nm-applet 179 | exec swaync 180 | exec nextcloud --background 181 | exec pasystray 182 | exec fcitx5 183 | exec gammastep-indicator -l 48:11.5 184 | 185 | ### Sway defaults 186 | include /etc/sway/config.d/* 187 | -------------------------------------------------------------------------------- /files/sway/.config/sway/screenshot: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # https://github.com/moverest/sway-interactive-screenshot 4 | 5 | import abc 6 | import argparse 7 | import os 8 | import json 9 | import signal 10 | import sys 11 | import subprocess 12 | from datetime import datetime 13 | from functools import partial 14 | from typing import ( 15 | Any, 16 | Callable, 17 | Dict, 18 | Iterable, 19 | Iterator, 20 | List, 21 | NamedTuple, 22 | Union, 23 | Optional, 24 | Set, 25 | Tuple, 26 | Type, 27 | ) 28 | from pathlib import Path 29 | 30 | try: 31 | import tomllib 32 | except ModuleNotFoundError: 33 | import tomli as tomllib 34 | 35 | 36 | class ValidationError(NamedTuple): 37 | path: str 38 | error: str 39 | 40 | 41 | CONFIG_VALIDATOR = Callable[[str, Any], Iterator[ValidationError]] 42 | 43 | 44 | def config_dict_validator( 45 | field_validators: Dict[str, CONFIG_VALIDATOR] 46 | ) -> CONFIG_VALIDATOR: 47 | def validate(path: str, value: Any) -> Iterator[ValidationError]: 48 | if not isinstance(value, Dict): 49 | yield ValidationError(path, "Should be a dictionary.") 50 | return 51 | 52 | unknown_fields = set(value).difference(field_validators) 53 | for unknown_field in unknown_fields: 54 | yield ValidationError(f"{path}.{unknown_field}", "Field does not exist.") 55 | 56 | for field_name, field_value in value.items(): 57 | if field_name not in field_validators: 58 | continue 59 | 60 | yield from field_validators[field_name](f"{path}.{field_name}", field_value) 61 | 62 | return validate 63 | 64 | 65 | def config_type_validator(*types: Type) -> CONFIG_VALIDATOR: 66 | def validate(path: str, value: Any) -> Iterator[ValidationError]: 67 | if not isinstance(value, types): 68 | yield ValidationError( 69 | path, f"Type {type(value)} is not one of {', '.join(types)}." 70 | ) 71 | 72 | return validate 73 | 74 | 75 | def config_enum_validator(values: Set[Any]) -> CONFIG_VALIDATOR: 76 | def validate(path: str, value: Any) -> Iterator[ValidationError]: 77 | if value not in values: 78 | yield ValidationError(path, f"Value '{value}' not one of {values}.") 79 | 80 | return validate 81 | 82 | def config_list_validator(*types: Type) -> CONFIG_VALIDATOR: 83 | def validate(path: str, value: Any) -> Iterator[ValidationError]: 84 | if not isinstance(value, list): 85 | yield ValidationError(path, f"Expected a list") 86 | return 87 | 88 | for i, element in enumerate(value): 89 | if not isinstance(element, types): 90 | yield ValidationError( 91 | f"{path}[{i}]", f"Type {type(value)} is not one of {', '.join(types)}." 92 | ) 93 | 94 | return validate 95 | 96 | 97 | class ConfigError(Exception): 98 | def __init__(self, errors: List[ValidationError]) -> None: 99 | super().__init__( 100 | "Config errors: \n" 101 | + "\n".join(f" {error.path}: {error.error}" for error in errors) 102 | ) 103 | self.errors = errors 104 | 105 | 106 | class Config: 107 | CONFIG_DEFAULT = { 108 | "screenshot": { 109 | "prompt": "📷> ", 110 | "file_name": "screenshots/screenshot_%Y-%m-%dT%H:%M:%S.png", 111 | }, 112 | "screencast": { 113 | "prompt": "📹> ", 114 | "pid_file": "${XDG_RUNTIME_DIR}/sway-interactive-screenshot.${WAYLAND_DISPLAY}.video.pid", 115 | "file_name": "screencast_%Y-%m-%dT%H:%M:%S.mkv", 116 | "audio": "ask", 117 | }, 118 | "notification_actions": { 119 | "dragon": { 120 | "command": "dragon-drop", 121 | } 122 | }, 123 | "ask" : { 124 | "command" : "rofi", 125 | "args": [], 126 | } 127 | } 128 | 129 | _validate = staticmethod( 130 | config_dict_validator( 131 | { 132 | "screenshot": config_dict_validator( 133 | { 134 | "prompt": config_type_validator(str), 135 | "save_dir": config_type_validator(str), 136 | "file_name": config_type_validator(str), 137 | "type": config_enum_validator({"png", "jpeg", "ppm"}), 138 | "jpeg_quality": config_type_validator(int), 139 | "png_level": config_type_validator(int), 140 | "cursor": config_type_validator(bool), 141 | } 142 | ), 143 | "screencast": config_dict_validator( 144 | { 145 | "prompt": config_type_validator(str), 146 | "save_dir": config_type_validator(str), 147 | "pid_file": config_type_validator(str), 148 | "file_name": config_type_validator(str), 149 | "audio": config_enum_validator({"yes", "no", "ask"}), 150 | } 151 | ), 152 | "notification_actions": config_dict_validator( 153 | { 154 | "dragon": config_dict_validator( 155 | { 156 | "command": config_type_validator(str), 157 | } 158 | ) 159 | } 160 | ), 161 | "ask" : config_dict_validator( 162 | { 163 | "command" : config_type_validator(str), 164 | "args" : config_list_validator(str), 165 | } 166 | ), 167 | } 168 | ) 169 | ) 170 | 171 | config: Dict[str, Any] 172 | 173 | def __init__(self, filepath: Union[Path, str, None]) -> None: 174 | self._load(filepath) 175 | errors = list(self._validate("", self.config)) 176 | if errors: 177 | raise ConfigError(errors) 178 | 179 | def get(self, *path: str) -> Any: 180 | value: Any = self.config 181 | for item in path: 182 | if item not in value: 183 | default: Any = self.CONFIG_DEFAULT 184 | for item in path: 185 | default = default.get(item) 186 | if default is None: 187 | return None 188 | 189 | return default 190 | 191 | value = value.get(item) 192 | 193 | return value 194 | 195 | def _load(self, filepath: Union[Path, str, None]) -> None: 196 | if filepath is None: 197 | xdg_config_home = os.getenv("XDG_CONFIG_HOME", "~/.config") 198 | filepath = Path(xdg_config_home) / "sway-interactive-screenshot/config.toml" 199 | 200 | filepath = Path(filepath).expanduser() 201 | 202 | if filepath.exists(): 203 | with open(filepath, "rb") as f: 204 | self.config = tomllib.load(f) 205 | 206 | else: 207 | self.config = {} 208 | 209 | 210 | class CanceledError(Exception): 211 | def __init__(self, msg: Optional[str] = None) -> None: 212 | super().__init__(msg) 213 | self.msg = msg 214 | 215 | 216 | class Area(NamedTuple): 217 | output: Optional[str] = None 218 | geometry: Optional[str] = None 219 | 220 | 221 | class Window(NamedTuple): 222 | name: str 223 | x: int 224 | y: int 225 | width: int 226 | height: int 227 | focused: bool 228 | 229 | def __str__(self) -> str: 230 | return f"window: {self.name}" 231 | 232 | def get_geometry_str(self) -> str: 233 | return f"{self.x},{self.y} {self.width}x{self.height}" 234 | 235 | def get_area(self) -> Area: 236 | return Area(geometry=self.get_geometry_str()) 237 | 238 | 239 | class AllOutputs: 240 | selection_name = "all-outputs" 241 | 242 | def __str__(self) -> str: 243 | return "all outputs" 244 | 245 | def get_area(self) -> Area: 246 | return Area() 247 | 248 | 249 | class Region: 250 | selection_name = "region" 251 | 252 | def __str__(self) -> str: 253 | return "region" 254 | 255 | def get_area(self) -> Area: 256 | geometry = ask_geometry() 257 | if geometry is None: 258 | raise CanceledError("No region selected.") 259 | 260 | return Area(geometry=geometry) 261 | 262 | 263 | class FocusedWindow: 264 | selection_name = "focused-window" 265 | 266 | def __str__(self) -> str: 267 | return "focused window" 268 | 269 | def get_area(self) -> Area: 270 | window = next( 271 | (window for window in get_windows() if window.focused), 272 | None, 273 | ) 274 | if window is None: 275 | raise CanceledError("Could not find any focused window.") 276 | 277 | return window.get_area() 278 | 279 | 280 | class SelectWindow: 281 | selection_name = "select-window" 282 | 283 | def __str__(self) -> str: 284 | return "select window" 285 | 286 | def get_area(self) -> Area: 287 | windows = list(get_windows()) 288 | if not windows: 289 | raise CanceledError("No visible window found.") 290 | 291 | geometry = ask_geometry(window.get_geometry_str() for window in windows) 292 | if geometry is None: 293 | raise CanceledError("No window selected.") 294 | 295 | return Area(geometry=geometry) 296 | 297 | 298 | class FocusedOutput: 299 | selection_name = "focused-output" 300 | 301 | def __str__(self) -> str: 302 | return "focused output" 303 | 304 | def get_area(self) -> Area: 305 | output = next( 306 | (output for output in get_outputs() if output.focused), 307 | None, 308 | ) 309 | if output is None: 310 | raise CanceledError("Could not find any focused output.") 311 | 312 | return output.get_area() 313 | 314 | 315 | class Output(NamedTuple): 316 | name: str 317 | model: Optional[str] 318 | focused: bool 319 | 320 | def __str__(self) -> str: 321 | model = f" ({self.model})" if self.model else "" 322 | focused = " (focused)" if self.focused else "" 323 | return f"output: {self.name}{model}{focused}" 324 | 325 | def get_area(self) -> Area: 326 | return Area(output=self.name) 327 | 328 | 329 | class SelectOutput: 330 | selection_name = "select-output" 331 | 332 | def __str__(self) -> str: 333 | return "select output" 334 | 335 | def get_area(self) -> Area: 336 | output = ask_output() 337 | if output is None: 338 | raise CanceledError("No output selected.") 339 | 340 | return Area(output=output) 341 | 342 | 343 | def get_windows() -> Iterator[Window]: 344 | def walk(node: Dict[str, Any]) -> Iterator[Window]: 345 | sub_nodes = node.get("floating_nodes") 346 | if sub_nodes: 347 | for sub_node in sub_nodes: 348 | yield from walk(sub_node) 349 | sub_nodes = node.get("nodes") 350 | if sub_nodes: 351 | for sub_node in sub_nodes: 352 | yield from walk(sub_node) 353 | elif node.get("visible") and node.get("pid"): 354 | rect = node["rect"] 355 | yield Window( 356 | name=node["name"], 357 | x=rect["x"], 358 | y=rect["y"], 359 | width=rect["width"], 360 | height=rect["height"], 361 | focused=node["focused"], 362 | ) 363 | 364 | process = subprocess.run( 365 | ["swaymsg", "-t", "get_tree"], 366 | capture_output=True, 367 | check=True, 368 | ) 369 | tree = json.loads(process.stdout.decode()) 370 | return walk(tree) 371 | 372 | 373 | def get_outputs() -> Iterator[Output]: 374 | process = subprocess.run( 375 | ["swaymsg", "-t", "get_outputs"], 376 | capture_output=True, 377 | check=True, 378 | ) 379 | for output in json.loads(process.stdout.decode()): 380 | if output["active"]: 381 | yield Output( 382 | name=output["name"], 383 | model=output["model"], 384 | focused=output["focused"], 385 | ) 386 | 387 | 388 | def ask_rofi( 389 | choices: List[Any], 390 | *, 391 | prompt: Optional[str] = None, 392 | lines: Optional[int] = None, 393 | index: bool = False, 394 | additional_args: Optional[List[str]] = None 395 | ) -> Union[int, str, None]: 396 | args = ["rofi", "-dmenu"] 397 | 398 | if index: 399 | args.extend(("-format","i")) 400 | 401 | if prompt is not None: 402 | args.extend(("-p", prompt)) 403 | 404 | if lines is not None: 405 | args.extend(("-l", str(lines))) 406 | 407 | if additional_args: 408 | args.extend(additional_args) 409 | 410 | process = subprocess.run( 411 | args, 412 | input=b"\n".join(str(choice).encode() for choice in choices), 413 | capture_output=True, 414 | check=False, 415 | ) 416 | 417 | if process.returncode != 0: 418 | return None 419 | 420 | stdout = process.stdout.decode() 421 | 422 | breakpoint() 423 | 424 | return int(stdout) if index else stdout.strip() 425 | 426 | 427 | def ask_fuzzel( 428 | choices: List[Any], 429 | *, 430 | prompt: Optional[str] = None, 431 | lines: Optional[int] = None, 432 | index: bool = False, 433 | additional_args: Optional[List[str]] = None 434 | ) -> Union[int, str, None]: 435 | args = ["fuzzel", "--dmenu"] 436 | 437 | if index: 438 | args.append("--index") 439 | 440 | if prompt is not None: 441 | args.extend(("--prompt", prompt)) 442 | 443 | if lines is not None: 444 | args.extend(("--lines", str(lines))) 445 | 446 | if additional_args: 447 | args.extend(additional_args) 448 | 449 | process = subprocess.run( 450 | args, 451 | input=b"\n".join(str(choice).encode() for choice in choices), 452 | capture_output=True, 453 | check=False, 454 | ) 455 | 456 | if process.returncode != 0: 457 | return None 458 | 459 | stdout = process.stdout.decode() 460 | 461 | return int(stdout) if index else stdout.strip() 462 | 463 | 464 | ASK_FNS = { 465 | "rofi" : ask_rofi, 466 | "fuzzel" : ask_fuzzel 467 | } 468 | 469 | 470 | ask = ask_fuzzel 471 | 472 | def notify( 473 | title: str, 474 | summary: Optional[str] = None, 475 | *, 476 | icon: Optional[str] = None, 477 | actions: Optional[List[Tuple[str, str]]] = None, 478 | ) -> Optional[str]: 479 | args = ["notify-send"] 480 | 481 | if icon is not None: 482 | args.extend(("--icon", icon)) 483 | 484 | for action_name, action_desc in actions or (): 485 | args.extend(("-A", f"{action_name}={action_desc}")) 486 | 487 | args.extend(("--", title)) 488 | if summary: 489 | args.append(summary) 490 | 491 | process = subprocess.run(args, capture_output=True) 492 | if process.returncode != 0: 493 | print("Error while sending notification.", file=sys.stderr) 494 | print(process.stderr.decode(), file=sys.stderr) 495 | 496 | return process.stdout.decode().strip() or None 497 | 498 | 499 | def take_screenshot( 500 | *, 501 | filepath: str, 502 | geometry: Optional[str] = None, 503 | output: Optional[str] = None, 504 | cursor: Optional[bool] = None, 505 | type_: Optional[str] = None, 506 | jpeg_quality: Optional[int] = None, 507 | png_level: Optional[int] = None, 508 | ) -> None: 509 | args = ["grim"] 510 | 511 | if geometry is not None: 512 | args.extend(("-g", geometry)) 513 | 514 | if output is not None: 515 | args.extend(("-o", output)) 516 | 517 | if cursor: 518 | args.append("-c") 519 | 520 | if type_ is not None: 521 | args.extend(("-t", type_)) 522 | 523 | if png_level is not None and (type == "png" or filepath.endswith(".png")): 524 | args.extend(("-l", str(png_level))) 525 | 526 | if jpeg_quality is not None and ( 527 | type == "jpeg" or filepath.endswith(".jpg") or filepath.endswith(".jpeg") 528 | ): 529 | args.extend(("-q", str(jpeg_quality))) 530 | 531 | args.append(filepath) 532 | subprocess.run(args, check=True) 533 | 534 | 535 | def take_screencast( 536 | *, 537 | filepath: str, 538 | geometry: Optional[str] = None, 539 | output: Optional[str] = None, 540 | audio: Union[bool, str, None] = None, 541 | pid_file: Optional[Path] = None, 542 | ) -> None: 543 | args = ["wf-recorder", "-f", filepath] 544 | 545 | if geometry is not None: 546 | args.extend(("-g", geometry)) 547 | 548 | if output is not None: 549 | args.extend(("-o", output)) 550 | 551 | if audio is not None: 552 | if audio is True: 553 | args.append("-a") 554 | else: 555 | args.extend(("-a", str(audio))) 556 | 557 | with subprocess.Popen(args) as process: 558 | try: 559 | if pid_file: 560 | pid_file.write_text(str(process.pid)) 561 | process.wait() 562 | if process.returncode != 0: 563 | raise Exception( 564 | f"wf-recorder exited with status code {process.returncode}" 565 | ) 566 | finally: 567 | if pid_file: 568 | pid_file.unlink(missing_ok=True) 569 | 570 | 571 | def ask_geometry(geometries: Optional[Iterable[str]] = None) -> Optional[str]: 572 | if geometries is not None: 573 | geomerties_input = b"\n".join(geometry.encode() for geometry in geometries) 574 | else: 575 | geomerties_input = None 576 | 577 | process = subprocess.run( 578 | ["slurp"], 579 | capture_output=True, 580 | input=geomerties_input, 581 | check=False, 582 | ) 583 | if process.returncode != 0: 584 | return None 585 | 586 | return process.stdout.decode().strip() 587 | 588 | 589 | def ask_output() -> Optional[str]: 590 | process = subprocess.run( 591 | ["slurp", "-o", "-f", "%o"], capture_output=True, check=False 592 | ) 593 | if process.returncode != 0: 594 | return None 595 | 596 | return process.stdout.decode().strip() 597 | 598 | 599 | def edit_capture(filepath: str) -> None: 600 | subprocess.run(["swappy", "-f", filepath, "-o", filepath], check=False) 601 | 602 | 603 | def copy_file_to_clipboard(filepath: str) -> None: 604 | with open(filepath, "rb") as file: 605 | with subprocess.Popen("wl-copy", stdin=file) as process: 606 | process.wait() 607 | 608 | 609 | class NotificationAction(abc.ABC): 610 | name: str 611 | description: str 612 | 613 | @classmethod 614 | @abc.abstractmethod 615 | def run(cls, *, filepath: Path, config_getter: Callable[[str], Any]) -> None: 616 | pass 617 | 618 | 619 | class EditNotificationAction(NotificationAction): 620 | name = "default" 621 | description = "Edit" 622 | 623 | @classmethod 624 | def run(cls, *, filepath: Path, config_getter: Callable[[str], Any]) -> None: 625 | filepath_str = str(filepath.expanduser()) 626 | edit_capture(filepath_str) 627 | copy_file_to_clipboard(filepath_str) 628 | 629 | 630 | class DeleteNotificationAction(NotificationAction): 631 | name = "delete" 632 | description = "Delete" 633 | 634 | @classmethod 635 | def run(cls, *, filepath: Path, config_getter: Callable[[str], Any]) -> None: 636 | filepath.expanduser().unlink() 637 | notify("Deleted") 638 | 639 | 640 | class DragonNotificationAction(NotificationAction): 641 | name = "dragon" 642 | description = "Drag and drop" 643 | 644 | @classmethod 645 | def run(cls, *, filepath: Path, config_getter: Callable[[str], Any]) -> None: 646 | subprocess.run([config_getter("command"), filepath.expanduser()], check=False) 647 | 648 | 649 | class OpenNotificationAction(NotificationAction): 650 | name = "open" 651 | description = "Open" 652 | 653 | @classmethod 654 | def run(cls, *, filepath: Path, config_getter: Callable[[str], Any]) -> None: 655 | subprocess.run(["xdg-open", filepath.expanduser()], check=False) 656 | 657 | 658 | def parse_arguments(): 659 | argparser = argparse.ArgumentParser( 660 | prog="sway-interactive-screenshot", 661 | description="Interactively take screenshots with Sway.", 662 | ) 663 | selections = ( 664 | Region, 665 | FocusedOutput, 666 | AllOutputs, 667 | SelectOutput, 668 | FocusedWindow, 669 | SelectWindow, 670 | ) 671 | argparser.add_argument( 672 | "-s", 673 | "--selection", 674 | choices=[selection.selection_name for selection in selections], 675 | help="Selection mode.", 676 | ) 677 | argparser.add_argument( 678 | "--save-dir", 679 | help="Directory where screenshots are saved.", 680 | ) 681 | argparser.add_argument( 682 | "-o", 683 | "--output", 684 | help="Output file name. If set, --save-dir is ignored.", 685 | ) 686 | argparser.add_argument( 687 | "--video", 688 | help="Make a screen video recording.", 689 | action="store_true", 690 | ) 691 | argparser.add_argument( 692 | "-c", 693 | "--config", 694 | help="Config file.", 695 | ) 696 | 697 | args = argparser.parse_args() 698 | if args.selection is not None: 699 | args.selection = next( 700 | ( 701 | selection 702 | for selection in selections 703 | if selection.selection_name == args.selection 704 | ), 705 | None, 706 | ) 707 | return args 708 | 709 | 710 | class CaptureMode(abc.ABC): 711 | def __init__(self, config_getter: Callable[[str], Any]) -> None: 712 | self.config_getter = config_getter 713 | 714 | def get_prompt(self) -> str: 715 | return self.config_getter("prompt") 716 | 717 | def get_filename(self) -> str: 718 | return datetime.now().strftime(self.config_getter("file_name")) 719 | 720 | def get_save_dir(self) -> str: 721 | return self.config_getter("save_dir") 722 | 723 | @abc.abstractmethod 724 | def get_display_name(self) -> str: 725 | pass 726 | 727 | def early_exit(self) -> bool: 728 | return False 729 | 730 | @abc.abstractmethod 731 | def capture(self, *, area: Area, filepath: str) -> None: 732 | pass 733 | 734 | @abc.abstractmethod 735 | def get_notification_actions(self) -> Iterable[Type[NotificationAction]]: 736 | pass 737 | 738 | def get_notification_icon(self, filepath: str) -> Optional[str]: 739 | return None 740 | 741 | 742 | class Screenshot(CaptureMode): 743 | def get_display_name(self) -> str: 744 | return "Screenshot" 745 | 746 | def capture(self, *, area: Area, filepath: str) -> None: 747 | take_screenshot( 748 | filepath=filepath, 749 | geometry=area.geometry, 750 | output=area.output, 751 | cursor=self.config_getter("cursor"), 752 | type_=self.config_getter("type"), 753 | jpeg_quality=self.config_getter("jpeg_quality"), 754 | png_level=self.config_getter("png_level"), 755 | ) 756 | copy_file_to_clipboard(filepath) 757 | 758 | def get_notification_actions(self) -> Iterable[Type[NotificationAction]]: 759 | return ( 760 | EditNotificationAction, 761 | DeleteNotificationAction, 762 | DragonNotificationAction, 763 | OpenNotificationAction, 764 | ) 765 | 766 | def get_notification_icon(self, filepath: str) -> Optional[str]: 767 | return filepath 768 | 769 | 770 | class Screencast(CaptureMode): 771 | def get_display_name(self) -> str: 772 | return "Screencast" 773 | 774 | def get_pid_filepath(self) -> Path: 775 | uid = os.getuid() 776 | xdg_runtime_dir = os.getenv("XDG_RUNTIME_DIR", f"/run/user/{uid}") 777 | wayland_display = os.getenv("WAYLAND_DISPLAY", "wayland-1") 778 | 779 | return Path( 780 | self.config_getter("pid_file") 781 | .replace("${XDG_RUNTIME_DIR}", xdg_runtime_dir) 782 | .replace("${WAYLAND_DISPLAY}", wayland_display) 783 | .replace("${UID}", str(uid)) 784 | ) 785 | 786 | def early_exit(self) -> bool: 787 | pid_filepath = self.get_pid_filepath() 788 | if pid_filepath.exists(): 789 | pid = int(pid_filepath.read_text()) 790 | print( 791 | f"Sending kill signal to {pid} to stop video recording.", 792 | file=sys.stderr, 793 | ) 794 | os.kill(pid, signal.SIGINT) 795 | notify(self.get_display_name(), "Stopping recording.") 796 | return True 797 | 798 | return False 799 | 800 | def capture(self, *, area: Area, filepath: str) -> None: 801 | audio_raw_input = self.config_getter("audio") 802 | if audio_raw_input == "ask": 803 | audio_raw_input = ask(["yes", "no"], prompt=self.get_prompt() + "Audio? ") 804 | if audio_raw_input is None: 805 | raise CanceledError("No audio preference selected.") 806 | 807 | start_recording = ask( 808 | ["yes", "cancel"], prompt=self.get_prompt() + "Start recording? " 809 | ) 810 | if start_recording != "yes": 811 | raise CanceledError() 812 | 813 | take_screencast( 814 | filepath=filepath, 815 | geometry=area.geometry, 816 | output=area.output, 817 | audio=audio_raw_input == "yes", 818 | pid_file=self.get_pid_filepath(), 819 | ) 820 | 821 | def get_notification_actions(self) -> Iterable[Type[NotificationAction]]: 822 | return ( 823 | DeleteNotificationAction, 824 | DragonNotificationAction, 825 | OpenNotificationAction, 826 | ) 827 | 828 | 829 | def main(): 830 | mode: Optional[CaptureMode] = None 831 | try: 832 | args = parse_arguments() 833 | config = Config(args.config) 834 | mode: CaptureMode = ( 835 | Screenshot(partial(config.get, "screenshot")) 836 | if not args.video 837 | else Screencast(partial(config.get, "screencast")) 838 | ) 839 | if mode.early_exit(): 840 | return 841 | 842 | global ask 843 | ask = partial( 844 | ASK_FNS[config.get("ask","command")], 845 | additional_args=config.get("ask","args") 846 | ) 847 | 848 | save_dir = args.save_dir 849 | if save_dir is None: 850 | save_dir = mode.get_save_dir() 851 | if save_dir is None: 852 | save_dir = os.getenv("SWAY_INTERACTIVE_SCREENSHOT_SAVEDIR", "~") 853 | 854 | save_dir = Path(save_dir) 855 | save_dir.expanduser().mkdir(parents=True, exist_ok=True) 856 | filepath = Path(args.output) if args.output else None 857 | 858 | if args.selection is None: 859 | choices = [ 860 | Region(), 861 | FocusedOutput(), 862 | *((AllOutputs(),) if isinstance(mode, Screenshot) else ()), 863 | SelectOutput(), 864 | *get_outputs(), 865 | FocusedWindow(), 866 | SelectWindow(), 867 | *get_windows(), 868 | ] 869 | 870 | choice_idx = ask(choices, prompt=mode.get_prompt(), index=True) 871 | if choice_idx is None: 872 | return 873 | if choice_idx == -1: 874 | raise CanceledError("No option selected.") 875 | 876 | choice = choices[choice_idx] 877 | else: 878 | choice = args.selection() 879 | 880 | area = choice.get_area() 881 | if not filepath: 882 | filepath = save_dir / mode.get_filename() 883 | 884 | mode.capture(filepath=str(filepath.expanduser()), area=area) 885 | 886 | action_name = notify( 887 | mode.get_display_name(), 888 | summary=f"File saved as {filepath}.", 889 | icon=mode.get_notification_icon(filepath.expanduser()), 890 | actions=[ 891 | (action.name, action.description) 892 | for action in mode.get_notification_actions() 893 | ], 894 | ) 895 | action = next( 896 | ( 897 | action 898 | for action in mode.get_notification_actions() 899 | if action.name == action_name 900 | ), 901 | None, 902 | ) 903 | 904 | if action is not None: 905 | action.run(filepath=filepath, 906 | config_getter=partial(config.get, 907 | "notification_actions", 908 | action.name) 909 | ) 910 | 911 | except Exception as err: # pylint: disable=broad-except 912 | display_name = ( 913 | mode.get_display_name() 914 | if mode is not None 915 | else "sway-interactive-screenshot" 916 | ) 917 | if isinstance(err, CanceledError): 918 | notify(f"{display_name} canceled", summary=err.msg) 919 | else: 920 | notify(f"{display_name} error", str(err)) 921 | raise 922 | 923 | 924 | if __name__ == "__main__": 925 | main() 926 | -------------------------------------------------------------------------------- /files/swaync/.config/swaync/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | all: unset; 3 | font-size: 14px; 4 | font-family: "JetBrainsMono Nerd Font Mono"; 5 | transition: 200ms; 6 | } 7 | 8 | trough highlight { 9 | background: #cdd6f4; 10 | } 11 | 12 | scale trough { 13 | margin: 0rem 1rem; 14 | background-color: #A7C080; 15 | min-height: 8px; 16 | min-width: 70px; 17 | } 18 | 19 | slider { 20 | background-color: #89b4fa; 21 | } 22 | 23 | .floating-notifications.background .notification-row .notification-background { 24 | box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #A7C080; 25 | border-radius: 12.6px; 26 | margin: 18px; 27 | background-color: #1e1e2e; 28 | color: #cdd6f4; 29 | padding: 0; 30 | } 31 | 32 | .floating-notifications.background .notification-row .notification-background .notification { 33 | padding: 7px; 34 | border-radius: 12.6px; 35 | } 36 | 37 | .floating-notifications.background .notification-row .notification-background .notification.critical { 38 | box-shadow: inset 0 0 7px 0 #A7C080; 39 | } 40 | 41 | .floating-notifications.background .notification-row .notification-background .notification .notification-content { 42 | margin: 7px; 43 | } 44 | 45 | .floating-notifications.background .notification-row .notification-background .notification .notification-content .summary { 46 | color: #cdd6f4; 47 | } 48 | 49 | .floating-notifications.background .notification-row .notification-background .notification .notification-content .time { 50 | color: #a6adc8; 51 | } 52 | 53 | .floating-notifications.background .notification-row .notification-background .notification .notification-content .body { 54 | color: #cdd6f4; 55 | } 56 | 57 | .floating-notifications.background .notification-row .notification-background .notification > *:last-child > * { 58 | min-height: 3.4em; 59 | } 60 | 61 | .floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action { 62 | border-radius: 7px; 63 | color: #1e1e2e; 64 | background-color: #A7C080; 65 | box-shadow: inset 0 0 0 1px #45475a; 66 | margin: 7px; 67 | } 68 | 69 | .floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:hover { 70 | box-shadow: inset 0 0 0 1px #45475a; 71 | background-color: #A7C080; 72 | color: #cdd6f4; 73 | } 74 | 75 | .floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:active { 76 | box-shadow: inset 0 0 0 1px #45475a; 77 | background-color: #74c7ec; 78 | color: #cdd6f4; 79 | } 80 | 81 | .floating-notifications.background .notification-row .notification-background .close-button { 82 | margin: 7px; 83 | padding: 2px; 84 | border-radius: 6.3px; 85 | color: #1e1e2e; 86 | background-color: #A7C080; 87 | } 88 | 89 | .floating-notifications.background .notification-row .notification-background .close-button:hover { 90 | background-color: #eba0ac; 91 | color: #1e1e2e; 92 | } 93 | 94 | .floating-notifications.background .notification-row .notification-background .close-button:active { 95 | background-color: #f38ba8; 96 | color: #1e1e2e; 97 | } 98 | 99 | .control-center { 100 | box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #A7C080; 101 | border-radius: 12.6px; 102 | margin: 18px; 103 | background-color: #1e1e2e; 104 | color: #cdd6f4; 105 | padding: 14px; 106 | } 107 | 108 | .control-center .widget-title > label { 109 | color: #cdd6f4; 110 | font-size: 1.3em; 111 | } 112 | 113 | .control-center .widget-title button { 114 | border-radius: 7px; 115 | color: #cdd6f4; 116 | background-color: #A7C080; 117 | box-shadow: inset 0 0 0 1px #45475a; 118 | padding: 8px; 119 | } 120 | 121 | .control-center .widget-title button:hover { 122 | box-shadow: inset 0 0 0 1px #45475a; 123 | background-color: #585b70; 124 | color: #cdd6f4; 125 | } 126 | 127 | .control-center .widget-title button:active { 128 | box-shadow: inset 0 0 0 1px #45475a; 129 | background-color: #74c7ec; 130 | color: #1e1e2e; 131 | } 132 | 133 | .control-center .notification-row .notification-background { 134 | border-radius: 7px; 135 | color: #cdd6f4; 136 | background-color: #A7C080; 137 | box-shadow: inset 0 0 0 1px #45475a; 138 | margin-top: 14px; 139 | } 140 | 141 | .control-center .notification-row .notification-background .notification { 142 | padding: 7px; 143 | border-radius: 7px; 144 | } 145 | 146 | .control-center .notification-row .notification-background .notification.critical { 147 | box-shadow: inset 0 0 7px 0 #f38ba8; 148 | } 149 | 150 | .control-center .notification-row .notification-background .notification .notification-content { 151 | margin: 7px; 152 | } 153 | 154 | .control-center .notification-row .notification-background .notification .notification-content .summary { 155 | color: #cdd6f4; 156 | } 157 | 158 | .control-center .notification-row .notification-background .notification .notification-content .time { 159 | color: #a6adc8; 160 | } 161 | 162 | .control-center .notification-row .notification-background .notification .notification-content .body { 163 | color: #cdd6f4; 164 | } 165 | 166 | .control-center .notification-row .notification-background .notification > *:last-child > * { 167 | min-height: 3.4em; 168 | } 169 | 170 | .control-center .notification-row .notification-background .notification > *:last-child > * .notification-action { 171 | border-radius: 7px; 172 | color: #cdd6f4; 173 | background-color: #11111b; 174 | box-shadow: inset 0 0 0 1px #45475a; 175 | margin: 7px; 176 | } 177 | 178 | .control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:hover { 179 | box-shadow: inset 0 0 0 1px #45475a; 180 | background-color: #A7C080; 181 | color: #cdd6f4; 182 | } 183 | 184 | .control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:active { 185 | box-shadow: inset 0 0 0 1px #45475a; 186 | background-color: #74c7ec; 187 | color: #cdd6f4; 188 | } 189 | 190 | .control-center .notification-row .notification-background .close-button { 191 | margin: 7px; 192 | padding: 2px; 193 | border-radius: 6.3px; 194 | color: #1e1e2e; 195 | background-color: #eba0ac; 196 | } 197 | 198 | .close-button { 199 | border-radius: 6.3px; 200 | } 201 | 202 | .control-center .notification-row .notification-background .close-button:hover { 203 | background-color: #f38ba8; 204 | color: #1e1e2e; 205 | } 206 | 207 | .control-center .notification-row .notification-background .close-button:active { 208 | background-color: #f38ba8; 209 | color: #1e1e2e; 210 | } 211 | 212 | .control-center .notification-row .notification-background:hover { 213 | box-shadow: inset 0 0 0 1px #45475a; 214 | background-color: #7f849c; 215 | color: #cdd6f4; 216 | } 217 | 218 | .control-center .notification-row .notification-background:active { 219 | box-shadow: inset 0 0 0 1px #45475a; 220 | background-color: #74c7ec; 221 | color: #cdd6f4; 222 | } 223 | 224 | .notification.critical progress { 225 | background-color: #f38ba8; 226 | } 227 | 228 | .notification.low progress, 229 | .notification.normal progress { 230 | background-color: #89b4fa; 231 | } 232 | 233 | .control-center-dnd { 234 | margin-top: 5px; 235 | border-radius: 8px; 236 | background: #A7C080; 237 | border: 1px solid #45475a; 238 | box-shadow: none; 239 | } 240 | 241 | .control-center-dnd:checked { 242 | background: #A7C080; 243 | } 244 | 245 | .control-center-dnd slider { 246 | background: #45475a; 247 | border-radius: 8px; 248 | } 249 | 250 | .widget-dnd { 251 | margin: 0px; 252 | font-size: 1.1rem; 253 | } 254 | 255 | .widget-dnd > switch { 256 | font-size: initial; 257 | border-radius: 8px; 258 | background: #A7C080; 259 | border: 1px solid #45475a; 260 | box-shadow: none; 261 | } 262 | 263 | .widget-dnd > switch:checked { 264 | background: #A7C080; 265 | } 266 | 267 | .widget-dnd > switch slider { 268 | background: #45475a; 269 | border-radius: 8px; 270 | border: 1px solid #6c7086; 271 | } 272 | 273 | .widget-mpris .widget-mpris-player { 274 | background: #A7C080; 275 | padding: 7px; 276 | } 277 | 278 | .widget-mpris .widget-mpris-title { 279 | font-size: 1.2rem; 280 | } 281 | 282 | .widget-mpris .widget-mpris-subtitle { 283 | font-size: 0.8rem; 284 | } 285 | 286 | .widget-menubar > box > .menu-button-bar > button > label { 287 | font-size: 3rem; 288 | padding: 0.5rem 2rem; 289 | } 290 | 291 | .widget-menubar > box > .menu-button-bar > :last-child { 292 | color: #f38ba8; 293 | } 294 | 295 | .power-buttons button:hover, 296 | .powermode-buttons button:hover, 297 | .screenshot-buttons button:hover { 298 | background: #A7C080; 299 | } 300 | 301 | .control-center .widget-label > label { 302 | color: #cdd6f4; 303 | font-size: 2rem; 304 | } 305 | 306 | .widget-buttons-grid { 307 | padding-top: 1rem; 308 | } 309 | 310 | .widget-buttons-grid > flowbox > flowboxchild > button label { 311 | font-size: 2.5rem; 312 | } 313 | 314 | .widget-volume { 315 | padding-top: 1rem; 316 | } 317 | 318 | .widget-volume label { 319 | font-size: 1.5rem; 320 | color: #74c7ec; 321 | } 322 | 323 | .widget-volume trough highlight { 324 | background: #74c7ec; 325 | } 326 | 327 | .widget-backlight trough highlight { 328 | background: #f9e2af; 329 | } 330 | 331 | .widget-backlight label { 332 | font-size: 1.5rem; 333 | color: #f9e2af; 334 | } 335 | 336 | .widget-backlight .KB { 337 | padding-bottom: 1rem; 338 | } 339 | 340 | .image { 341 | padding-right: 0.5rem; 342 | } 343 | -------------------------------------------------------------------------------- /files/tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | # tmux.conf 2 | # ~ M. Thomas 3 | 4 | ######### Terminal Setup ########## 5 | # set default terminal 6 | set -g default-terminal "tmux-256color" 7 | # enable true color terminal 8 | set -ga terminal-overrides ",*256col*:Tc,alacritty:Tc" 9 | 10 | ######### Keybinds ########## 11 | # new panes (open with current path) 12 | bind-key -n M-v split-window -h -c "#{pane_current_path}" 13 | bind-key -n M-s split-window -v -c "#{pane_current_path}" 14 | 15 | # new windows 16 | bind-key -n M-c new-window -c "#{pane_current_path}" 17 | 18 | # vi-style pane selection 19 | bind-key -n M-h select-pane -L 20 | bind-key -n M-j select-pane -D 21 | bind-key -n M-k select-pane -U 22 | bind-key -n M-l select-pane -R 23 | 24 | # pane zoom 25 | bind-key -n M-f resize-pane -Z 26 | 27 | # window rename 28 | bind-key -n M-, command-prompt -p "Rename window:" "rename-window '%%'" 29 | bind-key -n M-< set automatic-rename on 30 | 31 | # navigate windows 32 | bind-key -n M-1 select-window -t 1 33 | bind-key -n M-2 select-window -t 2 34 | bind-key -n M-3 select-window -t 3 35 | bind-key -n M-4 select-window -t 4 36 | bind-key -n M-5 select-window -t 5 37 | bind-key -n M-6 select-window -t 6 38 | bind-key -n M-7 select-window -t 7 39 | bind-key -n M-8 select-window -t 8 40 | bind-key -n M-9 select-window -t 9 41 | 42 | # swap panes 43 | bind-key -n 'M-J' swap-pane -D 44 | bind-key -n 'M-K' swap-pane -U 45 | 46 | # move panes to and from windows 47 | bind-key -n 'M-t' command-prompt -p "Send pane to:" "join-pane -t :'%%'" 48 | bind-key -n 'M-!' select-layout even-horizontal 49 | bind-key -n 'M-@' select-layout even-vertical 50 | bind-key -n 'M-#' select-layout main-vertical 51 | 52 | set -g main-pane-width 40% 53 | 54 | # resize panes 55 | bind-key -n 'M-Left' resize-pane -L 5 56 | bind-key -n 'M-Right' resize-pane -R 5 57 | bind-key -n 'M-Up' resize-pane -U 5 58 | bind-key -n 'M-Down' resize-pane -D 5 59 | 60 | ########## General ########## 61 | # alias 62 | set -s command-alias[1] respawn='respawn-pane -k' 63 | 64 | # make escape bindings of programs work in tmux 65 | set -s escape-time 5 66 | 67 | # renumber windows, when one gets closed 68 | set-option -g renumber-windows on 69 | 70 | # enable mouse 71 | set-option -g mouse on 72 | 73 | # start pane index at 1 74 | set -g base-index 1 75 | setw -g pane-base-index 1 76 | 77 | # set terminal window title (update every second) 78 | set-option -g status-interval 1 79 | set-option -g set-titles on 80 | set-option -g set-titles-string "#H: #W" 81 | 82 | # Make inactive border a bit less noticeable 83 | set -g pane-border-style fg="#e3ddcc" 84 | 85 | # Status 86 | set -g status-style "bg=default" 87 | set -g status-right "#S @ #H [%H:%M]" 88 | set -g status-left "" 89 | setw -g window-status-format "#I:#W " 90 | setw -g window-status-current-format "#[fg=green]#I:#W*" 91 | -------------------------------------------------------------------------------- /files/tofi/.config/tofi/config: -------------------------------------------------------------------------------- 1 | font-size = 12 2 | font = JetBrainsMono NFM 3 | anchor = top 4 | width = 100% 5 | height = 31 6 | horizontal = true 7 | prompt-text = " run: " 8 | outline-width = 0 9 | border-width = 0 10 | background-color = #11111133 11 | selection-color = #A7C080 12 | min-input-width = 120 13 | result-spacing = 15 14 | padding-top = 6 15 | padding-bottom = 0 16 | padding-left = 0 17 | padding-right = 0 18 | auto-accept-single = false 19 | physical-keybindings = false 20 | text-cursor = false 21 | 22 | -------------------------------------------------------------------------------- /files/vim/.vimrc: -------------------------------------------------------------------------------- 1 | " ~/.vimrc 2 | " 3 | " caveats in config start with XXX 4 | " 5 | " ~ M. Thomas 6 | 7 | let mapleader = "\" 8 | 9 | " ============================== vim-plug 10 | let data_dir = '~/.vim' 11 | if empty(glob(data_dir . '/autoload/plug.vim')) 12 | silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' 13 | autocmd VimEnter * PlugInstall --sync | source ~/.vimrc 14 | endif 15 | 16 | call plug#begin() 17 | 18 | " essentials 19 | Plug 'jiangmiao/auto-pairs' " pair completion 20 | Plug 'tpope/vim-commentary' " DWIM comments 21 | 22 | " file search 23 | Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } 24 | Plug 'junegunn/fzf.vim' 25 | 26 | " colors 27 | Plug 'sainnhe/everforest' " color scheme 28 | Plug 'vim-airline/vim-airline' " nicer status line 29 | Plug 'vim-airline/vim-airline-themes' " auto settings theme for airline 30 | 31 | call plug#end() 32 | 33 | " ============================== Colors 34 | syntax on 35 | set background=light 36 | let g:everforest_background = 'medium' 37 | let g:everforest_better_performance = 1 38 | colorscheme everforest 39 | let &t_8f = "\[38;2;%lu;%lu;%lum" 40 | let &t_8b = "\[48;2;%lu;%lu;%lum" 41 | set termguicolors 42 | 43 | " ============================== General 44 | filetype indent plugin on 45 | set number " show line number 46 | set relativenumber " show relative line number 47 | set cursorline " highlight current line 48 | set ruler " show line and row at bottom right 49 | set colorcolumn=80 50 | set nowrap " don't wrap lines 51 | 52 | set showmatch " highlights paranthesis 53 | set hidden " allow moving to a new buffer without saving 54 | set noswapfile " don't create a swap file 55 | set confirm " can't quit without saving 56 | set noshowmode " don't show mode in status 57 | set noshowcmd " don't show command in status 58 | set encoding=utf-8 59 | set mouse=a " a=on, c=off 60 | set undolevels=1337 61 | set backspace=indent,eol,start " always delete with backspace 62 | set wildmenu " autocomplete :e 63 | set scrolloff=5 " minimum lines above or below the cursor 64 | 65 | autocmd FileType c setlocal tabstop=4 shiftwidth=4 noexpandtab 66 | 67 | let g:ctrlp_show_hidden = 1 " show hidden files in ctrlp menus 68 | let g:fzf_preview_window = ['down,50%', 'ctrl-/'] 69 | 70 | let g:LanguageClient_useFloatingHover = 1 " prevent buggy split preview from opening 71 | 72 | " ============================== Statusline 73 | let g:airline_section_x = airline#section#create([]) 74 | let g:airline_section_y = airline#section#create_right(['%{&fileencoding}', '%{&fileformat}', '%{&filetype}']) 75 | let g:airline_section_z = airline#section#create(['%{line(".")}:%{col(".")}']) 76 | 77 | " ============================== Indents and Whitespaces 78 | set list 79 | set listchars=tab:──\ ,extends:›,precedes:‹,nbsp:·,trail:· " show chars for whitespaces 80 | set fillchars+=vert:\ " don't draw verticle split 81 | 82 | " openbsd style 83 | autocmd FileType c setlocal tabstop=8 shiftwidth=4 noexpandtab 84 | 85 | " show trailing whitespaces in red 86 | highlight ExtraWhitespace ctermbg=red guibg=red 87 | match ExtraWhitespace /\s\+\%#\@ unless capitol letters 93 | set hlsearch " highlight all results 94 | set mat=5 95 | 96 | " ============================== Cursor Thiccness 97 | let &t_SI = "\[6 q" 98 | let &t_SR = "\[4 q" 99 | let &t_EI = "\[2 q" 100 | 101 | " ============================== Macros and Mappings 102 | 103 | map f :GFiles 104 | map F :Files 105 | map b :Buffers 106 | 107 | command! -bang -nargs=* GGrep 108 | \ call fzf#vim#grep( 109 | \ 'git grep --line-number -- '.shellescape(), 0, 110 | \ fzf#vim#with_preview(), 0) 111 | if has("linux") 112 | map :GGrep 113 | else " openbsd 114 | map :GGrep 115 | endif 116 | 117 | " kill whitespaces fast and efficient 118 | fun! TrimWhitespace() 119 | let l:save = winsaveview() 120 | keeppatterns %s/\s\+$//e 121 | call winrestview(l:save) 122 | endfun 123 | noremap ws :call TrimWhitespace() 124 | 125 | " comment DWIM 126 | map :Commentary 127 | 128 | " clear search highlighting faster 129 | map :noh 130 | -------------------------------------------------------------------------------- /files/waybar/.config/waybar/config: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // Waybar configuration 4 | // 5 | // Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration 6 | // 7 | // ============================================================================= 8 | 9 | { 10 | // ------------------------------------------------------------------------- 11 | // Global configuration 12 | // ------------------------------------------------------------------------- 13 | 14 | "layer": "top", 15 | 16 | "position": "top", 17 | 18 | // If height property would be not present, it'd be calculated dynamically 19 | "height": 25, 20 | "margin-left": 6, 21 | "margin-right": 6, 22 | "margin-top": 6, 23 | "margin-bottom": 0, 24 | 25 | "modules-left": [ 26 | "sway/workspaces", 27 | // "sway/mode", 28 | "sway/window" 29 | ], 30 | "modules-center": [ 31 | ], 32 | "modules-right": [ 33 | // "network", 34 | // "pulseaudio", 35 | // "memory", 36 | // "cpu", 37 | // "temperature", 38 | "backlight", 39 | // "custom/keyboard-layout", 40 | "battery", 41 | // "custom/conservation", 42 | // "custom/power", 43 | "clock#date", 44 | "clock#time", 45 | "custom/sep", 46 | "tray" 47 | ], 48 | 49 | 50 | // ------------------------------------------------------------------------- 51 | // Modules 52 | // ------------------------------------------------------------------------- 53 | 54 | "battery": { 55 | "interval": 1, 56 | "states": { 57 | "warning": 30, 58 | "critical": 15 59 | }, 60 | // Connected to AC 61 | "format": "{capacity}% 󰂄", // Icon: bolt 62 | // "format": "⚡ {capacity}%", // Icon: bolt 63 | // "format": "C {capacity}%", // Icon: bolt 64 | // Not connected to AC 65 | "format-discharging": "{capacity}% {icon}", 66 | // "format-discharging": "🔋 {capacity}%", 67 | // "format-discharging": "{capacity}%", 68 | "format-icons": [ 69 | "󰁺", // Icon: battery-empty 70 | "󰁼", // Icon: battery-quarter 71 | "󰁾", // Icon: battery-half 72 | "󰂁", // Icon: battery-three-quarters 73 | "󰁹" // Icon: battery-full 74 | ], 75 | "tooltip": true, 76 | "on-click": "~/.config/waybar/conservation-toggle.sh" 77 | }, 78 | 79 | "backlight": { 80 | "device": "intel_backligt", 81 | "format": "{percent} {icon}", 82 | // "format": "{percent}%", 83 | // "format-icons": ["🔅", "🔆"] 84 | "format-icons": ["󰃚", "󰃝", "󰃞", "󰃟", "󰃠"] 85 | }, 86 | 87 | 88 | "clock#time": { 89 | "interval": 1, 90 | // "format": "🕒 {:%H:%M}", 91 | "format": "{:%H:%M}", 92 | "tooltip": false, 93 | "on-click": "gnome-clocks" 94 | }, 95 | 96 | "clock#date": { 97 | "interval": 10, 98 | // "format": " {:%e %b %Y}", // Icon: calendar-alt 99 | // "format": "🗓️ {:%e. %b %Y (%a)}", // Icon: calendar-alt 100 | "format": "{:%e. %b (%a)}", // Icon: calendar-alt 101 | "tooltip-format": "{:%e %B %Y}", 102 | "on-click": "gnome-calendar" 103 | }, 104 | 105 | "cpu": { 106 | "interval": 30, 107 | "format": "🧮 {usage}% ({load})", // Icon: microcip 108 | "states": { 109 | "warning": 70, 110 | "critical": 90 111 | } 112 | }, 113 | 114 | "custom/keyboard-layout": { 115 | "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4", 116 | // Interval set only as a fallback, as the value is updated by signal 117 | "interval": 30, 118 | "format": " {}", // Icon: keyboard 119 | // Signal sent by Sway key binding (~/.config/sway/key-bindings) 120 | "signal": 1, // SIGHUP 121 | "tooltip": false 122 | }, 123 | 124 | "memory": { 125 | "interval": 30, 126 | "format": "💾 {used} GiB", // Icon: memory 127 | "states": { 128 | "warning": 70, 129 | "critical": 90 130 | } 131 | }, 132 | 133 | "network": { 134 | "interval": 5, 135 | "format-wifi": " {essid} ({signalStrength}%)", // Icon: wifi 136 | "format-ethernet": " {ifname}: {ipaddr}/{cidr}", // Icon: ethernet 137 | "format-disconnected": "⚠ Disconnected", 138 | "tooltip-format": "{ifname}: {ipaddr}" 139 | }, 140 | 141 | "sway/mode": { 142 | "format": " {}", // Icon: expand-arrows-alt 143 | "tooltip": false 144 | }, 145 | 146 | "sway/window": { 147 | "format": "{}", 148 | "max-length": 100, 149 | "icon": true, 150 | "icon-size": 18 151 | }, 152 | 153 | "sway/workspaces": { 154 | "all-outputs": false, 155 | "disable-scroll": false, 156 | "format": "{name}", 157 | "format-icons": { 158 | "1": "一", 159 | "2": "二", 160 | "3": "三", 161 | "4": "四", 162 | "5": "五", 163 | "6": "六", 164 | "7": "七", 165 | "8": "八", 166 | "9": "九", 167 | "10": "十", 168 | // "urgent": "", 169 | // "focused": "", 170 | "default": "" 171 | } 172 | }, 173 | 174 | "pulseaudio": { 175 | //"scroll-step": 1, 176 | "format": "{volume}%", 177 | "format-bluetooth": "{volume}%", 178 | "format-muted": "Mute", 179 | "format-icons": { 180 | "headphones": "", 181 | "handsfree": "", 182 | "headset": "", 183 | "phone": "", 184 | "portable": "", 185 | "car": "", 186 | "default": ["", ""] 187 | }, 188 | "on-click": "pavucontrol" 189 | }, 190 | 191 | "temperature": { 192 | "critical-threshold": 80, 193 | "interval": 5, 194 | "format": "{icon} {temperatureC}°C", 195 | "format-icons": [ 196 | "", // Icon: temperature-empty 197 | "", // Icon: temperature-quarter 198 | "", // Icon: temperature-half 199 | "", // Icon: temperature-three-quarters 200 | "" // Icon: temperature-full 201 | ], 202 | "tooltip": true 203 | }, 204 | 205 | "tray": { 206 | "icon-size": 13, 207 | "spacing": 15 208 | }, 209 | 210 | "custom/conservation": { 211 | "exec": "~/.config/waybar/conservation.sh", 212 | "interval": 10, 213 | "on-click": "~/.config/waybar/conservation-toggle.sh" 214 | }, 215 | 216 | "custom/power": { 217 | "exec": "echo 💻 $(cat /sys/firmware/acpi/platform_profile)", 218 | "interval": 10, 219 | "on-click": "kitty -e 'htop'" 220 | }, 221 | 222 | "custom/sep": { 223 | "format": "|", 224 | }, 225 | } 226 | -------------------------------------------------------------------------------- /files/waybar/.config/waybar/conservation-toggle.sh: -------------------------------------------------------------------------------- 1 | location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode' 2 | val=$(cat $location) 3 | 4 | if [ "X$val" == "X1" ]; then 5 | echo 0 | sudo tee $location 6 | notify-send "Battery" "Disabled conservation mode" -i battery 7 | else 8 | echo 1 | sudo tee $location 9 | notify-send "Battery" "Enabled conservation mode" -i battery 10 | fi 11 | -------------------------------------------------------------------------------- /files/waybar/.config/waybar/conservation.sh: -------------------------------------------------------------------------------- 1 | location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode' 2 | val=$(cat $location) 3 | 4 | if [ "X$val" == "X1" ]; then 5 | echo "(On)" 6 | else 7 | echo "(Off)" 8 | fi 9 | -------------------------------------------------------------------------------- /files/waybar/.config/waybar/style.css: -------------------------------------------------------------------------------- 1 | /* ============================================================================= 2 | * 3 | * Waybar configuration 4 | * 5 | * Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration 6 | * 7 | * =========================================================================== */ 8 | 9 | /* ----------------------------------------------------------------------------- 10 | * Keyframes 11 | * -------------------------------------------------------------------------- */ 12 | 13 | @keyframes blink-warning { 14 | 70% { 15 | color: white; 16 | } 17 | 18 | to { 19 | color: orange; 20 | } 21 | } 22 | 23 | @keyframes blink-critical { 24 | 70% { 25 | color: white; 26 | } 27 | 28 | to { 29 | color: red; 30 | } 31 | } 32 | 33 | 34 | /* ----------------------------------------------------------------------------- 35 | * Base styles 36 | * -------------------------------------------------------------------------- */ 37 | 38 | /* Reset all styles */ 39 | * { 40 | border: none; 41 | border-radius: 0; 42 | min-height: 0; 43 | margin: 0; 44 | padding: 0; 45 | } 46 | 47 | /* The whole bar */ 48 | #waybar { 49 | background: rgba(100, 100, 100, 0.2); 50 | color: white; 51 | /* font-family: Cantarell, Noto Sans, sans-serif; */ 52 | font-family: JetBrainsMono Nerd Font; 53 | font-size: 12px; 54 | } 55 | 56 | /* Each module */ 57 | #battery, 58 | #backlight, 59 | #clock, 60 | #cpu, 61 | #custom-keyboard-layout, 62 | #custom-weather, 63 | #custom-power, 64 | #memory, 65 | #mode, 66 | #network, 67 | #pulseaudio, 68 | #temperature, 69 | #tray { 70 | padding-left: 10px; 71 | padding-right: 10px; 72 | } 73 | 74 | #custom-conservation { 75 | padding-right: 10px; 76 | } 77 | 78 | 79 | /* ----------------------------------------------------------------------------- 80 | * Module styles 81 | * -------------------------------------------------------------------------- */ 82 | 83 | #battery { 84 | animation-timing-function: linear; 85 | animation-iteration-count: infinite; 86 | animation-direction: alternate; 87 | } 88 | 89 | #battery.warning { 90 | color: orange; 91 | } 92 | 93 | #battery.critical { 94 | color: red; 95 | } 96 | 97 | #battery.warning.discharging { 98 | animation-name: blink-warning; 99 | animation-duration: 3s; 100 | } 101 | 102 | #battery.critical.discharging { 103 | animation-name: blink-critical; 104 | animation-duration: 2s; 105 | } 106 | 107 | #clock { 108 | /* font-weight: bold; */ 109 | } 110 | 111 | #cpu { 112 | /* No styles */ 113 | } 114 | 115 | #cpu.warning { 116 | color: orange; 117 | } 118 | 119 | #cpu.critical { 120 | color: red; 121 | } 122 | 123 | #memory { 124 | animation-timing-function: linear; 125 | animation-iteration-count: infinite; 126 | animation-direction: alternate; 127 | } 128 | 129 | #memory.warning { 130 | color: orange; 131 | } 132 | 133 | #memory.critical { 134 | color: red; 135 | animation-name: blink-critical; 136 | animation-duration: 2s; 137 | } 138 | 139 | #mode { 140 | background: #64727D; 141 | border-top: 2px solid white; 142 | /* To compensate for the top border and still have vertical centering */ 143 | padding-bottom: 2px; 144 | } 145 | 146 | #network { 147 | /* No styles */ 148 | } 149 | 150 | #network.disconnected { 151 | color: orange; 152 | } 153 | 154 | #pulseaudio { 155 | /* No styles */ 156 | } 157 | 158 | #pulseaudio.muted { 159 | /* No styles */ 160 | } 161 | 162 | #custom-spotify { 163 | color: rgb(102, 220, 105); 164 | } 165 | 166 | #temperature { 167 | /* No styles */ 168 | } 169 | 170 | #temperature.critical { 171 | color: red; 172 | } 173 | 174 | #tray { 175 | /* No styles */ 176 | } 177 | 178 | #window { 179 | /* font-weight: bold; */ 180 | padding-left: 10px; 181 | } 182 | 183 | #workspaces button { 184 | border-top: 4px solid transparent; 185 | /* To compensate for the top border and still have vertical centering */ 186 | padding-bottom: 2px; 187 | padding-left: 5px; 188 | padding-right: 5px; 189 | color: #ffffff; 190 | } 191 | 192 | #workspaces button.focused { 193 | border-color: #A7C080; 194 | /* color: white; */ 195 | color: #A7C080; 196 | text-shadow: 0 0 2px #000; 197 | } 198 | 199 | #workspaces button.urgent { 200 | border-color: #c9545d; 201 | color: #c9545d; 202 | } 203 | 204 | #workspaces button:hover { 205 | box-shadow: none; /* Remove predefined box-shadow */ 206 | text-shadow: none; /* Remove predefined text-shadow */ 207 | background: none; /* Remove predefined background color (white) */ 208 | transition: none; /* Disable predefined animations */ 209 | } -------------------------------------------------------------------------------- /stow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Utility script to stow or un-stow configuration 4 | 5 | set -e 6 | 7 | for i in "$1" 8 | do 9 | case $i in 10 | -s|--stow) 11 | echo "Stowing configuration for $2" 12 | stow -v -d files -t $HOME $2 13 | ;; 14 | -u|--unstow) 15 | echo "Deleting configuration for $2" 16 | stow -D -v -d files -t $HOME $2 17 | ;; 18 | *) 19 | echo "Use $0 --stow to deploy configuration" 20 | echo "Use $0 --unstow to remove configuration" 21 | exit -1 22 | ;; 23 | esac 24 | done 25 | -------------------------------------------------------------------------------- /templates/flakes/typst.flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Nightly Typst with Typst LSP"; 3 | 4 | inputs.typst-lsp.url = "github:nvarner/typst-lsp"; 5 | inputs.typst.url = "github:typst/typst"; 6 | inputs.utils.url = "github:numtide/flake-utils"; 7 | inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 8 | 9 | outputs = { 10 | nixpkgs, 11 | utils, 12 | typst, 13 | typst-lsp, 14 | ... 15 | }: 16 | utils.lib.eachDefaultSystem (system: let 17 | typst-overlay = _self: _super: { 18 | typst-lsp = typst-lsp.packages.${system}.default; 19 | typst = typst.packages.${system}.default.overrideAttrs (_old: { 20 | dontCheck = true; 21 | }); 22 | }; 23 | pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [typst-overlay]; 24 | typst-shell = pkgs.mkShell { 25 | nativeBuildInputs = [ 26 | pkgs.typst-lsp 27 | pkgs.typst 28 | ]; 29 | }; 30 | in { 31 | devShells.default = typst-shell; 32 | overlays.default = typst-overlay; 33 | legacyPackages = pkgs; 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /templates/howto.md: -------------------------------------------------------------------------------- 1 | Start normal shell with `nix-shell -p ` 2 | Run file with `nix-shell ` 3 | -------------------------------------------------------------------------------- /templates/sage.nix: -------------------------------------------------------------------------------- 1 | with (import {}); 2 | mkShell { 3 | buildInputs = [ 4 | python3 5 | sage 6 | ]; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /templates/tex.nix: -------------------------------------------------------------------------------- 1 | with (import {}); 2 | mkShell { 3 | buildInputs = [ 4 | python3 5 | texlive.combined.scheme-full 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /templates/typst.nix: -------------------------------------------------------------------------------- 1 | # Before updating: 2 | # 3 | # 1. Make sure to be on unstable 4 | # 2. nix-channel --update 5 | # 6 | with (import {}); 7 | mkShell { 8 | buildInputs = [ 9 | (typst.overrideAttrs { version = "0.13.1"; }) 10 | tinymist 11 | ]; 12 | } 13 | 14 | 15 | --------------------------------------------------------------------------------