commit 902227b06fa430293043ade485762f429dac56a1 Author: Pratham Patel Date: Fri Sep 23 19:28:12 2022 +0530 init commit diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..15c94d9 --- /dev/null +++ b/.bashrc @@ -0,0 +1,5 @@ +if [[ "$OSTYPE" == "freebsd"* ]]; then + echo "FreeBSD" +elif [[ "$OSTYPE" == "openbsd"* ]]; then + echo "OpenBSD" +fi diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..5598267 --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,898 @@ +# 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: +# - ~/.config/alacritty/load_linux.yml +# - ~/.config/alacritty/load_linux.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. + # DO NOT USE THIS YET... #TERM: alacritty + #TERM: xterm-256color + +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: 100 + lines: 30 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + #padding: + # x: 0 + # y: 0 + + # Spread additional padding evenly around the terminal content. + #dynamic_padding: false + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background 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.85 + + # 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 (Linux/BSD only) + # + # Override the variant of the GTK theme/Wayland client side decorations. + # Commonly supported values are `dark` and `light`. Set this to `None` to use + # the default theme variant. + #decorations_theme_variant: dark + +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: "Overpass 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: "Overpass Mono" + + # 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: "Overpass Mono" + + # 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: "Overpass Mono" + + # 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: 0 + # y: 0 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + #glyph_offset: + # x: 0 + # y: 0 + + # 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 + +# If `true`, bold text is drawn using the bright color variants. +draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +colors: + # Default colors + #primary: + # background: '#1d1f21' + # foreground: '#c5c8c6' + + # 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: '0xffffff' + # cursor: CellForeground + + # 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: '0x000000' + # background: CellForeground + + # Normal colors + #normal: + # black: '#1d1f21' + # red: '#cc6666' + # green: '#b5bd68' + # yellow: '#f0c674' + # blue: '#81a2be' + # magenta: '#b294bb' + # cyan: '#8abeb7' + # white: '#c5c8c6' + + # Bright colors + #bright: + # black: '#666666' + # red: '#d54e53' + # green: '#b9ca4a' + # yellow: '#e7c547' + # blue: '#7aa6da' + # magenta: '#c397d8' + # cyan: '#70c0b1' + # white: '#eaeaea' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '#131415' + # red: '#864343' + # green: '#777c44' + # yellow: '#9e824c' + # blue: '#556a7d' + # magenta: '#75617b' + # cyan: '#5b7d78' + # white: '#828482' + + # 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 + +# 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: Block + + # 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 + +# Send ESC (\x1b) before characters when alt is pressed. +#alt_send_esc: true + +# 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 + +# 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, mode: ~Vi, action: PasteSelection } + +# 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/glutin/*/glutin/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 +# - 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: 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: SpawnNewInstance } + #- { 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 + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false + diff --git a/.config/alacritty/load_linux.yml b/.config/alacritty/load_linux.yml new file mode 100644 index 0000000..746d4a9 --- /dev/null +++ b/.config/alacritty/load_linux.yml @@ -0,0 +1,6 @@ +key_bindings: + - { key: V, mods: Control|Shift, action: Paste } + - { key: C, mods: Control|Shift, action: Copy } + - { key: F11, mods: None, action: ToggleFullscreen } + - { key: L, mods: Control, chars: "\x0c" } + - { key: Key0, mods: Control, action: ResetFontSize } diff --git a/.config/alacritty/load_macos.yml b/.config/alacritty/load_macos.yml new file mode 100644 index 0000000..956c6f4 --- /dev/null +++ b/.config/alacritty/load_macos.yml @@ -0,0 +1,8 @@ +key_bindings: + - { key: Left, mods: Alt, chars: "\x1b[1;5D" } + - { key: Right, mods: Alt, chars: "\x1b[1;5C" } + - { key: L, mods: Control, chars: "\x0c" } + - { key: Key6, mods: Control, chars: "\x1e" } + - { key: V, mods: Command, action: Paste } + - { key: C, mods: Command, action: Copy } + - { key: Key0, mods: Command, action: ResetFontSize } diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc new file mode 100644 index 0000000..c057506 --- /dev/null +++ b/.config/bspwm/bspwmrc @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +bash $HOME/.config/feh/fehbg & +bash $HOME/.config/polybar/launch.sh & + +pgrep -x sxhkd > /dev/null || sxhkd & + +bspc monitor -d work virtualization music other extra extraa + +bspc config border_width 6 +bspc config window_gap 12 + +bspc config focused_border_color \#FF0000 +bspc config active_border_color \#FFFFFF +bspc config normal_border_color \#FFFFFF #08C96B +bspc config presel_border_color \#A57FE8 + +bspc config split_ratio 0.5 + +bspc config borderless_monocle false +bspc config gapless_monocle true + +bspc config left_padding 8 +bspc config bottom_padding 8 +bspc config top_padding 8 +bspc config right_padding 8 + +bspc config left_monocle_padding 6 +bspc config bottom_monocle_padding 6 +bspc config top_monocle_padding 6 +bspc config right_monocle_padding 6 + +bspc config focus_follows_pointer false +bspc config pointer_follows_focus false +bspc config pointer_follows_monitor false + +bspc config center_pseudo_tiled false + +bspc rule -a mpv state=floating +bspc rule -a "Nvidia-settings" state=floating + +bspc rule -a "VirtualBox Machine" state=pseudo_tiled +bspc rule -a "Virt-manager" state=psuedo_tiled diff --git a/.config/feh/fehbg b/.config/feh/fehbg new file mode 100755 index 0000000..91ea3be --- /dev/null +++ b/.config/feh/fehbg @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +feh --bg-fill --no-fehbg --randomize $HOME/Pictures/*.jpg diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100644 index 0000000..1ecc9b4 --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,67 @@ +[ playlist-prev +] playlist-next +> playlist-next +< playlist-prev + +h seek -1 exact +l seek 1 exact +H seek -30 exact +L seek 30 exact + +m cycle mute + +j add volume -1 +k add volume 1 +J add volume -5 +K add volume 5 + +g seek 0 absolute +G seek -2 absolute + +i script-binding stats/display-stats +I script-binding stats/display-stats-toggle + +p show-progress +o show-progress + +s add sub-scale -0.1 +S add sub-scale +0.1 + +z cycle sub +Z cycle sub down + +a cycle audio +A cycle audio down + +UP cycle audio +DOWN cycle audio down +RIGHT cycle sub +LEFT cycle sub down + +WHEEL_UP ignore +WHEEL_DOWN ignore +WHEEL_LEFT ignore +WHEEL_RIGHT ignore + +{ multiply speed 0.5 +} multiply speed 2.0 +ESC set speed 1.0 + +c screenshot +C screenshot video + +c screenshot +C screenshot video + +x add sub-delay +0.1 +X add sub-delay -0.1 + +PLAY cycle pause +PAUSE cycle pause +PLAYPAUSE cycle pause +PLAYONLY set pause no +PAUSEONLY set pause yes +STOP quit + +R cycle-values loop-file "inf" "no" +r cycle-values loop-file "inf" "no" diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf new file mode 100644 index 0000000..2380b42 --- /dev/null +++ b/.config/mpv/mpv.conf @@ -0,0 +1,8 @@ +script-opts-append=ytdl_hook-ytdl_path=yt-dlp +input-ipc-server=/tmp/mpvsocket +tone-mapping=reinhard +volume=30 +vo=gpu +cache=yes +cache-secs=900 +hwdec=vaapi diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..27e0b17 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,208 @@ +" ============================================================================== +" Plugins +" ============================================================================== +call plug#begin('~/.vim/plugged') + +" base16 theme +Plug 'chriskempson/base16-vim' + +" ncm2 (Neovim-only auto-complete) +"Plug 'roxma/nvim-yarp' +"Plug 'ncm2/ncm2' +"Plug 'ncm2/ncm2-bufword' +"Plug 'ncm2/ncm2-path' + +" Fuzzy finder +Plug 'airblade/vim-rooter' +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +Plug 'junegunn/fzf.vim' + +" vim ripgrep +Plug 'jremmen/vim-ripgrep' + +" .rs +Plug 'rust-lang/rust.vim' +"Plug 'neoclide/coc.nvim', {'branch': 'release'} +"Plug 'dense-analysis/ale' + +"Plug 'wuelnerdotexe/vim-enfocado' +"Plug 'tpope/vim-fugitive' +Plug 'preservim/nerdtree' +"Plug 'pineapplegiant/spaceduck' +"Plug 'pineapplegiant/spaceduck', { 'branch': 'main' } + +call plug#end() + + +" ============================================================================== +" Neovim core(?) +" ============================================================================== +" dealing with files +syntax on +filetype plugin indent on +set colorcolumn=72 +set autoindent expandtab tabstop=4 shiftwidth=4 +set encoding=utf-8 + +" appearance +set number relativenumber +set noshowmode +set showcmd +set timeoutlen=300 " (http://stackoverflow.com/questions/2158516/delay-before-o-opens-a-new-line) +set spell +set termguicolors +set cursorline +let base16colorspace=256 +colorscheme base16-gruvbox-dark-hard +colorscheme base16-google-dark +"set cursorcolumn + +"set clipboard=unnamed,unnamedplus +set title +set noswapfile +"set lazyredraw +"set ttyfast (https://neovim.io/doc/user/vim_diff.html#'ttyfast') + +" undo +set undolevels=200 +set undodir=~/.vimdid +set undofile + +" search +set incsearch ignorecase smartcase hlsearch +" do not substitute _globally_ +set nogdefault + +set visualbell +set wildmenu +set showmatch + +set pastetoggle= +"set guifont=Fira\ Code:h12 +"set viminfo= + + +" ============================================================================== +" Auto-complete (ncm2) +" ============================================================================== +" enable ncm2 for all buffers +"autocmd BufEnter * call ncm2#enable_for_buffer() + +" IMPORTANT: :help Ncm2PopupOpen for more information +"set completeopt=noinsert,menuone,noselect + +" ncm2: CTRL-C doesn't trigger the InsertLeave autocmd . map to instead. +"inoremap + +" When the key is pressed while the popup menu is visible, it only +" hides the menu. Use this mapping to close the menu and also start a new +" line. +"inoremap (pumvisible() ? "\\" : "\") + +" Use to select the popup menu: +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" + + +" ============================================================================== +" Rust +" ============================================================================== +let g:rustfmt_autosave = 1 +let g:rustfmt_emit_files = 1 +let g:rustfmt_fail_silently = 0 +"let g:ale_linters = {'rust': ['analyzer']} +"au Filetype rust set colorcolumn=80 +"au Filetype c set colorcolumn=80 +"let g:LanguageClient_serverCommands = { +" \ 'rust': ['rust-analyzer'], +" \ } +"let g:ale_linters = {'rust': ['rustc', 'rls']} + + +" ============================================================================== +" Statusline +" ============================================================================== +" Define all the different modes +let g:currentmode={ + \ 'n' : 'NORMAL', + \ 'no' : 'NORMAL·OPERATOR PENDING', + \ 'v' : 'VISUAL', + \ 'V' : 'V·LINE', + \ '^V' : 'V·BLOCK', + \ 's' : 'SELECT', + \ 'S' : 'S·LINE', + \ '^S' : 'S·BLOCK', + \ 'i' : 'INSERT', + \ 'R' : 'REPLACE', + \ 'Rv' : 'V·REPLACE', + \ 'c' : 'COMMAND', + \ 'cv' : 'VIM EX', + \ 'ce' : 'EX', + \ 'r' : 'PROMPT', + \ 'rm' : 'MORE', + \ 'r?' : 'CONFIRM', + \ '!' : 'SHELL', + \ 't' : 'TERMINAL' + \} + +set statusline= +" 2 space padding +set statusline+=%#ErrorMsg#\ \ +" shows mode +set statusline+=%#Search#\ %{g:currentmode[mode()]}\ +" shows '[+]' if modified else '[0]' +set statusline+=%#ErrorMsg#\ %{&modified?'[+]':'[0]'}\ +" show if a file is readonly +set statusline+=%#Question#%{&readonly?'[RO]':'[RW]'}\ +" show the file name +set statusline+=%#CursorLineNr#\ %f\ +" show filename +set statusline+=%#SignColumn#\(%{wordcount().words}\)\ %#Comment# +" show wc +set statusline+=%= +" show file format dos/UNIX +set statusline+=%#Title#%{&ff}\ +" show encoding format +set statusline+=%#Directory#%{&fileencoding}\ +" show the syntax/file type eg Rust, C, Python, Vim etc +set statusline+=%#Todo#\ %Y\ +" show percentage through a file +set statusline+=%#Identifier#\ %p%% +" show the currentline/totallines +set statusline+=%#Normal#\ %lL\ +" show column number +set statusline+=%#CursorColumn#\ %cC\ +" 2 space padding +set statusline+=%#Normal#\ \ +set laststatus=2 + + +" ============================================================================== +" key bindings +" ============================================================================== +" Jump to start and end of line using the home row keys +map H ^ +map L $ + +" remap uppercase J and K to their lowercase counterparts; +" been bitten too many times +nnoremap K k +nnoremap J j +"inoremap K k +"inoremap J j + +"map-command [map-arg] {lhs} {rhs} +nnoremap +nnoremap +nnoremap +nnoremap + +"enable nerdtree with ^\ +map :NERDTreeToggle + + +" ============================================================================== +" change highlight color when yanking +" ============================================================================== +au TextYankPost * silent! lua vim.highlight.on_yank {higroup="Visual", timeout=250} + diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini new file mode 100644 index 0000000..ea9fc27 --- /dev/null +++ b/.config/polybar/config.ini @@ -0,0 +1,237 @@ +[colors] +background = #222 +background-alt = #444 +background-transparent = #00000000 + +foreground = #dfdfdf +foreground-alt = #555 + +primary = #ffb52a +secondary = #e60053 +alert = #bd2c40 + + +[padding] +inner = 1 +outer = 1 + + +[bar/top] +width = 100% +height = 40 + +radius = 0.0 +fixed-center = true + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 2 +line-color = #f00 + +border-size = 8 +border-color = #00000000 + +module-margin-right = 2 + +font-0 = Fira Code:pixelsize=14;1 +font-1 = forkawesome:pixelsize=14;1 +font-2 = fixed:pixelsize=10;1 +font-3 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-4 = siji:pixelsize=10;1 + +modules-left = bspwm date +modules-center = xwindow mpv +modules-right = alsa cpu memory eth + +tray-position = right +tray-padding = 1 + +cursor-click = pointer +cursor-scroll = ns-resize + +wm-restack = bspwm + + +[module/xwindow] +type = internal/xwindow + +label = %title% +label-maxlen = 100 + +label-empty = + + +[module/bspwm] +type = internal/bspwm + +enable-click = true +enable-scroll = false +reverse-scroll = false + +label-focused = [%index%: %name%] +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 1 + +label-occupied = %index%: %name% +label-occupied-padding = 1 + +label-urgent = %index%!: %name%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %{F#dfdfdf}%index%%{F-}: %{F#555}%name%%{F-} +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 1 + + +[module/i3] +type = internal/i3 + +format = + +index-sort = true +wrapping-scroll = false +strip-wsnumbers = true + +label-mode-padding = 1 +label-mode-foreground = #000 +label-mode-background = ${colors.primary} + +label-focused = %name% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 1 + +label-unfocused = %name% +label-unfocused-padding = 1 + +label-visible = %name% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + + +[module/cpu] +type = internal/cpu + +label = CPU: %percentage%% +interval = 2 + +format-prefix-foreground = ${colors.foreground-alt} +format-underline = #f90000 + + +[module/memory] +type = internal/memory + +label = %gb_used%/%gb_total% +interval = 2 + +format-prefix-foreground = ${colors.foreground-alt} +format-underline = #4bffdc + + +[module/eth] +type = internal/network + +interface = enp5s0 +interval = 1.0 + +label-connected = ↓%downspeed:9% ↑%upspeed:9% +label-disconnected = NETWORK DOWN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (%ifname%) + +format-connected-underline = #55aa55 +format-disconnected-underline = ${colors.alert} + + +[module/date] +type = internal/date + +label = %date% %time% +interval = 1 + +date-alt = "%d/%m/%y" +time-alt = %H:%M:%S +date = "%a %d-%b %Y" +time = %H:%M:%S + +format-underline = #0a6cf5 + + +[module/mpv] +type = custom/script + +exec = $HOME/.config/polybar/mods/module_mpv.sh + +label-foreground = #FFA500 +interval = 1 + +click-left = echo 'cycle pause' | socat - /tmp/mpvsocket +click-right = echo 'cycle mute' | socat - /tmp/mpvsocket + + +[module/powermenu] +type = custom/menu +expand-right = true +format-spacing = 1 + +label-open = "|  " +label-open-foreground = #ECEFF4 +label-close = "| " +label-close-foreground = #EBCB8B +label-separator = : +label-separator-foreground = #A3BE8C + +menu-0-0 = "Power Off" +menu-0-0-exec = menu-open-1 +menu-0-1 = "Reboot" +menu-0-1-exec = menu-open-2 +menu-0-2 = "Suspend" +menu-0-2-exec = menu-open-3 +menu-0-3 = "Log Out " +menu-0-3-exec = menu-open-4 + +menu-1-0 = "Power Off" +menu-1-0-exec = systemctl poweroff +menu-1-1 = "Cancel " +menu-1-1-exec = menu-open-0 + +menu-2-0 = "Reboot" +menu-2-0-exec = systemctl reboot +menu-2-1 = "Cancel " +menu-2-1-exec = menu-open-0 + +menu-3-0 = "Suspend" +menu-3-0-exec = $HOME/.config/polybar/mods/module_suspend_script.sh +menu-3-1 = "Cancel " +menu-3-1-exec = menu-open-0 + +menu-4-0 = "Log Out" +menu-4-0-exec = bspc quit +menu-4-1 = "Cancel " +menu-4-1-exec = menu-open-0 + +[module/alsa] +type = internal/alsa + +interval = 10 + +format-volume = Sound: | + +label-muted = Sound: muted | +label-muted-foreground = #66 + + +[settings] +screenchange-reload = true + + +[global/wm] +margin-top = 5 +margin-bottom = 5 diff --git a/.config/polybar/launch.sh b/.config/polybar/launch.sh new file mode 100755 index 0000000..a8be798 --- /dev/null +++ b/.config/polybar/launch.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + +# Launch Polybar, using default config location ~/.config/polybar/config +polybar top -c $HOME/.config/polybar/config.ini & diff --git a/.config/polybar/mods/module_mpv.sh b/.config/polybar/mods/module_mpv.sh new file mode 100755 index 0000000..f75138c --- /dev/null +++ b/.config/polybar/mods/module_mpv.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +if [[ $(pidof mpv) ]]; then + POS=$(echo '{ "command": ["get_property_string", "time-pos"] }' | socat - /tmp/mpvsocket | jq .data | tr '"' ' ' | cut -d'.' -f 1) + DUR=$(echo '{ "command": ["get_property_string", "duration"] }' | socat - /tmp/mpvsocket | jq .data | tr '"' ' ' | cut -d'.' -f 1) + METADATA=$(echo '{ "command": ["get_property", "media-title"] }' | socat - /tmp/mpvsocket | awk -F "\"*,\"*" '{print $1}' | awk -F "\"*:\"*" '{print $2}' ) + + printf "$METADATA" + printf ' (%d:%02d:%02d' $(($POS/3600)) $(($POS%3600/60)) $(($POS%60)) + printf ' / %d:%02d:%02d)\n' $(($DUR/3600)) $(($DUR%3600/60)) $(($DUR%60)) + +else + exit +fi diff --git a/.config/polybar/mods/module_suspend_script.sh b/.config/polybar/mods/module_suspend_script.sh new file mode 100755 index 0000000..450eb17 --- /dev/null +++ b/.config/polybar/mods/module_suspend_script.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +i3lock-fancy & +systemctl suspend diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..5058592 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,10 @@ +configuration { + font: "Fira Code 14"; + show-icons: true; + terminal: "alacritty"; + /*icon-theme: ;*/ + sidebar-mode: false; + click-to-exit: true; + show-match: true; + theme: "gruvbox-dark-hard"; +} diff --git a/.config/sxhkd/mods/module_alsa.sh b/.config/sxhkd/mods/module_alsa.sh new file mode 100755 index 0000000..30ca692 --- /dev/null +++ b/.config/sxhkd/mods/module_alsa.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +VOL="$(amixer -D pulse sget Master | tail -n 1 | cut -c 32-35)" +STAT0="$(amixer -D pulse sget Master | tail -n 1 | cut -c 38)" +STAT1="$(amixer -D pulse sget Master | tail -n 1 | cut -c 35)" +STAT2="$(amixer -D pulse sget Master | tail -n 1 | cut -c 40)" +UPORDOWN="$1" + +if [ "$UPORDOWN" = "up" ] +then + if [ "$STAT0" = "f" ] || [ "$STAT1" = "f" ] || [ "$STAT2" = "f" ] + then + notify-send -u critical "Volume Manager" "Unmuted\!" + pactl set-sink-mute 1 0 + fi + amixer -D pulse sset Master 10%+ +fi + +if [ "$UPORDOWN" = "down" ] +then + + # the commented out part below should work + # but for some reason + # decreasing 10% volume shows 9% volume decrease in polybar widget + # but it is actually 10% volume decrease when checking with amixer + # so less efficient code; for the OCD; + #if [ "$VOL" = "100%" ] + #then + # amixer -D pulse sset Master 90% + #else + # amixer -D pulse sset Master 10%- + #fi + + case "$VOL" in + + "100%") + amixer -D pulse sset Master 90% + ;; + + "90%]") + amixer -D pulse sset Master 80% + ;; + + "80%]") + amixer -D pulse sset Master 70% + ;; + + "70%]") + amixer -D pulse sset Master 60% + ;; + + "60%]") + amixer -D pulse sset Master 50% + ;; + + "50%]") + amixer -D pulse sset Master 40% + ;; + + "40%]") + amixer -D pulse sset Master 30% + ;; + + "30%]") + amixer -D pulse sset Master 20% + ;; + + "20%]") + amixer -D pulse sset Master 10% + ;; + + "0%] ") + amixer -D pulse sset Master 10%- + ;; + + esac + +fi diff --git a/.config/sxhkd/mods/module_lock_script.sh b/.config/sxhkd/mods/module_lock_script.sh new file mode 100755 index 0000000..f35f230 --- /dev/null +++ b/.config/sxhkd/mods/module_lock_script.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +i3lock-fancy & +xset -display "$DISPLAY" dpms force off & diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..aa6975e --- /dev/null +++ b/.config/sxhkd/sxhkdrc @@ -0,0 +1,66 @@ +# launch rofi +super + space + rofi -modi drun,run -show drun + +# Return to launch terminal emulator +# b to launch browser +super + {Return,b} + {alacritty,firefox} + +# w to reload/relaunch feh/change bg +# p to reload/relaunch polybar +# Escape to turn screen off and lock the computer +super + shift + {w,p,Escape} + {bash $HOME/.config/feh/fehbg &,bash $HOME/.config/polybar/launch.sh &,bash $HOME/.config/sxhkd/mods/module_lock_script.sh} + +# c to reload config +# q to quit selected window +super + shift + {c,q} + {pkill -USR1 -x sxhkd && bspc wm -r,bspc node -c} + +# t to enable tiled mode for current window +# shift + t to enable floating mode for current window +# f to enable fullscreen mode for current window +super + {t,shift + t,f} + bspc node -t {tiled,floating,fullscreen} + +# super h,j,k,l to move between windows +# add shift to swap the window to left right etc +super + {_,shift +, ctrl +}{h,j,k,l} + bspc node -{f,s,n} {west,south,north,east} + +# expand a window by moving one of its side outward +super + alt + shift {h,j,k,l} + bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0} +#contract a window by moving one of its side inward +super + ctrl + shift + {h,j,k,l} + bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0} + +# focus the next/previous desktop in the current monitor +super + bracket{left,right} + bspc desktop -f {prev,next}.local + +# [ to decrease volume by 10% +# ] to increase volume by 10% +super + shift + bracket{left,right} + {bash $HOME/.config/sxhkd/mods/module_alsa.sh down,bash $HOME/.config/sxhkd/mods/module_alsa.sh up} + +# switch between nodes (locally) +alt + {_,shift} + Tab + bspc node -f {next,prev}.local.!hidden.window + +# focus or send to the given desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# move a floating window +super + {Left,Down,Up,Right} + bspc node -v {-20 0,0 20,0 -20,20 0} + +# bspwm rotate: split horizontally/vertically +super + shift + {v,s} + bspc node @parent -R {90,90} + +# exit bspwn (return to console) +super + shift + ctrl + alt + 0 + bspc quit diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..1cf56bf --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,71 @@ +# Start windows and panes at 1, not 0 +set -g base-index 1 +setw -g pane-base-index 1 + +# Use Ctrl + Space for tmux +unbind C-b +set -g prefix C-space + +# xterm-256color is most compatible, but use it in .zshrc +#set -g default-terminal "xterm-256color" +#set -g default-terminal "screen-256color" +#set -g default-terminal "alacritty" + +# Set 265color for tmux +set -g default-terminal "tmux-256color" +set -ga terminal-overrides ",alacritty:Tc" +set -ga terminal-overrides ",*256col*:Tc" +#set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' +#set -g terminal-overrides 'xterm*:smcup@:rmcup@' +set-environment -g COLORTERM "truecolor" + +#set-window-option -g automatic-rename on +set -g automatic-rename on +set-option -g set-titles on + +set -g history-limit 100000 + +# vi mode +set-window-option -g mode-keys vi +set -g status-keys vi + +set -g monitor-activity on +set -g visual-activity both +set -sg escape-time 0 + +set -g mouse on + +# status +set -g status-bg black +set -g status-fg white +set -g status-interval 10 +# show `session_name:` to the leftmost bottom corner +set -g status-left '#[fg=colour245] #S: ' +set -g status-left-length 0 +# status format for the window that you are active on +setw -g window-status-current-format ' #I#[fg=yellow,bright]:#[fg=white,bright]#W#[fg=red,bright]#F ' +# normal format for the window +setw -g window-status-format ' #I#[fg=gray,dark]:#[fg=gray,bright]#W#[fg=white,bright]#F ' +# show date and time in the rightmost bottom corner `DayOfWeek date-month hour:minute` +set -g status-right '#[fg=color233,bg=color241,bold] %a #[fg=color233,bg=color245,bold] %d/%m %H:%M ' +set -g status-right-length 50 + +# Clipboard related, I don't know shit about this +set-option -g update-environment " DISPLAY" +set-option -s set-clipboard off +bind P paste-buffer +#bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + +#unbind -T copy-mode-vi y +#bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" + +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send-keys -X copy-pipe 'xclip -in -selection clipboard &> /dev/null' +bind -T copy-mode-vi Enter send-keys -X cancel + +#bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection c" +#bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard" +#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard' + +unbind r +bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded" diff --git a/.config/yt-dlp/norm_config b/.config/yt-dlp/norm_config new file mode 100755 index 0000000..bb57f24 --- /dev/null +++ b/.config/yt-dlp/norm_config @@ -0,0 +1,15 @@ +--no-playlist +--no-keep-fragments +--hls-use-mpegts +--no-windows-filenames +--no-continue +--no-mtime +--no-write-description +--console-title +--write-subs +--no-write-auto-subs +--restrict-filename +--trim-filenames 200 +--format 'bestvideo*+bestaudio/b' +--no-overwrites +--output '%(title)s,%(width)s_%(height)s_%(fps)s,%(duration_string)s,%(id)s.%(ext)s' diff --git a/.config/yt-dlp/plst_config b/.config/yt-dlp/plst_config new file mode 100755 index 0000000..164e86d --- /dev/null +++ b/.config/yt-dlp/plst_config @@ -0,0 +1,14 @@ +--yes-playlist +--no-keep-fragments +--hls-use-mpegts +--no-windows-filenames +--no-continue +--no-mtime +--no-write-description +--console-title +--write-subs +--restrict-filename +--trim-filenames 200 +--format 'bestvideo*+bestaudio/b' +--no-overwrites +--output '%(playlist_index)s__%(title)s,%(width)s_%(height)s_%(fps)s,%(duration_string)s,%(id)s.%(ext)s' diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..87a0e70 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,15 @@ +[credential] + helper = store +[core] + editor = nvim +[user] + name = Pratham Patel + email = thefirst1322@gmail.com +[color] + ui = auto +[init] + defaultBranch = master +[push] + default = simple +[diff] + tool = meld diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..458782e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# macOS junk +.DS_Store +._* diff --git a/.hushlogin b/.hushlogin new file mode 100644 index 0000000..e69de29 diff --git a/.profile b/.profile new file mode 100644 index 0000000..e560980 --- /dev/null +++ b/.profile @@ -0,0 +1,5 @@ +if command -v zsh; then + source $HOME/.zshrc +elif command -v bash; then + source $HOME/.bashrc +fi diff --git a/.scripts/flameboi/hdd/notify_user.sh b/.scripts/flameboi/hdd/notify_user.sh new file mode 100755 index 0000000..d429fa2 --- /dev/null +++ b/.scripts/flameboi/hdd/notify_user.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# detect the name of the display in use +display=":$(ls /tmp/.X11-unix/* | sed 's#/tmp/.X11-unix/X##' | head -n 1)" + +# detect the user using such display +user=$(who | grep '('$display')' | awk '{print $1}' | head -n 1) + +# detect the id of the user +uid=$(id -u $user) + +# send notif +sudo -u $user DISPLAY=$display DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send --urgency="$1" "$2" "$3" diff --git a/.scripts/flameboi/hdd/on_boot.sh b/.scripts/flameboi/hdd/on_boot.sh new file mode 100755 index 0000000..77eeeef --- /dev/null +++ b/.scripts/flameboi/hdd/on_boot.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# set standby timeout to 5 minutes (60*5 seconds) +/usr/sbin/hdparm -S 60 /dev/sda +/usr/sbin/hdparm -S 60 /dev/sdb +/usr/sbin/hdparm -S 60 /dev/sdc +/usr/sbin/hdparm -S 60 /dev/sdd + +/usr/bin/updatedb & +sleep 600s + +/home/pratham/.scripts/flameboi/hdd/notify_user.sh "critical" "Check HDDs" "Check if the HDDs are in standby ([re]boot-ed)" && exit 0 diff --git a/.scripts/flameboi/hdd/on_resume.sh b/.scripts/flameboi/hdd/on_resume.sh new file mode 100755 index 0000000..ecae04f --- /dev/null +++ b/.scripts/flameboi/hdd/on_resume.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +/usr/bin/updatedb & +sleep 600s + +/home/pratham/.scripts/flameboi/hdd/notify_user.sh "critical" "Check HDDs" "Check if the HDDs are in standby (resumed from suspend)" && exit 0 diff --git a/.scripts/other/sort.py b/.scripts/other/sort.py new file mode 100755 index 0000000..55a0ae2 --- /dev/null +++ b/.scripts/other/sort.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import sys +import os + + +def mk_list(): + + input_args = "" + for i in sys.argv: + input_args = input_args + " " + i + + input_args = list(dict.fromkeys(input_args.split(" "))) + + del input_args[0] + del input_args[0] + input_args.sort() + + return input_args + +to_print = mk_list() +print('[ %s ]' % ' '.join(map(str, to_print))) diff --git a/.scripts/xorg/root/restart_x.sh b/.scripts/xorg/root/restart_x.sh new file mode 100755 index 0000000..b1238a8 --- /dev/null +++ b/.scripts/xorg/root/restart_x.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [[ "$EUID" -ne 0 ]]; then + >&2 echo "fail: you are not root" + exit 1 +fi + +systemctl restart gdm.service diff --git a/.zkbd/xterm-256color b/.zkbd/xterm-256color new file mode 100644 index 0000000..1142497 --- /dev/null +++ b/.zkbd/xterm-256color @@ -0,0 +1,26 @@ +typeset -g -A key + +key[F1]='^[OP' +key[F2]='^[OQ' +key[F3]='^[OR' +key[F4]='^[OS' +key[F5]='^[[15~' +key[F6]='^[[17~' +key[F7]='^[[18~' +key[F8]='^[[19~' +key[F9]='^[[20~' +key[F10]='^[[21~' +key[F11]='''' +key[F12]='^[[24~' +key[Backspace]='^?' +key[Insert]='^[[2~' +key[Home]='^[[H' +key[PageUp]='^[[5~' +key[Delete]='^[[3~' +key[End]='^[[F' +key[PageDown]='^[[6~' +key[Up]='^[[A' +key[Left]='^[[D' +key[Down]='^[[B' +key[Right]='^[[C' +key[Menu]='''' diff --git a/.zsh_aliases b/.zsh_aliases new file mode 100644 index 0000000..9f32fec --- /dev/null +++ b/.zsh_aliases @@ -0,0 +1,195 @@ +export TIMEFMT=$'\nJob\t%J\n\nCPU\t%P\nuser\t%U\nsystem\t%S\ntotal\t%E' +[[ -d "$HOME/.cargo/bin" ]] && export PATH=$HOME/.cargo/bin:$PATH +[[ -d "$HOME/.local/bin" ]] && export PATH=$HOME/.local/bin:$PATH +[[ -d "/usr/local/sbin" ]] && export PATH=/usr/local/sbin:$PATH +typeset -U PATH + +# common aliases +alias flushSSH="ssh-keygen -R" +alias mtr='mtr --show-ips --displaymode 0 -o "LDR AGJMXI"' +alias update="source $HOME/.zshrc" # ~/.zshrc will automatically source ~/.zsh_aliases +alias custcp="rsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes" +alias pysort="python3 $HOME/.scripts/other/sort.py" +alias download="aria2c -x 16 -k 1M --file-allocation=none --continue=false" +alias vim="nvim" +alias ytdown="yt-dlp --config-location $HOME/.config/yt-dlp/norm_config --external-downloader aria2c" +alias playdl="yt-dlp --config-location $HOME/.config/yt-dlp/plst_config --external-downloader aria2c" +alias ytslow="yt-dlp --config-location $HOME/.config/yt-dlp/norm_config --no-part --concurrent-fragments 1 --limit-rate 4M" +alias gitaddpush="git remote set-url --add --push origin" +alias gitaddpull="git remote set-url --add --pull origin" + +if command -v batcat > /dev/null; then + alias bat="batcat" +fi + +alias sudo="sudo " +if command -v doas > /dev/null; then + unalias sudo + alias sudo="doas " +fi + +# some common functions +towebp() { + cwebp -q 80 "$1" -o "$1".webp +} + +togif() { + ffmpeg -i "$1" -pix_fmt rgb24 "$1".gif +} + + + +# Linux specific things +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + + # make less more friendly for non-text input files, see lesspipe(1) + [[ -x /usr/bin/lesspipe ]] && eval "$(SHELL=/bin/sh lesspipe)" + + export EDITOR=/usr/bin/nvim + export SYSTEMD_EDITOR=/usr/bin/nvim + + alias l="ls --group-directories-first --color=auto -v" + alias ll="ls --group-directories-first --color=auto -1lv" + alias la="ls --group-directories-first --color=auto -1Av" + alias lo="ls --group-directories-first --color=auto -1v" + alias llh="ls --group-directories-first --color=auto -1hlv" + alias lah="ls --group-directories-first --color=auto -1Ahlv" + alias ldt="ls --group-directories-first --color=auto -1Altv" + + alias grep="grep --color=auto" + alias greplv="grep --color=auto -lv" + alias grepli="grep --color=auto -li" + alias grepv="grep --color=auto -v" + alias grepi="grep --color=auto -i" + + alias tmux="/usr/bin/tmux -f $HOME/.config/tmux/tmux.conf" + alias ping="ping -W 0.1 -O" + alias pmount="mount -o gid=pratham,uid=pratham" + + source /etc/os-release + MACHINE_HOSTNAME=$(cat /etc/hostname) + + if [[ "$NAME" == "Pop\!_OS" && "$MACHINE_HOSTNAME" == "flameboi" ]]; then + + export OWNDIR=/heathen_disk + + alias sentinel="ssh ubuntu@sentinel.lan" + alias bluefeds="ssh pratham@bluefeds.lan" + + alias flatpakupdates="flatpak remote-ls --updates flathub" + alias mpv="/usr/bin/mpv --geometry=60% --vo=gpu --hwdec=vaapi" + alias pbcopy="xsel --clipboard --input" + alias pbpaste="xsel --clipboard --output" + + + # window manager + alias suslock="$HOME/.config/polybar/mods/module_suspend_script.sh" + alias gnomecontrolcenter="XDG_CURRENT_DESKTOP=GNOME gnome-control-center" + alias gnomecc="XDG_CURRENT_DESKTOP=GNOME gnome-control-center" + + + if command -v flatpak > /dev/null + then + + # Get a list of flatpak applications in the reverse domain name format + readarray -t ids < <(flatpak list --app --columns=application) + for id in "${ids[@]}" + do + # Take everything past the last dot (the name) + name="${id##*.}" + # Make it lowercase to approximate binary name + binary="${name,,}" + + # If there is not already a command at that name + if ! command -v "${binary}" > /dev/null + then + # Create an alias that runs the flatpak + alias "$binary=flatpak run \"$id\"" + fi + done + fi + + owndisk() { + sudo chmod 774 -R ${OWNDIR} + sudo /usr/bin/chown pratham:pratham -R ${OWNDIR} + find ${OWNDIR} -type f -exec chmod 660 {} \; + find ${OWNDIR} -type f -name "._*" -exec rm -iv {} \; + find ${OWNDIR} -type f -name "*.DS_Store" -exec rm -iv {} \; + } + + elif [[ "$NAME" == "Fedora Linux" && "$MACHINE_HOSTNAME" == "bluefeds" ]]; then + alias sentinel="ssh ubuntu@sentinel.lan" + alias clear="/usr/bin/clear && printf '\e[3J'" + alias confont="setfont /usr/share/consolefonts/Lat2-Terminus28x14.psf.gz" + alias containerupdate='podman auto-update --dry-run --format="{{.Unit}}\t{{.Updated}}"' + alias containerdisableall="systemctl --user disable container-gitea-chitragupta container-hugo-vaikunthnatham container-nextcloud-chitragupta container-hugo-mahayogi container-gitea-govinda container-nextcloud-govinda container-transmission-raadhe container-caddy-vishwambhar" + alias containerenableall="systemctl --user enable container-gitea-chitragupta container-hugo-vaikunthnatham container-nextcloud-chitragupta container-hugo-mahayogi container-gitea-govinda container-nextcloud-govinda container-transmission-raadhe container-caddy-vishwambhar" + + + containerstats() { + systemctl --user status \ + container-gitea-chitragupta \ + container-hugo-vaikunthnatham \ + container-nextcloud-chitragupta \ + container-hugo-mahayogi \ + container-gitea-govinda \ + container-nextcloud-govinda \ + container-transmission-raadhe \ + container-caddy-vishwambhar | grep '(running) since\|●\|ago' + + TOTAL_RUNNING=$(podman ps --format '{{.Names}}' | wc -l) + TOTAL_CONTAINERS=$(podman container list -a --format '{{.Names}}' | wc -l) + + echo -e "Running:\t${TOTAL_RUNNING}/8" + echo -e "Containers:\t${TOTAL_CONTAINERS}/8" + } + + rebuildzfs() { + ALL_KERNELS=($(sudo dnf info kernel | grep Source | awk '{print $3}' | sed "s/kernel-//g" | sed "s/src.rpm/$(uname -m)/g")) + LATEST_ZFS_VER=$(git ls-remote --refs --tags https://github.com/openzfs/zfs | cut --delimiter='/' --fields=3 | sort --version-sort | tail --lines=2 | head --lines=1 | sed "s/-/\//g") + + for KERN in ${ALL_KERNELS[@]}; do + ZFS_DKMS_STATUS=$(sudo dkms status -k ${KERN}) + + if [[ ${ZFS_DKMS_STATUS} =~ "zfs" ]]; then + echo -ne "ZFS is installed for ${KERN}, you may REINSTALL it using the following command:\nsudo dkms install ${LATEST_ZFS_VER} -k ${KERN}\n\n" + else + sudo dkms install ${LATEST_ZFS_VER} -k ${KERN} + echo -ne "\n--------------------------------------------------------------------------------\n" + fi + done + } + + + elif [[ "$NAME" == "Ubuntu" && "$MACHINE_HOSTNAME" == "sentinel" ]]; then + fi + +elif [[ "$OSTYPE" == "darwin"* ]];then + + export EDITOR=/usr/local/bin/nvim + + alias l="/usr/local/bin/gls --group-directories-first --color=auto -v" + alias ll="/usr/local/bin/gls --group-directories-first --color=auto -1lv" + alias la="/usr/local/bin/gls --group-directories-first --color=auto -1Av" + alias lo="/usr/local/bin/gls --group-directories-first --color=auto -1v" + alias llh="/usr/local/bin/gls --group-directories-first --color=auto -1hlv" + alias lah="/usr/local/bin/gls --group-directories-first --color=auto -1Ahlv" + alias ldt="/usr/local/bin/gls --group-directories-first --color=auto -1Altv" + + alias grep="/usr/local/bin/ggrep --color=auto" + alias greplv="/usr/local/bin/ggrep --color=auto -lv" + alias grepli="/usr/local/bin/ggrep --color=auto -li" + alias grepv="/usr/local/bin/ggrep --color=auto -v" + alias grepi="/usr/local/bin/ggrep --color=auto -i" + + alias xargs="/usr/local/opt/findutils/libexec/gnubin/xargs" + + alias flameboi="ssh pratham@flameboi.lan" + alias sentinel="ssh ubuntu@sentinel.lan" + alias bluefeds="ssh pratham@bluefeds.lan" + + alias tmux="/usr/local/bin/tmux -f $HOME/.config/tmux/tmux.conf" + alias clear="/usr/bin/clear && printf '\e[3J'" + alias ktb="sudo pkill TouchBarServer; killall ControlStrip" + alias mpv="/usr/local/bin/mpv --vo=libmpv" +fi diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..ff174b5 --- /dev/null +++ b/.zshrc @@ -0,0 +1,113 @@ + +# if not running interactively, do not do anything +case $- in + *i*) ;; + *) return;; +esac + +# load ~/.zsh_aliases if it exists +if [[ -f "$HOME/.zsh_aliases" ]]; then + source $HOME/.zsh_aliases +fi + +# load keybinds if they exist +if [[ -f "$HOME/.zkbd/$TERM" ]]; then + source $HOME/.zkbd/$TERM + [[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line + [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line + [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char +fi + +export TERM="xterm-256color" +#bindkey "^[[H" beginning-of-line +#bindkey "^[[F" end-of-line +#bindkey "^[[3~" delete-char + +# enable ZSH history +export HISTFILE=$HOME/.sh_history +export HISTFILESIZE=1000000000 +export HISTSIZE=1000000000 +export SAVEHIST=1000000000 +# refer to https://linux.die.net/man/1/zshoptions +setopt APPEND_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_SAVE_BY_COPY +setopt INC_APPEND_HISTORY + +# keep the space after tab auto-completion +ZLE_REMOVE_SUFFIX_CHARS="" + +# use Ctrl+left and Ctrl+right to jump a word back and forth respectively +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word +bindkey '^i' expand-or-complete-prefix + +# for using comments in interactive shell +setopt INTERACTIVECOMMENTS + +PROMPT=$'\n%F{11}─┬─[%f %F{5}%y %f%F{white}%? %D %*%f %F{11}]%f +%F{11} ├─[%f %F{red}%m:%f %F{white}%n%f %F{8}▶%f %F{cyan}%/%f %F{11}]%f +%F{11} ╰─>%F{11}%f ' + + +# common stuff for Linux +if [[ "$OSTYPE" == "linux-gnu"* ]] +then + + # syntax highlighting + ZSH_SYNTAX_HIGH="/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" + if [[ -f "$ZSH_SYNTAX_HIGH" ]]; then + source $ZSH_SYNTAX_HIGH + fi + + + source /etc/os-release + MACHINE_HOSTNAME=$(cat /etc/hostname) + + if [[ "$NAME" = "Pop!_OS" && "$MACHINE_HOSTNAME" == "flameboi" ]]; then + # The following lines were added by compinstall + zstyle ':completion:*' completer _expand _complete _ignored + zstyle ':completion:*' group-name '' + zstyle :compinstall filename "$HOME/.zshrc" + + autoload -Uz compinit + compinit + # End of lines added by compinstall + fi + + + if [[ "$NAME" = "Fedora Linux" && "$MACHINE_HOSTNAME" == "bluefeds" ]]; then + # use bigger fonts in tty + case $(tty) in + (/dev/tty[0-9]) setfont /usr/share/consolefonts/Lat2-Terminus28x14.psf.gz;; + (/dev/pts/[0-9]) ;; + esac + + export LC_ALL=en_US.UTF-8 + export LANG=en_US.UTF-8 + fi + + + if [[ "$NAME" = "Ubuntu" && "$MACHINE_HOSTNAME" == "sentinel" ]]; then + # use bigger fonts in tty + case $(tty) in + (/dev/tty[0-9]) setfont /usr/share/consolefonts/Lat2-Terminus28x14.psf.gz;; + (/dev/pts/[0-9]) ;; + esac + + export LC_ALL=en_US.UTF-8 + export LANG=en_US.UTF-8 + fi + +# stuff for macOS +elif [[ "$OSTYPE" == "darwin"* ]] +then + + # syntax highlighting + ZSH_SYNTAX_HIGH="/usr/local/opt/zsh-fast-syntax-highlighting/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" + if [[ -f "$ZSH_SYNTAX_HIGH" ]]; then + source $ZSH_SYNTAX_HIGH + fi +fi diff --git a/README.md b/README.md new file mode 100644 index 0000000..84090ea --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# README + +Initial setup: + - `git clone git@git.thefossguy.com:thefossguy/dotfiles-priv.git` + - Uncomment the most appropriate line in `~/.config/alacritty/alacritty.yml`, under `import` (line 11) diff --git a/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-boot.service b/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-boot.service new file mode 100644 index 0000000..8ad0cd3 --- /dev/null +++ b/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-boot.service @@ -0,0 +1,9 @@ +[Unit] +Description=Notify the user regarding HDDs upon boot + +[Service] +ExecStart=/usr/bin/bash /home/pratham/.scripts/flameboi/hdd/on_boot.sh & +Type=simple + +[Install] +WantedBy=multi-user.target diff --git a/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-resume.service b/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-resume.service new file mode 100644 index 0000000..d45773f --- /dev/null +++ b/_SYSTEMD/flameboi_etc/systemd/system/hdd-standby-on-resume.service @@ -0,0 +1,10 @@ +[Unit] +Description=Put HDDs to sleep after waking up from suspend +After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target graphical.target + +[Service] +ExecStart=/usr/bin/bash /home/pratham/.scripts/flameboi/hdd/on_resume.sh & +Type=simple + +[Install] +WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target