diff options
Diffstat (limited to 'home-manager/soispha/config')
107 files changed, 6402 insertions, 0 deletions
diff --git a/home-manager/soispha/config/alacritty/alacritty.yml b/home-manager/soispha/config/alacritty/alacritty.yml new file mode 100644 index 00000000..ad6e417e --- /dev/null +++ b/home-manager/soispha/config/alacritty/alacritty.yml @@ -0,0 +1,1003 @@ +--- +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# 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: alacritty + +window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + dimensions: + columns: 0 + lines: 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: 5 + y: 5 + + # 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 and no title bar buttons + decorations: none + + # 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. + opacity: 0.9 + + # 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: Alacritty + + # Allow terminal applications to change Alacritty's window title. + dynamic_title: true + + # Window class (Linux/BSD only): + class: + # Application instance name + instance: Alacritty + # General application class + general: Alacritty + + # Decorations theme variant + # + # Override the variant of the System theme/GTK theme/Wayland client side + # decorations. Commonly supported values are `Dark`, `Light`, and `None` for + # auto pick-up. Set this to `None` to use the default theme variant. + decorations_theme_variant: None + + # Resize increments + # + # Prefer resizing window by discrete steps equal to cell dimensions. + #resize_increments: false + + # Make `Option` key behave as `Alt` (macOS only): + # - OnlyLeft + # - OnlyRight + # - Both + # - None (default) + #option_as_alt: None + +scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + history: 10000 + + # Scrolling distance multiplier. + multiplier: 3 + +# Font configuration +font: + # Normal (roman) font face + normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + # family: Source Code Pro + #family: SauceCodePro Nerd Font # This is needed because of reserved font names + family: SauceCodePro Nerd Font Mono + + # 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: Source Code Pro + + # 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: Source Code Pro + + # The `style` can be specified to pick a specific face. + #style: Italic + + # Bold italic font face + #bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: Source Code Pro + + # The `style` can be specified to pick a specific face. + #style: Bold Italic + + # Point size + size: 12.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: -1 + y: -1 + + # 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 upward. + glyph_offset: + x: -1 + y: -1 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + builtin_box_drawing: true # TODO + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: true # TODO + +# Colors (Tomorrow Night) +colors: + # Default colors + primary: + background: '#191919' + foreground: '#d8dee9' + + # 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: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + cursor: + text: '#191919' + cursor: '#d8dee9' + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + vi_mode_cursor: + text: CellBackground + cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + matches: + foreground: '#000000' + background: '#ffffff' + focused_match: + foreground: '#ffffff' + background: '#000000' + + # Keyboard hints + hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + start: + foreground: '#1d1f21' + background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + end: + foreground: '#e9ff5e' + background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + footer_bar: + background: '#c5c8c6' + foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + selection: + text: '#191919' + background: '#d8dee9' + + # Normal colors + normal: + black: '#191919' + red: '#b02626' + green: '#40a62f' + yellow: '#f2e635' + blue: '#314ad0' + magenta: '#b30ad0' + cyan: '#32d0fc' + white: '#acadb1' + + # Bright colors + bright: + black: '#36393d' + red: '#ce2727' + green: '#47c930' + yellow: '#fff138' + blue: '#2e4bea' + magenta: '#cc15ed' + cyan: '#54d9ff' + white: '#dbdbdb' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + dim: + black: '#676f78' + red: '#b55454' + green: '#78a670' + yellow: '#faf380' + blue: '#707fd0' + magenta: '#c583d0' + cyan: '#8adaf1' + white: '#e0e3e7' + # 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: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false # TODO + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + save_to_clipboard: false + +cursor: + # Cursor style + style: + # Cursor shape + # + # Values for `shape`: + # - ▇ Block + # - _ Underline + # - | Beam + shape: Beam + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + blinking: On + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + vi_mode_style: None + + # Cursor blinking interval in milliseconds. + blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + thickness: 0.15 + +# 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: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (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 + +# Offer IPC using `alacritty msg` (unix only) +ipc_socket: true + +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 +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +hints: + # Keys used for the hint labels. + alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + enabled: + - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + hyperlinks: true + command: xdg-open + post_processing: true + mouse: + enabled: true + mods: None + binding: + key: U + mods: Control|Shift + + - regex: "([^ '\"`=:\\[\\(]*/)([^/: '\"`\\)\\]]*)" + action: Paste + post_procesing: false + binding: + key: T + mods: Control|Shift + + - regex: "([a-z0-9]{7})\\s" + action: Paste + post_procesing: false + binding: + key: H + mods: Control|Shift + + # multi regex for different purposes: + # 2. UUIDs + # 3. hex (for example signatures) + # 4. IP addresses +# - regex: "([[:alnum:]_$%&+=/@-]+)\ +#|([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\ +#|([0-9a-f]{12,128})\ +#|([[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3})" +# action: Copy +# post_processing: false +# binding: +# key: U +# mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } + - { mouse: Middle, action: Copy } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/winit/*/winit/event/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`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# 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. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - ToggleMaximized +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# 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 `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +key_bindings: +# +# + - { key: P, mods: Control, action: Paste } + - { key: Insert, mods: Shift, action: Paste } + - { key: Slash, mods: Control, chars: "gc" } + - { key: Y, mods: Control, action: Copy } + - { key: Key0, mods: Control, action: ResetFontSize } + - { key: Equals, mods: Control, action: IncreaseFontSize } + - { key: Plus, mods: Control, action: IncreaseFontSize } + - { key: Minus, mods: Control, action: DecreaseFontSize } + + # Vi Mode + - { key: Space, mods: Control, action: ToggleViMode } + - { key: Space, mods: Control, mode: Vi, action: ScrollToBottom } + - { key: I, mode: Vi, action: ScrollToBottom } + - { key: I, mode: Vi, action: ToggleViMode } + - { key: C, mods: Control, mode: Vi, action: ScrollToBottom } + - { key: C, mods: Control, mode: Vi, action: ToggleViMode } + - { key: Escape, mode: Vi, action: ClearSelection } + - { key: Y, mods: Control, mode: Vi, action: ScrollLineUp } + - { key: E, mods: Control, mode: Vi, action: ScrollLineDown } + - { key: G, mode: Vi, action: ScrollToTop } + - { key: G, mods: Shift, mode: Vi, action: ScrollToBottom } + - { key: B, mods: Control, mode: Vi, action: ScrollPageUp } + - { key: F, mods: Control, mode: Vi, action: ScrollPageDown } + - { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp } + - { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown } + - { key: Y, mode: Vi, action: Copy } + - { key: Y, mode: Vi, action: ClearSelection } + - { key: V, mode: Vi, action: ToggleNormalSelection } + - { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection } + - { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection } + - { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection } + - { key: Return, mode: Vi, action: Open } + - { key: K, mode: Vi, action: Up } + - { key: J, mode: Vi, action: Down } + - { key: H, mode: Vi, action: Left } + - { key: L, mode: Vi, action: Right } + - { key: Up, mode: Vi, action: Up } + - { key: Down, mode: Vi, action: Down } + - { key: Left, mode: Vi, action: Left } + - { key: Right, mode: Vi, action: Right } + - { key: Key0, mode: Vi, action: First } + - { key: Key4, mode: Vi, action: Last } + - { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied } + - { key: H, mods: Shift, mode: Vi, action: High } + - { key: M, mods: Shift, mode: Vi, action: Middle } + - { key: L, mods: Shift, mode: Vi, action: Low } + - { key: B, mode: Vi, action: SemanticLeft } + - { key: W, mode: Vi, action: SemanticRight } + - { key: E, mode: Vi, action: SemanticRightEnd } + - { key: B, mods: Shift, mode: Vi, action: WordLeft } + - { key: W, mods: Shift, mode: Vi, action: WordRight } + - { key: E, mods: Shift, mode: Vi, action: WordRightEnd } + - { key: Key5, mods: Shift, mode: Vi, action: Bracket } + - { key: Slash, mode: Vi, action: SearchForward } + - { key: Slash, mods: Shift, mode: Vi, action: SearchBackward } + - { key: N, mode: Vi, action: SearchNext } + - { key: N, mods: Shift, mode: Vi, action: SearchPrevious } +# +# +# + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: CreateNewWindow } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#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`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Renderer override. + # - glsl3 + # - gles2 + # - gles2_pure + #renderer: None + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false diff --git a/home-manager/soispha/config/alacritty/default.nix b/home-manager/soispha/config/alacritty/default.nix new file mode 100644 index 00000000..4e98f502 --- /dev/null +++ b/home-manager/soispha/config/alacritty/default.nix @@ -0,0 +1,6 @@ +{config, ...}: { + programs.alacritty = { + enable = true; + }; + xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml; +} diff --git a/home-manager/soispha/config/btop/default.nix b/home-manager/soispha/config/btop/default.nix new file mode 100644 index 00000000..06b56ea7 --- /dev/null +++ b/home-manager/soispha/config/btop/default.nix @@ -0,0 +1,5 @@ +{config, ...}: { + programs.btop = { + enable = true; + }; +} diff --git a/home-manager/soispha/config/dconf/default.nix b/home-manager/soispha/config/dconf/default.nix new file mode 100644 index 00000000..dc439e1e --- /dev/null +++ b/home-manager/soispha/config/dconf/default.nix @@ -0,0 +1,9 @@ +{...}: { + # Also see: https://github.com/gvolpe/dconf2nix + dconf.settings = { + "org/gnome/desktop/wm/preferences" = { + # hide gtk buttons in titelbar + button-layout = ""; + }; + }; +} diff --git a/home-manager/soispha/config/default.nix b/home-manager/soispha/config/default.nix new file mode 100644 index 00000000..4dfb0f9b --- /dev/null +++ b/home-manager/soispha/config/default.nix @@ -0,0 +1,36 @@ +{...}: { + imports = [ + ./alacritty + ./btop + ./dconf + ./direnv + ./firefox + ./gammastep + ./git + ./gpg + ./grades + ./gtk + ./himalaya + ./keepassxc + ./latexindent + ./less + ./lf + ./mail + ./mako + ./mbsync + ./mpd + ./mpv + ./mumble + ./neomutt + ./neovim + ./nheko + ./npm + ./python + ./rclone + ./ssh + ./swayidle + ./swaylock + ./yambar + ./zsh + ]; +} diff --git a/home-manager/soispha/config/direnv/default.nix b/home-manager/soispha/config/direnv/default.nix new file mode 100644 index 00000000..3a7b8add --- /dev/null +++ b/home-manager/soispha/config/direnv/default.nix @@ -0,0 +1,6 @@ +{...}: { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/home-manager/soispha/config/firefox/config/bookmarks/default.nix b/home-manager/soispha/config/firefox/config/bookmarks/default.nix new file mode 100644 index 00000000..4de83ac9 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/bookmarks/default.nix @@ -0,0 +1,26 @@ +[ + { + name = "Feed - Piped"; + url = "https://piped.video/feed"; + } + + { + name = "DeepL Translate"; + url = "https://www.deepl.com/translator"; + } + + { + name = "HM Options"; + url = "https://mipmip.github.io/home-manager-option-search/"; + } + + { + name = "Nix lib"; + url = "https://teu5us.github.io/nix-lib.html"; + } + + { + name = "Nixpkgs manual"; + url = "https://ryantm.github.io/nixpkgs/"; + } +] diff --git a/home-manager/soispha/config/firefox/config/chrome/userChrome.css b/home-manager/soispha/config/firefox/config/chrome/userChrome.css new file mode 100644 index 00000000..0b3aff77 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/chrome/userChrome.css @@ -0,0 +1,41 @@ +/* thickness of tab when you have too many open tabs */ +.tabbrowser-tab:not([pinned="true"]) { + min-width: 10px !important; + min-height: 10px !important; +} + +/* tab height +#TabsToolbar .tabbrowser-tabs { +min-height: 10px !important; +} +*/ + +/* +.tabbrowser-tab {min-width: 016px !important;} +.tabbrowser-tab {clip-width: 016px !important;} +*/ + +/* the + button that opens new tabs */ +#TabsToolbar .tabs-newtab-button { + margin-left: 10px !important; + height: Auto !important; +} + +#main-window[privatebrowsingmode="temporary"] #navigator-toolbox { + background-color: #c40944 !important; +} + +/* close button inside a tab */ +.tab-close-button * { + width: 10px !important; + height: 10px !important; +} + +/* bookmark toolbar */ +#personal-bookmarks .bookmark-item > .toolbarbutton-text { + font-size: 10pt !important; +} +#personal-bookmarks .bookmark-item > .toolbarbutton-icon { + height: 12px !important; + width: 12px !important; +} diff --git a/home-manager/soispha/config/firefox/config/extensions/extensions.json b/home-manager/soispha/config/firefox/config/extensions/extensions.json new file mode 100644 index 00000000..735ef932 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/extensions/extensions.json @@ -0,0 +1,51 @@ +{ + "darkreader": { + "addonId": "addon@darkreader.org", + "pname": "darkreader", + "sha256": "sha256:c09ed43a96dccab1de3445aac263de0569e3333da330d645094e3f938f13b30e", + "url": "https://addons.mozilla.org/firefox/downloads/file/4128489/darkreader-4.9.64.xpi", + "version": "4.9.64" + }, + "keepassxc-browser": { + "addonId": "keepassxc-browser@keepassxc.org", + "pname": "keepassxc-browser", + "sha256": "sha256:deb1c3c29fabe90dd811536d434d64c200caab9a9f7febc3428aa170eefec5f2", + "url": "https://addons.mozilla.org/firefox/downloads/file/4134768/keepassxc_browser-1.8.7.xpi", + "version": "1.8.7" + }, + "libredirect": { + "addonId": "7esoorv3@alefvanoon.anonaddy.me", + "pname": "libredirect", + "sha256": "sha256:564e56e1ccccf2f445b6cb9485c602609589a23052d2a53ab491cbce51c6b42f", + "url": "https://addons.mozilla.org/firefox/downloads/file/4144580/libredirect-2.7.1.xpi", + "version": "2.7.1" + }, + "simple-tab-groups": { + "addonId": "simple-tab-groups@drive4ik", + "pname": "simple-tab-groups", + "sha256": "sha256:b56f30cea753a9c4d1c0e078c0e5e635f1885ea7e40305cee59b9e145fad0a6c", + "url": "https://addons.mozilla.org/firefox/downloads/file/4103800/simple_tab_groups-5.2.xpi", + "version": "5.2" + }, + "tridactyl-vim": { + "addonId": "tridactyl.vim@cmcaine.co.uk", + "pname": "tridactyl-vim", + "sha256": "sha256:08b7af97bef05300ab3ac3ad721322ff00505631233482568fc4489c16d51b71", + "url": "https://addons.mozilla.org/firefox/downloads/file/4036604/tridactyl_vim-1.23.0.xpi", + "version": "1.23.0" + }, + "ublock-origin": { + "addonId": "uBlock0@raymondhill.net", + "pname": "ublock-origin", + "sha256": "sha256:8b73468bc233a11dd2895219466381783d19123857dd0b6fd16a01820fca4834", + "url": "https://addons.mozilla.org/firefox/downloads/file/4141256/ublock_origin-1.51.0.xpi", + "version": "1.51.0" + }, + "video-pauser": { + "addonId": "video-pauser@addons.vhack.eu", + "pname": "video-pauser", + "sha256": "sha256:da02e29f1d50d3a6db8a28bb7972afaeaa788bb8d38a2e9ebbfcd73d65d84841", + "url": "https://addons.mozilla.org/firefox/downloads/file/4098103/video_pauser-0.1.0.xpi", + "version": "0.1.0" + } +} diff --git a/home-manager/soispha/config/firefox/config/prefs/default.nix b/home-manager/soispha/config/firefox/config/prefs/default.nix new file mode 100644 index 00000000..e0e72cf9 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/prefs/default.nix @@ -0,0 +1,23 @@ +{ + pkgs, + config, + user_js, + lib, + ... +}: let + bookmarks = import ../bookmarks; + firefoxBookmarksFile = (import ../../functions/bookmarks) {inherit lib pkgs;}; + user_js_override = pkgs.writeText "user.override.js" (builtins.readFile ./override.js); +in + pkgs.runCommand "user.js" {} '' + mkdir $out; + cat "${user_js}/user.js" > $out/user.js; + cat "${user_js_override}" >> $out/user.js; + + cat << EOF >> $out/user.js; + // My bookmarks + user_pref("browser.bookmarks.file", "${toString (firefoxBookmarksFile bookmarks)}"); + user_pref("browser.startup.homepage", "file:///home/dt/home.html"); // 0103 // TODO add this from a flake + user_pref("browser.download.dir", "${config.home.homeDirectory}/media/downloads"); + EOF + '' diff --git a/home-manager/soispha/config/firefox/config/prefs/override.js b/home-manager/soispha/config/firefox/config/prefs/override.js new file mode 100644 index 00000000..7e63e532 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/prefs/override.js @@ -0,0 +1,191 @@ +/* + 0100: STARTUP + 0200: GEOLOCATION / LANGUAGE / LOCALE + 0300: QUIETER FOX + 0400: SAFE BROWSING + 0600: BLOCK IMPLICIT OUTBOUND + 0700: DNS / DoH / PROXY / SOCKS / IPv6 + 0800: LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS + 0900: PASSWORDS + 1000: DISK AVOIDANCE + 1200: HTTPS (SSL/TLS / OCSP / CERTS / HPKP) + 1400: FONTS + 1600: HEADERS / REFERERS + 1700: CONTAINERS + 2000: PLUGINS / MEDIA / WEBRTC + 2400: DOM (DOCUMENT OBJECT MODEL) + 2600: MISCELLANEOUS + 2700: ETP (ENHANCED TRACKING PROTECTION) + 2800: SHUTDOWN & SANITIZING + 4500: RFP (RESIST FINGERPRINTING) + 5000: OPTIONAL OPSEC + 5500: OPTIONAL HARDENING + 6000: DON'T TOUCH + 7000: DON'T BOTHER + 8000: DON'T BOTHER: FINGERPRINTING + 9000: NON-PROJECT RELATED + 9999: DEPRECATED / REMOVED / LEGACY / RENAMED +*/ + + +// restore session +user_pref("browser.startup.page", 3); // 0102 + +user_pref("browser.newtabpage.enabled", true); // 0104 + +// disable the geoservice, TODO don't know if I want this +//user_pref("geo.provider.use_geoclue", false); // 0202 + +// TODO is this something useful? +user_pref("datareporting.policy.dataSubmissionEnabled", true); // 0330 + +// enable health reports +user_pref("datareporting.healthreport.uploadEnabled", true); // 0331 + +// Do I want to opt-out? +user_pref("toolkit.telemetry.coverage.opt-out", false); // 0333 + +// enables studies +user_pref("app.shield.optoutstudies.enabled", true); // 0340 + +// I guess that browsing protection is useful +user_pref("browser.safebrowsing.downloads.remote.enabled", true); // 0403 + +// TODO does this (-> set to false) make things slower? +user_pref("network.prefetch-next", true); // 0601 + +// enable ipv6 because the rest of the system uses it +user_pref("network.dns.disableIPv6", false); // 0701 + +// TRR only +user_pref("network.trr.mode", 3); // 0710 + +// I trust my search engine +user_pref("keyword.enabled", true); // 801 +user_pref("browser.search.suggest.enabled", true); // 0804 +user_pref("browser.urlbar.suggest.searches", true); // 0804 +// TODO no idea what this does, enabling it +user_pref("browser.urlbar.showSearchTerms.enabled", true); // 9004 + +// prefetch urls, if the get auto completed +user_pref("browser.urlbar.speculativeConnect.enabled", true); // 0805 + +// Disable autoScrolling (clicking with the mouse wheel) +user_pref("general.autoScroll", false); + +// add new tabs after the current one +user_pref("browser.tabs.insertAfterCurrent", true); + +// TODO I might want to enable this +//user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); // 0807 + +// TODO enable form and search history? +//user_pref("browser.formfill.enable", false); // 0810 + +// disk cache should help performance +user_pref("browser.cache.disk.enable", true); // 1001 + +// store extra session data (form content, cookies and POST data) 0: everywhere +user_pref("browser.sessionstore.privacy_level", 0); // 1003 + +// Disable unsafe passive content (images) on https sites +user_pref("security.mixed_content.block_display_content", true); // 1241 + +// Disable the eme banner +user_pref("browser.eme.ui.enabled", false); // 2022 + +// Don't delete my precious temp files +user_pref("browser.helperApps.deleteTempFileOnExit", false); // 2603 + +// Download to the download dir +user_pref("browser.download.useDownloadDir", true); // 2651 + +// Open the download panel +user_pref("browser.download.alwaysOpenPanel", true); // 2652 + +// Block after custom ruleset +user_pref("browser.contentblocking.category", "custom"); // 2701 + +// set the custom settings // 7016 +user_pref("network.cookie.cookieBehavior", 1); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault.top_navigation", true); +user_pref("privacy.partition.network_state.ocsp_cache", true); +user_pref("privacy.query_stripping.enabled", true); +user_pref("privacy.trackingprotection.enabled", true); +user_pref("privacy.trackingprotection.socialtracking.enabled", true); +user_pref("privacy.trackingprotection.cryptomining.enabled", true); +user_pref("privacy.trackingprotection.fingerprinting.enabled", true); + + +// I might want to change that, when it hinders session restore +//user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false); // 2720 + +// I like my history very much! +user_pref("privacy.sanitize.sanitizeOnShutdown", false); // 2810 + +// The downsides (light theme + potential breakages): +//user_pref("privacy.resistFingerprinting", true); // 4501 +user_pref("privacy.resistFingerprinting.letterboxing", false); // 4504 + +// I would like to keep my gl, even in the web +user_pref("webgl.disabled", false); // 4520 + +// I like my service workers and am using a service using them. +user_pref("dom.serviceWorkers.enabled", true); // 7017 + +// I've got a password manager already +user_pref("signon.rememberSignons", false); // 5003 + +// Do not track header +user_pref("privacy.donottrackheader.enabled", true); // 7015 + +// Allow my custom css +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + +// might improve performance TODO +user_pref("gfx.webrender.all", true); + +// disable updates (pretty pointless with nix) +user_pref("extensions.update.autoUpdateDefault", false); +user_pref("extensions.update.enabled", false); +user_pref("app.update.channel", "default"); + +user_pref("browser.ctrlTab.recentlyUsedOrder", false); + +user_pref("browser.download.useDownloadDir", true); +user_pref("browser.download.folderList", 2); # TODO +user_pref("browser.download.viewableInternally.typeWasRegistered.svg", true); +user_pref("browser.download.viewableInternally.typeWasRegistered.webp", true); +user_pref("browser.download.viewableInternally.typeWasRegistered.xml", true); + +// TODO what does this do? +user_pref("browser.search.widget.inNavBar", true); + +user_pref("browser.shell.checkDefaultBrowser", false); +user_pref("browser.tabs.loadInBackground", true); +user_pref("browser.urlbar.placeholderName", "Brave"); + +// Set the tabs and bookmarks +user_pref("browser.tabs.inTitlebar", 1); +user_pref("browser.toolbars.bookmarks.visibility", "always"); +user_pref("browser.places.importBookmarksHTML", true); + +// Theme +user_pref("extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); +user_pref("extensions.extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); + +// highlight all entries when searching +user_pref("findbar.highlightAll", true); + +// TODO +//user_pref("extensions.webcompat.enable_picture_in_picture_overrides", true); +//user_pref("extensions.webcompat.enable_shims", true); +//user_pref("extensions.webcompat.perform_injections", true); +//user_pref("extensions.webcompat.perform_ua_overrides", true); + +// onlykey / copied from a yubikey config +//user_pref("security.webauth.u2f", true); +//user_pref("security.webauth.webauthn", true); +//user_pref("security.webauth.webauthn_enable_softtoken", true); +//user_pref("security.webauth.webauthn_enable_usbtoken", true); diff --git a/home-manager/soispha/config/firefox/config/search/engines/default.nix b/home-manager/soispha/config/firefox/config/search/engines/default.nix new file mode 100644 index 00000000..286d7247 --- /dev/null +++ b/home-manager/soispha/config/firefox/config/search/engines/default.nix @@ -0,0 +1,59 @@ +{pkgs, ...}: { + "Brave Search" = { + urls = [{template = "https://search.brave.com/search?q={searchTerms}";}]; + IconUpdateURL = "https://raw.githubusercontent.com/brave/brave-core/master/components/brave_welcome_ui/components/images/lion_logo.svg"; + updateInterval = 24; # every day + definedAliases = ["@bs"]; + }; + + # NIX + "Nix Packages" = { + urls = [{template = "https://search.nixos.org/packages?type=packages&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + "Nix Options" = { + urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@no"]; + }; + "NixOS Wiki" = { + urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@nw"]; + }; + + "Arch Wiki" = { + urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; + iconUpdateURL = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Archlinux-icon-crystal-64.svg"; + updateInterval = 24; + definedAliases = ["@aw"]; + }; + + # RUST + "Rust std" = { + urls = [{template = "https://doc.rust-lang.org/std/?search={searchTerms}";}]; + iconUpdateURL = "https://rustacean.net/assets/rustacean-orig-noshadow.svg"; + updateInterval = 24; + definedAliases = ["@rs"]; + }; + + "Google Scholar" = { + urls = [{template = "https://scholar.google.com/scholar?hl=en&q={searchTerms}";}]; + iconUpdateURL = "https://scholar.google.com/favicon.ico"; + updateInterval = 24; + definedAliases = ["@gs"]; + }; + "Wikipedia" = { + urls = [{template = "https://en.wikipedia.org/wiki/{searchTerms}";}]; + iconUpdateURL = "https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg"; + updateInterval = 24; + definedAliases = ["@wp"]; + }; + + "Wikipedia (en)".metaData.hidden = true; + "DuckDuckGo".metaData.hidden = true; + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "Amazon.de".metaData.hidden = true; +} diff --git a/home-manager/soispha/config/firefox/default.nix b/home-manager/soispha/config/firefox/default.nix new file mode 100644 index 00000000..3c792045 --- /dev/null +++ b/home-manager/soispha/config/firefox/default.nix @@ -0,0 +1,65 @@ +{ + config, + pkgs, + lib, + user_js, + video_pause, + ... +}: let + userChrome = builtins.readFile ./config/chrome/userChrome.css; + + user_js_nix = (import ./config/prefs) {inherit pkgs lib config user_js;}; + + extensions = builtins.map buildFirefoxXpiAddon ( + lib.attrValues ( + lib.importJSON ./config/extensions/extensions.json + ) + ); + engines = (import ./config/search/engines) {inherit pkgs;}; + + # source: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/default.nix + buildFirefoxXpiAddon = (import ./functions/extensions) {inherit pkgs;}; + + video-pauser = (import ./functions/extensions/video-pauser.nix) {inherit pkgs video_pause;}; +in { + home.sessionVariables = { + # improve touch input & make scrolling smother + MOZ_USE_XINPUT2 = "1"; + # improve wayland support + MOZ_ENABLE_WAYLAND = 1; + }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop"]; + "x-scheme-handler/unknown" = ["firefox.desktop"]; + }; + }; + programs.firefox = { + enable = true; + package = pkgs.firefox-wayland.override { + extraNativeMessagingHosts = [video-pauser]; + }; + profiles."default" = { + inherit extensions; + isDefault = true; + id = 0; + name = "default"; + + inherit userChrome; + + search = { + default = "Brave Search"; + force = true; + + inherit engines; + }; + + bookmarks = []; + extraConfig = builtins.readFile "${user_js_nix}/user.js"; + }; + }; +} diff --git a/home-manager/soispha/config/firefox/functions/bookmarks/default.nix b/home-manager/soispha/config/firefox/functions/bookmarks/default.nix new file mode 100644 index 00000000..d1d89dd2 --- /dev/null +++ b/home-manager/soispha/config/firefox/functions/bookmarks/default.nix @@ -0,0 +1,49 @@ +{ + lib, + pkgs, +}: bookmarks: let + indent = level: + lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); + + bookmarkToHTML = indentLevel: bookmark: '' + ${indent indentLevel}<DT><A HREF="${ + lib.escapeXML bookmark.url + }" ADD_DATE="0" LAST_MODIFIED="0">${lib.escapeXML bookmark.name}</A>''; + + directoryToHTML = indentLevel: directory: '' + ${indent indentLevel}<DT>${ + if directory.toolbar + then ''<H3 PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar'' + else "<H3>${lib.escapeXML directory.name}" + }</H3> + ${indent indentLevel}<DL><p> + ${allItemsToHTML (indentLevel + 1) directory.bookmarks} + ${indent indentLevel}</p></DL>''; + + itemToHTMLOrRecurse = indentLevel: item: + if item ? "url" + then bookmarkToHTML indentLevel item + else directoryToHTML indentLevel item; + + allItemsToHTML = indentLevel: bookmarks: + lib.concatStringsSep "\n" + (map (itemToHTMLOrRecurse indentLevel) bookmarks); + + bookmarkEntries = allItemsToHTML 1 bookmarks; +in + pkgs.writeText "firefox-bookmarks.html" '' + <!DOCTYPE NETSCAPE-Bookmark-file-1> + <!-- This is an automatically generated file. + It will be read and overwritten. + DO NOT EDIT! --> + <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> + <TITLE>Bookmarks</TITLE> + <H1>Bookmarks Menu</H1> + + <DL><p> + <DT><H3 ADD_DATE="0" LAST_MODIFIED="0" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Toolbar</H3> + <DL><p> + ${bookmarkEntries} + </DL><p> + </p></DL> + '' diff --git a/home-manager/soispha/config/firefox/functions/extensions/default.nix b/home-manager/soispha/config/firefox/functions/extensions/default.nix new file mode 100644 index 00000000..b84461c7 --- /dev/null +++ b/home-manager/soispha/config/firefox/functions/extensions/default.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: { + pname, + version, + addonId, + url, + sha256, + #meta, + ... +}: +pkgs.stdenv.mkDerivation { + name = "${pname}-${version}"; + + #inherit meta; + + src = builtins.fetchurl {inherit url sha256;}; + + preferLocalBuild = true; + allowSubstitutes = true; + + buildCommand = '' + dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" + mkdir -p "$dst" + install -v -m644 "$src" "$dst/${addonId}.xpi" + ''; +} diff --git a/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix b/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix new file mode 100644 index 00000000..c4c5238f --- /dev/null +++ b/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix @@ -0,0 +1,30 @@ +{ + pkgs, + video_pause, + ... +}: +pkgs.runCommand "video_pause_native_messaging" {} '' + install -d $out/share/ + cat << EOF > $out/share/video_pauser.json + { + "name": "video_pauser", + "description": "Pause your Videos with a single key stroke!", + "path": "${video_pause}/bin/video_pause", + "type": "stdio", + "allowed_extensions": ["video-pauser@addons.vhack.eu"] + } + EOF + + nativeMessagingPaths=( + /lib/mozilla/native-messaging-hosts + /etc/opt/chrome/native-messaging-hosts + /etc/chromium/native-messaging-hosts + /etc/vivaldi/native-messaging-hosts + /lib/librewolf/native-messaging-hosts + ) + + for manifestDir in "''${nativeMessagingPaths[@]}"; do + install -d $out$manifestDir + ln -s $out/share/video_pauser.json $out$manifestDir/ + done +'' diff --git a/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py b/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py new file mode 100755 index 00000000..311fd214 --- /dev/null +++ b/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# source: https://unix.stackexchange.com/a/497861 +# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information. +# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4. +# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17). + +import lz4.block # pip install lz4 --user + + +def mozlz4_to_text(filepath): + # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, + # return the uncompressed text. + bytestream = open(filepath, "rb") + bytestream.read(8) # skip past the b"mozLz40\0" header + valid_bytes = bytestream.read() + text = lz4.block.decompress(valid_bytes) + return text + + +def main(args): + # Given command-line arguments of an input filepath for a ".mozlz4" file + # and optionally an output filepath, write the decompressed text to the + # output filepath. + # Default output filepath is the input filepath minus the last three characters + # (e.g. "foo.jsonlz4" becomes "foo.json") + filepath_in = args[0] + if len(args) < 2: + filepath_out = filepath_in[:-3] + else: + filepath_out = args[1] + text = mozlz4_to_text(filepath_in) + with open(filepath_out, "wb") as outfile: + outfile.write(text) + print("Wrote decompressed text to {}".format(filepath_out)) + + +if __name__ == "__main__": + import sys + args = sys.argv[1:] + if args and not args[0] in ("--help", "-h"): + main(args) + else: + print("Usage: mozlz4.py <mozlz4 file to read> <location to write>") diff --git a/home-manager/soispha/config/firefox/scripts/update_extensions b/home-manager/soispha/config/firefox/scripts/update_extensions new file mode 100755 index 00000000..05f47aad --- /dev/null +++ b/home-manager/soispha/config/firefox/scripts/update_extensions @@ -0,0 +1,22 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +#. ~/.local/lib/shell/lib + +tmp=$(mktemp) +cat << EOF > $tmp + darkreader + keepassxc-browser + simple-tab-groups + ublock-origin + tridactyl-vim + video-pauser + libredirect +EOF + +# The bin is provided in the devshell. The cat execution should be unquoted +generate_extensions $(cat "$tmp") > "$(dirname $0)"/../config/extensions/extensions.json + + + +rm "$tmp"; diff --git a/home-manager/soispha/config/gammastep/default.nix b/home-manager/soispha/config/gammastep/default.nix new file mode 100644 index 00000000..6090921b --- /dev/null +++ b/home-manager/soispha/config/gammastep/default.nix @@ -0,0 +1,29 @@ +{ + lib, + nixosConfig, + ... +}: let + temp = + if nixosConfig.soispha.laptop.enable + then 2000 + else 1300; +in { + services.gammastep = { + enable = true; + settings = { + general = { + temp-day = lib.mkForce temp; + temp-night = lib.mkForce temp; + gamma = "0.8:0.8:0.8"; + fade = 0; + adjustment-method = "wayland"; + location-provider = "manual"; + }; + + manual = { + lat = 48.1; + lon = 11.6; + }; + }; + }; +} diff --git a/home-manager/soispha/config/git/default.nix b/home-manager/soispha/config/git/default.nix new file mode 100644 index 00000000..9e15da1d --- /dev/null +++ b/home-manager/soispha/config/git/default.nix @@ -0,0 +1,76 @@ +{...}: let + gitIgnoreFile = ./git_ignore.git; + gitTemplateFile = ./git_template.git; +in { + programs.git = { + enable = true; + #package = pkgs.gitAndTools.gitFull; # TODO for git send-email support + aliases = { + st = "status"; + ds = "diff --staged"; + di = "diff"; + rs = "restore --staged"; + + ## Logging: + ls = "log --max-count=10 --color --format=format:'%C(bold red)%h%C(reset) %C(dim bold blue)%s%C(reset) %C(dim white)[%aN] %C(bold red)<%G?>%C(reset)%C(auto)%d%C(reset)'"; + + # https://stackoverflow.com/a/61487052 + lg = "lg1"; + lg1 = "lg1-specific --all"; + lg2 = "lg2-specific --all"; + lg3 = "lg3-specific --all"; + + lg1-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold cyan) [%G?]%C(reset)%C(auto)%d%C(reset)'"; + + lg2-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"; + + lg3-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset)\ + - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)\ + %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)\ + %C(bold red)(signature: %G? by %GS, trust: %GT)%C(reset)%n\ + '' %C(white)%s%C(reset)%n''\ + %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)\ + %C(bold white)- trailers: %(trailers) %C(reset)'"; + }; + extraConfig = { + core = { + excludesFile = "${gitIgnoreFile}"; + }; + init = { + defaultBranch = "prime"; + }; + user = { + email = "soispha@vhack.eu"; + name = "Soispha"; + }; + help = { + autocorrect = 5; + }; + push = { + gpgSign = "if-asked"; + }; + commit = { + template = "${gitTemplateFile}"; + }; + }; + delta = { + enable = true; + options = { + decorations = { + commit-decoration-style = "bold yellow box ul"; + file-decoration-style = "none"; + file-style = "bold yellow ul"; + }; + features = "decorations"; + whitespace-error-style = "22 reverse"; + }; + }; + signing = { + key = "9606FC749FCE16360723D4ADA5E94010C3A642AD!"; + signByDefault = true; + }; + }; +} diff --git a/home-manager/soispha/config/git/git_ignore.git b/home-manager/soispha/config/git/git_ignore.git new file mode 100644 index 00000000..8f29815e --- /dev/null +++ b/home-manager/soispha/config/git/git_ignore.git @@ -0,0 +1,4 @@ +# default nvim Session file name +Session.vim + +# vim: ft=gitignore diff --git a/home-manager/soispha/config/git/git_template.git b/home-manager/soispha/config/git/git_template.git new file mode 100644 index 00000000..9621698d --- /dev/null +++ b/home-manager/soispha/config/git/git_template.git @@ -0,0 +1,66 @@ + +# Title: Summary, imperative, start upper case, don't end with a period +# If applied, this commit will <your Title> + +# Body: Explain *what* and *why* (not *how*). + + +# BREAKING CHANGE: <description> +# Fixes: # +# Refs: # +# Co-authored-by: <name> <email> + + + +# Convention Commits (https://www.conventionalcommits.org/en/v1.0.0/ or https://github.com/angular/angular/blob/85b4941be137a2fcdc664dc870e408dd72ad7de7/CONTRIBUTING.md#commit): +# Feat: [Features] -> MINOR version bump +# A new feature +# +# Fix: [Bug Fixes] -> PATCH version bump +# A bug fix +# +# append '!' after the type/scope: [Breaking Change] -> MAJOR version bump +# A breaking API change +# +# Docs: [Documentation] +# Documentation only changes +# +# Style: [Styles] +# Changes that do not affect the meaning of the code +# (white-space, formatting, missing semi-colons, etc) +# +# Refactor: [Code Refactoring] +# A code change that neither fixes a bug nor adds a feature +# +# Perf: [Performance Improvements] -> PATCH version bump +# A code change that improves performance +# +# Test: [Tests] +# Adding missing tests or correcting existing tests +# +# Build: [Builds] -> PATCH version bump +# Changes that affect the build system or external dependencies +# (example scopes: gulp, broccoli, npm) +# +# Ci: [Continuous Integrations] +# Changes to our CI configuration files and scripts +# (example scopes: Travis, Circle, BrowserStack, SauceLabs) +# +# Chore: [Chores] +# Other changes that don't modify src or test files +# +# Reverts: [Reverts] +# Reverts a previous commit + +# How to Write a Git Commit Message: +# [https://chris.beams.io/posts/git-commit/] -> https://cbea.ms/git-commit/ +# +# 1. Separate subject from body with a blank line +# 2. Limit the subject line to 50 characters +# 3. Capitalize the subject line +# 4. Do not end the subject line with a period +# 5. Use the imperative mood in the subject line +# 6. Wrap the body at 72 characters +# 7. Use the body to explain *what* and *why* vs. *how* +# +# vim: ft=gitcommit diff --git a/home-manager/soispha/config/gpg/agent-program b/home-manager/soispha/config/gpg/agent-program new file mode 100755 index 00000000..e6917db0 --- /dev/null +++ b/home-manager/soispha/config/gpg/agent-program @@ -0,0 +1,2 @@ +#!/bin/sh +onlykey-gpg-agent -v --skey-slot=ECC32 --dkey-slot=ECC32 "$@" diff --git a/home-manager/soispha/config/gpg/default.nix b/home-manager/soispha/config/gpg/default.nix new file mode 100644 index 00000000..52069c94 --- /dev/null +++ b/home-manager/soispha/config/gpg/default.nix @@ -0,0 +1,65 @@ +{ + config, + nixosConfig, + sysLib, + pkgs, + ... +}: let + agent-program = sysLib.writeShellScriptWithLibrary { + name = "onlykey-gpg-agent"; + src = ./agent-program; + dependencies = with pkgs; [ + python3 + onlykey-agent + ]; + }; + settings = + if nixosConfig.networking.hostName == "isimud" + then {} + else { + # Hardware-based GPG configuration + agent-program = "${agent-program}/bin/onlykey-gpg-agent"; + + default-key = "Soispha <soispha@vhack.eu>"; + # TODO add more + }; + gpg-agent = + if nixosConfig.networking.hostName == "isimud" + then { + enable = true; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + } + else { + enable = false; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + }; +in { + programs.gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg/onlykey"; + mutableKeys = false; + mutableTrust = false; + inherit settings; + publicKeys = [ + { + source = ./keys/key_1; + trust = "ultimate"; + } + { + source = ./keys/key_2; + trust = "ultimate"; + } + { + source = ./keys/key_3; + trust = "full"; + } + ]; + }; + services = { + inherit gpg-agent; + }; +} diff --git a/home-manager/soispha/config/gpg/keys/key_1 b/home-manager/soispha/config/gpg/keys/key_1 new file mode 100644 index 00000000..b10b8b6c --- /dev/null +++ b/home-manager/soispha/config/gpg/keys/key_1 Binary files differdiff --git a/home-manager/soispha/config/gpg/keys/key_2 b/home-manager/soispha/config/gpg/keys/key_2 new file mode 100644 index 00000000..0b06cf3b --- /dev/null +++ b/home-manager/soispha/config/gpg/keys/key_2 Binary files differdiff --git a/home-manager/soispha/config/gpg/keys/key_3 b/home-manager/soispha/config/gpg/keys/key_3 new file mode 100644 index 00000000..22ffb931 --- /dev/null +++ b/home-manager/soispha/config/gpg/keys/key_3 Binary files differdiff --git a/home-manager/soispha/config/grades/config.yaml b/home-manager/soispha/config/grades/config.yaml new file mode 100644 index 00000000..36712971 --- /dev/null +++ b/home-manager/soispha/config/grades/config.yaml @@ -0,0 +1,68 @@ +# für oberstufe +--- +unit: Punkte +grade_groups: + - name: Zeugnis + weight: '100' + double_weight_on_class_type: false + - name: Sonstige + weight: '1' + double_weight_on_class_type: true + - name: Klausur + weight: '1' + double_weight_on_class_type: false + +grade_types: + - name: Zeugnis + group: Zeugnis + - name: Klausur + group: Klausur + - name: Epo + group: Sonstige + - name: Test + group: Sonstige + +class_types: + - name: NebenFach + double_weight_on_marked_grade_groups: true + - name: LeistungsKurs + double_weight_on_marked_grade_groups: false + +classes: + - name: M + long_name: Mathe + class_type: LeistungsKurs + - name: E + long_name: Englisch + class_type: LeistungsKurs + - name: CH + long_name: Chemie + class_type: LeistungsKurs + + - name: d + long_name: Deutsch + class_type: NebenFach + - name: g + long_name: Geschichte + class_type: NebenFach + - name: se + long_name: Sozialkunde/Erdkunde + class_type: NebenFach + - name: et + long_name: Ethik + class_type: NebenFach + - name: spj + long_name: Sport + class_type: NebenFach + - name: inf + long_name: Informatik + class_type: NebenFach + - name: ph + long_name: Phyisk + class_type: NebenFach + - name: phi + long_name: Philosophie + class_type: NebenFach + - name: bi + long_name: Biologie + class_type: NebenFach diff --git a/home-manager/soispha/config/grades/default.nix b/home-manager/soispha/config/grades/default.nix new file mode 100644 index 00000000..d2678174 --- /dev/null +++ b/home-manager/soispha/config/grades/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."grades/config.yaml".source = ./config.yaml; +} diff --git a/home-manager/soispha/config/gtk/default.nix b/home-manager/soispha/config/gtk/default.nix new file mode 100644 index 00000000..f5411369 --- /dev/null +++ b/home-manager/soispha/config/gtk/default.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + pkgs, + stdenv, + ... +}: { + gtk = { + enable = true; + theme = { + package = pkgs.nordic; + name = "Nordic"; + }; + cursorTheme = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + }; + iconTheme = { + package = pkgs.nordzy-icon-theme; + name = "Nordzy-icon"; + }; + font = { + name = "Noto Sans"; + size = 10; + }; + gtk2 = { + configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + # extraConfig = '' + # gtk-enable-animations=1 + # gtk-primary-button-warps-slider=0 + # gtk-toolbar-style=3 + # gtk-menu-images=1 + # gtk-button-images=1 + # + # ''; + }; + gtk3 = { + # extraConfig = '' + # gtk-button-images=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-menu-images=true + # gtk-primary-button-warps-slider=false + # gtk-toolbar-style=3 + # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module + # ''; + extraCss = ""; + }; + gtk4 = { + # extraConfig = '' + # gtk-application-prefer-dark-theme=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-primary-button-warps-slider=false + # ''; + }; + }; +} diff --git a/home-manager/soispha/config/himalaya/default.nix b/home-manager/soispha/config/himalaya/default.nix new file mode 100644 index 00000000..99329a34 --- /dev/null +++ b/home-manager/soispha/config/himalaya/default.nix @@ -0,0 +1,8 @@ +{...}: { + programs.himalaya = { + enable = true; + settings = { + # TODO + }; + }; +} diff --git a/home-manager/soispha/config/keepassxc/default.nix b/home-manager/soispha/config/keepassxc/default.nix new file mode 100644 index 00000000..3ac82812 --- /dev/null +++ b/home-manager/soispha/config/keepassxc/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."keepassxc/keepassxc.ini".source = ./keepassxc.ini; +} diff --git a/home-manager/soispha/config/keepassxc/keepassxc.ini b/home-manager/soispha/config/keepassxc/keepassxc.ini new file mode 100644 index 00000000..288a194b --- /dev/null +++ b/home-manager/soispha/config/keepassxc/keepassxc.ini @@ -0,0 +1,58 @@ +[General] +AutoSaveAfterEveryChange=true +BackupBeforeSave=true +BackupFilePathPattern=/home/soispha/.local/share/keepassxc/{DB_FILENAME}.old.kdbx +ConfigVersion=2 +HideWindowOnCopy=false + +[Browser] +CustomProxyLocation= +Enabled=true + +[FdoSecrets] +Enabled=true + +[GUI] +AdvancedSettings=true +ApplicationTheme=dark +CompactMode=false +HidePasswords=true +ShowExpiredEntriesOnDatabaseUnlockOffsetDays=1 +TrayIconAppearance=monochrome-light + +[KeeShare] +Active="" +Own="" +QuietSuccess=true + +[PasswordGenerator] +AdditionalChars= +AdvancedMode=true +Braces=true +Dashes=true +EASCII=true +ExcludedChars= +Length=128 +Logograms=true +LowerCase=true +Math=true +Numbers=true +Punctuation=true +Quotes=true +SpecialChars=true +Type=0 +UpperCase=true +WordCount=4 +WordSeparator="," + +[SSHAgent] +Enabled=true + +[Security] +HidePasswordPreviewPanel=true +IconDownloadFallback=true +LockDatabaseIdle=false +LockDatabaseIdleSeconds=960 +PasswordEmptyPlaceholder=true +PasswordsHidden=true +PasswordsRepeatVisible=true diff --git a/home-manager/soispha/config/latexindent/default.nix b/home-manager/soispha/config/latexindent/default.nix new file mode 100644 index 00000000..0d776e14 --- /dev/null +++ b/home-manager/soispha/config/latexindent/default.nix @@ -0,0 +1,8 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."latexindent/indentconfig.yaml".source = ./indentconfig.yaml; + xdg.configFile."latexindent/mysettings.yaml".source = ./mysettings.yaml; +} diff --git a/home-manager/soispha/config/latexindent/indentconfig.yaml b/home-manager/soispha/config/latexindent/indentconfig.yaml new file mode 100644 index 00000000..d67351f3 --- /dev/null +++ b/home-manager/soispha/config/latexindent/indentconfig.yaml @@ -0,0 +1,2 @@ +paths: +- /home/dt/.config/latexindent/mysettings.yaml diff --git a/home-manager/soispha/config/latexindent/mysettings.yaml b/home-manager/soispha/config/latexindent/mysettings.yaml new file mode 100644 index 00000000..9a0f8b2f --- /dev/null +++ b/home-manager/soispha/config/latexindent/mysettings.yaml @@ -0,0 +1,672 @@ +# defaultSettings.yaml for latexindent.pl, version 3.19.1, 2022-12-04 +# a script that aims to +# beautify .tex, .sty, .cls files +# +# (or latexindent.exe if you're on Windows) +# +#--------------------------------------------------------------------------------------- +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See http://www.gnu.org/licenses/. +# +# Chris Hughes, 2017 +# +# For all communication, please visit: https://github.com/cmhughes/latexindent.pl +# +#--------------------------------------------------------------------------------------- +# You should feel encouraged to change anything you like in these settings, but +# it would probably be better to have your own user settings +# files somewhere else - remember that this file may be overwritten +# when you update your tex distribution. Please see the manual linked from: +# +# https://github.com/cmhughes/latexindent.pl +# +# for details of how to create and configure your own settings files. +# +# Please read the manual (linked from above) first to understand what each switch does. +# +#--------------------------------------------------------------------------------------- + +# latexindent can be called to act on a file without using the file's extension, +# e.g, simply +# latexindent myfile +# in which case the choice of file extension is chosen +# according to the choices made in fileExtensionPreference +# Other file extensions can be added. +fileExtensionPreference: + .tex: 1 + .sty: 2 + .cls: 3 + .bib: 4 + +# default file extension of backup file (if -w switch is active) +# for example, if your .tex file is called +# myfile.tex +# and you specify the backupExtension as BACKUP.bak then your +# backup file will be +# myfileBACKUP.bak +backupExtension: .bak + +# only one backup per file: +# - if onlyOneBackUp is 0 then, as a safety measure, +# the number on the extension increments by 1 each time: +# +# myfile.bak0, myfile.bak1, myfile.bak2 +# - if you set onlyOnebackUp to 1, then the backup file will +# be overwritten each time (not recommended until you trust the script) +onlyOneBackUp: 0 + +# some users may want a finite number of backup files, +# say at most 3; in which case, they can change this maxNumberOfBackUps. +# +# If maxNumberOfBackUps is set to 0 (or less) then infinitely +# many backups are possible, unless onlyOneBackUp is switched on +maxNumberOfBackUps: 0 + +# some users may wish to cycle through back up files. +# +# for example, with maxNumberOfBackUps: 4, they may +# wish to delete the oldest back up file, and keep only the most recent. +# +# copy myfile.bak1 to myfile.bak0 +# copy myfile.bak2 to myfile.bak1 +# copy myfile.bak3 to myfile.bak2 +# copy myfile.bak4 to myfile.bak3 +# +# the back up will be written to myfile.bak4 +cycleThroughBackUps: 0 + +# preferences for information displayed in the log file +logFilePreferences: + showEveryYamlRead: 1 + showAmalgamatedSettings: 0 + showDecorationStartCodeBlockTrace: 0 + showDecorationFinishCodeBlockTrace: 0 + endLogFileWith: '--------------' + showGitHubInfoFooter: 1 + Dumper: + Terse: 1 + Indent: 1 + Useqq: 1 + Deparse: 1 + Quotekeys: 0 + Sortkeys: 1 + Pair: " => " + +# verbatim environments specified +# in this field will not be changed at all! +verbatimEnvironments: + verbatim: 1 + lstlisting: 1 + minted: 1 + +# verbatim commands such as \verb! body !, \lstinline$something else$ +verbatimCommands: + verb: 1 + lstinline: 1 + +# no indent blocks (not necessarily verbatim +# environments) which are marked as %\begin{noindent} +# or anything else that you detail in the following +noIndentBlock: + noindent: 1 + cmhtest: 1 + +# \begin{document} and \end{document} are treated differently +# by latexindent within filecontents environments +fileContentsEnvironments: + filecontents: 1 + filecontents*: 1 + +# indent preamble +indentPreamble: 1 + +# assume no preamble in cls, sty, by default +lookForPreamble: + .tex: 1 + .sty: 0 + .cls: 0 + .bib: 0 + +# some preambles can contain \begin and \end statements +# that are not in their 'standard environment block', for example, +# consider the following key = values: +# preheadhook={\begin{mdframed}[style=myframedstyle]}, +# postfoothook=\end{mdframed}, +preambleCommandsBeforeEnvironments: 0 + +# default value of indentation +defaultIndent: " " + +# remove trailing whitespace from all lines +removeTrailingWhitespace: + beforeProcessing: 0 + afterProcessing: 1 + +# name of code blocks that should have their body aligned at ampersand delimiters +lookForAlignDelims: + tabular: + delims: 1 + alignDoubleBackSlash: 1 + spacesBeforeDoubleBackSlash: 1 + multiColumnGrouping: 0 + alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 + justification: left + alignFinalDoubleBackSlash: 0 + dontMeasure: 0 + delimiterRegEx: '(?<!\\)(&)' + delimiterJustification: left + lookForChildCodeBlocks: 1 + tabularx: + delims: 1 + longtable: 1 + tabu: 1 + array: 1 + matrix: 1 + listabla: 1 + # amsmath + align: 1 + align*: 1 + alignat: 1 + alignat*: 1 + aligned: 1 + bmatrix: 1 + Bmatrix: 1 + cases: 1 + flalign: 1 + flalign*: 1 + pmatrix: 1 + vmatrix: 1 + Vmatrix: 1 + # mathtools + cases*: 1 + dcases: 1 + dcases*: 1 + rcases: 1 + rcases*: 1 + drcases: 1 + drcases*: 1 + # nicematrix + NiceTabular: 1 + NiceMatrix: 1 + pNiceMatrix: 1 + bNiceMatrix: 1 + BNiceMatrix: 1 + vNiceMatrix: 1 + VNiceMatrix: 1 + NiceArray: 1 + pNiceArrayC: 1 + bNiceArrayC: 1 + BNiceArrayC: 1 + vNiceArrayC: 1 + VNiceArrayC: 1 + NiceArrayCwithDelims: 1 + pNiceArrayRC: 1 + bNiceArrayRC: 1 + BNiceArrayRC: 1 + vNiceArrayRC: 1 + VNiceArrayRC: 1 + NiceArrayRCwithDelims: 1 + # tabularray + tblr: 1 + longtblr: 1 + talltblr: 1 + +# if you want the script to look for \item commands +# and format it, as follows (for example), +# \begin{itemize} +# \item content here +# next line is indented +# next line is indented +# \item another item +# \end{itemize} +# then populate indentAfterItems. See also itemNames +indentAfterItems: + itemize: 1 + itemize*: 1 + enumerate: 1 + enumerate*: 1 + description: 1 + description*: 1 + list: 1 + +# if you want to use other names for your items (for example, \part) +# then populate them here; note that you can trick latexindent.pl +# into indenting all kinds of commands (within environments specified in +# indentAfterItems) using this technique. +itemNames: + item: 1 + myitem: 1 + +# specialBeginEnd is, by default, mathmode focus, although +# there's no restrictions +specialBeginEnd: + displayMath: + begin: '\\\[' + end: '\\\]' + lookForThis: 1 + inlineMath: + begin: '(?<!\$)(?<!\\)\$(?!\$)' + end: '(?<!\\)\$(?!\$)' + lookForThis: 1 + displayMathTeX: + begin: '\$\$' + end: '\$\$' + lookForThis: 1 + specialBeforeCommand: 0 + +# if you want to add indentation after +# a heading, such as \part, \chapter, etc +# then populate it in here - you can add +# an indent rule to indentRules if you would +# like something other than defaultIndent +# +# you can also change the level if you like, +# or add your own title command +indentAfterHeadings: + part: + indentAfterThisHeading: 0 + level: 1 + chapter: + indentAfterThisHeading: 0 + level: 2 + section: + indentAfterThisHeading: 0 + level: 3 + subsection: + indentAfterThisHeading: 0 + level: 4 + subsection*: + indentAfterThisHeading: 0 + level: 4 + subsubsection: + indentAfterThisHeading: 0 + level: 5 + paragraph: + indentAfterThisHeading: 0 + level: 6 + subparagraph: + indentAfterThisHeading: 0 + level: 7 + +# maximum indentation, off by default +maximumIndentation: -1 + +# if you don't want to have additional indentation +# in a code block, then add it to noAdditionalIndent; note that +# code blocks in this field will inherit +# the *current* level of indentation they just won't +# get any *additional* indentation +noAdditionalIndent: + myexample: 0 + mydefinition: 0 + problem: 0 + exercises: 0 + mysolution: 0 + foreach: 0 + widepage: 0 + comment: 0 + document: 0 + frame: 0 + +# if you have indent rules for particular code blocks +# then you can populate them in indentRules; for example, you might just want +# to use a space " " or maybe a double tab " " +indentRules: + myenvironment: " " + anotherenvironment: " " + chapter: " " + section: " " + item: " " + myitem: " " + +# set noAdditionalIndent globally for codeblocks +noAdditionalIndentGlobal: + environments: 0 + commands: 0 + optionalArguments: 0 + mandatoryArguments: 0 + ifElseFi: 0 + items: 0 + keyEqualsValuesBracesBrackets: 0 + namedGroupingBracesBrackets: 0 + UnNamedGroupingBracesBrackets: 0 + specialBeginEnd: 0 + afterHeading: 0 + filecontents: 0 + +# set indentRules globally for codeblocks; these need +# to be horizontal spaces, if they are to be used +indentRulesGlobal: + environments: 0 + commands: 0 + optionalArguments: 0 + mandatoryArguments: 0 + ifElseFi: 0 + items: 0 + keyEqualsValuesBracesBrackets: 0 + namedGroupingBracesBrackets: 0 + UnNamedGroupingBracesBrackets: 0 + specialBeginEnd: 0 + afterHeading: 0 + filecontents: 0 + +# command code block details +commandCodeBlocks: + roundParenthesesAllowed: 1 + stringsAllowedBetweenArguments: + - + amalgamate: 1 + - 'node' + - 'at' + - 'to' + - 'decoration' + - '\+\+' + - '\-\-' + - '\#\#\d' + commandNameSpecial: + - + amalgamate: 1 + - '@ifnextchar\[' + +# change dos line breaks into unix +dos2unixlinebreaks: 1 + +# modifyLineBreaks will only be searched if the -m +# switch is active +# +# poly-switch examples: +# +# BeginStartsOnOwnLine: +# modify line breaks before a begin statement +# +# when set to -1, e.g +# some text some text +# \begin{myenvironment} +# will be changed to +# some text some text \begin{myenvironment} +# when set to 0, the switch is ignored +# when set to 1, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text +# \begin{myenvironment} +# when set to 2, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text% +# \begin{myenvironment} +# when set to 3, e.g +# some text some text \begin{myenvironment} +# will be changed to +# some text some text +# +# \begin{myenvironment} +# +# BodyStartsOnOwnLine: +# modify line breaks before the beginning of the body +# +# when set to -1, e.g +# \begin{myenv} +# body text body text +# will be changed to +# \begin{myenv}body text body text +# when set to 0, the switch is ignored +# when set to 1, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv} +# body text body text +# when set to 2, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv}% +# body text body text +# when set to 3, e.g +# \begin{myenv}body text body text +# will be changed to +# \begin{myenv} +# +# body text body text +# +# EndStartsOnOwnLine: +# modify line breaks before the end statement +# +# when set to -1, e.g +# some text some text +# \end{myenvironment} +# will be changed to +# some text some text \end{myenvironment} +# when set to 0, the switch is ignored +# when set to 1, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text +# \end{myenvironment} +# when set to 2, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text% +# \end{myenvironment} +# when set to 3, e.g +# some text some text \end{myenvironment} +# will be changed to +# some text some text +# +# \end{myenvironment} +# +# EndFinishesWithLineBreak: +# modify line breaks after the end statement +# +# when set to -1, e.g +# \end{myenvironment} +# some text some text +# will be changed to +# \end{myenvironment}some text some text +# when set to 0, the switch is ignored +# when set to 1, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment} +# some text some text +# when set to 2, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment}% +# some text some text +# when set to 3, e.g +# \end{myenvironment}some text some text +# will be changed to +# \end{myenvironment} +# +# some text some text +# +# you can specify settings on a per-name basis +modifyLineBreaks: + preserveBlankLines: 1 + condenseMultipleBlankLinesInto: 1 + oneSentencePerLine: + manipulateSentences: 0 + removeSentenceLineBreaks: 1 + multipleSpacesToSingle: 1 + textWrapSentences: 0 # setting to 1 disables main textWrap routine + sentenceIndent: "" + sentencesFollow: + par: 1 + blankLine: 1 + fullStop: 1 + exclamationMark: 1 + questionMark: 1 + rightBrace: 1 + commentOnPreviousLine: 1 + other: 0 + sentencesBeginWith: + A-Z: 1 + a-z: 0 + other: 0 + sentencesEndWith: + basicFullStop: 0 + betterFullStop: 1 + exclamationMark: 1 + questionMark: 1 + other: 0 + textWrapOptions: + columns: 0 + multipleSpacesToSingle: 1 + removeBlockLineBreaks: 1 + blocksFollow: + headings: 1 + commentOnPreviousLine: 1 + par: 1 + blankLine: 1 + verbatim: 1 + filecontents: 1 + other: '\\\]|\\item(?:\h|\[)' # regex + blocksBeginWith: + A-Z: 1 + a-z: 1 + 0-9: 0 + other: 0 # regex + blocksEndBefore: + commentOnOwnLine: 1 + verbatim: 1 + filecontents: 1 + other: '\\begin\{|\\\[|\\end\{' # regex + huge: overflow # forbid mid-word line breaks + separator: "" + # poly-switches below here + environments: + BeginStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + EndStartsOnOwnLine: 0 + EndFinishesWithLineBreak: 0 + equation*: + BeginStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + EndStartsOnOwnLine: 0 + EndFinishesWithLineBreak: 0 + ifElseFi: + IfStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + OrStartsOnOwnLine: 0 + OrFinishesWithLineBreak: 0 + ElseStartsOnOwnLine: 0 + ElseFinishesWithLineBreak: 0 + FiStartsOnOwnLine: 0 + FiFinishesWithLineBreak: 0 + ifnum: + IfStartsOnOwnLine: 0 + BodyStartsOnOwnLine: 0 + OrStartsOnOwnLine: 0 + OrFinishesWithLineBreak: 0 + ElseStartsOnOwnLine: 0 + ElseFinishesWithLineBreak: 0 + FiStartsOnOwnLine: 0 + FiFinishesWithLineBreak: 0 + commands: + CommandStartsOnOwnLine: 0 + CommandNameFinishesWithLineBreak: 0 + optionalArguments: + LSqBStartsOnOwnLine: 0 + OptArgBodyStartsOnOwnLine: 0 + RSqBStartsOnOwnLine: 0 + RSqBFinishesWithLineBreak: 0 + mandatoryArguments: + LCuBStartsOnOwnLine: 0 + MandArgBodyStartsOnOwnLine: 0 + RCuBStartsOnOwnLine: 0 + RCuBFinishesWithLineBreak: 0 + keyEqualsValuesBracesBrackets: + KeyStartsOnOwnLine: 0 + EqualsStartsOnOwnLine: 0 + EqualsFinishesWithLineBreak: 0 + items: + ItemStartsOnOwnLine: 0 + ItemFinishesWithLineBreak: 0 + namedGroupingBracesBrackets: + NameStartsOnOwnLine: 0 + NameFinishesWithLineBreak: 0 + specialBeginEnd: + SpecialBeginStartsOnOwnLine: 0 + SpecialBodyStartsOnOwnLine: 0 + SpecialEndStartsOnOwnLine: 0 + SpecialEndFinishesWithLineBreak: 0 + verbatim: + VerbatimBeginStartsOnOwnLine: 0 + VerbatimEndFinishesWithLineBreak: 0 + +# replacements, only active when either -r or -rr switches are active +replacements: + - + amalgamate: 1 + - + this: 'latexindent.pl' + that: 'pl.latexindent' + lookForThis: 0 + when: before + +# fineTuning allows you to tweak the internal pattern matching that +# is central to latexindent.pl +fineTuning: + environments: + name: '[a-zA-Z@\*0-9_\\]+' + ifElseFi: + name: '(?!@?if[a-zA-Z@]*?\{)@?if[a-zA-Z@]*?' + commands: + name: '[+a-zA-Z@\*0-9_\:]+?' + items: + canBeFollowedBy: '(?:\[[^]]*?\])|(?:<[^>]*?>)' + keyEqualsValuesBracesBrackets: + name: '[a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*?' + follow: '(?:(?<!\\)\{)|,|(?:(?<!\\)\[)' + namedGroupingBracesBrackets: + name: '[0-9\.a-zA-Z@\*><]+?' + follow: '\h|\R|\{|\[|\$|\)|\(' + UnNamedGroupingBracesBrackets: + follow: '\{|\[|,|&|\)|\(|\$' + arguments: + before: '(?:#\d\h*;?,?\/?)+|\<.*?\>' + between: '_|\^|\*' + trailingComments: + notPreceededBy: '(?<!\\)' + modifyLineBreaks: + doubleBackSlash: '\\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])?' + comma: ',' + betterFullStop: |- + (?x) # ignore spaces in the below + (?: # + \.\) # .) + (?!\h*[a-z]) # not *followed by* a-z + ) # + | # OR + (?: # + (?<! # not *preceeded by* + (?: # + (?:[eE]\.[gG]) # e.g OR E.g OR e.G OR E.G + | # + (?:[iI]\.[eE]) # i.e OR I.e OR i.E OR I.E + | # + (?:etc) # etc + ) # + ) # + ) # + \. # . + (?! # not *followed by* + (?: # + [a-zA-Z0-9-~,] # + | # + \), # ), + | # + \)\. # ). + ) # + ) # diff --git a/home-manager/soispha/config/less/default.nix b/home-manager/soispha/config/less/default.nix new file mode 100644 index 00000000..fe7142f1 --- /dev/null +++ b/home-manager/soispha/config/less/default.nix @@ -0,0 +1,15 @@ +{ + config, + pkgs, + ... +}: { + programs.less = { + enable = true; + keys = '' + t forw-line + n back-line + l repeat-search + L reverse-search + ''; + }; +} diff --git a/home-manager/soispha/config/lf/colors b/home-manager/soispha/config/lf/colors new file mode 100644 index 00000000..b2289b4e --- /dev/null +++ b/home-manager/soispha/config/lf/colors @@ -0,0 +1,190 @@ +# vim:ft=dircolors +# (This is not a dircolors file but it helps to highlight colors and comments) + +# default values from dircolors +# (entries with a leading # are not implemented in lf) +# #no 00 # NORMAL +# fi 00 # FILE +# #rs 0 # RESET +# di 01;34 # DIR +# ln 01;36 # LINK +# #mh 00 # MULTIHARDLINK +# pi 40;33 # FIFO +# so 01;35 # SOCK +# #do 01;35 # DOOR +# bd 40;33;01 # BLK +# cd 40;33;01 # CHR +# or 40;31;01 # ORPHAN +# #mi 00 # MISSING +# su 37;41 # SETUID +# sg 30;43 # SETGID +# #ca 30;41 # CAPABILITY +# tw 30;42 # STICKY_OTHER_WRITABLE +# ow 34;42 # OTHER_WRITABLE +# st 37;44 # STICKY +# ex 01;32 # EXEC + +# default values from lf (with matching order) +# ln 01;36 # LINK +# or 31;01 # ORPHAN +# tw 01;34 # STICKY_OTHER_WRITABLE +# ow 01;34 # OTHER_WRITABLE +# st 01;34 # STICKY +# di 01;34 # DIR +# pi 33 # FIFO +# so 01;35 # SOCK +# bd 33;01 # BLK +# cd 33;01 # CHR +# su 01;32 # SETUID +# sg 01;32 # SETGID +# ex 01;32 # EXEC +# fi 00 # FILE + + +# file types (with matching order) +ln 01;33 # LINK +#ln 01;34 # LINK +or 01;35;46 # ORPHAN +tw 35 # STICKY_OTHER_WRITABLE +ow 35 # OTHER_WRITABLE +st 01;36 # STICKY +di 01;36 # DIR +pi 33 # FIFO +so 01;35 # SOCK +bd 33;01 # BLK +cd 33;01 # CHR +su 01;32 # SETUID +sg 01;32 # SETGID +ex 01;31;44 # EXEC +fi 00 # FILE + +# links +~/.mbsyncrc 01;34 +~/.cups 01;34 +~/.mozilla 01;34 +~/.ssh 01;34 + +~/.steampid 01;34 +~/.steam 01;34 +~/.steampath 01;34 + +# nix +~/.nix-profile 01;34 +~/.nix-defexpr 01;34 + +# archives or compressed (dircolors defaults) +*.tar 01;31 +*.tgz 01;31 +*.arc 01;31 +*.arj 01;31 +*.taz 01;31 +*.lha 01;31 +*.lz4 01;31 +*.lzh 01;31 +*.lzma 01;31 +*.tlz 01;31 +*.txz 01;31 +*.tzo 01;31 +*.t7z 01;31 +*.zip 01;31 +*.z 01;31 +*.dz 01;31 +*.gz 01;31 +*.lrz 01;31 +*.lz 01;31 +*.lzo 01;31 +*.xz 01;31 +*.zst 01;31 +*.tzst 01;31 +*.bz2 01;31 +*.bz 01;31 +*.tbz 01;31 +*.tbz2 01;31 +*.tz 01;31 +*.deb 01;31 +*.rpm 01;31 +*.jar 01;31 +*.war 01;31 +*.ear 01;31 +*.sar 01;31 +*.rar 01;31 +*.alz 01;31 +*.ace 01;31 +*.zoo 01;31 +*.cpio 01;31 +*.7z 01;31 +*.rz 01;31 +*.cab 01;31 +*.wim 01;31 +*.swm 01;31 +*.dwm 01;31 +*.esd 01;31 + +# image formats (dircolors defaults) +*.jpg 01;35 +*.jpeg 01;35 +*.mjpg 01;35 +*.mjpeg 01;35 +*.gif 01;35 +*.bmp 01;35 +*.pbm 01;35 +*.pgm 01;35 +*.ppm 01;35 +*.tga 01;35 +*.xbm 01;35 +*.xpm 01;35 +*.tif 01;35 +*.tiff 01;35 +*.png 01;35 +*.svg 01;35 +*.svgz 01;35 +*.mng 01;35 +*.pcx 01;35 +*.mov 01;35 +*.mpg 01;35 +*.mpeg 01;35 +*.m2v 01;35 +*.mkv 01;35 +*.webm 01;35 +*.ogm 01;35 +*.mp4 01;35 +*.m4v 01;35 +*.mp4v 01;35 +*.vob 01;35 +*.qt 01;35 +*.nuv 01;35 +*.wmv 01;35 +*.asf 01;35 +*.rm 01;35 +*.rmvb 01;35 +*.flc 01;35 +*.avi 01;35 +*.fli 01;35 +*.flv 01;35 +*.gl 01;35 +*.dl 01;35 +*.xcf 01;35 +*.xwd 01;35 +*.yuv 01;35 +*.cgm 01;35 +*.emf 01;35 +*.ogv 01;35 +*.ogx 01;35 + +# audio formats (dircolors defaults) +*.aac 00;36 +*.au 00;36 +*.flac 00;36 +*.m4a 00;36 +*.mid 00;36 +*.midi 00;36 +*.mka 00;36 +*.mp3 00;36 +*.mpc 00;36 +*.ogg 00;36 +*.ra 00;36 +*.wav 00;36 +*.oga 00;36 +*.opus 00;36 +*.spx 00;36 +*.xspf 00;36 diff --git a/home-manager/soispha/config/lf/commands/default.nix b/home-manager/soispha/config/lf/commands/default.nix new file mode 100644 index 00000000..67362fd0 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/default.nix @@ -0,0 +1,222 @@ +{ + pkgs, + sysLib, + shell_library, + system, + ... +}: let + functionCall = { + file, + dependencies, + replacementStrings, + ... + }: + sysLib.writeShellScriptWithLibraryAndKeepPath { + name = "${builtins.baseNameOf file}"; + src = file; + dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash coreutils;}); + inherit replacementStrings; + } + + "/bin/${builtins.baseNameOf file}"; + shell = { + file, + dependencies, + replacementStrings ? null, + ... + }: '' + ''${{ + ${functionCall {inherit file dependencies replacementStrings;}} + }} + ''; # closes the lf tui + pipe = { + file, + dependencies, + replacementStrings ? null, + ... + }: '' + %{{ + ${functionCall {inherit file dependencies replacementStrings;}} + }} + ''; # runs the command in the ui/term bar + async = { + file, + dependencies, + replacementStrings ? null, + ... + }: '' + &{{ + ${functionCall {inherit file dependencies replacementStrings;}} + }} + ''; # runs the command in the background + wait = { + file, + dependencies, + replacementStrings ? null, + ... + }: '' + !{{ + ${functionCall {inherit file dependencies replacementStrings;}} + }} + ''; # adds a prompt after the command has run +in { + archive = shell { + file = ./scripts/archive; + dependencies = builtins.attrValues { + inherit + (pkgs) + fzf + gnutar + xz + p7zip + zip + ; + }; + }; + broot_jump = shell { + file = ./scripts/broot_jump; + dependencies = builtins.attrValues { + inherit (pkgs) broot; + }; + }; + chmod = pipe { + file = ./scripts/chmod; + dependencies = []; + }; + clear_trash = shell { + file = ./scripts/clear_trash; + dependencies = builtins.attrValues { + inherit + (pkgs) + fzf + trashy + ; + }; + }; + dl_file = pipe { + file = ./scripts/dl_file; + dependencies = builtins.attrValues { + inherit + (pkgs) + xdragon + curl + ; + }; + }; + dragon = pipe { + file = ./scripts/dragon; + dependencies = builtins.attrValues { + inherit + (pkgs) + xdragon + ; + }; + }; + dragon_individual = pipe { + file = ./scripts/dragon_individual; + dependencies = builtins.attrValues { + inherit + (pkgs) + xdragon + ; + }; + }; + dragon_stay = pipe { + file = ./scripts/dragon_stay; + dependencies = builtins.attrValues { + inherit + (pkgs) + xdragon + ; + }; + }; + fzf_jump = shell { + file = ./scripts/fzf_jump; + dependencies = builtins.attrValues { + inherit (pkgs) fzf lf gnused; + }; + }; + mk_dir = pipe { + file = ./scripts/mk_dir; + dependencies = []; + }; + mk_file = shell { + file = ./scripts/mk_file; + dependencies = []; + }; + mk_ln = pipe { + file = ./scripts/mk_ln; + dependencies = []; + }; + mk_scr_default = shell { + file = ./scripts/mk_scr_default; + dependencies = builtins.attrValues {inherit (pkgs) neovim;}; + replacementStrings = { + SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; + }; + }; + mk_scr_temp = shell { + file = ./scripts/mk_scr_temp; + dependencies = builtins.attrValues {inherit (pkgs) neovim;}; + replacementStrings = { + SHELL_LIBRARY_TEMPLATE = "${shell_library.rawTemplate."${system}"}"; + TO_BE_SHELL_LIBRARY_PATH = "%SHELL_LIBRARY_PATH"; # replacement is not recursive + }; + }; + open = shell { + file = ./scripts/open; + dependencies = builtins.attrValues {inherit (pkgs) file xdg-utils neovim git;}; + }; + open_config = shell { + file = ./scripts/open_config; + dependencies = builtins.attrValues { + #inherit + #(pkgs) + ## TODO rewrite this: bookmenu, https://github.com/jarun/buku + # + #buku + #; + }; + }; + restore_trash = shell { + file = ./scripts/restore_trash; + dependencies = builtins.attrValues { + inherit + (pkgs) + fzf + trashy + ; + }; + }; + set_wall_paper = pipe { + file = ./scripts/set_wall_paper; + dependencies = []; + }; + stripspace = pipe { + file = ./scripts/stripspace; + dependencies = []; + }; + trash = pipe { + file = ./scripts/trash; + dependencies = builtins.attrValues { + inherit + (pkgs) + trashy + trash-cli + findutils + ; + }; + }; + unarchive = pipe { + file = ./scripts/unarchive; + dependencies = builtins.attrValues { + inherit + (pkgs) + gnutar + unzip + # TODO this is unfree! unrar + + p7zip + ; + }; + }; +} diff --git a/home-manager/soispha/config/lf/commands/scripts/archive b/home-manager/soispha/config/lf/commands/scripts/archive new file mode 100755 index 00000000..48fe25fc --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/archive @@ -0,0 +1,54 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# Option '-f' disables pathname expansion which can be useful when $f, $fs, and +# $fx variables contain names with '*' or '?' characters. However, this option +# is used selectively within individual commands as it can be limiting at +# times. +set -f + +archivers="$(tmp 'echo "gzip xz 7z zip"')"; + +prompt "Archive name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "Archive already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "Archive name: " + fi + fi +done + +root="$(if [ "$(pwd)" = "/" ]; then pwd; else echo "$(pwd)/";fi)"; + +# fx contains all selected file name separated by a newline +while read -r raw_file; do + file="$(echo "$raw_file" | sed "s|$root||")"; + set -- "$@" "$file"; +done < "$(tmp "echo '$fx'")"; + +case "$(awk '{for (i=1; i<=NF; i++) print $i}' "$archivers" | fzf)" in + "gzip") + tar -czf "$name".tar.gz "$@" + ;; + "xz") + tar -cf "$name".tar "$@" + xz -z -9 -e -T0 "$name".tar + ;; + "7z") + 7z a "$name".7z "$@" + ;; + "zip") + zip --symlinks -r "$name".zip "$@" + ;; +esac +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/broot_jump b/home-manager/soispha/config/lf/commands/scripts/broot_jump new file mode 100755 index 00000000..abefc616 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/broot_jump @@ -0,0 +1,16 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +tmp=$(mktmp) +res="$(broot --outcmd "$tmp" && sed 's/cd //' "$tmp")" + +if [ -f "$res" ]; then + cmd="select" +elif [ -d "$res" ]; then + cmd="cd" +fi + +lf -remote "send '$id' '$cmd' '$res'" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/chmod b/home-manager/soispha/config/lf/commands/scripts/chmod new file mode 100755 index 00000000..07bc37cc --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/chmod @@ -0,0 +1,13 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +readp "Mode bits: " bits + +while read -r file; do + chmod "$bits" "$file" +done < "$(tmp "echo $fx")" + +lf -remote 'send reload' +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/clear_trash b/home-manager/soispha/config/lf/commands/scripts/clear_trash new file mode 100755 index 00000000..f2571fcc --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/clear_trash @@ -0,0 +1,8 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# could also use --force, for instand removal +trash list | fzf --multi | awk '{print $NF}' | xargs trash empty --match=exact +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/dl_file b/home-manager/soispha/config/lf/commands/scripts/dl_file new file mode 100755 index 00000000..54518049 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/dl_file @@ -0,0 +1,33 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# Provides the ability to download a file by dropping it into a window + +url="$(dragon -t -x)" + +if [ -n "$url" ]; then + prompt "File Name: " + name="" + while [ -z "$name" ] || [ -e "$name" ] + do + read -r name + if [ -e "$name" ]; then + prompt "File already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "File Name: " + fi + fi + done + + # Download the file with curl + [ -n "$name" ] && curl -o "$name" "$url" || die "curl failed" +else + die "URL is null!" +fi +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/dragon b/home-manager/soispha/config/lf/commands/scripts/dragon new file mode 100755 index 00000000..7e2d9ba6 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/dragon @@ -0,0 +1,11 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while read -r file; do + set -- "$@" "$file" +done < "$(tmp "echo '$fx'")" + +dragon -a -x "$@" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/dragon_individual b/home-manager/soispha/config/lf/commands/scripts/dragon_individual new file mode 100755 index 00000000..5d55aaa8 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/dragon_individual @@ -0,0 +1,11 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while read -r file; do + set -- "$@" "$file" +done < "$(tmp "echo '$fx'")" + +dragon "$@" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/dragon_stay b/home-manager/soispha/config/lf/commands/scripts/dragon_stay new file mode 100755 index 00000000..f3483483 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/dragon_stay @@ -0,0 +1,11 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while read -r file; do + set -- "$@" "$file"; +done < "$(tmp "echo '$fx'")" + +dragon -a "$@" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/fzf_jump b/home-manager/soispha/config/lf/commands/scripts/fzf_jump new file mode 100755 index 00000000..c05216f0 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/fzf_jump @@ -0,0 +1,15 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +res="$(fd . --maxdepth 3 | fzf --header='Jump to location')" + +if [ -f "$res" ]; then + cmd="select" +elif [ -d "$res" ]; then + cmd="cd" +fi + +lf -remote "send '$id' '$cmd' '$res'" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_dir b/home-manager/soispha/config/lf/commands/scripts/mk_dir new file mode 100755 index 00000000..4dca06dc --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/mk_dir @@ -0,0 +1,24 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +prompt "Directory Name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "Directory already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "Directory Name: " + fi + fi +done + +mkdir "$name" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_file b/home-manager/soispha/config/lf/commands/scripts/mk_file new file mode 100755 index 00000000..2e5a2deb --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/mk_file @@ -0,0 +1,25 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +prompt "File name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "File already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "File name: " + fi + fi +done + +touch "$name" +"$EDITOR" "$name" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_ln b/home-manager/soispha/config/lf/commands/scripts/mk_ln new file mode 100755 index 00000000..1e97517f --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/mk_ln @@ -0,0 +1,36 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while IFS= read -r i;do + set -- "$@" "$i" +done < "$HOME"/.local/share/lf/files + +mode="$1" +shift + +if [ "$#" -eq 0 ]; then + msg "no files to link" + exit 0 +fi + +case "$mode" in + copy) + while [ "$#" -gt 0 ]; do + file="$1" + ans="$(basename "$file")" + + while [ -e "$ans" ];do + prompt "$ans already exists, new name for link: " + read -r ans + done + + ln -s "$file" "$(pwd)/$ans" + shift + done + ;; +esac +rm ~/.local/share/lf/files +# lf -remote "send clear" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_scr_default b/home-manager/soispha/config/lf/commands/scripts/mk_scr_default new file mode 100755 index 00000000..b13ca9f5 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/mk_scr_default @@ -0,0 +1,31 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + + +prompt "Script name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "Script already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "Script Name: " + fi + fi +done + +script="$(pwd)"/"$name" + +cat "%SHELL_LIBRARY_TEMPLATE" > "$script" +chmod +x "$script" +"$VISUAL" "$script" + + +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp b/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp new file mode 100755 index 00000000..a520469c --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp @@ -0,0 +1,31 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + + +prompt "Script name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "Script already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "Script Name: " + fi + fi +done + +script="$(pwd)"/"$name" + +sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" > "$script" +chmod +x "$script" +"$VISUAL" "$script" + + +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/open b/home-manager/soispha/config/lf/commands/scripts/open new file mode 100755 index 00000000..c507482b --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/open @@ -0,0 +1,11 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +case $(file --mime-type "$f" -bL) in + text/*|application/json|application/vnd.hp-HPGL) "$EDITOR" "$f";; + image/*) "$IVIEWER" "$f";; + *) xdg-open "$f";; +esac +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/open_config b/home-manager/soispha/config/lf/commands/scripts/open_config new file mode 100755 index 00000000..c99422f1 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/open_config @@ -0,0 +1,7 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +"$EDITOR" "$(bookmenu -b ~/.config/bookmenu/configs -f fzf -o)" # TODO implement this +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/restore_trash b/home-manager/soispha/config/lf/commands/scripts/restore_trash new file mode 100755 index 00000000..a7bf0094 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/restore_trash @@ -0,0 +1,7 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +trash list | fzf --multi | awk '{print $NF}' | xargs trash restore --match=exact +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/set_wall_paper b/home-manager/soispha/config/lf/commands/scripts/set_wall_paper new file mode 100755 index 00000000..45049283 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/set_wall_paper @@ -0,0 +1,10 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +die "No yet implemented" # TODO do what the 'die' says +#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv +#nohub swaybg -i "$f" +#feh --bg-max --no-fehbg "$f" +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/stripspace b/home-manager/soispha/config/lf/commands/scripts/stripspace new file mode 100755 index 00000000..91714712 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/stripspace @@ -0,0 +1,31 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +files=$(mktmp); +echo "$fx" > "$files"; + +awk_source=$(mktmp); +cat << OFT > "$awk_source" +BEGIN {FS=" "} +{for (i=1; i != NF + 1; i++) + if (i == NF) { + parts[i]=tolower(\$i); + } else { + parts[i]=tolower(\$i"_"); + } +} +END {for (i in parts) printf parts[i]} +OFT + +while read -r file; do + dirty_name=$(mktmp) + basename "$file" > "$dirty_name"; + clean_name=$(awk -f "$awk_source" "$dirty_name"); + + [ -e "$clean_name" ] && die "file \"$clean_name\" already exists!"; + mv "$(cat "$dirty_name")" "$clean_name" || die "Move failed"; + lf -remote 'send reload' +done < "$files"; +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/trash b/home-manager/soispha/config/lf/commands/scripts/trash new file mode 100755 index 00000000..7f477550 --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/trash @@ -0,0 +1,26 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +trash_output=$(mktmp); +expected_error_output=$(mktmp); + +while read -r file; do + set -- "$@" "$file" +done < "$(tmp "echo '$fx'")" + +# TODO why are we using trashy at all, when trash-cli can do everything? +# try trashy first, trough nix because both trashy and trash-cli provide a trash command, which conflicts +nix run nixpkgs#trashy -- put "$@" 2> "$trash_output"; + +cat << EOF > "$expected_error_output"; +[1;31merror:[0m Error during a \`trash\` operation: Unknown { description: "Path: '\"/.Trash-1000\"'. Message: Permission denied (os error 13)" } +EOF + +if [ "$(cat "$expected_error_output")" = "$(cat "$trash_output")" ];then + warning "Deleting with trash-cli to the /.Trash folder"; + # this file could not be trashed because it is on the tempfs volume, trash-cli can do this this + trash-put "$@"; +fi +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/unarchive b/home-manager/soispha/config/lf/commands/scripts/unarchive new file mode 100755 index 00000000..69cc601c --- /dev/null +++ b/home-manager/soispha/config/lf/commands/scripts/unarchive @@ -0,0 +1,22 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# extract the current file with the right command +# (xkcd link: https://xkcd.com/1168/) +set -f +# TODO add support for multiple files at once +case "$f" in + *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf "$f";; + *.tar.gz|*.tgz) tar xzvf "$f";; + *.tar.xz|*.txz) tar xJvf "$f";; + *.zip) unzip "$f";; + *.rar) + die "rar is a unfree format!" + #unrar x $f + ;; + *.7z) 7z x "$f";; + *) die "Unsupported format" ;; +esac +# vim: ft=sh diff --git a/home-manager/soispha/config/lf/default.nix b/home-manager/soispha/config/lf/default.nix new file mode 100644 index 00000000..9f43a891 --- /dev/null +++ b/home-manager/soispha/config/lf/default.nix @@ -0,0 +1,52 @@ +{ + pkgs, + sysLib, + nixosConfig, + shell_library, + system, + ... +}: let + commands = import ./commands {inherit pkgs sysLib shell_library system;}; + keybindings = import ./keybindings {inherit nixosConfig;}; +in { + xdg.configFile."lf/icons".source = ./icons; + xdg.configFile."lf/colors".source = ./colors; + + # TODO add the systemd tempfile option here + + programs.lf = { + enable = true; + + inherit commands keybindings; + + previewer = { + keybinding = "i"; + source = "${pkgs.ctpv}/bin/ctpv"; + }; + settings = { + # TODO this needs to be added to nixos: + #autoquit = true; # quit the server, if no clients are left + #dirpreviews = true; # preview for directories + + dircounts = true; # count things in directories TODO this has performance impact + drawbox = true; + # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; + errorfmt = "\\033[1;91m%s\\033[0m"; + hidden = true; # show hidden files + icons = true; + ifs = "\\n"; # internal field separator for shell commands + #info = "size"; # show the size of a directory + shell = "sh"; + shellopts = "-eu"; # e: exit on error; u: error for unset variables + }; + # TODO remove auto quit, if it has been added + extraConfig = '' + &${pkgs.ctpv}/bin/ctpv -s $id + cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id + set cleaner ${pkgs.ctpv}/bin/ctpvclear + + # close the server, after the last client exits + set autoquit true + ''; + }; +} diff --git a/home-manager/soispha/config/lf/icons b/home-manager/soispha/config/lf/icons new file mode 100644 index 00000000..7ef62a0b --- /dev/null +++ b/home-manager/soispha/config/lf/icons @@ -0,0 +1,357 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# default values from lf (with matching order) +# ln l # LINK +# or l # ORPHAN +# tw t # STICKY_OTHER_WRITABLE +# ow d # OTHER_WRITABLE +# st t # STICKY +# di d # DIR +# pi p # FIFO +# so s # SOCK +# bd b # BLK +# cd c # CHR +# su u # SETUID +# sg g # SETGID +# ex x # EXEC +# fi - # FILE + +# file types (with matching order) +ln # LINK +or # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow # OTHER_WRITABLE # nf-oct-file_directory +st t # STICKY +di # DIR # nf-oct-file_directory +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex # EXEC +fi # FILE # nf-fa-file_text_o + +# file extensions (vim-devicons) +*.styl +*.sass +*.scss +*.htm +*.html +*.slim +*.haml +*.ejs +*.css +*.less +*.md +*.mdx +*.markdown +*.rmd +*.json +*.webmanifest +*.js +*.mjs +*.jsx +*.rb +*.gemspec +*.rake +*.php +*.py +*.pyc +*.pyo +*.pyd +*.coffee +*.mustache +*.hbs +*.conf +*.ini +*.yml +*.yaml +*.toml +*.bat +*.mk +*.jpg +*.jpeg +*.bmp +*.png +*.webp +*.gif +*.ico +*.twig +*.cpp +*.c++ +*.cxx +*.cc +*.cp +*.c +*.cs +*.h +*.hh +*.hpp +*.hxx +*.hs +*.lhs +*.nix +*.lua +*.java +*.sh +*.fish +*.bash +*.zsh +*.ksh +*.csh +*.awk +*.ps1 +*.ml λ +*.mli λ +*.diff +*.db +*.sql +*.dump +*.clj +*.cljc +*.cljs +*.edn +*.scala +*.go +*.dart +*.xul +*.sln +*.suo +*.pl +*.pm +*.t +*.rss +'*.f#' +*.fsscript +*.fsx +*.fs +*.fsi +*.rs +*.rlib +*.d +*.erl +*.hrl +*.ex +*.exs +*.eex +*.leex +*.heex +*.vim +*.ai +*.psd +*.psb +*.ts +*.tsx +*.jl +*.pp +*.vue +*.elm +*.swift +*.xcplayground +*.tex +*.r +*.rproj +*.sol +*.pem + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee +*gruntfile.js +*gruntfile.ls +*gulpfile.coffee +*gulpfile.js +*gulpfile.ls +*mix.lock +*dropbox +*.ds_store +*.gitconfig +*.gitignore +*.gitattributes +*.gitlab-ci.yml +*.bashrc +*.zshrc +*.zshenv +*.zprofile +*.vimrc +*.gvimrc +*_vimrc +*_gvimrc +*.bashprofile +*favicon.ico +*license +*node_modules +*react.jsx +*procfile +*dockerfile +*docker-compose.yml +*rakefile +*config.ru +*gemfile +*makefile +*cmakelists.txt +*robots.txt + +# file names (case-sensitive adaptations) +*Gruntfile.coffee +*Gruntfile.js +*Gruntfile.ls +*Gulpfile.coffee +*Gulpfile.js +*Gulpfile.ls +*Dropbox +*.DS_Store +*LICENSE +*React.jsx +*Procfile +*Dockerfile +*Docker-compose.yml +*Rakefile +*Gemfile +*Makefile +*CMakeLists.txt + +# file patterns (vim-devicons) (patterns not supported in lf) +# .*jquery.*\.js$ +# .*angular.*\.js$ +# .*backbone.*\.js$ +# .*require.*\.js$ +# .*materialize.*\.js$ +# .*materialize.*\.css$ +# .*mootools.*\.js$ +# .*vimrc.* +# Vagrantfile$ + +# file patterns (file name adaptations) +*jquery.min.js +*angular.min.js +*backbone.min.js +*require.min.js +*materialize.min.js +*materialize.min.css +*mootools.min.js +*vimrc +Vagrantfile + +# archives or compressed (extensions from dircolors defaults) +*.tar +*.tgz +*.arc +*.arj +*.taz +*.lha +*.lz4 +*.lzh +*.lzma +*.tlz +*.txz +*.tzo +*.t7z +*.zip +*.z +*.dz +*.gz +*.lrz +*.lz +*.lzo +*.xz +*.zst +*.tzst +*.bz2 +*.bz +*.tbz +*.tbz2 +*.tz +*.deb +*.rpm +*.jar +*.war +*.ear +*.sar +*.rar +*.alz +*.ace +*.zoo +*.cpio +*.7z +*.rz +*.cab +*.wim +*.swm +*.dwm +*.esd + +# image formats (extensions from dircolors defaults) +*.jpg +*.jpeg +*.mjpg +*.mjpeg +*.gif +*.bmp +*.pbm +*.pgm +*.ppm +*.tga +*.xbm +*.xpm +*.tif +*.tiff +*.png +*.svg +*.svgz +*.mng +*.pcx +*.mov +*.mpg +*.mpeg +*.m2v +*.mkv +*.webm +*.ogm +*.mp4 +*.m4v +*.mp4v +*.vob +*.qt +*.nuv +*.wmv +*.asf +*.rm +*.rmvb +*.flc +*.avi +*.fli +*.flv +*.gl +*.dl +*.xcf +*.xwd +*.yuv +*.cgm +*.emf +*.ogv +*.ogx + +# audio formats (extensions from dircolors defaults) +*.aac +*.au +*.flac +*.m4a +*.mid +*.midi +*.mka +*.mp3 +*.mpc +*.ogg +*.ra +*.wav +*.oga +*.opus +*.spx +*.xspf + +# other formats +*.pdf diff --git a/home-manager/soispha/config/lf/keybindings/default.nix b/home-manager/soispha/config/lf/keybindings/default.nix new file mode 100644 index 00000000..bd11f3e3 --- /dev/null +++ b/home-manager/soispha/config/lf/keybindings/default.nix @@ -0,0 +1,125 @@ +{nixosConfig, ...}: { + # Remove some defaults + m = null; + "\"'\"" = null; + "'\"'" = null; + d = null; + c = null; + e = null; + j = null; + k = null; + l = null; + ";" = null; + + # File Openers + ee = "\$\$EDITOR \"$f\""; + u = "%\$IVIEWER \"$f\""; + cc = "\$sudo -e \"$f\""; + + # Archive Mappings + au = "unarchive"; + aa = "archive"; + + # Trash Mappings + dd = "trash"; + jc = "clear_trash"; + jr = "restore_trash"; + + # Broot Mapping + f = "fzf_jump"; + + # Dragon Mapping + dr = "dragon"; + ds = "dragon-stay"; + di = "dragon-individual"; + #dm = "mvdragon"; + #dc = "cpdragon"; + dl = "dlfile"; + + cs = "stripspace"; + + # Vim keys + h = "updir"; + t = "down"; + n = "up"; + s = "open"; + + # Basic Functions + "." = "set hidden!"; + DD = "delete"; + p = "paste"; + x = "cut"; + y = "copy"; + "<enter>" = "open"; + + mk = "mk_ln"; + mf = "mk_file"; + md = "mk_dir"; + ms = "mk_scr_default"; + mt = "mk_scr_temp"; + + ch = "chmod"; + bg = "set_wall_paper"; + o = "open_config"; + r = "rename"; + H = "top"; + L = "bottom"; + R = "reload"; + C = "clear"; + U = "unselect"; + + # Movement + gjr = "cd ~/.local/share/Trash/files"; + gus = "cd /run/user/${builtins.toString nixosConfig.users.users.soispha.uid}"; + + "gr." = "cd ~/repos"; + grn = "cd ~/repos/nix"; + grcc = "cd ~/repos/c"; + grcp = "cd ~/repos/cpp"; + grl = "cd ~/repos/lua"; + grr = "cd ~/repos/rust"; + grs = "cd ~/repos/shell"; + grjs = "cd ~/repos/java_script"; + grmd = "cd ~/repos/mark_down"; + grty = "cd ~/repos/typst"; + grte = "cd ~/repos/tex"; + grj = "cd ~/repos/java"; + gra = "cd ~/repos/awk"; + grpy = "cd ~/repos/python"; + grpe = "cd ~/repos/perl"; + grahk = "cd ~/repos/auto_hot_key"; + grh = "cd ~/repos/html"; + # ------------- + "gm." = "cd ~/media"; + gmp = "cd ~/media/pictures"; + gmd = "cd ~/media/downloads"; + gmm = "cd ~/media/music"; + gmi = "cd ~/media/isos"; + # ------------- + "gs." = "cd ~/school"; + gsi = "cd ~/school/infomatik"; + gsc = "cd ~/school/chemie"; + gse = "cd ~/school/english"; + gsgo = "cd ~/school/geographie"; + gsgs = "cd ~/school/geschichte"; + gskr = "cd ~/school/katholische_religion"; + gsmu = "cd ~/school/musik"; + gsma = "cd ~/school/mathematik"; + gsl = "cd ~/school/latein"; + gsd = "cd ~/school/deutsch"; + gsb = "cd ~/school/biologie"; + gsso = "cd ~/school/sozialkunde"; + gssp = "cd ~/school/sport"; + gspy = "cd ~/school/physik"; + gspi = "cd ~/school/philosophie"; + # ------------- + + gc = "cd ~/.config"; + gl = "cd ~/.local"; + gE = "cd /etc"; + + "gU." = "cd /usr"; + gUs = " cd /usr/share"; + + gt = "cd /tmp"; +} diff --git a/home-manager/soispha/config/mail/default.nix b/home-manager/soispha/config/mail/default.nix new file mode 100644 index 00000000..f934b68c --- /dev/null +++ b/home-manager/soispha/config/mail/default.nix @@ -0,0 +1,64 @@ +{ + config, + pkgs, + lib, + ... +}: let + non_public_accounts = import ./non_public_accounts.nix {inherit pkgs;}; + accounts = lib.recursiveUpdate {inherit soispha;} non_public_accounts; + + soispha = { + address = "soispha@vhack.eu"; + userName = "soispha@vhack.eu"; + realName = "Soispha"; + primary = true; + passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup account soispha@vhack.eu"; + aliases = [ + "admin@vhack.eu" + ]; + folders = { + }; + gpg = { + encryptByDefault = true; + key = "9606FC749FCE16360723D4ADA5E94010C3A642AD"; + signByDefault = true; + }; + signature = { + # TODO + }; + neomutt = { + enable = true; + }; + mbsync = { + enable = true; + create = "both"; + }; + himalaya = { + enable = true; + backend = "imap"; + sender = "smtp"; + settings = { + # TODO + }; + }; + smtp = { + host = "server1.vhack.eu"; + port = 465; + }; + imap = { + host = "server1.vhack.eu"; + port = 993; + }; + jmap = { + # TODO + }; + maildir = { + path = "soispha"; + }; + }; +in { + accounts.email = { + maildirBasePath = "${config.xdg.dataHome}/maildir"; + inherit accounts; + }; +} diff --git a/home-manager/soispha/config/mail/non_public_accounts.nix b/home-manager/soispha/config/mail/non_public_accounts.nix new file mode 100644 index 00000000..edd2f6ba --- /dev/null +++ b/home-manager/soispha/config/mail/non_public_accounts.nix Binary files differdiff --git a/home-manager/soispha/config/mako/default.nix b/home-manager/soispha/config/mako/default.nix new file mode 100644 index 00000000..e6eb5eb3 --- /dev/null +++ b/home-manager/soispha/config/mako/default.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + ... +}: { + services.mako = { + enable = true; + backgroundColor = "#2e3440"; + borderColor = "#88c0d0"; + borderRadius = 25; + borderSize = 2; + defaultTimeout = 5000; + font = "Source Code Pro 10"; + width = 500; + height = 500; + icons = true; + ignoreTimeout = true; + layer = "overlay"; + markup = true; # TODO + maxIconSize = 64; + sort = "-time"; + extraConfig = '' + [urgency=low] + border-color=#cccccc + + [urgency=normal] + border-color=#d08770 + + [urgency=high] + border-size=3 + border-color=#bf616a + default-timeout=0 + + [urgency=critical] + border-size=4 + border-color=#bf616a + default-timeout=0 + + [category=mpd] + default-timeout=2000 + group-by=category + ''; + }; +} diff --git a/home-manager/soispha/config/mbsync/default.nix b/home-manager/soispha/config/mbsync/default.nix new file mode 100644 index 00000000..6be4f57c --- /dev/null +++ b/home-manager/soispha/config/mbsync/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: { + # TODO I have no clue if both are needed, but it looks neat, right? + programs.mbsync = { + enable = true; + }; + services.mbsync = { + enable = true; + # TODO enable after isync 1.5 drops + #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf"; + }; + # Disable the timer, and only activate it on neomutt start + systemd.user.timers.mbsync = lib.mkForce {}; +} diff --git a/home-manager/soispha/config/mpd/default.nix b/home-manager/soispha/config/mpd/default.nix new file mode 100644 index 00000000..bbd345a7 --- /dev/null +++ b/home-manager/soispha/config/mpd/default.nix @@ -0,0 +1,39 @@ +{ + config, + pkgs, + lib, + osConfig, + ... +}: let + dataDir = "${config.xdg.dataHome}/mpd"; + playlistDirectory = "${dataDir}/playlists"; + runtimeDir = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd"; +in { + systemd.user.services.mpd.Service.ExecStartPre = lib.mkForce '' + ${pkgs.coreutils}/bin/mkdir -p "${dataDir}" "${playlistDirectory}" "${runtimeDir}" + ''; + services.mpd = { + enable = true; + inherit dataDir; + musicDirectory = "~/media/music"; + network = { + listenAddress = "${runtimeDir}/socket"; + }; + extraConfig = '' + metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc,comment" + auto_update "yes" + + audio_output { + type "pipewire" + name "pipewire" + } + #database { + # plugin "simple" + # path "~/.local/share/mpd/db + # cache_directory "~/.local/share/mpd/cache" + #} + + filesystem_charset "UTF-8" + ''; + }; +} diff --git a/home-manager/soispha/config/mpd/mpdconf.example b/home-manager/soispha/config/mpd/mpdconf.example new file mode 100644 index 00000000..eaa5e641 --- /dev/null +++ b/home-manager/soispha/config/mpd/mpdconf.example @@ -0,0 +1,418 @@ +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the +# available audio files and add them to the daemon's online database. This +# setting defaults to the XDG directory, otherwise the music directory will be +# be disabled and audio files will only be accepted over ipc socket (using +# file:// protocol) or streaming files over an accepted protocol. +# +#music_directory "~/music" +# +# This setting sets the MPD internal playlist directory. The purpose of this +# directory is storage for playlists created by MPD. The server will use +# playlist files not created by the server but only if they are in the MPD +# format. This setting defaults to playlist saving being disabled. +# +#playlist_directory "~/.mpd/playlists" +# +# This setting sets the location of the MPD database. This file is used to +# load the database at server start up and store the database while the +# server is not up. This setting defaults to disabled which will allow +# MPD to accept files over ipc socket (using file:// protocol) or streaming +# files over an accepted protocol. +# +#db_file "~/.mpd/database" + +# These settings are the locations for the daemon log files for the daemon. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +# If you use systemd, do not configure a log_file. With systemd, MPD +# defaults to the systemd journal, which is fine. +# +#log_file "~/.mpd/log" + +# This setting sets the location of the file which stores the process ID +# for use of mpd --kill and some init scripts. This setting is disabled by +# default and the pid file will not be stored. +# +# If you use systemd, do not configure a pid_file. +# +#pid_file "~/.mpd/pid" + +# This setting sets the location of the file which contains information about +# most variables to get MPD back into the same general shape it was in before +# it was brought down. This setting is disabled by default and the server +# state will be reset on server start up. +# +#state_file "~/.mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +#sticker_file "~/.mpd/sticker.sql" +# +############################################################################### + + +# General music daemon options ################################################ +# +# This setting specifies the user that MPD will run as. MPD should never run as +# root and you may use this setting to make MPD change its user ID after +# initialization. This setting is disabled by default and MPD is run as the +# current user. +# +#user "nobody" +# +# This setting specifies the group that MPD will run as. If not specified +# primary group of user specified with "user" setting will be used (if set). +# This is useful if MPD needs to be a member of group such as "audio" to +# have permission to use sound card. +# +#group "nogroup" +# +# This setting sets the address for the daemon to listen on. Careful attention +# should be paid if this is assigned to anything other than the default, any. +# This setting can deny access to control of the daemon. Not effective if +# systemd socket activation is in use. +# +# For network +#bind_to_address "any" +# +# And for Unix Socket +#bind_to_address "~/.mpd/socket" +# +# This setting is the TCP port that is desired for the daemon to get assigned +# to. +# +#port "6600" +# +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", +# "warning" and "error". +# +#log_level "notice" +# +# Setting "restore_paused" to "yes" puts MPD into pause mode instead +# of starting playback after startup. +# +#restore_paused "no" +# +# This setting enables MPD to create playlists in a format usable by other +# music players. +# +#save_absolute_paths_in_playlists "no" +# +# This setting defines a list of tag types that will be extracted during the +# audio file discovery process. The complete list of possible values can be +# found in the user manual. +#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +# +# This example just enables the "comment" tag without disabling all +# the other supported tags: +#metadata_to_use "+comment" +# +# This setting enables automatic update of MPD's database when files in +# music_directory are changed. +# +#auto_update "yes" +# +# Limit the depth of the directories being watched, 0 means only watch +# the music directory itself. There is no limit by default. +# +#auto_update_depth "3" +# +############################################################################### + + +# Symbolic link behavior ###################################################### +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links outside of the configured music_directory. +# +#follow_outside_symlinks "yes" +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links inside of the configured music_directory. +# +#follow_inside_symlinks "yes" +# +############################################################################### + + +# Zeroconf / Avahi Service Discovery ########################################## +# +# If this setting is set to "yes", service information will be published with +# Zeroconf / Avahi. +# +#zeroconf_enabled "yes" +# +# The argument to this setting will be the Zeroconf / Avahi unique name for +# this MPD server on the network. %h will be replaced with the hostname. +# +#zeroconf_name "Music Player @ %h" +# +############################################################################### + + +# Permissions ################################################################# +# +# If this setting is set, MPD will require password authorization. The password +# setting can be specified multiple times for different password profiles. +# +#password "password@read,add,control,admin" +# +# This setting specifies the permissions a user has who has not yet logged in. +# +#default_permissions "read,add,control,admin" +# +############################################################################### + + +# Database ####################################################################### +# +# An example of a database section instead of the old 'db_file' setting. +# It enables mounting other storages into the music directory. +# +#database { +# plugin "simple" +# path "~/.local/share/mpd/db +# cache_directory "~/.local/share/mpd/cache" +#} +# +# An example of database config for a satellite setup +# +#music_directory "nfs://fileserver.local/srv/mp3" +#database { +# plugin "proxy" +# host "other.mpd.host" +# port "6600" +#} + +# Input ####################################################################### +# +input { + plugin "curl" +# proxy "proxy.isp.com:8080" +# proxy_user "user" +# proxy_password "password" +} + +# +############################################################################### + +# Audio Output ################################################################ +# +# MPD supports various audio output types, as well as playing through multiple +# audio outputs at the same time, through multiple audio_output settings +# blocks. Setting this block is optional, though the server will only attempt +# autodetection for one sound card. +# +# An example of an ALSA output: +# +#audio_output { +# type "alsa" +# name "My ALSA Device" +## device "hw:0,0" # optional +## mixer_type "hardware" # optional +## mixer_device "default" # optional +## mixer_control "PCM" # optional +## mixer_index "0" # optional +#} +# +# An example of an OSS output: +# +#audio_output { +# type "oss" +# name "My OSS Device" +## device "/dev/dsp" # optional +## mixer_type "hardware" # optional +## mixer_device "/dev/mixer" # optional +## mixer_control "PCM" # optional +#} +# +# An example of a shout output (for streaming to Icecast): +# +#audio_output { +# type "shout" +# encoder "vorbis" # optional +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" +# quality "5.0" +# bitrate "128" +# format "44100:16:1" +## protocol "icecast2" # optional +## user "source" # optional +## description "My Stream Description" # optional +## url "http://example.com" # optional +## genre "jazz" # optional +## public "no" # optional +## timeout "2" # optional +## mixer_type "software" # optional +#} +# +# An example of a recorder output: +# +#audio_output { +# type "recorder" +# name "My recorder" +# encoder "vorbis" # optional, vorbis or lame +# path "/var/lib/mpd/recorder/mpd.ogg" +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +#} +# +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} +# +# An example of a pulseaudio output (streaming to a remote pulseaudio server) +# +#audio_output { +# type "pulse" +# name "My Pulse Output" +## server "remote_server" # optional +## sink "remote_server_sink" # optional +## media_role "media_role" #optional +#} +# +# An example of a winmm output (Windows multimedia API). +# +#audio_output { +# type "winmm" +# name "My WinMM output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +#} +# +# An example of a wasapi output (Windows multimedia API). +# +#audio_output { +# type "wasapi" +# name "My WASAPI output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## Exclusive mode blocks all other audio source, and get best audio quality without resampling. +## exclusive "no" # optional +## Enumerate all devices in log. +## enumerate "no" # optional +#} +# +# An example of an openal output. +# +#audio_output { +# type "openal" +# name "My OpenAL output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +#} +# +# An example of an sndio output. +# +#audio_output { +# type "sndio" +# name "sndio output" +# mixer_type "hardware" +#} +# +# An example of an OS X output: +# +#audio_output { +# type "osx" +# name "My OS X Device" +## device "Built-in Output" # optional +## channel_map "-1,-1,0,1" # optional +#} +# +## Example "pipe" output: +# +#audio_output { +# type "pipe" +# name "my pipe" +# command "aplay -f cd 2>/dev/null" +## Or if you're want to use AudioCompress +# command "AudioCompress -m | aplay -f cd 2>/dev/null" +## Or to send raw PCM stream through PCM: +# command "nc example.org 8765" +# format "44100:16:2" +#} +# +## An example of a null output (for no audio output): +# +#audio_output { +# type "null" +# name "My Null Output" +# mixer_type "none" # optional +#} +# +############################################################################### + + +# Normalization automatic volume adjustments ################################## +# +# This setting specifies the type of ReplayGain to use. This setting can have +# the argument "off", "album", "track" or "auto". "auto" is a special mode that +# chooses between "track" and "album" depending on the current state of +# random playback. If random playback is enabled then "track" mode is used. +# See <https://wiki.hydrogenaud.io/index.php?title=Replaygain> for +# more details about ReplayGain. +# This setting is off by default. +# +#replaygain "album" +# +# This setting sets the pre-amp used for files that have ReplayGain tags. By +# default this setting is disabled. +# +#replaygain_preamp "0" +# +# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. +# By default this setting is disabled. +# +#replaygain_missing_preamp "0" +# +# This setting enables or disables ReplayGain limiting. +# MPD calculates actual amplification based on the ReplayGain tags +# and replaygain_preamp / replaygain_missing_preamp setting. +# If replaygain_limit is enabled MPD will never amplify audio signal +# above its original level. If replaygain_limit is disabled such amplification +# might occur. By default this setting is enabled. +# +#replaygain_limit "yes" +# +# This setting enables on-the-fly normalization volume adjustment. This will +# result in the volume of all playing audio to be adjusted so the output has +# equal "loudness". This setting is disabled by default. +# +#volume_normalization "no" +# +############################################################################### + +# Character Encoding ########################################################## +# +# If file or directory names do not display correctly for your locale then you +# may need to modify this setting. +# +#filesystem_charset "UTF-8" +# +############################################################################### diff --git a/home-manager/soispha/config/mpv/default.nix b/home-manager/soispha/config/mpv/default.nix new file mode 100644 index 00000000..63e36117 --- /dev/null +++ b/home-manager/soispha/config/mpv/default.nix @@ -0,0 +1,10 @@ +{ + config, + pkgs, + ... +}: { + programs.mpv = { + enable = true; + # TODO add config + }; +} diff --git a/home-manager/soispha/config/mumble/Mumble.conf b/home-manager/soispha/config/mumble/Mumble.conf new file mode 100644 index 00000000..2d895f41 --- /dev/null +++ b/home-manager/soispha/config/mumble/Mumble.conf @@ -0,0 +1,67 @@ +[General] +databaselocation=/home/soispha/.local/share/Mumble/Mumble/mumble.sqlite +lastupdate=3 + +[audio] +headphone=true +input=PipeWire +loudness=1549 +output=PipeWire +quality=72000 +vadmax=@Variant(\0\0\0\x87?Kw\x97) +vadmin=@Variant(\0\0\0\x87?7\x1e\xd4) + +[messages] +10\log=13 +12\log=13 +14\log=13 +15\log=13 +17\log=13 +18\log=13 +19\log=13 +2\log=13 +20\log=13 +21\log=13 +22\log=13 +23\log=13 +25\log=13 +26\log=13 +27\log=13 +28\log=13 +29\log=13 +30\log=13 +31\log=13 +5\log=13 +6\log=13 +9\log=13 +size=32 + +[messagesounds] +size=31 + +[net] +certificate="@ByteArray(0\x82\tX\x2\x1\x3\x30\x82\t\xe\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\b\xff\x4\x82\b\xfb\x30\x82\b\xf7\x30\x82\x3\xad\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x3\x9e\x4\x82\x3\x9a\x30\x82\x3\x96\x30\x82\x3\x92\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x3\xa0\x82\x3+0\x82\x3'\x6\n*\x86H\x86\xf7\r\x1\t\x16\x1\xa0\x82\x3\x17\x4\x82\x3\x13\x30\x82\x3\xf\x30\x82\x1\xf7\xa0\x3\x2\x1\x2\x2\x1\x1\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x30\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x1e\x17\r230710132716Z\x17\r430705132716Z0\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x82\x1\"0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x3\x82\x1\xf\0\x30\x82\x1\n\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\xa3h0f0\f\x6\x3U\x1d\x13\x1\x1\xff\x4\x2\x30\0\x30\x13\x6\x3U\x1d%\x4\f0\n\x6\b+\x6\x1\x5\x5\a\x3\x2\x30\x1d\x6\x3U\x1d\xe\x4\x16\x4\x14\xb9\x41\x19t\x16\x18~\xe8\v\xa9\x9b\x86i\x86\xeP%\xd7\n\xc9\x30\"\x6\t`\x86H\x1\x86\xf8\x42\x1\r\x4\x15\x16\x13Generated by Mumble0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x3\x82\x1\x1\0\x91+\r'hS\xc2\x12k\x13O\xb2\"\x85\xd6w\x96\x8a\x97\x46\xee\x95Q\x8b\x8b\t\x8a\xfcH\xab\x30\x1dxV\xc9\xf5\x80\x42;'o\xf1\xd1\xf2\xfb\x18\xe2+\x8d\x39 \xc3\xe\x44\xa9\t\xe2i\x8a\xa7?#\xcd]0\xf4\x1d\x4\a\xd6\x87\x62\xe2\xd8\x34\xb6\xcf\x89\xf2\v\xf1\x8b\xc6\xf8\x8f\x94H/\xfa`\x9d\xb5\xac\x66H\xef\xf4\tJ\xfeHg]!\xed\n\xaf\xa8nd@y\xe8>A\x10\xc4>\xc3\xf7\xe3\xffW\x90T\x87\x94[\x7fg0+p\xdd\x3\x8d\xdb\x80\f?\xe9\xf9l5\xac)z+4R\xbc\xf3\xe1\x82\xde\xc3u\xb2\xa1s\xe2\xbb\xdcp<I\xff\x9d\xc6\xa7\xfe\xda{\xe7\xee\xe4\xeb\xc2\xfc\x9d\x1d\x41T\xee\x91\xbe\x9f\x87\x1\x62\xf8\xc3\xa5+\xc8h\xe2\xedz\xd7\x37\xb8\xbb\xf2\x1b%\xef\xfd\xa5\x36\x35Y\xfb\xf9\xa8\x6|\x8ep\xb5\x64\x14L+\f\xad\a5\x5\xf6\xe9\xcb\xf1\xac\x96\xe0lZ^PP0\xc6\xb2\n\xd6ny\xcc\x9aZ\xb1\xc9\x35\x10\x10\x31T0#\x6\t*\x86H\x86\xf7\r\x1\t\x15\x31\x16\x4\x14\x9f\xdc\xf9\x38\xc2\x8a\x1c\xfe\x6}\xf6\x64\x62>L#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0\x82\x5\x42\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x5\x33\x4\x82\x5/0\x82\x5+0\x82\x5'\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x1\xa0\x82\x4\xc0\x30\x82\x4\xbc\x2\x1\0\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x4\x82\x4\xa6\x30\x82\x4\xa2\x2\x1\0\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\x2\x82\x1\0\x4\xd6\xf2\x66\v\xe0\xae\xc6(\xccw\x91Ub\xfe\xd8\x7f\x97\x92\xa2Imc\x16\xaf}y\x8a\x14,\xe3\x90\xbc\x63!\xb2\aQ\xdbQ\x1f\xbc\xbc\x62\\\xd0\xc2\xa5\xf2-\xcc\xdc\x19\xd0\xe4\xcc\x8ey\xb7\xd1\xac\xcfP\x8du\x94\xa4\x3u\x1b;\xe5\xa2\x61\x12\xd1R\xaaZ\v\xe7\x8d\xf0\xabl\xce\xba\x99\xbd\x95\xdbpkCJr\xfb\xc5P9\x1e\xf\xb1iI9&\xeb\x62\x8a#\xa7\x17\xcbw\x92\xf9\xf7JZ\xa6;F\xb3\xba\xb1H\x89]uU7\x1e\xd7\xf6U`\x8d\xa1\x1aG7\x11\x31\xbf\xf4\xdb\x32\x63\xbf\x3\xad&h\x82\x9b\xe7\x19/\xf6\r\x8c\x89\xc6\xd0\x1d\0\x87\t|\xc0\xf2\x8f\xbb\x87_8{\xf2\xc7\x8a\x34)\xe3\xf1\xcc(\xf4\xee\xeb($\x5\x84\xaf\x1\xaa\xf7\xff\x9b\x15h\x2y\xb3\x91\xba,Oq\xc9$\x81\x11Zg\xc4I3\v\xeay\f\xf0\x33\xc6p\xea\xc6\x9d\xac\xaa\xedp\xa7!\xcbHf5\xa0i\xbdo@\xb8![\x7f\xea\xad\x6\x31p\x81\x61\x2\x81\x81\0\xdc\x8d}{\xc3\x31\xb6(F\xc5\x36\x9b\xba\x66\xb1\xce\r_\x90\xc6\x1f\x87\x37\x84m\xd1\a8\xc0\v9\xe0\x8bm\xaf\x64\xbe\x81\xa8\xe7\xaf\x19\x43,vj\xaf!9rz\x87\"\xca\xbf\xcf\x16\x88\x46t\xbd\x12\xaa;\xf4x_\x1b\xb3\x90\b\xb6\xf6\xec\x1f\x95\x62\xac\xfa\x1b\xae\xa2\xa7oA\x9bhOW\xa8\x44\\\xadz T\xe3\x43\x46\x99\x98\xb4{*\"\xdb\xd9\xc8\xd2\x15\n4\"\x8d\x96$\x17\xfd^\xf7\x84\x93\x7fw{o\0\xe1\x2\x81\x81\0\xd0hNA\xc3\x9e\x93&iq\x1dQ\xb6\xc6\x1c\x32\xf3\xfc c&Y\xe7|\xbeq2P\xe1\xdb\x97\xf8\x9fI(\x98\x9d\xf1\xfe\xb6\xf\x90\xa5\xebi>\x14\x6\xd8.\xf4\xce\x86\x9d*\x87 \xf9X\x4\xdcZ\xf9g\x3\x98H{\xdf\x66\xde\xd6zr\xecG_\x14t\x1dm%P\xe5\xea\x8e\x6\xa2. \xa1\xd7\xd7W]\xdd\x15\x6\xcf+/\x11\vel\xd3\xe8\xc3/\xbc\x1f\xc3n\xd4\xb8\x62j\xf5\xc0\xc0\x89\xe3z\xb8\x36\xd5\xb2\xa3\x2\x81\x80z`W\xdc\x30\x36\x89(W\xfc]\x8c\x93% K\x80\xc8\"\0\x8c\xc5\xee\\ \xc2\xf7\n\xda$`|\xe3`}\r\x9dW<m1\x8f\x6\xe2\xc8\xe1\xf1\x42\xb2)\x7f+4v\xe3n\xf8\xc5\xac\xb2\x61\xa6\xd5\xa6\x66\xc3\xd3\xa1\xff\x44PQ\x95\x38\xf7]`_2w\xe1\xb2\x86\xcd\b\xce>V\xa8\0\xc9\xcd\xd2\xc4\f\xe4\x8d%k+\x16\xbc.\n\xf7\x44\x9d\xd6\xfc\x1a\x88\x8a\xdd\x11J\xd9\xc4%\xe6g\xd8\xbc.\xe2\x11/J\x81\x2\x81\x80\x63;W\xf\xbf:1,\x98\x6\x31\x4\xa8wz\x13\xd4\xd2\x97\x5>\xcc\x8e\tz\x90\x61y\xdb\xa0\xf8\xa2|\r\x94\x93\xde\x98\xcc\x44\x19\xf3\x30\xdd\x7fu\xfc\x89)\xc4i\xf2\x30l\x83\x44\x66\x31\xf3t\x15\f\b6\xc1\xa2o\xd8\xf3\x8d\x82\xcb\x32\xf0\xa7\x8ap>G\xef~\xf9\xc6\xa4\x42\xe3\xafJ\xe7\x95\xc8\x1a\x2\xc1\xe9\xc2\x8b\xf1{\x11?\xce\xe8\xd3\x39WI<.\xedo^Y\xd6U\x99\x1e\xfe\xb6\xf1\xb6v'\a\xb1\xac\\\xeb\x2\x81\x80@\x19\xc4\x32&\xcb\xc1\xca\x10K\xdf\x45\xf9\xf\x1d\x85\x39\x65\xdc\x33\x45\xbe\xac\x97~;\xe2m-\xd6\x9b\x82\x1\xbd\x90'W\xf5\xf5\xce\x35\xd7\xb4\xcdidTiP\\-vG+`\xb5u\xb7\x14\x44\xe1\xd9\xd3\r\x81\xb0GL\xe1U\xe3\xf0\xaa\xd1\x8f\xc6\"\xa5S\xb6\xbf\x4\x1a\xc4\xe0|\x8d\xa2+y(-\xad\ty\xd5\xe2g\xd3\x8c\xcdl\x96g3\xfe\x80\xb7|b[\xca\xb2\xbf\x61\xf7\x9c\x65\x30\x61\xa0\x35\xf6W\xb4\xcc\xdd\x34\x31T0#\x6\t*\x86H\x86\xf7\r\x1\t\x15\x31\x16\x4\x14\x9f\xdc\xf9\x38\xc2\x8a\x1c\xfe\x6}\xf6\x64\x62>L#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0A010\r\x6\t`\x86H\x1\x65\x3\x4\x2\x1\x5\0\x4 Fm\xb6/lL\x18\x1b!\xfa+x\xb5\xd9?GrR\xb7\xd3\x90\xc1N)L\x9c\xc7')\xe^\xbe\x4\b\x8b\x2\xb2\xb2\x97\b\x8a\xf6\x2\x2\b\0)" +framesperpacket=1 + +[overlay] +blacklist=@Invalid() +blacklistexclude=@Invalid() +launchers=@Invalid() +launchersexclude=@Invalid() +paths=@Invalid() +pathsexclude=@Invalid() +version=1.4.0 +whitelist=@Invalid() +whitelistexclude=@Invalid() + +[shortcuts] +size=0 + +[ui] +HighContrast=true +connect\geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m)" +connect\header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2&\0\0\0\x3\x1\x1\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x3\0\0\x1w\0\0\0\x1\0\0\0\x1\0\0\0S\0\0\0\x1\0\0\0\x3\0\0\0\\\0\0\0\x1\0\0\0\x3\0\0\x3\xe8\0\0\0\0\x64) +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa\0\0\n\0\0\0\0\0\0\0\f\xde\0\0\x1\xb2\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa) +header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2\xb0\0\0\0\x1\x1\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x1\0\0\x2\xb0\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64) +server=mumble.vhack.eu +state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\0\0\0\x1\0\0\0\x3\xbd\xfc\x2\0\0\0\x2\xfb\0\0\0\f\0q\0\x64\0w\0L\0o\0g\x1\0\0\0>\0\0\x3\xa0\0\0\0z\0\xff\xff\xff\xfb\0\0\0\xe\0q\0\x64\0w\0\x43\0h\0\x61\0t\x1\0\0\x3\xe2\0\0\0\x19\0\0\0\x19\0\0\0\x19\0\0\x2\xb6\0\0\x3\xbd\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x1a\0q\0t\0I\0\x63\0o\0n\0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) diff --git a/home-manager/soispha/config/mumble/default.nix b/home-manager/soispha/config/mumble/default.nix new file mode 100644 index 00000000..6fa524dc --- /dev/null +++ b/home-manager/soispha/config/mumble/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."Mumble/Mumble.conf".source = ./Mumble.conf; +} diff --git a/home-manager/soispha/config/neomutt/default.nix b/home-manager/soispha/config/neomutt/default.nix new file mode 100644 index 00000000..e4fbcb39 --- /dev/null +++ b/home-manager/soispha/config/neomutt/default.nix @@ -0,0 +1,168 @@ +{pkgs, ...}: { + programs.neomutt = { + enable = true; + package = pkgs.writeShellScriptBin "neomutt" '' + systemctl --user start mbsync.service; + ${pkgs.neomutt}/bin/neomutt; + ''; + vimKeys = false; # see the modified ones below + checkStatsInterval = 60; + binds = [ + #------------------------------------------------------------ + # Vi Key Bindings (taken from their configuration, modified for dvorak) + #------------------------------------------------------------ + + # Moving around + { + action = "noop"; + key = "g"; + map = ["attach" "browser" "index"]; + } + { + action = "first-entry"; + key = "gg"; + map = ["attach" "browser" "index"]; + } + { + action = "last-entry"; + key = "G"; + map = ["attach" "browser" "index"]; + } + { + action = "noop"; + key = "g"; + map = ["pager"]; + } + { + action = "top"; + key = "gg"; + map = ["pager"]; + } + { + action = "bottom"; + key = "G"; + map = ["pager"]; + } + { + action = "previous-line"; + key = "n"; + map = ["pager"]; + } + { + action = "next-line"; + key = "t"; + map = ["pager"]; + } + + # Scrolling + { + action = "next-page"; + key = "\\CF"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "previous-page"; + key = "\\CB"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "half-up"; + key = "\\Cu"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "half-down"; + key = "\\Cd"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "next-line"; + key = "\\Ce"; + map = ["browser" "pager"]; + } + { + action = "previous-line"; + key = "\\Cy"; + map = ["browser" "pager"]; + } + { + action = "next-line"; + key = "\\Ce"; + map = ["index"]; + } + { + action = "previous-line"; + key = "\\Cy"; + map = ["index"]; + } + + { + action = "noop"; + key = "d"; + map = ["pager" "index"]; + } + { + action = "delete-message"; + key = "dd"; + map = ["pager" "index"]; + } + + # Mail & Reply + { + # Doesn't work currently + action = "list-reply"; + key = "\\Cm"; + map = ["index"]; + } + + # Threads + { + action = "search-opposite"; + key = "N"; + map = ["browser" "pager" "index"]; + } + { + action = "delete-thread"; + key = "dT"; + map = ["pager" "index"]; + } + { + action = "delete-subthread"; + key = "dt"; + map = ["pager" "index"]; + } + { + action = "next-thread"; + key = "gt"; + map = ["pager" "index"]; + } + { + action = "previous-thread"; + key = "gT"; + map = ["pager" "index"]; + } + { + action = "collapse-thread"; + key = "za"; + map = ["index"]; + } + { + # Missing: folddisable/foldenable + action = "collapse-all"; + key = "zA"; + map = ["index"]; + } + + { + action = "search-next"; + key = "l"; + map = ["index"]; + } + { + action = "limit"; + key = "f"; + map = ["index"]; + } + ]; + }; +} diff --git a/home-manager/soispha/config/neovim/default.nix b/home-manager/soispha/config/neovim/default.nix new file mode 100644 index 00000000..c84b6aaa --- /dev/null +++ b/home-manager/soispha/config/neovim/default.nix @@ -0,0 +1,8 @@ +{ + config, + pkgs, + neovim_config, + ... +}: { + xdg.configFile."nvim".source = neovim_config; +} diff --git a/home-manager/soispha/config/nheko/default.nix b/home-manager/soispha/config/nheko/default.nix new file mode 100644 index 00000000..fd147c0b --- /dev/null +++ b/home-manager/soispha/config/nheko/default.nix @@ -0,0 +1,13 @@ +{ + config, + nixosConfig, + lib, + ... +}: { + config = lib.mkIf nixosConfig.soispha.secrets.enable { + xdg.configFile."nheko/nheko.conf".source = config.lib.file.mkOutOfStoreSymlink nixosConfig.age.secrets.nheko.path; + programs.nheko = { + enable = true; + }; + }; +} diff --git a/home-manager/soispha/config/npm/.npmrc b/home-manager/soispha/config/npm/.npmrc new file mode 100644 index 00000000..d0d846bd --- /dev/null +++ b/home-manager/soispha/config/npm/.npmrc @@ -0,0 +1,6 @@ +scripts-prepend-node-path=true +node_gyp= +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +tmp=${XDG_RUNTIME_DIR}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/home-manager/soispha/config/npm/default.nix b/home-manager/soispha/config/npm/default.nix new file mode 100644 index 00000000..7b4bb6a1 --- /dev/null +++ b/home-manager/soispha/config/npm/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."npm/.npmrc".source = ./.npmrc; +} diff --git a/home-manager/soispha/config/python/default.nix b/home-manager/soispha/config/python/default.nix new file mode 100644 index 00000000..eeaccdcf --- /dev/null +++ b/home-manager/soispha/config/python/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."python/pythonrc".source = ./pythonrc; +} diff --git a/home-manager/soispha/config/python/pythonrc b/home-manager/soispha/config/python/pythonrc new file mode 100644 index 00000000..38c48e0f --- /dev/null +++ b/home-manager/soispha/config/python/pythonrc @@ -0,0 +1,11 @@ +import os +import atexit +import readline + +history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history') +readline.read_history_file(history) + +def write_history(): + readline.write_history_file(history) + +atexit.register(write_history) diff --git a/home-manager/soispha/config/rclone/default.nix b/home-manager/soispha/config/rclone/default.nix new file mode 100644 index 00000000..bd0c1ac2 --- /dev/null +++ b/home-manager/soispha/config/rclone/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."rclone/rclone.conf".source = ./rclone.conf; +} diff --git a/home-manager/soispha/config/rclone/rclone.conf b/home-manager/soispha/config/rclone/rclone.conf new file mode 100644 index 00000000..9e1c4f08 --- /dev/null +++ b/home-manager/soispha/config/rclone/rclone.conf @@ -0,0 +1,10 @@ +[vhack1] +type = sftp +host = server1.vhack.eu +user = soispha +key_use_agent = true +known_hosts_file = ~/.local/share/ssh/known_hosts +shell_type = unix +md5sum_command = md5sum +sha1sum_command = sha1sum + diff --git a/home-manager/soispha/config/ssh/default.nix b/home-manager/soispha/config/ssh/default.nix new file mode 100644 index 00000000..7160adac --- /dev/null +++ b/home-manager/soispha/config/ssh/default.nix @@ -0,0 +1,15 @@ +{config, ...}: { + programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = "${config.xdg.dataHome}/ssh/known_hosts"; + matchBlocks = { + "codeberg.org" = { + # TODO: Remove this once they fix their ipv6 config + addressFamily = "inet"; + }; + }; + }; +} diff --git a/home-manager/soispha/config/swayidle/config b/home-manager/soispha/config/swayidle/config new file mode 100644 index 00000000..8ba07850 --- /dev/null +++ b/home-manager/soispha/config/swayidle/config @@ -0,0 +1,5 @@ +timeout 180 'swaylock -fFu' + +timeout 360 'systemctl suspend-then-hibernate' + +before-sleep 'swaylock -f' diff --git a/home-manager/soispha/config/swayidle/default.nix b/home-manager/soispha/config/swayidle/default.nix new file mode 100644 index 00000000..073498a7 --- /dev/null +++ b/home-manager/soispha/config/swayidle/default.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."swayidle/config".source = ./config; + + # services.swayidle = { + # enable = true; + # events = [ + # { + # event = "before-sleep"; + # command = "${pkgs.swaylock}/bin/swaylock -f "; + # } + # ]; + # timeouts = [ + # { + # timeout = 180; + # command = "${pkgs.swaylock}/bin/swaylock -fFu "; + # } + # { + # timeout = 360; + # # TODO systemctl is installed? + # command = "systemctl suspend-then-hibernate"; + # } + # ]; + # # systemdTarget = ""; # TODO this might be usefull + # }; +} diff --git a/home-manager/soispha/config/swaylock/commands.jpg b/home-manager/soispha/config/swaylock/commands.jpg new file mode 100644 index 00000000..54016503 --- /dev/null +++ b/home-manager/soispha/config/swaylock/commands.jpg Binary files differdiff --git a/home-manager/soispha/config/swaylock/default.nix b/home-manager/soispha/config/swaylock/default.nix new file mode 100644 index 00000000..7c3762cc --- /dev/null +++ b/home-manager/soispha/config/swaylock/default.nix @@ -0,0 +1,10 @@ +{...}: { + programs.swaylock = { + enable = true; + settings = { + #image = "$WALLPAPER"; + image = "${./commands.jpg}"; + color = "000000"; + }; + }; +} diff --git a/home-manager/soispha/config/swaylock/gnu.png b/home-manager/soispha/config/swaylock/gnu.png new file mode 100644 index 00000000..d07dee3e --- /dev/null +++ b/home-manager/soispha/config/swaylock/gnu.png Binary files differdiff --git a/home-manager/soispha/config/yambar/config/config.yml b/home-manager/soispha/config/yambar/config/config.yml new file mode 100644 index 00000000..bb742fd3 --- /dev/null +++ b/home-manager/soispha/config/yambar/config/config.yml @@ -0,0 +1,234 @@ +--- +# Config file for yambar +# Note that this may be version-dependent, this file is written for v1.8.0 + + +# Font anchors +font-main: &fontmain Source Code Pro:pixelsize=26 +font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=23 + +# Color anchors +fg-none: &fgnone 00000000 +fg-1: &fg1 c6ceefff +fg-blue: &fgblue 99d1dbff +fg-sapphire: &fgsapp 74c7ecdd +fg-green: &fggreen a6e3a1dd +fg-peach: &fgpeach fab387dd +fg-mauve: &fgmauve cba6f7dd +fg-teal: &fgteal 94e2d5dd +fg-lavendar: &fglav b4befedd +fg-focus: &fgfocus e78284ff +bg-1: &bg1 303446ff +bg-tag: &bgtag 585b70ff +bg-tag2: &bgtag2 45475aff +bg-urgent: &bgurgent e78284ff + +# Background blocks +background-block: &bgcblock {background: {color: *bg1 }} +background-block-urgent: &bgcurg {background: {color: *bgurgent }} + +# Underlines +underline-focused: &line {underline: { size: 3, color: *fgfocus}} +underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} +underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} +underline-resources: &linemem {underline: { size: 3, color: *fggreen}} +underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} +underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} +underline-weather: &linewea {underline: { size: 3, color: *fglav}} +underline-title: &linetitle {underline: { size: 3, color: *bgtag}} + +# Combined decorations +combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} +combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} +combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} +combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} +combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} + + +### Main + +bar: + location: top + height: 45 + layer: bottom + spacing: 0 + margin: 10 + border: {margin: 0, top-margin: 10} + foreground: *fg1 + background: *fgnone + font: *fontmain + + ### Left, river tags + left: + - river: + anchors: + - id: &name { text: "{id}" } + - string: &focus { stack: [ {background: {color: *bg1}} ] } + - string: &normal { string: { <<: *name, margin: 10 } } + - string: + &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } + - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } + - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - base: &river_base + default: *normal + conditions: + state == focused: *focused + state == unfocused: *unfocused + state == urgent: *urgent + state == invisible: + map: + conditions: + occupied: *occupied + ~occupied: *normal + content: + map: + on-click: + left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" + right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" + middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" + conditions: + id == 1: { map: { <<: *river_base } } + id == 2: { map: { <<: *river_base } } + id == 3: { map: { <<: *river_base } } + id == 4: { map: { <<: *river_base } } + id == 5: { map: { <<: *river_base } } + id == 6: { map: { <<: *river_base } } + id == 7: { map: { <<: *river_base } } + id == 8: { map: { <<: *river_base } } + id == 9: { map: { <<: *river_base } } + title: + map: + default: + { + string: + { + text: "{title}", + left-margin: 12, + right-margin: 12, + # max: 35, + deco: *linetitle + }, + } + conditions: + title == "": { string: { text: "" } } + + ### Center, clock & weather gadget + center: + - clock: + time-format: "%H:%M:%S %Z" + date-format: "%d/%m/%y (%a)" + foreground: *fgblue + content: + string: + text: " {date} {time} " + deco: *combclock + + ### Right, system tray + right: + #- network: + # name: wlp5s0 + # poll-interval: 10 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: {empty: {}} + # carrier: + # string: {text: " {ssid} ", deco: *combutil} + #- network: + # name: enp4s0 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: + # string: {text: " Eth failed ", deco: *combutil} + # carrier: {empty: {}} + + - script: # Sound volume + path: @volume_script@ + content: + map: + on-click: /bin/sh -c "pavucontrol" + conditions: + muted: + string: + text: " ﱝ " + deco: *bgcurg + ~muted: + string: {text: " {volume}% ", deco: *combutil} + + - script: # Grade average + path: @grade_average_script@ + content: + string: + text: " {grade} " + deco: *combmem + + #- backlight: + # name: intel_backlight + # content: + # - string: {text: " {percent}% ", deco: *combutil} + + - script: # CPU + path: @cpu_script@ + content: + string: + text: " {cpu}% " + deco: *combmem + + - script: # Memory info + path: @memory_script@ + content: + map: + conditions: + swapstate: + string: + text: " {memperc}%({swapperc}%) " + deco: *combmem + ~swapstate: + string: + text: " {memperc}% " + deco: *combmem + - script: # Disk space + path: @disk_script@ + content: + string: + text: " {diskspace}({diskperc})" + deco: *combmem + #- battery: + # name: BAT0 + # poll-interval: 30 + # content: + # list: + # items: + # - ramp: + # tag: capacity + # items: + # - string: + # text: " {capacity}%({estimate}) " + # deco: *bgcurg + # - string: + # text: " {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: " {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: " {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: " {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + #- script: # tray + # path: /home/dt/.config/yambar/scripts/yambar-tray + # content: + # empty: {} + #- script: + # path: /home/dt/.config/yambar/scripts/yambar-tray-width + # poll-interval: 10 + # content: + # string: + # text: "{padding}" + # deco: *combmem diff --git a/home-manager/soispha/config/yambar/config/laptop.yml b/home-manager/soispha/config/yambar/config/laptop.yml new file mode 100644 index 00000000..1c169820 --- /dev/null +++ b/home-manager/soispha/config/yambar/config/laptop.yml @@ -0,0 +1,234 @@ +--- +# Config file for yambar +# Note that this may be version-dependent, this file is written for v1.8.0 + + +# Font anchors +font-main: &fontmain Source Code Pro:pixelsize=22 +font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=20 + +# Color anchors +fg-none: &fgnone 00000000 +fg-1: &fg1 c6ceefff +fg-blue: &fgblue 99d1dbff +fg-sapphire: &fgsapp 74c7ecdd +fg-green: &fggreen a6e3a1dd +fg-peach: &fgpeach fab387dd +fg-mauve: &fgmauve cba6f7dd +fg-teal: &fgteal 94e2d5dd +fg-lavendar: &fglav b4befedd +fg-focus: &fgfocus e78284ff +bg-1: &bg1 303446ff +bg-tag: &bgtag 585b70ff +bg-tag2: &bgtag2 45475aff +bg-urgent: &bgurgent e78284ff + +# Background blocks +background-block: &bgcblock {background: {color: *bg1 }} +background-block-urgent: &bgcurg {background: {color: *bgurgent }} + +# Underlines +underline-focused: &line {underline: { size: 3, color: *fgfocus}} +underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} +underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} +underline-resources: &linemem {underline: { size: 3, color: *fggreen}} +underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} +underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} +underline-weather: &linewea {underline: { size: 3, color: *fglav}} +underline-title: &linetitle {underline: { size: 3, color: *bgtag}} + +# Combined decorations +combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} +combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} +combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} +combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} +combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} + + +### Main + +bar: + location: top + height: 25 + layer: bottom + spacing: 0 + margin: 10 + border: {margin: 0, top-margin: 5} + foreground: *fg1 + background: *fgnone + font: *fontmain + + ### Left, river tags + left: + - river: + anchors: + - id: &name { text: "{id}" } + - string: &focus { stack: [ {background: {color: *bg1}} ] } + - string: &normal { string: { <<: *name, margin: 10 } } + - string: + &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } + - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } + - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - base: &river_base + default: *normal + conditions: + state == focused: *focused + state == unfocused: *unfocused + state == urgent: *urgent + state == invisible: + map: + conditions: + occupied: *occupied + ~occupied: *normal + content: + map: + on-click: + left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" + right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" + middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" + conditions: + id == 1: { map: { <<: *river_base } } + id == 2: { map: { <<: *river_base } } + id == 3: { map: { <<: *river_base } } + id == 4: { map: { <<: *river_base } } + id == 5: { map: { <<: *river_base } } + id == 6: { map: { <<: *river_base } } + id == 7: { map: { <<: *river_base } } + id == 8: { map: { <<: *river_base } } + id == 9: { map: { <<: *river_base } } + title: + map: + default: + { + string: + { + text: "{title}", + left-margin: 12, + right-margin: 12, + # max: 35, + deco: *linetitle + }, + } + conditions: + title == "": { string: { text: "" } } + + ### Center, clock & weather gadget + center: + - clock: + time-format: "%H:%M:%S %Z" + date-format: "%d/%m/%y (%a)" + foreground: *fgblue + content: + string: + text: " {date} {time} " + deco: *combclock + + ### Right, system tray + right: + #- network: + # name: wlp5s0 + # poll-interval: 10 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: {empty: {}} + # carrier: + # string: {text: " {ssid} ", deco: *combutil} + #- network: + # name: enp4s0 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: + # string: {text: " Eth failed ", deco: *combutil} + # carrier: {empty: {}} + + - script: # Sound volume + path: @volume_script@ + content: + map: + on-click: /bin/sh -c "pavucontrol" + conditions: + muted: + string: + text: " ﱝ " + deco: *bgcurg + ~muted: + string: {text: " {volume}% ", deco: *combutil} + + - script: # Grade average + path: @grade_average_script@ + content: + string: + text: " {grade} " + deco: *combmem + + - backlight: + name: @backlight@ + content: + - string: {text: " {percent}% ", deco: *combutil} + + - script: # CPU + path: @cpu_script@ + content: + string: + text: " {cpu}% " + deco: *combmem + + - script: # Memory info + path: @memory_script@ + content: + map: + conditions: + swapstate: + string: + text: " {memperc}%({swapperc}%) " + deco: *combmem + ~swapstate: + string: + text: " {memperc}% " + deco: *combmem + - script: # Disk space + path: @disk_script@ + content: + string: + text: " {diskspace}({diskperc})" + deco: *combmem + - battery: + name: BAT0 + poll-interval: 30 + content: + list: + items: + - ramp: + tag: capacity + items: + - string: + text: " {capacity}%({estimate}) " + deco: *bgcurg + - string: + text: " {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: " {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: " {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: " {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + #- script: # tray + # path: /home/dt/.config/yambar/scripts/yambar-tray + # content: + # empty: {} + #- script: + # path: /home/dt/.config/yambar/scripts/yambar-tray-width + # poll-interval: 10 + # content: + # string: + # text: "{padding}" + # deco: *combmem diff --git a/home-manager/soispha/config/yambar/default.nix b/home-manager/soispha/config/yambar/default.nix new file mode 100644 index 00000000..0bcf8419 --- /dev/null +++ b/home-manager/soispha/config/yambar/default.nix @@ -0,0 +1,53 @@ +{ + nixosConfig, + sysLib, + system, + pkgs, + grades, + yambar_cpu, + yambar_memory, + ... +}: let + makeScript = { + file, + dependencies, + ... + }: + sysLib.writeShellScriptWithLibrary { + name = "${builtins.baseNameOf file}"; + src = file; + dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); + } + + "/bin/${builtins.baseNameOf file}"; +in { + xdg.configFile."yambar/config.yml".source = pkgs.substituteAll { + src = + if nixosConfig.soispha.laptop.enable + then ./config/laptop.yml + else ./config/config.yml; + + backlight = + if nixosConfig.soispha.laptop.enable + then nixosConfig.soispha.laptop.backlight + else ""; + volume_script = makeScript { + dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;}; + file = ./scripts/sound-volume; + }; + grade_average_script = makeScript { + dependencies = + [ + grades.outputs.packages.${system}.default + ] + ++ (builtins.attrValues {inherit (pkgs) coreutils gawk;}); + file = ./scripts/grades-average; + }; + cpu_script = yambar_cpu.app.${system}.default.program; + memory_script = yambar_memory.app.${system}.default.program; + + disk_script = makeScript { + dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;}; + file = ./scripts/disk; + }; + }; +} diff --git a/home-manager/soispha/config/yambar/scripts/disk b/home-manager/soispha/config/yambar/scripts/disk new file mode 100755 index 00000000..83b23ad9 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/disk @@ -0,0 +1,22 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# Main loop +while true; do + # vars + used_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) + all_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") + + + # Check space available (4) and percentage used (5) + spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') + + echo "diskspace|string|$used_space" + echo "diskperc|string|$spaceperc" + echo "" + sleep 1 +done + +# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/grades-average b/home-manager/soispha/config/yambar/scripts/grades-average new file mode 100755 index 00000000..20de5684 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/grades-average @@ -0,0 +1,15 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while true; do + grade="$(grades list average | awk '{print $2}')"; + + echo "grade|string|$grade"; + echo ""; + + sleep 1; +done + +# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/network b/home-manager/soispha/config/yambar/scripts/network new file mode 100755 index 00000000..8e02d6dc --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/network @@ -0,0 +1,47 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +retest=120 +retest_if_con_fails=10 +backend=nmcli + +case "$backend" in + "nmcli") # Test for connectivity with nmcli + while true; do + connection_status=$(nmcli networking connectivity) + if [ "$connection_status" = "full" ]; then + echo "internet|string|Connected" + echo "" + sleep $retest + else + echo "internet|string|Disconnected" + echo "" + sleep $retest_if_con_fails + fi + done + ;; + "ping") # Test for connectivity with ping + ip_address='8.8.8.8' + ping_number=3 + + while true; do + + ping_result=$(mktmp) + ping $ip_address -c $ping_number -q | awk 'BEGIN {FS="/"} END {print $5}' > "$ping_result" + + if [ "$(cat "$ping_result" | wc -l)" -eq 0 ]; then + echo "med|string|No connection" + echo "" + sleep $retest_if_con_fails + else + echo "med|string|$(cat "$ping_result") ms" + echo "" + sleep $retest + fi + done + ;; +esac + +# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/old/amixer-monitor b/home-manager/soispha/config/yambar/scripts/old/amixer-monitor new file mode 100755 index 00000000..9e75acfa --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/amixer-monitor @@ -0,0 +1,24 @@ +#!/bin/sh +# An improved amixer script that actually detects volume beyond 100% + + +SLEEPTIME=1 + + +while true; do + + volume=$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/"} {print $2 }' | tr -d "%" | tr -d ' ') + + if [ "$volume" -eq 0 ]; then + echo "muted|bool|true" + + else + # Read sink volume in percentages + echo "volume|string|$volume" + echo "muted|bool|false" + fi + + echo "" + sleep "$SLEEPTIME" + +done diff --git a/home-manager/soispha/config/yambar/scripts/old/cpu b/home-manager/soispha/config/yambar/scripts/old/cpu new file mode 100755 index 00000000..bae820d0 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/cpu @@ -0,0 +1,126 @@ +#!/bin/bash +# I didn't write this script; this is almost directly copied from the dnkl/yambar github. + + +# cpu.sh - measures CPU usage at a configurable sample interval +# +# Usage: cpu.sh INTERVAL_IN_SECONDS +# +# This script will emit the following tags on stdout (N is the number +# of logical CPUs): +# +# Name Type +# -------------------- +# cpu range 0-100 +# cpu0 range 0-100 +# cpu1 range 0-100 +# ... +# cpuN-1 range 0-100 +# +# I.e. ‘cpu’ is the average (or aggregated) CPU usage, while cpuX is a +# specific CPU’s usage. +# +# Example configuration (update every second): +# +# - script: +# path: /path/to/cpu.sh +# args: [1] +# content: {string: {text: "{cpu}%"}} +# + +interval=2 + +case ${interval} in + ''|*[!0-9]*) + echo "interval must be an integer" + exit 1 + ;; + *) + ;; +esac + +# Get number of CPUs, by reading /proc/stat +# The output looks like: +# +# cpu A B C D ... +# cpu0 A B C D ... +# cpu1 A B C D ... +# cpuN A B C D ... +# +# The first line is a summary line, accounting *all* CPUs +IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) +cpu_count=$((${#all_cpu_stats[@]} - 1)) + +# Arrays of ‘previous’ idle and total stats, needed to calculate the +# difference between each sample. +prev_idle=() +prev_total=() +for i in $(seq ${cpu_count}); do + prev_idle+=(0) + prev_total+=(0) +done + +prev_average_idle=0 +prev_average_total=0 + +while true; do + IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) + + usage=() # CPU usage in percent, 0 <= x <= 100 + + average_idle=0 # All CPUs idle time since boot + average_total=0 # All CPUs total time since boot + + for i in $(seq 0 $((cpu_count - 1))); do + # Split this CPUs stats into an array + stats=($(echo "${all_cpu_stats[$((i + 1))]}")) + + # man procfs(5) + user=${stats[1]} + nice=${stats[2]} + system=${stats[3]} + idle=${stats[4]} + iowait=${stats[5]} + irq=${stats[6]} + softirq=${stats[7]} + steal=${stats[8]} + guest=${stats[9]} + guestnice=${stats[10]} + + # Guest time already accounted for in user + user=$((user - guest)) + nice=$((nice - guestnice)) + + idle=$((idle + iowait)) + + total=$((user + nice + system + irq + softirq + idle + steal + guest + guestnice)) + + average_idle=$((average_idle + idle)) + average_total=$((average_total + total)) + + # Diff since last sample + diff_idle=$((idle - prev_idle[i])) + diff_total=$((total - prev_total[i])) + + usage[i]=$((100 * (diff_total - diff_idle) / diff_total)) + + prev_idle[i]=${idle} + prev_total[i]=${total} + done + + diff_average_idle=$((average_idle - prev_average_idle)) + diff_average_total=$((average_total - prev_average_total)) + + average_usage=$((100 * (diff_average_total - diff_average_idle) / diff_average_total)) + + prev_average_idle=${average_idle} + prev_average_total=${average_total} + + echo "cpu|range:0-100|${average_usage}" + for i in $(seq 0 $((cpu_count - 1))); do + echo "cpu${i}|range:0-100|${usage[i]}" + done + + echo "" + sleep "${interval}" +done diff --git a/home-manager/soispha/config/yambar/scripts/old/dfspace b/home-manager/soispha/config/yambar/scripts/old/dfspace new file mode 100755 index 00000000..0b262481 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/dfspace @@ -0,0 +1,23 @@ +#!/bin/sh + +# Sleep seconds +timer="60" + +# Main loop +while true; do + + # vars + used_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) + all_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") + + + # Check space available (4) and percentage used (5) + spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') + + echo "diskspace|string|$used_space" + echo "diskperc|string|$spaceperc" + echo "" + sleep $timer + +done + diff --git a/home-manager/soispha/config/yambar/scripts/old/grades-average b/home-manager/soispha/config/yambar/scripts/old/grades-average new file mode 100755 index 00000000..a04b958c --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/grades-average @@ -0,0 +1,12 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +grade=$(grades list average | awk '{print $2}'); + +echo "grade|string|$grade"; +echo ""; + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/soispha/config/yambar/scripts/old/meminfo b/home-manager/soispha/config/yambar/scripts/old/meminfo new file mode 100755 index 00000000..0156e94c --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/meminfo @@ -0,0 +1,37 @@ +#!/bin/sh +# Checks memory usage + +# Number of seconds to retest +timer=5 + +# Main loop +while true; do + + mem_total=$(LANG=C free -b|awk '/^Mem:/{print $2}') + mem_used=$(LANG=C free -b|awk '/^Mem:/{print $3}') + swap_total=$(LANG=C free -b|awk '/^Swap:/{print $2}') + swap_used=$(LANG=C free -b|awk '/^Swap:/{print $3}') + + + memperc=$(echo "$mem_used" "$mem_total" | awk '{ div = 100 * ($1 / $2)} { printf "%.0f ", div }' | tr -d ' ' ) + swapperc=$(echo "$swap_used" "$swap_total" | awk '{ + if ( $1 == 0 || $2 == 0 ) { + print "%" + } else { + div = 100 * ($1 / $2); + printf "%.0f ", div +} +}' | tr -d ' ' ) + + +echo "memperc|string|$memperc" +if [ "$swapperc" = "%" ];then + echo "swapstate|bool|false" +else + echo "swapperc|string|$swapperc" + echo "swapstate|bool|true" +fi +echo "" +sleep "$timer" + +done diff --git a/home-manager/soispha/config/yambar/scripts/old/nmclitest b/home-manager/soispha/config/yambar/scripts/old/nmclitest new file mode 100755 index 00000000..3e8bc73a --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/nmclitest @@ -0,0 +1,23 @@ +#!/bin/sh +# Test for connectivity with nmcli + +Timer=${1:-120} # Number of seconds to retest +Timer2=${2:-10} # Number of seconds to retest if connection fails + +# Main loop +while true; do + + CONN=$(nmcli networking connectivity) + + if [[ "$CONN" == "full" ]]; then + echo "internet|string|Connected" + echo "" + sleep $Timer + else + echo "internet|string|Disconnected" + echo "" + sleep $Timer2 + fi + +done + diff --git a/home-manager/soispha/config/yambar/scripts/old/pingtest b/home-manager/soispha/config/yambar/scripts/old/pingtest new file mode 100755 index 00000000..2b5f9998 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/pingtest @@ -0,0 +1,28 @@ +#!/bin/sh +# Test for connectivity with ping + +Timer=${1:-120} # Number of seconds to retest +Timer2=${2:-10} # Number of seconds to retest if connection fails +IP=${3:-'8.8.8.8'} # IP address to test, defaults to Google +PCount=${4:-3} # Number of pings to send + +# Main loop +while true; do + + # Pings the IP address for five times + PINGSTR=$(ping $IP -c $PCount -q) + # Use text formatting to get min/max ms delays + MED=$(echo $PINGSTR | sed 's/min\/avg\/max\/mdev = /\n/g' | tail -n 1 | sed 's/\//\t/g' | cut -f2) + + if [[ "$MED" == "" ]]; then + echo "med|string|No connection" + echo "" + sleep $Timer2 + else + echo "med|string|$MED ms" + echo "" + sleep $Timer + fi + +done + diff --git a/home-manager/soispha/config/yambar/scripts/old/yambar-tray b/home-manager/soispha/config/yambar/scripts/old/yambar-tray new file mode 100755 index 00000000..1704c6dd --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/yambar-tray @@ -0,0 +1,27 @@ +#!/bin/sh + + +pkill stalonetray +pkill trayer + +# launch a tray. +echo + +sleep 0.1 # make sure yambar starts first so we can draw on tpo of it + +# trayer-srg fork! +trayer \ + --edge top \ + --tint 0x24242400 \ + --align right \ + --height 20 \ + --expand false \ + --transparent true \ + --alpha 0 \ + --width 20 \ + --monitor primary \ + --widthtype request + # &>/dev/null + + + diff --git a/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width b/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width new file mode 100755 index 00000000..00544e70 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width @@ -0,0 +1,28 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +CHARWIDTH=8 # i guess? + +tray_width_px() { + xwininfo -name panel | # trayer names its window "panel" + grep -i width: | + awk '{print $2}' +} + +px_to_spaces() { + spaces="$((1 + ${1:-0} / $CHARWIDTH))" + printf "% *s\n" $spaces +} + +sleep 0.2 # be sure trayer is already up + +output="$(px_to_spaces `tray_width_px`)" +echo "padding|string|$output" +echo "" + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/soispha/config/yambar/scripts/sound-volume b/home-manager/soispha/config/yambar/scripts/sound-volume new file mode 100755 index 00000000..8494cbd5 --- /dev/null +++ b/home-manager/soispha/config/yambar/scripts/sound-volume @@ -0,0 +1,20 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while true; do + volume="$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/" } {gsub("%","",$2); gsub(" ","",$2)} {printf $2}')" + + if [ "$volume" -eq 0 ]; then + echo "muted|bool|true" + else + echo "volume|string|$volume" + echo "muted|bool|false" + fi + echo "" + + sleep 1; +done + +# vim: ft=sh diff --git a/home-manager/soispha/config/zsh/config/custom_cursor.sh b/home-manager/soispha/config/zsh/config/custom_cursor.sh new file mode 100644 index 00000000..9a6da012 --- /dev/null +++ b/home-manager/soispha/config/zsh/config/custom_cursor.sh @@ -0,0 +1,40 @@ +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +# ci", ci', ci`, di", etc +autoload -U select-quoted +zle -N select-quoted +for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done +done + +# ci{, ci(, ci<, di{, etc +autoload -U select-bracketed +zle -N select-bracketed +for m in visual viopp; do + for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do + bindkey -M $m $c select-bracketed + done +done + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init + +echo -ne '\e[5 q' # Use beam shape cursor on startup. +precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. diff --git a/home-manager/soispha/config/zsh/config/zsh-init.sh b/home-manager/soispha/config/zsh/config/zsh-init.sh new file mode 100644 index 00000000..4d54d058 --- /dev/null +++ b/home-manager/soispha/config/zsh/config/zsh-init.sh @@ -0,0 +1,39 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Flex on the ubuntu users +[ "$NVIM" ] || hyfetch +#loginctl show-session $XDG_SESSION_ID + +## Enable colors and change prompt: +#autoload -Uz colors && colors +#autoload -Uz compinit && compinit -u +## Edit line in vim buffer ctrl-v +autoload -Uz edit-command-line; zle -N edit-command-line +## Enter vim buffer from normal mode +#autoload -Uz edit-command-line && zle -N edit-command-line +bindkey "^V" edit-command-line + +## zstyles +#zstyle ':completion:*' menu select +## Auto complete with case insensitivity +#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +#zmodload zsh/complist +#fpath+=/home/dt/.config/zsh/comp +#compinit +#_comp_options+=(globdots) # Include hidden files. +# +## Source configs +#source "${ZDOTDIR}/ali.sh" +#source "${ZDOTDIR}/prompt.sh" +#source "${ZDOTDIR}/hotkeys.sh" +#source "./${path_custom_cursor}" +#source ~/.local/lib/shell/lib +# +## Load zsh-syntax-highlighting +#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +## Suggest aliases for commands +#source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh +# +##eval "$(lua ~/scripts/z.lua --init zsh enhanced)" diff --git a/home-manager/soispha/config/zsh/config/zsh-prompt.sh b/home-manager/soispha/config/zsh/config/zsh-prompt.sh new file mode 100644 index 00000000..1af12443 --- /dev/null +++ b/home-manager/soispha/config/zsh/config/zsh-prompt.sh @@ -0,0 +1,63 @@ +#vim:ft=zsh +_command_time_preexec() { + timer=${timer:-$SECONDS} +} + +_command_time_precmd() { + PROMPT_TMP_DIR=$(mktemp) + if [ $timer ]; then + ts=$(($SECONDS - $timer)) + tts=$ts + mi=0 + ho=0 + if [ $ts -ge 3 ];then + while [ $ts -ge 60 ];do + ts=$((ts-60)) + mi=$((mi+1)) + done + + while [ $mi -ge 60 ];do + mi=$((mi-60)) + ho=$((ho+1)) + done + + if [ $tts -ge 3600 ];then + out=$(printf '%dh %dm %ds\n' $ho $mi $ts) + elif [ $tts -ge 60 ];then + out=$(printf '%dm %ds\n' $mi $ts) + elif [ $tts -lt 60 ];then + out=$(printf '%ds\n' $ts) + fi + + export psvar[1]="took $(printf '%s ' "$out")" + echo $psvar[1] > $PROMPT_TMP_DIR + fi + + unset timer + unset ts + unset tts + unset mi + unset ho +fi +} + +_command_ro_precmd() { +if ! [ -w $(pwd) ];then + echo " " +fi +} + +preexec_functions+=(_command_time_preexec) +precmd_functions+=(_command_time_precmd) + +blue="14" +red="9" +white="15" +setopt PROMPT_SUBST +export PROMPT='%(?.%F{$blue}.%F{$red})%B%3~%(!. %F{$red}as root %f. )%F{$white}$(if [ -n $PROMPT_TMP_DIR ];then cat $PROMPT_TMP_DIR 2>/dev/null; rm $PROMPT_TMP_DIR 2>/dev/null;fi)%f%(?.%F{$blue}.%F{$red})%F{$red}$(_command_ro_precmd)%F{$blue}❯ %b%f' +export RPROMPT='' + +#%(2V.%F{$red}%2v%f$(export psvar[2]="") .) + +# TODO: +# Add git support diff --git a/home-manager/soispha/config/zsh/default.nix b/home-manager/soispha/config/zsh/default.nix new file mode 100644 index 00000000..01a553d0 --- /dev/null +++ b/home-manager/soispha/config/zsh/default.nix @@ -0,0 +1,139 @@ +{ + config, + pkgs, + lib, + shell_library, + system, + osConfig, + ... +}: { + # TODO ADD THIS ADDON + # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it. + # TODO find something better for this use case + # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed + home.sessionPath = []; + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + autocd = true; + + dotDir = ".config/zsh"; + + history = { + extended = true; + ignoreDups = false; + expireDuplicatesFirst = false; + ignoreSpace = false; # TODO I might change that + + path = "${config.xdg.dataHome}/zsh/history"; + save = 9000000; # number of lines to save + size = 9000000; # number of lines to keep + share = false; # share between sessions + }; + historySubstringSearch = { + enable = true; + searchDownKey = "^[[B"; # DOWN Arrow key + searchUpKey = "^[[A"; # UP Arrow key + }; + + loginExtra = + '' + eval $(ssh-agent -s) > /dev/null # start ssh agent + '' + + lib.concatStringsSep "\nsetopt " [ + "setopt AUTO_CD" # This is needed as first item + "AUTO_PUSHD" + "CHASE_DOTS" + + "ALWAYS_TO_END" + + "EXTENDED_HISTORY" + "HIST_ALLOW_CLOBBER" + "HIST_VERIFY" + "HIST_FCNTL_LOCK" + "APPEND_HISTORY" + + "DVORAK" + "CORRECT" + + "PROMPT_SUBST" + "TRANSIENT_RPROMPT" # maybe? + + "COMBINING_CHARS" + "VI" + ]; + + initExtraFirst = + builtins.readFile ./config/zsh-init.sh + + builtins.readFile ./config/zsh-prompt.sh + + builtins.readFile ./config/custom_cursor.sh + + builtins.readFile "${pkgs.fzf}/share/fzf/key-bindings.zsh" + + "SHELL_LIBRARY_VERSION=\"1.1.4\" source ${shell_library.rawLib.${system}}"; + shellAliases = { + ll = ". ll"; + hisea = "history 0 | grep"; + }; + sessionVariables = { + EDITOR = "nvim"; + IVIEWER = "imv"; + READER = "zathura"; + VISUAL = "nvim"; + CODEEDITOR = "nvim"; + TERMINAL = "alacritty"; + BROWSER = "firefox"; + COLORTERM = "truecolor"; + PAGER = "less -R"; + WM = "river"; + WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper"; + + # FUNCNEST for more functions in functions + #FUNCNEST = "2000"; + + WALLPAPERDIR = "$HOME/media/pictures/wallpapers/"; + LESS = "R"; + MANPAGER = "less -R --use-color -Dd+r -Du+b"; + LIBVIRT_DEFAULT_URI = "qemu:///system"; + + BEMENU_SCALE = "1.5"; + BEMENU_BACKEND = "wayland"; + BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff"; + + MPD_HOST = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd/socket"; + + # Clean the home dir {{{ + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + + #_JAVA_OPTIONS = lib.concatStringsSep " " [ + # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"'' + # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"'' + # ]; + #GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle"; + #GOPATH = "${config.xdg.dataHome}/go"; + #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + #LESSHISFILE = "${config.xdg.cacheHome}/less/history"; + #LESSKEYIN = "${config.xdg.configHome}/less/lesskey"; + #RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; + #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; + #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages"; + #PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc"; + #XAUTHORITY = "${config.xdg.stateHome}/Xauthority"; + #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}"; + #IPYTHONDIR = "${config.xdg.configHome}/ipython"; + #PARALLEL_HOME = "${config.xdg.configHome}/parallel"; + #STACK_XDG = "1"; + #WINEPREFIX = "${config.xdg.dataHome}/wine"; + # }}} + + # Export Wayland env Vars {{{ + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; # might brake some things + MOZ_ENABLE_WAYLAND = "1"; + # }}} + }; + }; +} |