diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml new file mode 100644 index 0000000000000000000000000000000000000000..5638eeed9ee587db00c5ccf9940dddc408a0841c --- /dev/null +++ b/alacritty/alacritty.toml @@ -0,0 +1,795 @@ +live_config_reload = true +working_directory = "None" + +[bell] +animation = "EaseOutExpo" +color = "0xffffff" +duration = 0 + +[colors] +draw_bold_text_with_bright_colors = true +indexed_colors = [] + +[colors.bright] +black = "0x555555" +blue = "0x6464FF" +cyan = "0x00FFFF" +green = "0x00FF00" +magenta = "0xFF00FF" +red = "0xFF0000" +white = "0xFFFFFF" +yellow = "0xFFFF00" + +[colors.normal] +black = "0x000000" +blue = "0x5555AA" +cyan = "0x00AAAA" +green = "0x00AA00" +magenta = "0xAA00AA" +red = "0xB40000" +white = "0xAAAAAA" +yellow = "0xAAAA00" + +[colors.primary] +background = "0x000000" +foreground = "0xeaeaea" + +[cursor] +style = "Block" +unfocused_hollow = true + +[debug] +log_level = "Warn" +persistent_logging = false +print_events = false +render_timer = false + +[env] +TERM = "xterm-256color" + +[font] +size = 10.0 + +[font.glyph_offset] +x = 0 +y = 0 + +[font.normal] +family = "monospace" + +[font.offset] +x = 0 +y = 0 + +[[keyboard.bindings]] +action = "Paste" +key = "Paste" + +[[keyboard.bindings]] +action = "Copy" +key = "Copy" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3H" +key = "Home" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001BOH" +key = "Home" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[H" +key = "Home" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;3F" +key = "End" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001BOF" +key = "End" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[F" +key = "End" +mode = "~AppCursor" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[5;2~" +key = "PageUp" +mode = "Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[5;5~" +key = "PageUp" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[5;3~" +key = "PageUp" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[5~" +key = "PageUp" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[6;2~" +key = "PageDown" +mode = "Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[6;5~" +key = "PageDown" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[6;3~" +key = "PageDown" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[6~" +key = "PageDown" + +[[keyboard.bindings]] +chars = "\u001B[Z" +key = "Tab" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u007F" +key = "Back" + +[[keyboard.bindings]] +chars = "\u001B\u007F" +key = "Back" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[2~" +key = "Insert" + +[[keyboard.bindings]] +chars = "\u001B[3~" +key = "Delete" + +[[keyboard.bindings]] +chars = "\u001B[1;2D" +key = "Left" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5D" +key = "Left" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3D" +key = "Left" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[D" +key = "Left" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOD" +key = "Left" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;2C" +key = "Right" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5C" +key = "Right" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3C" +key = "Right" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[C" +key = "Right" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOC" +key = "Right" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;5A" +key = "Up" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3A" +key = "Up" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[A" +key = "Up" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOA" +key = "Up" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;5B" +key = "Down" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3B" +key = "Down" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[B" +key = "Down" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOB" +key = "Down" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOP" +key = "F1" + +[[keyboard.bindings]] +chars = "\u001BOQ" +key = "F2" + +[[keyboard.bindings]] +chars = "\u001BOR" +key = "F3" + +[[keyboard.bindings]] +chars = "\u001BOS" +key = "F4" + +[[keyboard.bindings]] +chars = "\u001B[15~" +key = "F5" + +[[keyboard.bindings]] +chars = "\u001B[17~" +key = "F6" + +[[keyboard.bindings]] +chars = "\u001B[18~" +key = "F7" + +[[keyboard.bindings]] +chars = "\u001B[19~" +key = "F8" + +[[keyboard.bindings]] +chars = "\u001B[20~" +key = "F9" + +[[keyboard.bindings]] +chars = "\u001B[21~" +key = "F10" + +[[keyboard.bindings]] +chars = "\u001B[23~" +key = "F11" + +[[keyboard.bindings]] +chars = "\u001B[24~" +key = "F12" + +[[keyboard.bindings]] +chars = "\u001B[1;2P" +key = "F1" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2Q" +key = "F2" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2R" +key = "F3" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2S" +key = "F4" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[15;2~" +key = "F5" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[17;2~" +key = "F6" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[18;2~" +key = "F7" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[19;2~" +key = "F8" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[20;2~" +key = "F9" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[21;2~" +key = "F10" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[23;2~" +key = "F11" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[24;2~" +key = "F12" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5P" +key = "F1" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5Q" +key = "F2" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5R" +key = "F3" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5S" +key = "F4" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[15;5~" +key = "F5" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[17;5~" +key = "F6" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[18;5~" +key = "F7" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[19;5~" +key = "F8" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[20;5~" +key = "F9" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[21;5~" +key = "F10" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[23;5~" +key = "F11" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[24;5~" +key = "F12" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;6P" +key = "F1" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6Q" +key = "F2" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6R" +key = "F3" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6S" +key = "F4" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[15;6~" +key = "F5" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[17;6~" +key = "F6" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[18;6~" +key = "F7" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[19;6~" +key = "F8" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[20;6~" +key = "F9" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[21;6~" +key = "F10" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[23;6~" +key = "F11" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[24;6~" +key = "F12" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;3P" +key = "F1" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3Q" +key = "F2" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3R" +key = "F3" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3S" +key = "F4" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[15;3~" +key = "F5" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[17;3~" +key = "F6" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[18;3~" +key = "F7" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[19;3~" +key = "F8" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[20;3~" +key = "F9" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[21;3~" +key = "F10" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[23;3~" +key = "F11" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[24;3~" +key = "F12" +mods = "Super" + +[[keyboard.bindings]] +chars = """ + +""" +key = "NumpadEnter" + +[[keyboard.bindings]] +key = "N" +mods = "Control|Shift" + +[keyboard.bindings.command] +args = ["/home/jiri/.config/alacritty/spawn-alacritty-cwd"] +program = "/bin/bash" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineUp" +key = "Up" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "ScrollLineDown" +key = "Down" +mods = "Shift|Control" + +[mouse] +hide_when_typing = false + +[[mouse.bindings]] +action = "PasteSelection" +mouse = "Middle" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = false +semantic_escape_chars = ",│`|:\"' ()[]{}<>" + +[window] +decorations = "full" +dynamic_padding = false +opacity = 0 +startup_mode = "Windowed" + +[window.dimensions] +columns = 0 +lines = 0 + +[window.padding] +x = 0 +y = 0 diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml deleted file mode 100644 index 6f0ac2ca1a42df656929b5fa2a148a11f7708752..0000000000000000000000000000000000000000 --- a/alacritty/alacritty.yml +++ /dev/null @@ -1,675 +0,0 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. -env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. - TERM: xterm-256color - -window: - # Window dimensions (changes require restart) - # - # Specified in number of columns/lines, not pixels. - # If both are `0`, this setting is ignored. - dimensions: - columns: 0 - lines: 0 - opacity: 0 - - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. - #position: - # x: 0 - # y: 0 - - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - padding: - x: 0 - y: 0 - - # Spread additional padding evenly around the terminal content. - dynamic_padding: false - - # Window decorations - # - # Values for `decorations`: - # - full: Borders and title bar - # - none: Neither borders nor title bar - # - # Values for `decorations` (macOS only): - # - transparent: Title bar, transparent background and title bar buttons - # - buttonless: Title bar, transparent background, but no title bar buttons - decorations: full - - # Startup Mode (changes require restart) - # - # Values for `startup_mode`: - # - Windowed - # - Maximized - # - Fullscreen - # - # Values for `startup_mode` (macOS only): - # - SimpleFullscreen - startup_mode: Windowed - - # Window title -title: Telminár - - # Window class (Linux only): -class: Alacritty - -scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - history: 10000 - - # Number of lines the viewport will move for every line scrolled when - # scrollback is enabled (history > 0). - multiplier: 3 - - -# Font configuration (changes require restart) -font: - # Normal (roman) font face - normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux) monospace - # - (Windows) Consolas - family: monospace - - # The `style` can be specified to pick a specific face. - #style: Regular - - # Bold font face - #bold: - # Font family - # - # If the bold family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - - # The `style` can be specified to pick a specific face. - #style: Bold - - # Italic font face - #italic: - # Font family - # - # If the italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - - # The `style` can be specified to pick a specific face. - #style: Italic - - # Point size - size: 10.0 - - # Offset is the extra space around each character. `offset.y` can be thought of - # as modifying the line spacing, and `offset.x` as modifying the letter spacing. - offset: - x: 0 - y: 0 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the right, - # increasing `y` moves the glyph upwards. - glyph_offset: - x: 0 - y: 0 - - # Thin stroke font rendering (macOS only) - # - # Thin strokes are suitable for retina displays, but for non-retina screens - # it is recommended to set `use_thin_strokes` to `false` - # - # macOS >= 10.14.x: - # - # If the font quality on non-retina display looks bad then set - # `use_thin_strokes` to `true` and enable font smoothing by running the - # following command: - # `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO` - # - # This is a global setting and will require a log out or restart to take - # effect. - # use_thin_strokes: true - -# If `true`, bold text is drawn using the bright color variants. -draw_bold_text_with_bright_colors: true - -# Colors (Tomorrow Night Bright) -colors: - # Default colors - primary: - background: '0x000000' - foreground: '0xeaeaea' - - # Bright and dim foreground colors - # - # The dimmed foreground color is calculated automatically if it is not present. - # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` - # is `false`, the normal foreground color will be used. - #dim_foreground: '0x9a9a9a' - #bright_foreground: '0xffffff' - - # Cursor colors - # - # Colors which should be used to draw the terminal cursor. If these are unset, - # the cursor color will be the inverse of the cell color. - #cursor: - # text: '0x000000' - # cursor: '0xffffff' - - # Selection colors - # - # Colors which should be used to draw the selection area. If selection - # background is unset, selection color will be the inverse of the cell colors. - # If only text is unset the cell text color will remain the same. - #selection: - # text: '0xeaeaea' - # background: '0x404040' - - ## Normal colors - #normal: - #black: '0x000000' - #red: '0xd54e53' - #green: '0xb9ca4a' - #yellow: '0xe6c547' - #blue: '0x7aa6da' - #magenta: '0xc397d8' - #cyan: '0x70c0ba' - #white: '0xeaeaea' - - # Bright colors - #bright: - #black: '0x666666' - #red: '0xff3334' - #green: '0x9ec400' - #yellow: '0xe7c547' - #blue: '0x7aa6da' - #magenta: '0xb77ee0' - #cyan: '0x54ced6' - #white: '0xffffff' - # Normal colors - normal: - black: '0x000000' - red: '0xB40000' - green: '0x00AA00' - yellow: '0xAAAA00' - blue: '0x5555AA' - magenta: '0xAA00AA' - cyan: '0x00AAAA' - white: '0xAAAAAA' - - # Bright colors - bright: - black: '0x555555' - red: '0xFF0000' - green: '0x00FF00' - yellow: '0xFFFF00' - blue: '0x6464FF' - magenta: '0xFF00FF' - cyan: '0x00FFFF' - white: '0xFFFFFF' - - # Dim colors - # - # If the dim colors are not set, they will be calculated automatically based - # on the `normal` colors. - #dim: - # black: '0x000000' - # red: '0x8c3336' - # green: '0x7a8530' - # yellow: '0x97822e' - # blue: '0x506d8f' - # magenta: '0x80638e' - # cyan: '0x497e7a' - # white: '0x9a9a9a' - - # Indexed Colors - # - # The indexed colors include all colors from 16 to 256. - # When these are not set, they're filled with sensible defaults. - # - # Example: - # `- { index: 16, color: '0xff00ff' }` - # - indexed_colors: [] - -# Visual Bell -# -# Any time the BEL code is received, Alacritty "rings" the visual bell. Once -# rung, the terminal background will be set to white and transition back to the -# default background color. You can control the rate of this transition by -# setting the `duration` property (represented in milliseconds). You can also -# configure the transition function by setting the `animation` property. -# -# Values for `animation`: -# - Ease -# - EaseOut -# - EaseOutSine -# - EaseOutQuad -# - EaseOutCubic -# - EaseOutQuart -# - EaseOutQuint -# - EaseOutExpo -# - EaseOutCirc -# - Linear -# -# Specifying a `duration` of `0` will disable the visual bell. -bell: - animation: EaseOutExpo - duration: 0 - color: '0xffffff' - -# Background opacity -# -# Window opacity as a floating point number from `0.0` to `1.0`. -# The value `0.0` is completely transparent and `1.0` is opaque. - -# Mouse bindings -# -# Available fields: -# - mouse -# - action -# - mods (optional) -# -# Values for `mouse`: -# - Middle -# - Left -# - Right -# - Numeric identifier such as `5` -# -# All available `mods` and `action` values are documented in the key binding -# section. -mouse_bindings: - - { mouse: Middle, action: PasteSelection } - -mouse: - # Click settings - # - # The `double_click` and `triple_click` settings control the time - # alacritty should wait for accepting multiple clicks as one double - # or triple click. - double_click: { threshold: 300 } - triple_click: { threshold: 300 } - - # If this is `true`, the cursor is temporarily hidden when typing. - hide_when_typing: false - - hints: - # URL launcher - # - # This program is executed when clicking on a text which is recognized as a URL. - # The URL is always added to the command as the last parameter. - # - # When set to `None`, URL launching will be disabled completely. - # - # Default: - # - (macOS) open - # - (Linux) xdg-open - # - (Windows) explorer - #launcher: - # program: xdg-open - # args: [] - - # URL modifiers - # - # These are the modifiers that need to be held down for opening URLs when clicking - # on them. The available modifiers are documented in the key binding section. - modifiers: None - -selection: - semantic_escape_chars: ",│`|:\"' ()[]{}<>" - - # When set to `true`, selected text will be copied to the primary clipboard. - save_to_clipboard: false - -# Allow terminal applications to change Alacritty's window title. -window.dynamic_title: true - -cursor: - # Cursor style - # - # Values for `style`: - # - ▇ Block - # - _ Underline - # - | Beam - style: Block - - # If this is `true`, the cursor will be rendered as a hollow box when the - # window is not focused. - unfocused_hollow: true - -# Live config reload (changes require restart) -live_config_reload: true - -# Shell -# -# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`. -# Entries in `shell.args` are passed unmodified as arguments to the shell. -# -# Default: -# - (macOS) /bin/bash --login -# - (Linux) user login shell -# - (Windows) powershell -#shell: -# program: /bin/bash -# args: -# - --login - -# Startup directory -# -# Directory the shell is started in. If this is unset, or `None`, the working -# directory of the parent process will be used. -working_directory: None - -# Windows 10 ConPTY backend (Windows only) -# -# This will enable better color support and may resolve other issues, -# however this API and its implementation is still young and so is -# disabled by default, as stability may not be as good as the winpty -# backend. -# -# Alacritty will fall back to the WinPTY automatically if the ConPTY -# backend cannot be initialized. -enable_experimental_conpty_backend: false - -debug: - # Display the time it takes to redraw each frame. - render_timer: false - - # Keep the log file after quitting Alacritty. - persistent_logging: false - - # Log level - # - # Values for `log_level`: - # - None - # - Error - # - Warn - # - Info - # - Debug - # - Trace - log_level: Warn - - # Print all received window events. - print_events: false - - # Record all characters and escape sequences as test data. - ref_test: false - -# Key bindings -# -# Key bindings are specified as a list of objects. Each binding will specify a -# key and modifiers required to trigger it, terminal modes where the binding is -# applicable, and what should be done when the key binding fires. It can either -# send a byte sequence to the running application (`chars`), execute a -# predefined action (`action`) or fork and execute a specified command plus -# arguments (`command`). -# -# Bindings are always filled by default, but will be replaced when a new binding -# with the same triggers is defined. To unset a default binding, it can be -# mapped to the `None` action. -# -# Example: -# `- { key: V, mods: Control|Shift, action: Paste }` -# -# Available fields: -# - key -# - mods (optional) -# - chars | action | command (exactly one required) -# - mode (optional) -# -# Values for `key`: -# - `A` -> `Z` -# - `F1` -> `F12` -# - `Key1` -> `Key0` -# -# A full list with available key codes can be found here: -# https://docs.rs/glutin/*/glutin/enum.VirtualKeyCode.html#variants -# -# Instead of using the name of the keys, the `key` field also supports using -# the scancode of the desired key. Scancodes have to be specified as a -# decimal number. -# This command will allow you to display the hex scancodes for certain keys: -# `showkey --scancodes` -# -# Values for `mods`: -# - Command -# - Control -# - Option -# - Super -# - Shift -# - Alt -# -# Multiple `mods` can be combined using `|` like this: `mods: Control|Shift`. -# Whitespace and capitalization is relevant and must match the example. -# -# Values for `chars`: -# The `chars` field writes the specified string to the terminal. This makes -# it possible to pass escape sequences. -# To find escape codes for bindings like `PageUp` ("\x1b[5~"), you can run -# the command `showkey -a` outside of tmux. -# Note that applications use terminfo to map escape sequences back to -# keys. It is therefore required to update the terminfo when -# changing an escape sequence. -# -# Values for `action`: -# - Paste -# - PasteSelection -# - Copy -# - IncreaseFontSize -# - DecreaseFontSize -# - ResetFontSize -# - ScrollPageUp -# - ScrollPageDown -# - ScrollLineUp -# - ScrollLineDown -# - ScrollToTop -# - ScrollToBottom -# - ClearHistory -# - Hide -# - Quit -# - ClearLogNotice -# - SpawnNewInstance -# - ToggleFullscreen -# - None -# -# Values for `action` (macOS only): -# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space -# -# Values for `command`: -# The `command` field must be a map containing a `program` string and -# an `args` array of command line parameter strings. -# -# Example: -# `command: { program: "alacritty", args: ["-e", "vttest"] }` -# -# Values for `mode`: -# - ~AppCursor -# - AppCursor -# - ~AppKeypad -# - AppKeypad -key_bindings: - # (Windows/Linux only) - #- { key: V, mods: Control|Shift, action: Paste } - #- { key: C, mods: Control|Shift, action: Copy } - #- { key: Insert, mods: Shift, action: PasteSelection } - #- { key: Key0, mods: Control, action: ResetFontSize } - #- { key: Equals, mods: Control, action: IncreaseFontSize } - #- { key: Subtract, mods: Control, action: DecreaseFontSize } - #- { key: Minus, mods: Control, action: DecreaseFontSize } - #- { key: Return, mods: Alt, action: ToggleFullscreen } - - # (macOS only) - #- { key: Key0, mods: Command, action: ResetFontSize } - #- { key: Equals, mods: Command, action: IncreaseFontSize } - #- { key: Minus, mods: Command, action: DecreaseFontSize } - #- { key: K, mods: Command, action: ClearHistory } - #- { key: K, mods: Command, chars: "\x0c" } - #- { key: V, mods: Command, action: Paste } - #- { key: C, mods: Command, action: Copy } - #- { key: H, mods: Command, action: Hide } - #- { key: Q, mods: Command, action: Quit } - #- { key: W, mods: Command, action: Quit } - #- { key: F, mods: Command|Control, action: ToggleFullscreen } - - - { key: Paste, action: Paste } - - { key: Copy, action: Copy } - - { key: L, mods: Control, action: ClearLogNotice } - - { key: L, mods: Control, chars: "\x0c" } - - { key: Home, mods: Alt, chars: "\x1b[1;3H" } - - { key: Home, chars: "\x1bOH", mode: AppCursor } - - { key: Home, chars: "\x1b[H", mode: ~AppCursor } - - { key: End, mods: Alt, chars: "\x1b[1;3F" } - - { key: End, chars: "\x1bOF", mode: AppCursor } - - { key: End, chars: "\x1b[F", mode: ~AppCursor } - - { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } - - { key: PageUp, mods: Shift, chars: "\x1b[5;2~", mode: Alt } - - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } - - { key: PageUp, mods: Alt, chars: "\x1b[5;3~" } - - { key: PageUp, chars: "\x1b[5~" } - - { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } - - { key: PageDown, mods: Shift, chars: "\x1b[6;2~", mode: Alt } - - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } - - { key: PageDown, mods: Alt, chars: "\x1b[6;3~" } - - { key: PageDown, chars: "\x1b[6~" } - - { key: Tab, mods: Shift, chars: "\x1b[Z" } - - { key: Back, chars: "\x7f" } - - { key: Back, mods: Alt, chars: "\x1b\x7f" } - - { key: Insert, chars: "\x1b[2~" } - - { key: Delete, chars: "\x1b[3~" } - - { key: Left, mods: Shift, chars: "\x1b[1;2D" } - - { key: Left, mods: Control, chars: "\x1b[1;5D" } - - { key: Left, mods: Alt, chars: "\x1b[1;3D" } - - { key: Left, chars: "\x1b[D", mode: ~AppCursor } - - { key: Left, chars: "\x1bOD", mode: AppCursor } - - { key: Right, mods: Shift, chars: "\x1b[1;2C" } - - { key: Right, mods: Control, chars: "\x1b[1;5C" } - - { key: Right, mods: Alt, chars: "\x1b[1;3C" } - - { key: Right, chars: "\x1b[C", mode: ~AppCursor } - - { key: Right, chars: "\x1bOC", mode: AppCursor } - - { key: Up, mods: Control, chars: "\x1b[1;5A" } - - { key: Up, mods: Alt, chars: "\x1b[1;3A" } - - { key: Up, chars: "\x1b[A", mode: ~AppCursor } - - { key: Up, chars: "\x1bOA", mode: AppCursor } - - { key: Down, mods: Control, chars: "\x1b[1;5B" } - - { key: Down, mods: Alt, chars: "\x1b[1;3B" } - - { key: Down, chars: "\x1b[B", mode: ~AppCursor } - - { key: Down, chars: "\x1bOB", mode: AppCursor } - - { key: F1, chars: "\x1bOP" } - - { key: F2, chars: "\x1bOQ" } - - { key: F3, chars: "\x1bOR" } - - { key: F4, chars: "\x1bOS" } - - { key: F5, chars: "\x1b[15~" } - - { key: F6, chars: "\x1b[17~" } - - { key: F7, chars: "\x1b[18~" } - - { key: F8, chars: "\x1b[19~" } - - { key: F9, chars: "\x1b[20~" } - - { key: F10, chars: "\x1b[21~" } - - { key: F11, chars: "\x1b[23~" } - - { key: F12, chars: "\x1b[24~" } - - { key: F1, mods: Shift, chars: "\x1b[1;2P" } - - { key: F2, mods: Shift, chars: "\x1b[1;2Q" } - - { key: F3, mods: Shift, chars: "\x1b[1;2R" } - - { key: F4, mods: Shift, chars: "\x1b[1;2S" } - - { key: F5, mods: Shift, chars: "\x1b[15;2~" } - - { key: F6, mods: Shift, chars: "\x1b[17;2~" } - - { key: F7, mods: Shift, chars: "\x1b[18;2~" } - - { key: F8, mods: Shift, chars: "\x1b[19;2~" } - - { key: F9, mods: Shift, chars: "\x1b[20;2~" } - - { key: F10, mods: Shift, chars: "\x1b[21;2~" } - - { key: F11, mods: Shift, chars: "\x1b[23;2~" } - - { key: F12, mods: Shift, chars: "\x1b[24;2~" } - - { key: F1, mods: Control, chars: "\x1b[1;5P" } - - { key: F2, mods: Control, chars: "\x1b[1;5Q" } - - { key: F3, mods: Control, chars: "\x1b[1;5R" } - - { key: F4, mods: Control, chars: "\x1b[1;5S" } - - { key: F5, mods: Control, chars: "\x1b[15;5~" } - - { key: F6, mods: Control, chars: "\x1b[17;5~" } - - { key: F7, mods: Control, chars: "\x1b[18;5~" } - - { key: F8, mods: Control, chars: "\x1b[19;5~" } - - { key: F9, mods: Control, chars: "\x1b[20;5~" } - - { key: F10, mods: Control, chars: "\x1b[21;5~" } - - { key: F11, mods: Control, chars: "\x1b[23;5~" } - - { key: F12, mods: Control, chars: "\x1b[24;5~" } - - { key: F1, mods: Alt, chars: "\x1b[1;6P" } - - { key: F2, mods: Alt, chars: "\x1b[1;6Q" } - - { key: F3, mods: Alt, chars: "\x1b[1;6R" } - - { key: F4, mods: Alt, chars: "\x1b[1;6S" } - - { key: F5, mods: Alt, chars: "\x1b[15;6~" } - - { key: F6, mods: Alt, chars: "\x1b[17;6~" } - - { key: F7, mods: Alt, chars: "\x1b[18;6~" } - - { key: F8, mods: Alt, chars: "\x1b[19;6~" } - - { key: F9, mods: Alt, chars: "\x1b[20;6~" } - - { key: F10, mods: Alt, chars: "\x1b[21;6~" } - - { key: F11, mods: Alt, chars: "\x1b[23;6~" } - - { key: F12, mods: Alt, chars: "\x1b[24;6~" } - - { key: F1, mods: Super, chars: "\x1b[1;3P" } - - { key: F2, mods: Super, chars: "\x1b[1;3Q" } - - { key: F3, mods: Super, chars: "\x1b[1;3R" } - - { key: F4, mods: Super, chars: "\x1b[1;3S" } - - { key: F5, mods: Super, chars: "\x1b[15;3~" } - - { key: F6, mods: Super, chars: "\x1b[17;3~" } - - { key: F7, mods: Super, chars: "\x1b[18;3~" } - - { key: F8, mods: Super, chars: "\x1b[19;3~" } - - { key: F9, mods: Super, chars: "\x1b[20;3~" } - - { key: F10, mods: Super, chars: "\x1b[21;3~" } - - { key: F11, mods: Super, chars: "\x1b[23;3~" } - - { key: F12, mods: Super, chars: "\x1b[24;3~" } - - { key: NumpadEnter, chars: "\n" } - - { key: N, mods: Control|Shift, command: { program: "/bin/bash", args: [ "/home/jiri/.config/alacritty/spawn-alacritty-cwd"] }} - - { key: Up, mods: Shift, action: ScrollLineUp} - - { key: Up, mods: Shift, action: ScrollLineUp} - - { key: Up, mods: Shift, action: ScrollLineUp} - - { key: Up, mods: Shift, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp } - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp } - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp} - - { key: Up, mods: Shift|Control, action: ScrollLineUp } - - { key: Down, mods: Shift, action: ScrollLineDown} - - { key: Down, mods: Shift, action: ScrollLineDown} - - { key: Down, mods: Shift, action: ScrollLineDown} - - { key: Down, mods: Shift, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown } - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown } - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown} - - { key: Down, mods: Shift|Control, action: ScrollLineDown } - diff --git a/alacritty/init.sh b/alacritty/init.sh index f4065e229685e65adcf78dc281785b4d05e76c9b..7b82f77b2d27076219cc58683a4320243163f366 100755 --- a/alacritty/init.sh +++ b/alacritty/init.sh @@ -1,9 +1,10 @@ #!/bin/bash cd "$(dirname "$0")" . ../userconfig-lib.sh +version 1 install_begin -confln alacritty.yml ~/.config/alacritty/ +confln alacritty.toml ~/.config/alacritty/ confln spawn-alacritty-cwd ~/.config/alacritty/ install_ok diff --git a/alacritty/spawn-alacritty-cwd b/alacritty/spawn-alacritty-cwd index 7bf88b72c83a074c6a9e6a6bc231d07ac9e6cc64..280605187e7ac1ee7ed7d8f17d89335408fdf823 100755 --- a/alacritty/spawn-alacritty-cwd +++ b/alacritty/spawn-alacritty-cwd @@ -78,10 +78,9 @@ then while IFS= read -rd '' var; do export "$var"; done </proc/$CHILD_PID/environ alacritty --working-directory $SHELL_CWD else - sshCom="$(ps -p $ssh -o command | sed -n 2p)" + sshCom="$(xargs -0 printf "%q " < /proc/$ssh/cmdline)" ssh_cwd="$(xdotool getwindowfocus getwindowname)" ssh_cwd="$(printf "%s\n" "${ssh_cwd##*:}")" - #osdc $ssh_cwd #echo "$sshCom" > ~/.tmpSSH sshCom="${sshCom::3} -o SendEnv=LC_CD ${sshCom:3}" while IFS= read -rd '' var; do export "$var"; done </proc/$ssh/environ diff --git a/bash/bashrc b/bash/bashrc index 38c1fff6c7321fb4cdeac01185a584b3c83dcfa5..94804e642261e1b0a17804c6787be415dc759533 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -231,19 +231,19 @@ gia(){ git add "$@" } giac(){ - git add $@;git commit; + git add "$@"; git commit; } giaac(){ - git add . $@;git commit; + git add . "$@"; git commit; } giaca(){ - git add $@;git commit --amend; + git add "$@"; git commit --amend; } giaaca(){ - git add . $@;git commit --amend; + git add . "$@"; git commit --amend; } gip(){ - git pull $@;git push $@; + git pull "$@"; git push "$@"; } gipma(){ b=$1 diff --git a/i3/config-gen/init-vm.sh b/i3/config-gen/init-vm.sh index 3bd99b5ba733493b34867d9635206de0730f9470..0c0f485b005f68348813b1f2ccccf3731d471caf 100755 --- a/i3/config-gen/init-vm.sh +++ b/i3/config-gen/init-vm.sh @@ -1,13 +1,18 @@ #!/bin/bash cd "$(dirname "$0")" . ../../userconfig-lib.sh +version 3 install_begin confln main.km ~/.config/i3/config-gen +confln xrandr-cmddef.km ~/.config/i3/ ( cd ~/.config/i3 - ./config-gen > config + r mkdir -p ../sway + r -b './config-gen > config' + r -b './config-gen sway > ../sway/config' + r -b './config-gen sway vncserver > ../sway/vnc.config' ) install_ok diff --git a/i3/config-gen/init.sh b/i3/config-gen/init.sh index 9a0e8d93c2e5890967b7a7d6bae3752ae8906ebe..39b572798af641e9d248687698736e378ec62a0b 100755 --- a/i3/config-gen/init.sh +++ b/i3/config-gen/init.sh @@ -1,6 +1,7 @@ #!/bin/bash cd "$(dirname "$0")" . ../../userconfig-lib.sh +version 3 install_begin confln main.km ~/.config/i3/config-gen @@ -11,7 +12,10 @@ confln xrandr-cmddef.km ~/.config/i3/ ( cd ~/.config/i3 + r mkdir -p ../sway r -b './config-gen > config' + r -b './config-gen sway > ../sway/config' + r -b './config-gen sway vncserver > ../sway/vnc.config' ) install_ok diff --git a/i3/config-gen/main.km b/i3/config-gen/main.km index 88093f57ac47784f5ae68a09708b215927f184d4..df500c901e5822e8f3342775a482232526d4b0c0 100755 --- a/i3/config-gen/main.km +++ b/i3/config-gen/main.km @@ -167,10 +167,13 @@ with ADD_MODIFICATOR(SUPER): M(K_Q(SHIFT), release_action=CMD("xkill")) M(K_Q(CTRL), release_action=CMD("killall xkill")) - with M(K_ESC, GO_MODE(MODE("LOCK-MOD-ESC"))).action.mode: - M(K_ESC(SUPER), GO_MODE(GET_MODE(-2))) - with M(K_ESC(SHIFT), GO_MODE(MODE("LOCK-MOD-SHIFT-ESC"))).action.mode: - M(K_ESC(SUPER|SHIFT), GO_MODE(GET_MODE(-2))) + M(K(".", CTRL), SHOW_STATUSBAR(True)) + M(K(".", CTRL|SHIFT), SHOW_STATUSBAR(False)) + + for k, name in [(K_ESC(SUPER), "LOCK-MOD-ESC"), (K_ESC(SUPER|SHIFT), "LOCK-MOD-SHIFT-ESC")]: + with MODE(name) as m: + M(k, GO_MODE(GET_MODE(-2))) + M(k, AND(FULLSCREEN(False), SHOW_STATUSBAR(True), GO_MODE(m), main=2)) with M(K_X, GO_MODE(STD_MODE("System-modifikator"))).action.mode: M(KEY(2,1), LIGHT(raw=0)) @@ -196,13 +199,13 @@ with ADD_MODIFICATOR(SUPER): bind_osd_enable(KEY(4, 5), "display1") M(K_B, cmd_set_xkbmap) - M(K_H(SHIFT), ROOT_MODE_AND(CMD("terminal -e blueman-applet"))) - M(K_H, ROOT_MODE_AND(CMD("blueman-manager"))) + M(K_H, ROOT_MODE_AND(CMD("root bluetoothctl connect 11:11:22:37:1D:8D"))) + M(K_H(SHIFT), ROOT_MODE_AND(CMD("terminal -e root bluetoothctl"))) M(K_Y, ROOT_MODE_AND(CMD("amixer"))) M(K_O, CMD("osdc --output=display -- \"$(wifi on)\"")) M(K_P, CMD("osdc --output=display -- \"$(wifi off)\"")) - M(K_I, ROOT_MODE_AND(CMD("terminal -e nmtui"))) + M(K_I, ROOT_MODE_AND(CMD("terminal -e root iwctl"))) M(K_B(SHIFT), ROOT_MODE_AND(CMD("arandr"))) LOAD("xrandr.km", only_if_exists=True) @@ -249,8 +252,7 @@ with ADD_MODIFICATOR(SUPER): """) app_workspace(K_Z, "ZOOM", CMD("zoom")) - # File browser - M(K_N, CMD("nemo")) + M(K_N(CTRL), CMD("nemo")) # Pasman def bind_pasman(key, getter): @@ -278,3 +280,11 @@ with ADD_MODIFICATOR(SUPER): for_window [title="better xdg-open"] floating enable """) + # VM + M(K_N, CMD("vm terminal_ssh []")) + M(K_F(SHIFT), CMD("vm resize_wayland []")) + + +if "sway" in ARGS and "vncserver" in ARGS: + EXEC_ON_STARTUP(CMD("echo $WAYLAND_DISPLAY; echo $SWAYSOCK")) + EXEC_ON_STARTUP(CMD("wayvnc 0.0.0.0 $(( 5800 + ${WAYLAND_DISPLAY:8} )) --config ~/.config/wayvnc/config -S /tmp/wayvnc-ctl-${WAYLAND_DISPLAY:8}")) diff --git a/i3/config-gen/xrandr-cmddef.km b/i3/config-gen/xrandr-cmddef.km index 589ccecbe60a3c8abc65f7b5c9951d62578049a8..ef4709b902d2902ae473485c0dc3a24f41093df3 100644 --- a/i3/config-gen/xrandr-cmddef.km +++ b/i3/config-gen/xrandr-cmddef.km @@ -1,5 +1,7 @@ fhd = (1920, 1080) +fhdx = (1920, 1200) qhd = (2560, 1440) +qhdx = (2560, 1600) normal = "normal" left = "left" diff --git a/i3/config-gen/xrandr-hopik.km b/i3/config-gen/xrandr-hopik.km new file mode 100644 index 0000000000000000000000000000000000000000..ff2fc34c9bef4afeab30f10a932542ffe7fc4e60 --- /dev/null +++ b/i3/config-gen/xrandr-hopik.km @@ -0,0 +1,59 @@ +LOAD_LIB("xrandr-cmddef.km") +map_touchscreen = "for i in {0..10}; do sleep 0.5; xinput | grep WingCoolTouch | while read l; do id=${l:50:2}; xinput map-to-output $id DP-1; done; done;" + +def xrandr_set(mode_name, eDP_1=(qhdx, (0,0)), DP_1=None, DP_2=None, HDMI_1=None, after="", primary="eDP_1"): + out = xrandr(mode_name, {"eDP_1": eDP_1, "DP_1": DP_1, "DP_2": DP_2,"HDMI_1": HDMI_1}, primary, after) + globals()["r_" + mode_name] = out + return out + + +xrandr_set("std") +xrandr_set("std_small", eDP_1=(fhdx, (0,0))) +xrandr_set("std_small2", eDP_1=((1280,800), (0,0))) + +xrandr_set("samsung", eDP_1=(qhdx, (2560, 0)), DP_1=(qhd, (0,0)), primary="DP_1") +xrandr_set("samsung_only", eDP_1=None, DP_1=(qhd, (0,0)), primary="DP_1") +xrandr_set("samsung_unisim", eDP_1=(qhdx, (832, 0)), DP_1=((832, 624), (0,0)), primary="DP_1") + + +xrandr_set("verbatim_left_hand", eDP_1=(qhdx, (1080, 0)), DP_1=(fhd, (0,0), left), after=map_touchscreen, primary="eDP_1") +xrandr_set("verbatim_left_hand_only", eDP_1=None, DP_1=(fhd, (0,0), left), after=map_touchscreen, primary="DP_1") + +xrandr_set("verbatim_right_hand", eDP_1=(qhdx, (0,0)), DP_1=(fhd, (2560,0), right), after=map_touchscreen, primary="eDP_1") +xrandr_set("verbatim_right_hand_only", eDP_1=None, DP_1=(fhd, (0,0), right), after=map_touchscreen, primary="DP_1") + +xrandr_set("verbatim_left_table", eDP_1=(qhdx, (1920, 0)), DP_1=(fhd, (0,0)), after=map_touchscreen, primary="DP_1") +xrandr_set("verbatim_right_table", eDP_1=(qhdx, (0, 0)), DP_1=(fhd, (2560,0)), after=map_touchscreen, primary="DP_1") +xrandr_set("verbatim_table_only", eDP_1=None, DP_1=(fhd, (0,0)), after=map_touchscreen, primary="DP_1") + + +xrandr_set("camomile", eDP_1=(qhdx, (0, 1200)), HDMI_1=((1920, 1200), (0,0)), primary="HDMI_1") +xrandr_set("opler", eDP_1=(qhdx, (0, 1200)), DP_1=(fhdx, (0,0)), primary="DP_1") + + +if __name__ == "__main__": + print(r_std) +else: + M(K_N, r_std) + M(K_N(SHIFT), r_std_small) + M(K_N(CTRL), r_std_small2) + + M(K_M, r_samsung) + M(K_M(SHIFT), r_samsung_only) + M(K_M(CTRL), r_samsung_unisim) + + M(K_J(), r_verbatim_left_hand) + M(K_J(SHIFT), r_verbatim_left_hand_only) + + M(K_K(), r_verbatim_left_table) + M(K_K(SHIFT), r_verbatim_table_only) + M(K(";"), r_verbatim_right_table) + + M(K("'"), r_verbatim_right_hand) + M(K("'", SHIFT), r_verbatim_right_hand_only) + + M(K("/", SHIFT), CMD(map_touchscreen)) + + M(K(",") , r_camomile) + M(K(",", SHIFT) , r_opler) + diff --git a/i3/init-vm.sh b/i3/init-vm.sh new file mode 100755 index 0000000000000000000000000000000000000000..8a9eac2b3a3d1edd32191ddb7b045f1bfcd8506e --- /dev/null +++ b/i3/init-vm.sh @@ -0,0 +1,19 @@ +#!/bin/bash +cd "$(dirname "$0")" +. ../userconfig-lib.sh +version 1 +install_begin + +confln toggle-border ~/.config/i3/i3-toggle-border +confln kill ~/.config/i3/i3-kill +confln i3status.conf ~/.config/i3/ +confln i3csstatus.conf ~/.config/i3/ c +cat >~/.xinitrc <<EOF +exec i3 +EOF +r g++ status.cpp -o ~/.config/i3/status.out + + +r ./config-gen/init-vm.sh + +install_ok diff --git a/i3/init.sh b/i3/init.sh index 2c57ce207fb511f185cd68093eafe47b7fbf8531..08add1ec3c5027300a3c360a9de2f19bb75c252c 100755 --- a/i3/init.sh +++ b/i3/init.sh @@ -1,23 +1,27 @@ #!/bin/bash cd "$(dirname "$0")" . ../userconfig-lib.sh +version 1 install_begin confln toggle-border ~/.config/i3/i3-toggle-border confln kill ~/.config/i3/i3-kill confln i3status.conf ~/.config/i3/ -confln i3csstatus.conf ~/.config/i3/ +confln i3csstatus.conf ~/.config/i3/ c cat >~/.xinitrc <<EOF exec i3 EOF r g++ status.cpp -o ~/.config/i3/status.out r ../git-clupdate git@gitlab.kam.mff.cuni.cz:jirikalvoda/i3-woman.git build_git_i3-woman +r -b "cd build_git_i3-woman; make" +confln build_git_i3-woman/daemon.py ~/bin/i3-woman-daemon +confln build_git_i3-woman/client ~/bin/i3-woman r ../git-clupdate git@gitlab.kam.mff.cuni.cz:jirikalvoda/i3csstatus.git build_git_i3csstatus r -b "cd build_git_i3csstatus ; dotnet build --no-self-contained --configuration Release" confln build_git_i3csstatus/bin/Release/net7.0/i3csstatus ~/bin/ -r ./config-gen/init.sh +r -c ./config-gen/init.sh install_ok diff --git a/instpect-state.py b/instpect-state.py index b2da40ce2e23325125d74085e0aab2682344f2f9..f79b3a6d796e4888a94591301f1700e935186842 100755 --- a/instpect-state.py +++ b/instpect-state.py @@ -48,6 +48,8 @@ class Log: self.dir = state_dir/name/logname self.state = read(self.dir/"state") self.version = read(self.dir/"version") or "0" + self.date = read(self.dir/"date") + self.args = " ".join((read(self.dir/"args") or "").split(" ")[1:]) class Installation: def __init__(self, state_dir, name): @@ -123,5 +125,5 @@ if args.server: print(tabulate.tabulate(head+table)) else: local = load_state_dir() - table = [[name, name_to_path(name), current_version(name), local[name].last_ok().version, local[name].short()] for name in sorted(local)] - print(tabulate.tabulate([["Name", "Path", "cv", "iv", "state"], tabulate.SEPARATING_LINE]+table)) + table = [[name, name_to_path(name), local[name].last().args, current_version(name), local[name].last_ok().version, local[name].short(), local[name].last().date] for name in sorted(local)] + print(tabulate.tabulate([["Name", "Path","args", "cv", "iv", "state", "date"], tabulate.SEPARATING_LINE]+table)) diff --git a/keymap-python/actions.py b/keymap-python/actions.py index e19786a75e403bdf8531d6552460c7599cb5bd7d..7966b9c446b7764ba01e5c3d709b6b17e18bfc71 100644 --- a/keymap-python/actions.py +++ b/keymap-python/actions.py @@ -118,6 +118,14 @@ def CONT_TOGGLE(self, prop_name): assert_in(prop_name, ["fullscreen", "floating", "sticky"]) self.prop_name = prop_name +@action_init() +def FULLSCREEN(self, on=True): + self.on = on + +@action_init() +def SHOW_STATUSBAR(self, on=True): + self.on = on + @action_init() def RESTART_MANAGER(self, prop_name): assert_in(prop_name, ["fullscreen", "floating", "sticky"]) @@ -147,7 +155,7 @@ def f(self): return CONFIRM_CMD("i3-msg exit", "Do you really want to EXIT i3?") @action_implement("EXIT_LOCK") def f(self): - return CMD("xtrlock") + return CMD("i3lock") @action_init() def LIGHT(self, raw=None, val=None, change=None): diff --git a/keymap-python/i3.py b/keymap-python/i3.py index 7eeeb34a6e524e0c526edc95026b81b870d962a4..028d7cb68164871fa8be56b437ea67f5904c6357 100755 --- a/keymap-python/i3.py +++ b/keymap-python/i3.py @@ -97,6 +97,9 @@ def x(self): @action_serialize("CONT_TOGGLE") def x(self): return f"{self.prop_name} toggle" +@action_serialize("FULLSCREEN") +def x(self): + return f"fullscreen {'enable' if self.on else 'disable'}" @action_serialize("GO_MODE") def x(self): return f'mode "{self.mode.name or "default"}"; exec '+cmd_expand(f"i3-mode-log '{self.mode.name or 'default'}'") @@ -113,6 +116,9 @@ def f(self): def f(self): return g["CONFIRM_CMD"]("i3-msg exit", "Do you really want to EXIT i3?") +@action_serialize("SHOW_STATUSBAR") +def x(self): + return f"bar mode {'dock' if self.on else 'invisible'}" load_main() if have_i3_woman: diff --git a/keymap-python/main.py b/keymap-python/main.py index e1ed520afb00c25623371e38a04b1265396c69ce..caf7868d25325826c6a1091329281be15534ec0f 100644 --- a/keymap-python/main.py +++ b/keymap-python/main.py @@ -11,6 +11,7 @@ g_ph = {} modes_stack = [] all_modes = [] + def set_global(name=None): def l(f): nonlocal name @@ -38,6 +39,15 @@ def set_global_ph(name=None): INF = 1000 set_global("INF")(INF) +set_global("ARGS")(args := {}) +for i in sys.argv[2:]: + if '=' in i: + name, val = i.split('=')[0], '='.join(i.split('=')[1:]) + else: + name, val = i, True + assert name not in args + args[name] = val + @set_global() def which(cmd): import shutil diff --git a/light/init.sh b/light/init.sh index 859f1a5397497d4b9ec0ee416aac7c2b6ef28910..c8456175009ca585ea4a3d71d3c841b79e992075 100755 --- a/light/init.sh +++ b/light/init.sh @@ -4,8 +4,6 @@ cd "$(dirname "$0")" need_root install_begin -cd "$(dirname "$0")" - confln config-default.h config.h c r g++ ./light.c -o /usr/bin/light diff --git a/mail/init-deamon.sh b/mail/init-deamon.sh deleted file mode 100755 index a718501d63e284665f9d8e7c3f8d03d3648cfd61..0000000000000000000000000000000000000000 --- a/mail/init-deamon.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -../init-service.sh offlineimap "" offlineimap-deamon diff --git a/mail/init.sh b/mail/init.sh index c3b849f5c78b4abdfa95dc82d2aa721ecc1b00b1..51bde879093cf3b2d6ee848bce65789d6af255e2 100755 --- a/mail/init.sh +++ b/mail/init.sh @@ -1,5 +1,8 @@ #!/bin/bash +cd "$(dirname "$0")" . ../userconfig-lib.sh +version 1 +install_begin confln notmuch-config ~/.notmuch-config confln mailcap ~/.mailcap @@ -12,7 +15,6 @@ confln neomuttrc ~/.config/neomutt/ confln color ~/.config/neomutt/ c confln m ~/bin/ confln m-daemon ~/bin/ -confln m-daemon ~/bin/ confln m-repeat-notification ~/bin/ confln robot-send-mail ~/bin/ confln unzip-mail.py ~/bin/ E @@ -21,8 +23,6 @@ confln vm-mail.sh ~/bin/vmm r mkdir -p ~/.config/certs r -bc 'ssh jirikalvoda@kam.mff.cuni.cz cat /etc/ssl/certs/ca-certificates.crt > ~/.config/certs/nikam-ssl.cert' -confln robot-send-mail ~/bin/ - if [[ ! -L ~/Maildir ]] then @@ -43,3 +43,7 @@ fi done ) + +init-service offlineimap "" offlineimap-deamon + +install_ok diff --git a/mail/neomuttrc b/mail/neomuttrc index 03fc5904b28abeeef0bf26e35ff88b9255a3778b..7e7ec6519bcce0eb1d3b9da96503dadb0b0fe75d 100755 --- a/mail/neomuttrc +++ b/mail/neomuttrc @@ -119,3 +119,7 @@ alternates ^jirikalvoda@kam\.mff\.cuni\.cz$ \ ^jk@fnuk\.eu$ \ ^jk\+.*@fnuk\.eu$ \ ^jk--.*@fnuk\.eu$ + + + +send2-hook '~f ^.*@kalvodj\\.nswi106\\.cz$' 'set smtp_url = "smtp://127.0.0.1:1465"' diff --git a/myip/configIp b/myip/configIp index 03cbc235582beea60eff24c5b168cdfd5fd729c3..fc0c88d13fc294af2b4ec150abafa0cb3c975f51 100644 --- a/myip/configIp +++ b/myip/configIp @@ -1,3 +1,3 @@ #!/bin/bash -grepCMD="noprefixroute wlp" -awkCMD='{print $2}' +grepCMD="eth0\|wlan0" +awkCMD='{print $3}' diff --git a/myip/myip.sh b/myip/myip.sh index 5a12bb96cc6f6b3ff70d804ab4d78db6e84cb003..ea6878828b009498f6a81d5eb587ecb33837a06a 100755 --- a/myip/myip.sh +++ b/myip/myip.sh @@ -6,4 +6,4 @@ grepCMD="noprefixroute wlp" awkCMD='{print $3}' . configIp -ip -br addres | grep "$grepCMD"| awk "$awkCMD" | cut -d "/" -f 1 | head -n1 +ip -br addres | grep UP | grep "$grepCMD"| awk "$awkCMD" | cut -d "/" -f 1 | head -n1 diff --git a/network/arzen/dhcpcd.conf b/network/arzen/dhcpcd.conf index e3736ebd8ad57e9b032d44185db1af71efee0d8b..6f66c5a2799b47311ed25f8cb866979c18c324b7 100644 --- a/network/arzen/dhcpcd.conf +++ b/network/arzen/dhcpcd.conf @@ -63,4 +63,12 @@ static domain_name=kam.mff.cuni.cz noipv6rs +ssid blatto-jk-5g +static ip_address=10.19.12.20 +static routers=10.19.12.254 +static domain_name_servers=10.19.12.254 +static domain_name=blatto.eu +#static domain_search= +noipv6rs + diff --git a/network/blatto-wg b/network/blatto-wg new file mode 100755 index 0000000000000000000000000000000000000000..ec3cecca646ccc9c3b6dad3af6613a5076a9dd00 --- /dev/null +++ b/network/blatto-wg @@ -0,0 +1,111 @@ +#!/bin/sh +set -euo xtrace -o pipefail + +vlan_name=$1 +id=$2 +default_routing=${3:-blatto} + +eval "$(ssh root@blatto.eu wg-get-metadata $vlan_name)" + + +mkdir -p /etc/wireguard/blatto +cd /etc/wireguard/blatto/ +[ -f psk ] || (umask 0077 && wg genpsk > psk) +[ -f $id.key ] || wg genkey | (umask 0077 && tee $id.key) | wg pubkey > $id.pub + +ssh root@blatto.eu cat /etc/wireguard/$vlan_name/blattes.pub > blattes.pub +cat psk | ssh root@blatto.eu "wg-register $vlan_name $id $(hostname) $(cat $id.pub)" < psk + +#cat $id.pub | ssh root@blatto.eu "cat > /etc/wireguard/$vlan_name/$id.pub" +#cat psk | ssh root@blatto.eu "cat > /etc/wireguard/$vlan_name/$id.psk" + + +mkdir -p /etc/net + +cat <<AMEN > /etc/net/wg-blatto +#!/bin/sh +set -o xtrace + +ip link del wg-blatto || true +ip route flush table 12 +ip -6 route flush table 12 + +ip link add dev wg-blatto type wireguard +ip addr add $v4net.$id/24 dev wg-blatto metric 100 +ip addr add $v6net::$id/64 dev wg-blatto metric 100 +wg set wg-blatto listen-port 12061 private-key /etc/wireguard/blatto/$id.key +wg set wg-blatto peer \$(cat /etc/wireguard/blatto/blattes.pub) preshared-key /etc/wireguard/blatto/psk endpoint $blattes_ipv4:$port allowed-ips 0.0.0.0/0,::0/0 +ip link set mtu 1432 dev wg-blatto +ip link set wg-blatto up + +ip route add throw 10.0.0.0/8 table 12 +ip route add throw 192.168.0.0/16 table 12 +ip route add throw 172.16.0.0/12 table 12 +ip route add $v4net.0/24 dev wg-blatto table 12 +ip rule add not to $blattes_ipv4 ipproto udp dport $port table 12 +ip -6 route add throw fe80::/10 table 12 +ip -6 route add throw fc00::/7 table 12 +ip -6 route add $v6net::/64 dev wg-blatto table 12 +ip -6 rule add table 12 + +/etc/net/wg-blatto-route $default_routing +AMEN + +cat <<AMEN > /etc/net/wg-blatto-route +#!/bin/sh +set -o xtrace + +blatto=del +default=del +adopt_blatto=del +adopt_default=del +adopt=del + +if [[ \$1 == no ]] +then + true +elif [[ \$1 == blatto ]] +then + blatto=add +elif [[ \$1 == all ]] +then + blatto=add + default=add +elif [[ \$1 == adopt_blatto ]] +then + blatto=add + adopt_blatto=add + adopt=add +elif [[ \$1 == adopt_all ]] +then + blatto=add + default=add + adopt_blatto=add + adopt_default=add + adopt=add +else + echo usage: \$0 no/blatto/all/adopt_blatto/adopt_all + exit 1 +fi + + +ip route \$blatto $ipv4_prefix.0.0/16 via $v4net.1 dev wg-blatto table 12 metric 100 +ip route \$blatto ${ipv6_prefix}00::0/56 via $v6net::1 dev wg-blatto table 12 metric 100 +ip route \$default default via $v4net.1 dev wg-blatto table 12 metric 100 +ip route \$default default via $v6net::1 dev wg-blatto table 12 metric 100 + +ip addr \$adopt $adopt_v4net.$id/32 dev wg-blatto metric 1 +ip addr \$adopt $adopt_v6net::$id/128 dev wg-blatto metric 1 +ip route \$adopt_blatto $ipv4_prefix.0.0/16 dev wg-blatto table 12 metric 1 src $adopt_v4net.$id +ip route \$adopt_blatto ${ipv6_prefix}00::0/56 dev wg-blatto table 12 metric 1 src $adopt_v6net::$id +ip route \$adopt_default default dev wg-blatto table 12 metric 1 src $adopt_v4net.$id +ip route \$adopt_default default dev wg-blatto table 12 metric 1 src $adopt_v6net::$id + +if [ \$adopt == add ] +then + ip addr del $v4net.$id/24 dev wg-blatto metric 100 + ip addr add $v4net.$id/24 dev wg-blatto metric 100 +fi +AMEN + +chmod +x /etc/net/wg-blatto{,-route} diff --git a/network/cdwifi-autologin.service b/network/cdwifi-autologin.service new file mode 100644 index 0000000000000000000000000000000000000000..f53795e3dc87ff41ebd9e39d8442f4a57e6424dd --- /dev/null +++ b/network/cdwifi-autologin.service @@ -0,0 +1,8 @@ +[Unit] +Description=Scripts for login to CDWiFi + +[Service] +Type=oneshot +Environment=CDWIFI_IFACE=w +ExecStart=/usr/bin/cdwifi-autologin +WatchdogSec=10 diff --git a/network/dhcpcd-custom@.service b/network/dhcpcd-custom@.service index 443840a511ea36fb71623184f6c93aa48f97fb93..50935247f2aaf3a04b14f3258e2ea22e15d07a28 100644 --- a/network/dhcpcd-custom@.service +++ b/network/dhcpcd-custom@.service @@ -7,6 +7,8 @@ Before=network.target Type=exec PIDFile=/run/dhcpcd/%I.pid ExecStart=/usr/bin/dhcpcd -B %I +Restart=always +RestartSec=2 [Install] WantedBy=multi-user.target diff --git a/network/hopik/dhcpcd.conf b/network/hopik/dhcpcd.conf index 3ff722af1f964e54ec51f7ad5cd42d0396b56722..30d5460f466368525bb51e1de7538d0ad378e86e 100644 --- a/network/hopik/dhcpcd.conf +++ b/network/hopik/dhcpcd.conf @@ -50,12 +50,14 @@ slaac private noipv4ll noarp +nodelay + ssid MS-KAM-GUESTS -# static ip_address=10.10.10.30/24 -# static ip6_address=2001:718:1e03:81a::1e/64 +static ip_address=10.10.10.78/24 +static ip6_address=2001:718:1e03:81a::4e/64 static routers=10.10.10.1 static domain_name_servers=195.113.17.177 static domain_name=kam.mff.cuni.cz @@ -64,3 +66,11 @@ noipv6rs +ssid blatto-jk-5g +static ip_address=10.12.11.22/24 +static ip6_address=2a01:510:d504:751a::22/64 +static routers=10.12.11.1 +static domain_name_servers=10.12.11.1 +static domain_name=jk.blatto.eu +static domain_search=jk.blatto.eu blatto.eu +noipv6rs diff --git a/network/hopik/dhcpcd.enter-hook b/network/hopik/dhcpcd.enter-hook index 40003f8922905ab2a3b4d6a50fb2410a505e05be..11767a42bc495ca1de86e4eebda431c3d38be5b3 100644 --- a/network/hopik/dhcpcd.enter-hook +++ b/network/hopik/dhcpcd.enter-hook @@ -4,6 +4,27 @@ msg_prefix="$interface: dhcpd.enter-hook:" echo $msg_prefix $reason $interface $if_up $ifssid +mtu_wg_blatto(){ + ip link set wg-blatto mtu $1 +} +mtu_limit(){ + if [ "$reason" == CARRIER ] + then + if [[ $3 -le $2 ]] + then + $1 $3 + else + $1 $2 + fi + fi + if [ "$reason" == NOCARRIER ] + then + $1 $2 + fi +} +mtu(){ + mtu_limit mtu_wg_blatto 1432 $(( $1 - 60 )) +} conntrack_hack(){ if [ "$reason" == CARRIER ] then @@ -11,6 +32,30 @@ conntrack_hack(){ (echo R | socat unix:/run/conntrack_hack - ) & fi } +route6(){ + if [ "$reason" == STATIC6 ] + then + echo $msg_prefix add ip route: $@ + ip -6 route add $@ + fi + if [ "$reason" == NOCARRIER ] + then + echo $msg_prefix del ip route: $@ + ip -6 route del $@ + fi +} +route(){ + if [ "$reason" == STATIC ] + then + echo $msg_prefix add ip route: $@ + ip -4 route add $@ + fi + if [ "$reason" == NOCARRIER ] + then + echo $msg_prefix del ip route: $@ + ip -4 route del $@ + fi +} if [[ "$interface" == w ]] then @@ -21,13 +66,14 @@ then if [ "$reason" == STATIC6 ] then echo $msg_prefix set ipv6 default route - ip -6 route add default via 2001:718:1e03:81a::1 + route6 default via 2001:718:1e03:81a::1 dev w metric 3004 fi fi - if [ "$ifssid" == luminiferous-aether-jk-5g ] + if [ "$ifssid" == blatto-jk-5g ] || [ "$ifssid" == blatto-jk-2g ] then conntrack_hack + route6 default via 2a01:510:d504:751a::1 dev w metric 3004 fi if [ "$ifssid" == samet-5G ] @@ -35,4 +81,20 @@ then conntrack_hack fi + if [ "$ifssid" == CDWiFi ] + then + mtu 1340 + if [ "$reason" == BOUND ] + then + CDWIFI_IFACE=$interface cdwifi-autologin + fi + fi + + + if [ "$reason" == CARRIER ] + then + echo $msg_prefix sleep start + sleep 0.5 + echo $msg_prefix sleep end + fi fi diff --git a/network/hopik/scripts/con-blansko b/network/hopik/scripts/con-blansko new file mode 100755 index 0000000000000000000000000000000000000000..a40b8b3865824f447f12a209abac912d6196550e --- /dev/null +++ b/network/hopik/scripts/con-blansko @@ -0,0 +1,11 @@ +#!/bin/sh + +set -ueo pipefail + +interface=orico + +echo R | socat unix:/run/conntrack_hack - +ip link set $interface up +ip addres add 192.168.1.50/24 dev $interface +ip route add default via 192.168.1.1 dev $interface +(echo domain lan; echo nameserver 192.168.1.1 ) | resolvconf -a $interface diff --git a/network/hopik/scripts/con-opler b/network/hopik/scripts/con-opler new file mode 100755 index 0000000000000000000000000000000000000000..806ff4743540a731615fb266ed294d42a31d5e85 --- /dev/null +++ b/network/hopik/scripts/con-opler @@ -0,0 +1,13 @@ +#!/bin/sh + +set -ueo pipefail + +interface=opler + +echo R | socat unix:/run/conntrack_hack - +ip link set $interface up +ip addres add 10.10.10.78/24 dev $interface +ip addres add 2001:718:1e03:81a::4e/64 dev $interface +ip route add default via 10.10.10.1 dev $interface +ip route add default via 2001:718:1e03:81a::1 dev $interface +(echo domain kam.mff.cuni.cz; echo nameserver 10.10.10.1 ) | resolvconf -a $interface diff --git a/network/hopik/scripts/con-sm b/network/hopik/scripts/con-sm index 100eefd7e8bf5c491b430885bab8431e668fb58b..1a5e92d7e6d5a73bcfe357229e1771be0adbdc8f 100755 --- a/network/hopik/scripts/con-sm +++ b/network/hopik/scripts/con-sm @@ -1,12 +1,15 @@ #!/bin/sh - -set -ueo pipefail +set -o xtrace #interface=enp3s0f4u1u1 interface=sm echo R | socat unix:/run/conntrack_hack - ip link set $interface up -ip addres add 10.19.13.24/24 dev $interface -ip route add default via 10.19.13.254 -(echo domain lan; echo nameserver 10.19.13.254 ) | resolvconf -a enp3s0f4u1u1 +ip addres add 10.12.11.22/24 dev $interface +ip addres add 2a01:510:d504:751a::22/64 dev $interface +ip route add 10.12.0.0/16 via 10.12.11.1 dev $interface metric 1000 +ip route add 2a01:510:d504:7500::0/56 via 2a01:510:d504:751a::1 dev wg-blatto metric 1000 +ip route add default via 10.12.11.1 dev $interface metric 1000 +ip route add default via 2a01:510:d504:751a::1 dev $interface metric 1000 +(echo domain jk.blatto.eu; echo nameserver 10.12.11.1 ) | resolvconf -a $interface diff --git a/network/init.sh b/network/init.sh index 6e7a9431eec1267f91bea41ebd33ab0dfe7557e8..781d43007c3f382f6bbd3a35a2461fc5da191567 100755 --- a/network/init.sh +++ b/network/init.sh @@ -1,6 +1,7 @@ #!/bin/bash cd "$(dirname "$0")" . ../userconfig-lib.sh +version 6 need_root install_begin @@ -23,9 +24,14 @@ do done [ -f $h/dhcpcd.conf ] && confln $h/dhcpcd.conf /etc/ cr -[ -f $h/dhcpcd.enter-hook ] && confln $h/dhcpcd.conf /etc/ cr +[ -f $h/dhcpcd.enter-hook ] && confln $h/dhcpcd.enter-hook /etc/ cr r udevadm control --reload-rules r udevadm trigger +git_clupdate https://codeberg.org/regnarg/cdwifi-autologin.git build_git_cdwifi-autologin + +confln build_git_cdwifi-autologin/cdwifi-autologin.sh /usr/bin/ cE +confln cdwifi-autologin.service /lib/systemd/system/ cr + install_ok diff --git a/network/jk-net.rules b/network/jk-net.rules index 2d0fa28e5609a11832540fa14cd0fdf5b3839d9a..621dbdf760c6aa10312f78590110f836bd0a3f97 100644 --- a/network/jk-net.rules +++ b/network/jk-net.rules @@ -1,14 +1,25 @@ # orico usb-c hub SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:42:03:39",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="orico" +# axagon 2.5Gbit +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:4c:68:00:12",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="axagon" + # samsung monitor SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="54:44:a3:2b:41:e2",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="sm" # arzen WiFi -SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="c0:3c:59:ab:9b:8b",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="w" +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="c0:3c:59:ab:9b:8b",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="w" + +# hopik WiFi +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="40:1a:58:9d:75:d8",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="w" +# opler monitor +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b0:4f:13:d2:2d:4b",ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="opler" # samsung-monitor: configuration and wifi on/off ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start net-config@con-sm" ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start set-wifi-and-flush-neigh@off" ACTION=="remove", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start set-wifi-and-flush-neigh@on" + +# opler monitor: configuration +ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enxb04f13d22d4b", RUN+="/usr/bin/systemctl start net-config@con-opler" diff --git a/network/jk-samsung-monitor.rules b/network/jk-samsung-monitor.rules deleted file mode 100644 index a2f74d03e7fb8be8b778725fa2ff2e454c169efc..0000000000000000000000000000000000000000 --- a/network/jk-samsung-monitor.rules +++ /dev/null @@ -1,6 +0,0 @@ -ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", IMPORT="/lib/udev/rename_netiface %k sm" -ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx00e04c420339", IMPORT="/lib/udev/rename_netiface %k orico" - -ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start net-config@con-sm" -ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start set-wifi-and-flush-neigh@off" -ACTION=="remove", SUBSYSTEM=="net", ENV{ID_NET_NAME_MAC}=="enx5444a32b41e2", RUN+="/usr/bin/systemctl start set-wifi-and-flush-neigh@on" diff --git a/rofi/init.sh b/rofi/init.sh index d83fd54a0fa20ba2befdacb12eb37a236f8e7840..05afb02070e3f32d470dc0eea2a1a9795ed566a8 100755 --- a/rofi/init.sh +++ b/rofi/init.sh @@ -1,3 +1,8 @@ #!/bin/bash cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin + confln config.rasi ~/.config/rofi/ + +install_ok diff --git a/snapshoter/init-status.sh b/snapshoter/init-status.sh index 39fb05720daf108006787f635ffde17815954d80..5161e3c76cfd8a24bc01ed0cab27fd49a2606fbb 100755 --- a/snapshoter/init-status.sh +++ b/snapshoter/init-status.sh @@ -1,6 +1,7 @@ #!/bin/bash cd "$(dirname "$0")" . ../userconfig-lib.sh +version 1 install_begin confln status.py /usr/bin/snapshoter-status c diff --git a/snapshoter/init.sh b/snapshoter/init.sh index b39c739882528a63634baf8dd5226db7e572032a..30c7eda01f43973a0272f994d5b6f351238d8757 100755 --- a/snapshoter/init.sh +++ b/snapshoter/init.sh @@ -1,5 +1,9 @@ #!/bin/bash cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin confln snapshoter ~/bin/ confln "snapshoter.devices-$(hostname)" ~/snapshoter.devices + +install_ok diff --git a/snapshoter/snapshoter b/snapshoter/snapshoter index dd9531eefd10eadda960781ee3fe25a06857bb7d..50665ee270c7cbd8bcd34eac1ab8e7db7c11de1c 100755 --- a/snapshoter/snapshoter +++ b/snapshoter/snapshoter @@ -267,7 +267,12 @@ fi log_dir="$(mktemp -d)" mkdir $log_dir/last date -u +%s > $log_dir/last/$(cat $snapdir/name) -rsync "${sshcmd//"'"/}" -r $log_dir/ $from/.snapshoter +if [[ "$sshcmd" == "" ]] +then + rsync -r $log_dir/ $from/.snapshoter +else + rsync "${sshcmd//"'"/}" -r $log_dir/ $from/.snapshoter +fi rm -r $log_dir diff --git a/snapshoter/snapshoter.devices-hopik b/snapshoter/snapshoter.devices-hopik new file mode 100644 index 0000000000000000000000000000000000000000..e2aef7e554b7c7459d835810f2354f2adc91af13 --- /dev/null +++ b/snapshoter/snapshoter.devices-hopik @@ -0,0 +1,13 @@ +#!/bin/bash + +if [[ "$TARGET" == "terapeut" ]] +then + +snapdir="/mnt/terapeut-snapshot" +snapdrive="/dev/mapper/terapeut-snapshot" +case "$device" in + hopik) + from=/ +esac + +fi diff --git a/snapshoter/status.py b/snapshoter/status.py index a9938d4098c0e2706ad7860cb7481bafba6162ea..9f15df6bdaaa1434ca8452c1581f4a8755d44a9a 100755 --- a/snapshoter/status.py +++ b/snapshoter/status.py @@ -38,7 +38,7 @@ def age_to_color(age): def format_age(age): S = age.total_seconds() if S < 3*60: - return "{int(S)} s" + return f"{int(S)} s" M = int((S+30)/60) if M < 3*60: return f"{M} min" diff --git a/ssh/key_places b/ssh/key_places index b97c273466c0a55572c732d39d1b1eea124eb444..0a82e487352bccec1cf9ef2005c8decb45193ede 100644 --- a/ssh/key_places +++ b/ssh/key_places @@ -2,7 +2,7 @@ root@teplo [out of date] root@rpi-nula root@troposphere [out of date] -root@blattovzduch,blattozem,blattobod,blattobrana +root@blattes,git.blatto root@bilbo root,cmsuser@contest.kam.mff.cuni.cz diff --git a/state_push.sh b/state_push.sh index 98df814d1351d40a36b797205a61fe86a808e67b..4d12d61fef7547b55cf5776c44a8df6f27c6f05c 100755 --- a/state_push.sh +++ b/state_push.sh @@ -7,7 +7,7 @@ install_config_load if [[ $ic_push == "" ]] then echo -e "${Red}No push hook for state dir!$None" - exit 1 + exit 0 else cd $USERCONFIG_ROOT/state || err cd faild r -b "tar --create --to-stdout . | $ic_push bin/userconfig_state_server $ic_name" diff --git a/teatimer/init.sh b/teatimer/init.sh index d50b8ee171bbf07048c6117a2ac1fd2a1cc38e86..cd3ddf85bd602f25d402c47f7817e5e2dc52606d 100755 --- a/teatimer/init.sh +++ b/teatimer/init.sh @@ -1,7 +1,11 @@ #!/bin/bash cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin ../git-clupdate git://git.ucw.cz/teatimer.git build_git -(cd build_git ; make) +r -b "cd build_git ; make" confln build_git/teatimer ~/bin/ confln tt ~/bin/ + +install_ok diff --git a/userconfig-lib.sh b/userconfig-lib.sh index 4ef7c85ea9f2e29775577a86b2febe930931d69f..df9246b84cea3a29cfd4d4f35aeaffbcecaa70f0 100644 --- a/userconfig-lib.sh +++ b/userconfig-lib.sh @@ -59,7 +59,9 @@ confln() init-service() { - $USERCONFIG_ROOT/init-service.sh "$@" || err init-service faild + ( + . $USERCONFIG_ROOT/init-service.sh "$@" + ) || err init-service faild } git_clupdate() @@ -215,7 +217,7 @@ install_begin(){ echo -e "${Blue}INSTALLING $install_name$None (version $version)" echo $version > $state_run_dir/version echo installing > $state_run_dir/state - printf "%q " "$0" "$@" > $state_run_dir/args + printf "%s" "$global_args" > $state_run_dir/args date -Iseconds > $state_run_dir/date git rev-parse --verify HEAD > $state_run_dir/commit git diff > $state_run_dir/git_diff @@ -238,6 +240,8 @@ need_state_server(){ true } +global_args="$(printf "%q " "$0" "$@")" + if [[ $1 == -v ]] then version(){ diff --git a/vm/init-waydroid.sh b/vm/init-waydroid.sh new file mode 100755 index 0000000000000000000000000000000000000000..6ce4b1c74e2336fbc051607c8023abde1f77daef --- /dev/null +++ b/vm/init-waydroid.sh @@ -0,0 +1,8 @@ +#!/bin/bash +cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin + +confln waydroid-run.py ~/bin/ E + +install_ok diff --git a/vm/waydroid-run.py b/vm/waydroid-run.py new file mode 100755 index 0000000000000000000000000000000000000000..827ccf7e435754038eb28c86c8d469583b5bd845 --- /dev/null +++ b/vm/waydroid-run.py @@ -0,0 +1,38 @@ +#!/bin/python3 +import os, sys, subprocess +import time, select +import select + +app_name = sys.argv[1] if len(sys.argv) >= 2 else None +session = None + +def init(): + global session + session = subprocess.Popen(["waydroid", "session", "start"], stderr=subprocess.PIPE) + time.sleep(0.1) + p = subprocess.run(["waydroid", "show-full-ui"]) + +def clean(): + subprocess.run(["waydroid", "session", "stop"]) + session.communicate() + +init() +while True: + poll = select.poll() + poll.register(session.stderr.fileno(), select.POLLIN) + poll.register(sys.stdin.fileno(), select.POLLIN) + for fd, event in poll.poll(): + if fd == sys.stdin.fileno(): + inp = input() + print("STDIN", inp) + if inp == "reload": + clean() + init() + if fd == session.stderr.fileno(): + print("SESSION") + l = session.stderr.readline().strip().decode("utf-8") + print(l) + if l.endswith("Android with user 0 is ready"): + if app_name: + p = subprocess.run(["waydroid", "app", "launch", app_name]) + p = subprocess.run(["waydroid", "show-full-ui"]) diff --git a/wacom/init.sh b/wacom/init.sh index beb164ee198be9b89aa24e3585ff620d3427bdb0..89e2edaf453950ad5d83249275cc159a45dbe2fd 100755 --- a/wacom/init.sh +++ b/wacom/init.sh @@ -1,5 +1,9 @@ #!/bin/bash cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin confln wacom-config ~/bin/ -gcc wacom-daemon2.c -o ~/bin/wacom-daemon -lxdo +r gcc wacom-daemon2.c -o ~/bin/wacom-daemon -lxdo + +install_ok diff --git a/xdg-open/better-xdg-open.py b/xdg-open/better-xdg-open.py index 95884a9ce39589b5b9be453e50d5296126bf9114..b36c4430bc3894a1b5a43530dac776a241f1f9a9 100755 --- a/xdg-open/better-xdg-open.py +++ b/xdg-open/better-xdg-open.py @@ -104,11 +104,11 @@ def is_vm(): return m_win._vm.isChecked() def vm_run(cmd, gui=False): cmd = shell_escape_if_list(cmd) - r = subprocess.run(["vm", "extended_name", m_win._vm_name.text()], stdout=subprocess.PIPE, encoding='utf-8') - vm_id, vm_user = r.stdout.strip().split("\n") + r = subprocess.run(["vm", "eval", m_win._vm_name.text()], stdout=subprocess.PIPE, encoding='utf-8') + vm_ident = r.stdout.strip() if is_file_url_or_path(arg): - r = subprocess.run(["vm", "sshfs", vm_id, "--user", vm_user], encoding='utf-8') - r = subprocess.run(["vm", "sshfs_mountdir", vm_id, "--user", vm_user], stdout=subprocess.PIPE, encoding='utf-8') + r = subprocess.run(["vm", "sshfs", vm_ident], encoding='utf-8') + r = subprocess.run(["vm", "internal", "sshfs_mountdir", vm_ident], stdout=subprocess.PIPE, encoding='utf-8') mountdir = r.stdout.strip() path = file_url_to_path(arg) @@ -118,14 +118,14 @@ def vm_run(cmd, gui=False): tmp_dir_name = tmp_dir.split('/')[-1] shutil.copy(file, tmp_dir+"/"+filename) if gui: - p = subprocess.run(["vm", "vncapp", vm_user+'@'+vm_id, "--", f"cd {tmp_dir_name}; {cmd}"]) + p = subprocess.run(["vm", "vncapp", vm_ident, "--", f"cd {tmp_dir_name}; {cmd}"]) else: - p = subprocess.run([*terminal_cmd(), "vm", "ssh", vm_user+'@'+vm_id, "--", "-t", "--", f"cd {tmp_dir_name}; {cmd}"]) + p = subprocess.run([*terminal_cmd(), "vm", "ssh", vm_ident, "--", "-t", "--", f"cd {tmp_dir_name}; {cmd}"]) else: if gui: - p = subprocess.run(["vm", "vncapp", vm_user+'@'+vm_id, "--", cmd]) + p = subprocess.run(["vm", "vncapp", vm_ident, "--", cmd]) else: - p = subprocess.run([*terminal_cmd(), "vm", "ssh", vm_user+'@'+vm_id, "--", "-t", "--", cmd]) + p = subprocess.run([*terminal_cmd(), "vm", "ssh", vm_ident, "--", "-t", "--", cmd]) diff --git a/xdg-open/init_replace_xdg-open.sh b/xdg-open/init_replace_xdg-open.sh index d073df45830cd680f1b863044a8c6ae8fc9d68f8..4b4981aa40094d0b712bfaa6a8766b906e521fda 100755 --- a/xdg-open/init_replace_xdg-open.sh +++ b/xdg-open/init_replace_xdg-open.sh @@ -1,11 +1,11 @@ #!/bin/bash cd "$(dirname "$0")" . ../userconfig-lib.sh +version 1 +need_root install_begin -echo -e "\e[31mROOT REQUIRE\e[0m" - -if not grep "BETTER XDG-OPEN" /usr/bin/xdg-open +if ! grep "BETTER XDG-OPEN" /usr/bin/xdg-open then mv /usr/bin/xdg-open /usr/bin/xdg-open-real fi diff --git a/xdg-open/mimeapps.list b/xdg-open/mimeapps.list index 394c078f51ef88ede9454a05eaede751f0c0a22f..b4700a1e056ec99d29c38d95606336cd936f2e56 100644 --- a/xdg-open/mimeapps.list +++ b/xdg-open/mimeapps.list @@ -3,7 +3,7 @@ text/plain=vim.desktop application/pdf=org.pwmt.zathura.desktop x-scheme-handler/webcal=chromium.desktop x-scheme-handler/tg=userapp-Telegram Desktop-XEEW60.desktop -x-scheme-handler/etcher=balena-etcher-electron.desktop +x-scheme-handler/etcher=balena-etcher.desktop x-scheme-handler/mailto=xfce4-mail-reader.desktop text/html=chromium.desktop x-scheme-handler/http=chromium.desktop diff --git a/xournalpp/init.sh b/xournalpp/init.sh index e1d0c1b0a6228a32fcf4f794fe50e1338584496b..a3fdffd80f52d4784ce9ebca6329eb4ff6c996c0 100755 --- a/xournalpp/init.sh +++ b/xournalpp/init.sh @@ -1,6 +1,9 @@ #!/bin/bash -. ../userconfig-lib .. - +cd "$(dirname "$0")" +. ../userconfig-lib.sh +install_begin confln x ~/bin/ +confln plugins/jk ~/.config/xournalpp/plugins/ +install_ok diff --git a/xournalpp/plugins/init.sh b/xournalpp/plugins/init.sh deleted file mode 100755 index 75594e4d3a941877dd0c7947cc023d33d1a5ff03..0000000000000000000000000000000000000000 --- a/xournalpp/plugins/init.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -. ../../userconfig-lib ../.. - - -#confln jk ~/.config/xournalpp/plugins/ -confln jk /usr/share/xournalpp/plugins/ -