commit 56146dd096a7a66578e6e9cd47f0cedcd2644f1c Author: Dominic Reich Date: Sat Feb 18 21:12:37 2023 +0100 initial commit diff --git a/.Xresources b/.Xresources new file mode 100644 index 0000000..57452c9 --- /dev/null +++ b/.Xresources @@ -0,0 +1,4 @@ +! Xcursor.theme: Sweet-cursors +! Xcursor.theme: oxy-neon +Xcursor.theme: Future-cursors +Xcursor.size: 16 diff --git a/.abook/abookrc b/.abook/abookrc new file mode 100755 index 0000000..3c7f41e --- /dev/null +++ b/.abook/abookrc @@ -0,0 +1,83 @@ +# abook configuration file +# see abookrc(5) for detailed explanation + +# Defining a new custom field +# ----------------------------- +# +# syntax: field = [ , ] +# +# with being one of 'string' (default), 'emails', 'list', or 'date' +# +# Example of field definitions: +field address_lines = Adresse, list +field firma = Firma, string +field birthday = Geburtstag, date + +# Defining a view/tab +# --------------------- +# +# view = [ , , ... ] +# +# with being the identifier of a field declared with the 'field' +# command, or the identifier of a standard field. +# +# Standard fields: +# name, email, +# address, address2, city, state, zip, country, +# phone, workphone, fax, mobile, +# nick, url, notes, anniversary +# +# Note: if you don't define any view, abook will use a default display based +# on the above standard fields. +# +# Example of views: +view KONTAKT = name, nick, email, birthday, firma +view ADRESSE = address_lines, zip, city, state, country +view TELEFON = phone, workphone, mobile +view OTHER = url, notes, + +set autosave=true +# It must be one of 'all', 'standard' (default), or 'none'. +# * 'all': preserve any completely unknown field. +# * 'standard': only preserve the standard fields (see a list in the +# description of the 'view' command) and the legacy +# 'custom[1-5]' fields. +# * 'none': discards any unknown field. +set preserve_fields=standard + +# Show all email addresses in list +set show_all_emails=false + +# The below example displays: +# * the content of the 'name' field (with a maximum of 22 characters) +# * the first of the 'phone', 'workphone' or 'mobile' fields +# happening not to be empty (right aligned within 12 characters) +# * the 'anniversary' field, with no length limit +#set index_format=" {name:25} {phone:-12|workphone|mobile} {anniversary}" +#set index_format=" {name:35} {email:30} {phone:-18|workphone|mobile} {firma}" +set index_format=" {name:35} {email:30} {firma}" + +# Command used to start mutt +set mutt_command=mutt + +# Return all email addresses to a mutt query +set mutt_return_all_emails=true + +# Command used to print +set print_command=lp + +# Command used to start the web browser +set www_command=firefox + +# address style [eu|us|uk] +set address_style=eu + +# use ASCII characters only +set use_ascii_only=false +set add_email_prevent_duplicates=false + +# field to be used with "sort by field" command +set sort_field=firma + +# show cursor in main display +set show_cursor=false diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..5545f00 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,5 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..a355b0c --- /dev/null +++ b/.bashrc @@ -0,0 +1,9 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias ls='ls --color=auto' +PS1='[\u@\h \W]\$ ' diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..38a77c5 --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,295 @@ +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ ║ +# ║ ┏━━━━━━━━━━━━┓ ║ +# ║ ┃════════════┃ ║ +# ║ ┏━━┛════════════┗━━┓ ║ +# ║ ┃══════════════════┃ ║ +# ║ ┏━━┛══════════════════┗━━┓ ║ +# ║ ┃══════════┏━━┓══════════┃ ║ +# ║ ┃════════┏━┛ ┗━┓════════┃ ║ +# ║ ┃════════┃ ┏━━┓ ┃════════┃ ║ +# ║ ┏━━┛════════┃ ┃══┃ ┃════════┗━━┓ ║ +# ║ ┃═════════┏━┛ ┃══┃ ┗━┓═════════┃ ║ +# ║ ┃═════════┃ ┏━┛══┗━┓ ┃═════════┃ ║ +# ║ ┏━━┛═════════┃ ┃══════┃ ┃═════════┗━━┓ ║ +# ║ ┃══════════┏━┛ ┃══════┃ ┗━┓══════════┃ ║ +# ║ ┃══════════┃ ┏━┛══════┗━┓ ┃══════════┃ ║ +# ║ ┏━━┛══════════┃ ┃══════════┃ ┃══════════┗━━┓ ║ +# ║ ┃═════════════┃ ┗━┓══════┏━┛ ┃═════════════┃ ║ +# ║ ┃═══════════┏━┛ ┃══════┃ ┗━┓═══════════┃ ║ +# ║ ┃═══════════┃ ┃══════┃ ┃═══════════┃ ║ +# ║ ┏━━┛═════════┏━┛ ┗━┓══┏━┛ ┗━┓═════════┗━━┓ ║ +# ║ ┃════════════┃ ┃══┃ ┃════════════┃ ║ +# ║ ┃════════════┃ ┃══┃ ┃════════════┃ ║ +# ║ ┗━━━━━━━━━━━━┛ ┃══┃ ┗━━━━━━━━━━━━┛ ║ +# ║ ┗━━┛ ║ +# ║ ║ +# ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +# ║ ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +env: + TERM: xterm-256color + +shell: + program: /usr/bin/zsh + args: + - --login +window: + # dimensions: + # columns: 280 + # lines: 86 + padding: + x: 8 + y: 8 + dynamic_padding: true + dynamic_title: true + #decorations: none + #startup_mode: Windowed + # opacity: 0.96 + opacity: 1.0 + # opacity: 0.8 +scrolling: + history: 10000 + multiplier: 1 +font: + normal: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Regular + bold: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Bold + italic: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Italic + size: 12 + offset: + x: 0 + y: 0 + glyph_offset: + x: 0 + y: 0 + # `use_thin_strokes` was removed. On macOS, use: + # defaults write -g AppleFontSmoothing -int 0 + # DEPRECATED: use_thin_strokes: true +draw_bold_text_with_bright_colors: true +schemes: + dark: &dark + primary: + background: '0x040606' + foreground: '0xbde7e5' + cursor: + text: '0xFEFFFF' + cursor: '0xc7c7c7' + normal: + black: '#161821' + red: '#e27878' + green: '#b4be82' + yellow: '#e2a478' + blue: '#84a0c6' + magenta: '#a093c7' + cyan: '#89b8c2' + white: '#c6c8d1' + bright: + black: '#6b7089' + red: '#e98989' + green: '#c0ca8e' + yellow: '#e9b189' + blue: '#91acd1' + magenta: '#ada0d3' + cyan: '#95c4ce' + white: '#d2d4de' + # dim: + # black: '0x333366' + # red: '0x6666cc' + # green: '0x0099cc' + # yellow: '0x3366cc' + # blue: '0x006699' + # magenta: '0x0066ff' + # cyan: '0x669999' + # white: '0x99cccc' +colors: *dark +bell: + animation: Linear + duration: 0 + color: '0x320F09' +# mouse_bindings: + # - { mouse: Middle, action: None } +mouse: + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + hide_when_typing: false + # hints: + # enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift +selection: + semantic_escape_chars: ",│`|:\"' ()[]{}<>" + save_to_clipboard: false +cursor: + style: Block + unfocused_hollow: true +live_config_reload: true +working_directory: None +enable_experimental_conpty_backend: false +alt_send_esc: true +debug: + render_timer: false + persistent_logging: false + log_level: Warn + print_events: false + ref_test: false +key_bindings: + - { key: Paste, action: Paste } + - { key: Copy, action: Copy } + # - { key: L, mods: Control, action: ClearLogNotice } + # - { key: L, mods: Control, chars: "\x0c" } + - { key: Home, mods: Alt, chars: "\x1b[1;3H" } + - { key: Home, chars: "\x1bOH", mode: AppCursor } + - { key: Home, chars: "\x1b[H", mode: ~AppCursor } + - { key: End, mods: Alt, chars: "\x1b[1;3F" } + - { key: End, chars: "\x1bOF", mode: AppCursor } + - { key: End, chars: "\x1b[F", mode: ~AppCursor } + - { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } + - { key: PageUp, mods: Shift, chars: "\x1b[5;2~", mode: Alt } + - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } + - { key: PageUp, mods: Alt, chars: "\x1b[5;3~" } + - { key: PageUp, chars: "\x1b[5~" } + - { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } + - { key: PageDown, mods: Shift, chars: "\x1b[6;2~", mode: Alt } + - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } + - { key: PageDown, mods: Alt, chars: "\x1b[6;3~" } + - { key: PageDown, chars: "\x1b[6~" } + - { key: Tab, mods: Shift, chars: "\x1b[Z" } + - { key: Back, chars: "\x7f" } + - { key: Back, mods: Alt, chars: "\x1b\x7f" } + - { key: Insert, chars: "\x1b[2~" } + - { key: Delete, chars: "\x1b[3~" } + - { key: Left, mods: Shift, chars: "\x1b[1;2D" } + - { key: Left, mods: Control, chars: "\x1b[1;5D" } + - { key: Left, mods: Alt, chars: "\x1b[1;3D" } + - { key: Left, chars: "\x1b[D", mode: ~AppCursor } + - { key: Left, chars: "\x1bOD", mode: AppCursor } + - { key: Right, mods: Shift, chars: "\x1b[1;2C" } + - { key: Right, mods: Control, chars: "\x1b[1;5C" } + - { key: Right, mods: Alt, chars: "\x1b[1;3C" } + - { key: Right, chars: "\x1b[C", mode: ~AppCursor } + - { key: Right, chars: "\x1bOC", mode: AppCursor } + - { key: Up, mods: Shift, chars: "\x1b[1;2A" } + - { key: Up, mods: Control, chars: "\x1b[1;5A" } + - { key: Up, mods: Alt, chars: "\x1b[1;3A" } + - { key: Up, chars: "\x1b[A", mode: ~AppCursor } + - { key: Up, chars: "\x1bOA", mode: AppCursor } + - { key: Down, mods: Shift, chars: "\x1b[1;2B" } + - { key: Down, mods: Control, chars: "\x1b[1;5B" } + - { key: Down, mods: Alt, chars: "\x1b[1;3B" } + - { key: Down, chars: "\x1b[B", mode: ~AppCursor } + - { key: Down, chars: "\x1bOB", mode: AppCursor } + - { key: F1, chars: "\x1bOP" } + - { key: F2, chars: "\x1bOQ" } + - { key: F3, chars: "\x1bOR" } + - { key: F4, chars: "\x1bOS" } + - { key: F5, chars: "\x1b[15~" } + - { key: F6, chars: "\x1b[17~" } + - { key: F7, chars: "\x1b[18~" } + - { key: F8, chars: "\x1b[19~" } + - { key: F9, chars: "\x1b[20~" } + - { key: F10, chars: "\x1b[21~" } + - { key: F11, chars: "\x1b[23~" } + - { key: F12, chars: "\x1b[24~" } + - { key: F1, mods: Shift, chars: "\x1b[1;2P" } + - { key: F2, mods: Shift, chars: "\x1b[1;2Q" } + - { key: F3, mods: Shift, chars: "\x1b[1;2R" } + - { key: F4, mods: Shift, chars: "\x1b[1;2S" } + - { key: F5, mods: Shift, chars: "\x1b[15;2~" } + - { key: F6, mods: Shift, chars: "\x1b[17;2~" } + - { key: F7, mods: Shift, chars: "\x1b[18;2~" } + - { key: F8, mods: Shift, chars: "\x1b[19;2~" } + - { key: F9, mods: Shift, chars: "\x1b[20;2~" } + - { key: F10, mods: Shift, chars: "\x1b[21;2~" } + - { key: F11, mods: Shift, chars: "\x1b[23;2~" } + - { key: F12, mods: Shift, chars: "\x1b[24;2~" } + - { key: F1, mods: Control, chars: "\x1b[1;5P" } + - { key: F2, mods: Control, chars: "\x1b[1;5Q" } + - { key: F3, mods: Control, chars: "\x1b[1;5R" } + - { key: F4, mods: Control, chars: "\x1b[1;5S" } + - { key: F5, mods: Control, chars: "\x1b[15;5~" } + - { key: F6, mods: Control, chars: "\x1b[17;5~" } + - { key: F7, mods: Control, chars: "\x1b[18;5~" } + - { key: F8, mods: Control, chars: "\x1b[19;5~" } + - { key: F9, mods: Control, chars: "\x1b[20;5~" } + - { key: F10, mods: Control, chars: "\x1b[21;5~" } + - { key: F11, mods: Control, chars: "\x1b[23;5~" } + - { key: F12, mods: Control, chars: "\x1b[24;5~" } + - { key: F1, mods: Alt, chars: "\x1b[1;6P" } + - { key: F2, mods: Alt, chars: "\x1b[1;6Q" } + - { key: F3, mods: Alt, chars: "\x1b[1;6R" } + - { key: F4, mods: Alt, chars: "\x1b[1;6S" } + - { key: F5, mods: Alt, chars: "\x1b[15;6~" } + - { key: F6, mods: Alt, chars: "\x1b[17;6~" } + - { key: F7, mods: Alt, chars: "\x1b[18;6~" } + - { key: F8, mods: Alt, chars: "\x1b[19;6~" } + - { key: F9, mods: Alt, chars: "\x1b[20;6~" } + - { key: F10, mods: Alt, chars: "\x1b[21;6~" } + - { key: F11, mods: Alt, chars: "\x1b[23;6~" } + - { key: F12, mods: Alt, chars: "\x1b[24;6~" } + - { key: F1, mods: Super, chars: "\x1b[1;3P" } + - { key: F2, mods: Super, chars: "\x1b[1;3Q" } + - { key: F3, mods: Super, chars: "\x1b[1;3R" } + - { key: F4, mods: Super, chars: "\x1b[1;3S" } + - { key: F5, mods: Super, chars: "\x1b[15;3~" } + - { key: F6, mods: Super, chars: "\x1b[17;3~" } + - { key: F7, mods: Super, chars: "\x1b[18;3~" } + - { key: F8, mods: Super, chars: "\x1b[19;3~" } + - { key: F9, mods: Super, chars: "\x1b[20;3~" } + - { key: F10, mods: Super, chars: "\x1b[21;3~" } + - { key: F11, mods: Super, chars: "\x1b[23;3~" } + - { key: F12, mods: Super, chars: "\x1b[24;3~" } + - { key: NumpadEnter, chars: "\n" } + - { key: N, mods: Command, chars: "\x01c" } + - { key: Return, mods: Command, chars: "\x01c" } + - { key: T, mods: Command, chars: "\x01\x3d" } + - { key: T, mods: Command|Shift, chars: "\x01\x2d" } + - { key: W, mods: Command, chars: "\x01&" } + - { key: Tab, mods: Alt, chars: "\x01n" } + - { key: Tab, mods: Alt|Shift, chars: "\x01p" } + - { key: R, mods: Command|Shift, chars: "\x01," } + - { key: H, mods: Command, chars: "\x01\x1b\x5b\x44" } + - { key: L, mods: Command, chars: "\x01\x1b\x5b\x43" } + - { key: K, mods: Command, chars: "\x01\x1b\x5b\x41" } + - { key: J, mods: Command, chars: "\x01\x1b\x5b\x42" } + - { key: Left, mods: Command, chars: "\x01\x1b\x5b\x44" } + - { key: Right, mods: Command, chars: "\x01\x1b\x5b\x43" } + - { key: Up, mods: Command, chars: "\x01\x1b\x5b\x41" } + - { key: Down, mods: Command, chars: "\x01\x1b\x5b\x42" } + - { key: Left, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x44"} + - { key: Right, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x43"} + - { key: K, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x41"} + - { key: J, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x42"} + - { key: H, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x44"} + - { key: L, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x43"} + - { key: Up, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x41"} + - { key: Down, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x42"} + - { key: Key1, mods: Command, chars: "\x01\x30" } + - { key: Key2, mods: Command, chars: "\x01\x31" } + - { key: Key3, mods: Command, chars: "\x01\x32" } + - { key: Key4, mods: Command, chars: "\x01\x33" } + - { key: Key5, mods: Command, chars: "\x01\x34" } + - { key: Key6, mods: Command, chars: "\x01\x35" } + - { key: Key7, mods: Command, chars: "\x01\x36" } + - { key: Key8, mods: Command, chars: "\x01\x37" } + - { key: Key9, mods: Command, chars: "\x01\x38" } + - { key: Key0, mods: Command, chars: "\x01\x39" } + - { key: B, mods: Alt, chars: "\x1b\x62" } + - { key: F, mods: Alt, chars: "\x1b\x66" } diff --git a/.config/alacritty/neomutt.yml b/.config/alacritty/neomutt.yml new file mode 100644 index 0000000..68891ad --- /dev/null +++ b/.config/alacritty/neomutt.yml @@ -0,0 +1,294 @@ +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ ║ +# ║ ┏━━━━━━━━━━━━┓ ║ +# ║ ┃════════════┃ ║ +# ║ ┏━━┛════════════┗━━┓ ║ +# ║ ┃══════════════════┃ ║ +# ║ ┏━━┛══════════════════┗━━┓ ║ +# ║ ┃══════════┏━━┓══════════┃ ║ +# ║ ┃════════┏━┛ ┗━┓════════┃ ║ +# ║ ┃════════┃ ┏━━┓ ┃════════┃ ║ +# ║ ┏━━┛════════┃ ┃══┃ ┃════════┗━━┓ ║ +# ║ ┃═════════┏━┛ ┃══┃ ┗━┓═════════┃ ║ +# ║ ┃═════════┃ ┏━┛══┗━┓ ┃═════════┃ ║ +# ║ ┏━━┛═════════┃ ┃══════┃ ┃═════════┗━━┓ ║ +# ║ ┃══════════┏━┛ ┃══════┃ ┗━┓══════════┃ ║ +# ║ ┃══════════┃ ┏━┛══════┗━┓ ┃══════════┃ ║ +# ║ ┏━━┛══════════┃ ┃══════════┃ ┃══════════┗━━┓ ║ +# ║ ┃═════════════┃ ┗━┓══════┏━┛ ┃═════════════┃ ║ +# ║ ┃═══════════┏━┛ ┃══════┃ ┗━┓═══════════┃ ║ +# ║ ┃═══════════┃ ┃══════┃ ┃═══════════┃ ║ +# ║ ┏━━┛═════════┏━┛ ┗━┓══┏━┛ ┗━┓═════════┗━━┓ ║ +# ║ ┃════════════┃ ┃══┃ ┃════════════┃ ║ +# ║ ┃════════════┃ ┃══┃ ┃════════════┃ ║ +# ║ ┗━━━━━━━━━━━━┛ ┃══┃ ┗━━━━━━━━━━━━┛ ║ +# ║ ┗━━┛ ║ +# ║ ║ +# ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +# ║ ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +env: + TERM: xterm-256color + +shell: + program: /usr/bin/zsh + args: + - --login +window: + # dimensions: + # columns: 280 + # lines: 86 + padding: + x: 8 + y: 8 + dynamic_padding: true + dynamic_title: true + decorations: none + startup_mode: Windowed + # opacity: 0.96 + opacity: 0.9 +scrolling: + history: 10000 + multiplier: 1 +font: + normal: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Regular + bold: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Bold + italic: + family: 'FantasqueSansMono Nerd Font' + # style: Retina,Regular + style: Italic + size: 14.0 + offset: + x: 0 + y: 0 + glyph_offset: + x: 0 + y: 0 + # `use_thin_strokes` was removed. On macOS, use: + # defaults write -g AppleFontSmoothing -int 0 + # DEPRECATED: use_thin_strokes: true +draw_bold_text_with_bright_colors: true +schemes: + dark: &dark + primary: + background: '0x040606' + foreground: '0xbde7e5' + cursor: + text: '0xFEFFFF' + cursor: '0xc7c7c7' + normal: + black: '#161821' + red: '#e27878' + green: '#b4be82' + yellow: '#e2a478' + blue: '#84a0c6' + magenta: '#a093c7' + cyan: '#89b8c2' + white: '#c6c8d1' + bright: + black: '#6b7089' + red: '#e98989' + green: '#c0ca8e' + yellow: '#e9b189' + blue: '#91acd1' + magenta: '#ada0d3' + cyan: '#95c4ce' + white: '#d2d4de' + # dim: + # black: '0x333366' + # red: '0x6666cc' + # green: '0x0099cc' + # yellow: '0x3366cc' + # blue: '0x006699' + # magenta: '0x0066ff' + # cyan: '0x669999' + # white: '0x99cccc' +colors: *dark +bell: + animation: Linear + duration: 0 + color: '0x320F09' +mouse_bindings: + - { mouse: Middle, action: None } +mouse: + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + hide_when_typing: false + # hints: + # enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift +selection: + semantic_escape_chars: ",│`|:\"' ()[]{}<>" + save_to_clipboard: false +cursor: + style: Block + unfocused_hollow: true +live_config_reload: true +working_directory: None +enable_experimental_conpty_backend: false +alt_send_esc: true +debug: + render_timer: false + persistent_logging: false + log_level: Warn + print_events: false + ref_test: false +key_bindings: + - { key: Paste, action: Paste } + - { key: Copy, action: Copy } + # - { key: L, mods: Control, action: ClearLogNotice } + # - { key: L, mods: Control, chars: "\x0c" } + - { key: Home, mods: Alt, chars: "\x1b[1;3H" } + - { key: Home, chars: "\x1bOH", mode: AppCursor } + - { key: Home, chars: "\x1b[H", mode: ~AppCursor } + - { key: End, mods: Alt, chars: "\x1b[1;3F" } + - { key: End, chars: "\x1bOF", mode: AppCursor } + - { key: End, chars: "\x1b[F", mode: ~AppCursor } + - { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } + - { key: PageUp, mods: Shift, chars: "\x1b[5;2~", mode: Alt } + - { key: PageUp, mods: Control, chars: "\x1b[5;5~" } + - { key: PageUp, mods: Alt, chars: "\x1b[5;3~" } + - { key: PageUp, chars: "\x1b[5~" } + - { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } + - { key: PageDown, mods: Shift, chars: "\x1b[6;2~", mode: Alt } + - { key: PageDown, mods: Control, chars: "\x1b[6;5~" } + - { key: PageDown, mods: Alt, chars: "\x1b[6;3~" } + - { key: PageDown, chars: "\x1b[6~" } + - { key: Tab, mods: Shift, chars: "\x1b[Z" } + - { key: Back, chars: "\x7f" } + - { key: Back, mods: Alt, chars: "\x1b\x7f" } + - { key: Insert, chars: "\x1b[2~" } + - { key: Delete, chars: "\x1b[3~" } + - { key: Left, mods: Shift, chars: "\x1b[1;2D" } + - { key: Left, mods: Control, chars: "\x1b[1;5D" } + - { key: Left, mods: Alt, chars: "\x1b[1;3D" } + - { key: Left, chars: "\x1b[D", mode: ~AppCursor } + - { key: Left, chars: "\x1bOD", mode: AppCursor } + - { key: Right, mods: Shift, chars: "\x1b[1;2C" } + - { key: Right, mods: Control, chars: "\x1b[1;5C" } + - { key: Right, mods: Alt, chars: "\x1b[1;3C" } + - { key: Right, chars: "\x1b[C", mode: ~AppCursor } + - { key: Right, chars: "\x1bOC", mode: AppCursor } + - { key: Up, mods: Shift, chars: "\x1b[1;2A" } + - { key: Up, mods: Control, chars: "\x1b[1;5A" } + - { key: Up, mods: Alt, chars: "\x1b[1;3A" } + - { key: Up, chars: "\x1b[A", mode: ~AppCursor } + - { key: Up, chars: "\x1bOA", mode: AppCursor } + - { key: Down, mods: Shift, chars: "\x1b[1;2B" } + - { key: Down, mods: Control, chars: "\x1b[1;5B" } + - { key: Down, mods: Alt, chars: "\x1b[1;3B" } + - { key: Down, chars: "\x1b[B", mode: ~AppCursor } + - { key: Down, chars: "\x1bOB", mode: AppCursor } + - { key: F1, chars: "\x1bOP" } + - { key: F2, chars: "\x1bOQ" } + - { key: F3, chars: "\x1bOR" } + - { key: F4, chars: "\x1bOS" } + - { key: F5, chars: "\x1b[15~" } + - { key: F6, chars: "\x1b[17~" } + - { key: F7, chars: "\x1b[18~" } + - { key: F8, chars: "\x1b[19~" } + - { key: F9, chars: "\x1b[20~" } + - { key: F10, chars: "\x1b[21~" } + - { key: F11, chars: "\x1b[23~" } + - { key: F12, chars: "\x1b[24~" } + - { key: F1, mods: Shift, chars: "\x1b[1;2P" } + - { key: F2, mods: Shift, chars: "\x1b[1;2Q" } + - { key: F3, mods: Shift, chars: "\x1b[1;2R" } + - { key: F4, mods: Shift, chars: "\x1b[1;2S" } + - { key: F5, mods: Shift, chars: "\x1b[15;2~" } + - { key: F6, mods: Shift, chars: "\x1b[17;2~" } + - { key: F7, mods: Shift, chars: "\x1b[18;2~" } + - { key: F8, mods: Shift, chars: "\x1b[19;2~" } + - { key: F9, mods: Shift, chars: "\x1b[20;2~" } + - { key: F10, mods: Shift, chars: "\x1b[21;2~" } + - { key: F11, mods: Shift, chars: "\x1b[23;2~" } + - { key: F12, mods: Shift, chars: "\x1b[24;2~" } + - { key: F1, mods: Control, chars: "\x1b[1;5P" } + - { key: F2, mods: Control, chars: "\x1b[1;5Q" } + - { key: F3, mods: Control, chars: "\x1b[1;5R" } + - { key: F4, mods: Control, chars: "\x1b[1;5S" } + - { key: F5, mods: Control, chars: "\x1b[15;5~" } + - { key: F6, mods: Control, chars: "\x1b[17;5~" } + - { key: F7, mods: Control, chars: "\x1b[18;5~" } + - { key: F8, mods: Control, chars: "\x1b[19;5~" } + - { key: F9, mods: Control, chars: "\x1b[20;5~" } + - { key: F10, mods: Control, chars: "\x1b[21;5~" } + - { key: F11, mods: Control, chars: "\x1b[23;5~" } + - { key: F12, mods: Control, chars: "\x1b[24;5~" } + - { key: F1, mods: Alt, chars: "\x1b[1;6P" } + - { key: F2, mods: Alt, chars: "\x1b[1;6Q" } + - { key: F3, mods: Alt, chars: "\x1b[1;6R" } + - { key: F4, mods: Alt, chars: "\x1b[1;6S" } + - { key: F5, mods: Alt, chars: "\x1b[15;6~" } + - { key: F6, mods: Alt, chars: "\x1b[17;6~" } + - { key: F7, mods: Alt, chars: "\x1b[18;6~" } + - { key: F8, mods: Alt, chars: "\x1b[19;6~" } + - { key: F9, mods: Alt, chars: "\x1b[20;6~" } + - { key: F10, mods: Alt, chars: "\x1b[21;6~" } + - { key: F11, mods: Alt, chars: "\x1b[23;6~" } + - { key: F12, mods: Alt, chars: "\x1b[24;6~" } + - { key: F1, mods: Super, chars: "\x1b[1;3P" } + - { key: F2, mods: Super, chars: "\x1b[1;3Q" } + - { key: F3, mods: Super, chars: "\x1b[1;3R" } + - { key: F4, mods: Super, chars: "\x1b[1;3S" } + - { key: F5, mods: Super, chars: "\x1b[15;3~" } + - { key: F6, mods: Super, chars: "\x1b[17;3~" } + - { key: F7, mods: Super, chars: "\x1b[18;3~" } + - { key: F8, mods: Super, chars: "\x1b[19;3~" } + - { key: F9, mods: Super, chars: "\x1b[20;3~" } + - { key: F10, mods: Super, chars: "\x1b[21;3~" } + - { key: F11, mods: Super, chars: "\x1b[23;3~" } + - { key: F12, mods: Super, chars: "\x1b[24;3~" } + - { key: NumpadEnter, chars: "\n" } + - { key: N, mods: Command, chars: "\x01c" } + - { key: Return, mods: Command, chars: "\x01c" } + - { key: T, mods: Command, chars: "\x01\x3d" } + - { key: T, mods: Command|Shift, chars: "\x01\x2d" } + - { key: W, mods: Command, chars: "\x01&" } + - { key: Tab, mods: Alt, chars: "\x01n" } + - { key: Tab, mods: Alt|Shift, chars: "\x01p" } + - { key: R, mods: Command|Shift, chars: "\x01," } + - { key: H, mods: Command, chars: "\x01\x1b\x5b\x44" } + - { key: L, mods: Command, chars: "\x01\x1b\x5b\x43" } + - { key: K, mods: Command, chars: "\x01\x1b\x5b\x41" } + - { key: J, mods: Command, chars: "\x01\x1b\x5b\x42" } + - { key: Left, mods: Command, chars: "\x01\x1b\x5b\x44" } + - { key: Right, mods: Command, chars: "\x01\x1b\x5b\x43" } + - { key: Up, mods: Command, chars: "\x01\x1b\x5b\x41" } + - { key: Down, mods: Command, chars: "\x01\x1b\x5b\x42" } + - { key: Left, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x44"} + - { key: Right, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x43"} + - { key: K, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x41"} + - { key: J, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x42"} + - { key: H, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x44"} + - { key: L, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x43"} + - { key: Up, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x41"} + - { key: Down, mods: Command|Shift, chars: "\x01\x1b\x5b\x31\x3b\x32\x42"} + - { key: Key1, mods: Command, chars: "\x01\x30" } + - { key: Key2, mods: Command, chars: "\x01\x31" } + - { key: Key3, mods: Command, chars: "\x01\x32" } + - { key: Key4, mods: Command, chars: "\x01\x33" } + - { key: Key5, mods: Command, chars: "\x01\x34" } + - { key: Key6, mods: Command, chars: "\x01\x35" } + - { key: Key7, mods: Command, chars: "\x01\x36" } + - { key: Key8, mods: Command, chars: "\x01\x37" } + - { key: Key9, mods: Command, chars: "\x01\x38" } + - { key: Key0, mods: Command, chars: "\x01\x39" } + - { key: B, mods: Alt, chars: "\x1b\x62" } + - { key: F, mods: Alt, chars: "\x1b\x66" } diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc new file mode 100644 index 0000000..3ea5a54 --- /dev/null +++ b/.config/dunst/dunstrc @@ -0,0 +1,458 @@ +# See dunst(5) for all configuration options + +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = mouse + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = (0, 800) + + # The maximum height of a single notification, excluding the frame. + height = 600 + + # Position the notification in the top right corner + origin = top-right + + # Offset from the origin + offset = 20x50 + + # Scale factor. It is auto-detected if value is 0. + scale = 0 + + # Maximum number of notification (0 means no limit) + notification_limit = 16 + + ### Progress bar ### + + # Turn on the progess bar. It appears when a progress hint is passed with + # for example dunstify -h int:value:12 + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + + # Show how many messages are currently hidden (because of + # notification_limit). + indicate_hidden = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). (X11 only) + transparency = 10 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + # If gap_size is greater than 0, this setting will be ignored. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 10 + + # Padding between text and icon. + text_icon_padding = 5 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 1 + + # Defines color of the frame around the notification window. + #frame_color = "#aaaaaa" + frame_color = "#788388" + + # Size of gap to display between notifications - requires a compositor. + # If value is greater than 0, separator_height will be ignored and a border + # of size frame_width will be drawn around each notification instead. + # Click events on gaps do not currently propagate to applications below. + gap_size = 6 + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + # TODO + #separator_color = frame + separator_color = auto + #separator_color = #263238 + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + # idle_threshold = 120 + + ### Text ### + + font = FantasqueSansMono Nerd Font 16 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # bold + # italic + # strikethrough + # underline + # + # For a complete reference see + # . + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = false + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = false + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + ### Icons ### + + # Recursive icon lookup. You can set a single theme, instead of having to + # define all lookup paths. + enable_recursive_icon_lookup = true + + # Set icon theme (only used for recursive icon lookup) + icon_theme = Adwaita + # You can also set multiple icon themes, with the leftmost one being used first. + # icon_theme = "Adwaita, breeze" + + # Align icons left/right/top/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 32 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 128 + + # Paths to default icons (only neccesary when not using recursive icon lookup) + icon_path = /usr/share/icons/Adwaita/32x32/status/:/usr/share/icons/Adwaita/32x32/devices/ + + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = yes + + # Maximum amount of notifications kept in history + history_length = 20 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/xdg-open + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + corner_radius = 3 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#222222" + foreground = "#888888" + timeout = 10 + # Icon for notifications with low urgency, uncomment to enable + #default_icon = /path/to/icon + +[urgency_normal] + background = "#285577" + foreground = "#ffffff" + timeout = 10 + # Icon for notifications with normal urgency, uncomment to enable + #default_icon = /path/to/icon + +[urgency_critical] + background = "#900000" + foreground = "#ffffff" + frame_color = "#ff0000" + timeout = 0 + # Icon for notifications with critical urgency, uncomment to enable + #default_icon = /path/to/icon + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# set_category +# timeout +# urgency +# icon_position +# skip_display +# history_ignore +# action_name +# word_wrap +# ellipsize +# alignment +# hide_text +# +# Shell-like globbing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/.config/fastfetch/config.conf b/.config/fastfetch/config.conf new file mode 100644 index 0000000..b908d5c --- /dev/null +++ b/.config/fastfetch/config.conf @@ -0,0 +1,411 @@ +# Fastfetch configuration +# Write every argument in different lines. +# Direct arguments will overwrite the corresponding ones in this file. +# Argument keys are not case sensitive. +# Whitespaces are trimmed at the beginning and the end. +# Empty lines or lines starting with # are ignored. + +# This file was shipped with 1.9.1. +# Use fastfetch --gen-config-force to overwrite this file with the current defaults + +# Below some often usefull options are listed. Uncomment and modify them so they take affect. +# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help". +# Of course all of them can be made persistent here too. + +# Config option: +# Load additional config files. +# Some are shipped with fastfetch, list them with "fastfetch --list-presets". +# Must be a path to a config file or the name of a shipped preset. +# The config file is completely loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones. +# Can be used multiple times to load multiple config files / presets. +#--load-config /path/to/config.txt + +# Structure option: +# Sets the modules to use and their order. +# Must be a list of module names, separated by colons. +# List available modules with "fastfetch --list-modules". +# Get the default structure with "fastfetch --print-structure". +#--structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:Display:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:PowerAdapter:Locale:Break:Colors + +# Multithreading option: +# Sets if fastfetch should use multiple threads to detect the values. +# Must be true or false. +# Default is true. +#--multithreading true + +# Print stat option: +# Sets if fastfetch should print time usage (in ms) for individual modules +# If true, it will also enable --show-errors +# Must be true or false. +# Default is false. +#--stat true + +# Slow operations option: +# Sets if fastfetch is allowed to use known slow operations to detect more / better values. +# Must be true or false. +# Default is false. +#--allow-slow-operations false + +# Linewrap option: +# Sets if fastfetch should disable linewrap during the run. +# Must be true or false. +# Default is true. +#--disable-linewrap true + +# Cursor option: +# Sets if fastfetch should hide the console cursor during the run. +# Must be true or false. +# Default is true. +#--hide-cursor true + +# Logo option: +# Sets the logo to use. +# List available logos with "fastfetch --list-logos". +# Print available logos with "fastfetch --print-logos". +# Must be the name of an available logo or a path to a text file containing a custom logo. +# Default is the current distribution. +#--logo arch + +# Logo type option: +# Sets the logo type to use. +# Must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty or chafa. +# Default is auto. +#--logo-type auto + +# Logo width option: +# Sets the width of the logo (in characters) if the logo is an image. +# Must be a positive integer. +# Default is 65. +#--logo-width 65 + +# Logo height option: +# Sets the height of the logo (in characters) if the logo is an image. +# Must be a positive integer. +# Default is 0 (keeps aspect ration). +#--logo-height 0 + +# Logo color options: +# Overwrite a color in the logo. Also works for user provided logos. +# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign. +# Must be linux console color codes or the name of a color. +# Default is the one specified by the logo. +# Use "fastfetch --help color" to learn more and see examples. +# Valid index range is [1-9]. +#--logo-color-1 red +#--logo-color-2 32 +# [...] +#--logo-color-9 yellow + +# Logo padding option: +# Adds a padding to the left and the right side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding 0 + +# Logo padding left option: +# Adds a padding to the left side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding-left 0 + +# Logo padding right option: +# Adds a padding to the right side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding-right 0 + +# Logo padding top option: +# Adds a padding to the top side of the logo. +# Must be a positive integer. +# Default is 0. +#--logo-padding-top 0 + +# Logo print remaining option: +# Sets if the remaining logo should be printed, it is has more lines than modules to show. +# Must be true or false. +# Default is true. +#--logo-print-remaining true + +# Color keys option: +# Sets the color of the keys. +# Must be linux console color codes or the name of a color. +# Default is the key color of the logo. +# Use "fastfetch --help color" to learn more and see examples. +--color-keys magenta + +# Color title option: +# Sets the color of the title. +# Must be linux console color codes or the name of a color. +# Default is the title color of the logo. +# Use "fastfetch --help color" to learn more and see examples. +# --color-title magenta + +# Binary prefix option: +# Sets the binary prefix to use. +# Must be a IEC, SI or JEDEC. +# Default is IEC. +#--binary-prefix IEC + +# Title FQDN option: +# Sets if the title should use the fully qualified domain name. +# Must be true or false. +# Default is false. +#--title-fqdn false + +# Separator option: +# Sets the string placed between a key and its value. +# Can be any string. +# Default is ": ". +#--separator ": " + +# Separator string option: +# Sets the string printed by the "separator" module (usually between title and rest of output) +# Must be any string. It is repated / cut to fit perfectly. +# Default is "-" +#--separator-string - + +# Public IP URL option: +# Sets the URL of public IP detection server to be used. +# Only HTTP protocol is supported, and the value should not contain "http://" prefix. +# Default is "ipinfo.io/ip". +#--public-ip-url "ipinfo.io/ip" + +# Public IP timeout option: +# Sets the time to wait for the public ip server to respond. +# Must be a positive integer. +# Default is 0 (disabled). +#--public-ip-timeout 0 + +# Weather output format option: +# Sets the weather format to be used. It must be URI encoded. +# See: https://github.com/chubin/wttr.in#one-line-output +# Default is "%t+-+%C+(%l)". +#--weather-output-format "%t+-+%C+(%l)" + +# Weather timeout option: +# Sets the time to wait for the weather server (wttr.in) to respond. +# Must be a positive integer. +# Default is 0 (disabled). +#--weather-timeout 0 + +# OS file option +# Sets the path to the file containing the operating system information. +# Should be a valid path to an existing file. +# Default is /etc/os-release. +#--os-file /etc/os-release + +# Player name option +# Sets the name of the player. This is also used in song detection +# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify) +# Default is the first match starting with org.mpris.MediaPlayer2. +#--player-name spotify + +# Escape bedrock option +# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one +# Must be true or false. +# Default is true. +#--escape-bedrock true + +# GL option +# Sets with opengl context creation library to use +# Must be either auto, egl, glx or osmesa +# Default is auto. +#--gl auto + +# GPU hide options +# Sets weather to hide certain gpu types +# Must be either true or false +# Default is false. +#--gpu-hide-integrated +#--gpu-hide-discrete + +# Shell option +# Sets if shell version should be detected and printed +# Must be either true or false +# Default is true. +#--shell-version true + +# Terminal option +# Sets if terminal version should be detected and printed +# Must be either true or false +# Default is true. +#--terminal-version true + +# Disk show options +# Sets if certain types of disk should be printed +# Must be either true or false +# Default is false except for --disk-show-removable. +#--disk-show-removable true +#--disk-show-hidden false +#--disk-show-subvolumes false +#--disk-show-unknown false + +# Disk option +# A colon (semicolon on Windows) separated list of folder paths for the disk output +# This option override `--disk-show-*` options above +# Must be a string +# Default is "/:/home" ("C:\;D:\ ..." on Windows). +#--disk-folders /:/home + +# Percentage output type option +# Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported. +# Only works with default format ( without --module-format option ). +# 0: prints none; 1: prints percent number only; 2: prints bar only; 3: prints both percent number and bar; 6: prints bar and hide other texts +#--percent-type 1 + +# Key options: +# Sets the displayed key of a module +# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help. +#--os-key OS +#--host-key Host +#--chassis-key Chassis +#--kernel-key Kernel +#--uptime-key Uptime +#--processes-key Processes +#--packages-key Packages +#--shell-key Shell +#--display-key Display {1} +#--brightness-key Brightness ({1}) +#--de-key DE +#--wm-key WM +#--wm-theme-key WM Theme +#--theme-key Theme +#--icons-key Icons +#--font-key Font +#--cursor-key Cursor +#--terminal-key Terminal +#--terminal-font-key Terminal Font +#--cpu-key CPU +#--cpu-usage-key CPU Usage +#--gpu-key GPU {1} +#--memory-key Memory +#--swap-key Swap +#--disk-key Disk ({1}) +#--battery-key Battery {1} +#--poweradapter-key Power Adapter {1} +#--locale-key Locale +#--local-ip-key Local IP ({1}) +#--public-ip-key Public IP +#--wifi-key Wifi +#--weather-key Weather +#--player-key Media Player +#--media-key Media +#--datetime-key Date Time +#--vulkan-key Vulkan +#--opengl-key OpenGL +#--opencl-key OpenCL +#--users-key Users + +# Format options: +# Sets the format string for module values. +# For information on format strings, see "fastfetch --help format". +# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format". +# An empty format string (As they are currently below) will behave as if it was not set. +#--os-format +#--host-format +#--chassis-format +#--kernel-format +#--uptime-format +#--processes-format +#--packages-format +#--shell-format +#--display-format +#--brightness-format +#--de-format +#--wm-format +#--wm-theme-format +#--theme-format +#--icons-format +#--font-format +#--cursor-format +#--terminal-format +#--terminal-font-format +#--cpu-format +#--cpu-usage-format +#--gpu-format +#--memory-format +#--swap-format +#--disk-format +#--battery-format +#--poweradapter-format +#--locale-format +#--local-ip-format +#--public-ip-format +#--weather-format +#--player-format +#--media-format +#--datetime-format +#--vulkan-format +#--opengl-format +#--opencl-format +#--users-format + +# Error options: +# Sets the format string to use if an error occured +# For information on format strings, see "fastfetch --help format". +# Each of them take the error as first and only argument. +# If one of them is set, the module will appear, even if --show-errors is not given. +#--os-error +#--host-error +#--chassis-error +#--kernel-error +#--uptime-error +#--processes-error +#--packages-error +#--shell-error +#--display-error +#--brightness-error +#--de-error +#--wm-error +#--wm-theme-error +#--theme-error +#--icons-error +#--font-error +#--cursor-error +#--terminal-error +#--terminal-font-error +#--cpu-error +#--cpu-usage-error +#--gpu-error +#--memory-error +#--swap-error +#--disk-error +#--battery-error +#--poweradapter-error +#--locale-error +#--local-ip-error +#--public-ip-error +#--weather-error +#--player-error +#--media-error +#--datetime-error +#--vulkan-error +#--opengl-error +#--opencl-error +#--users-error + +# Library options: +# Sets an user specific path to a library to load. +# Must be a valid path to a library. +#--lib-PCI /usr/lib/libpci.so +#--lib-vulkan /usr/lib/libvulkan.so (libMoltenVK.dylib on macOS) +#--lib-wayland /usr/lib/libwayland-client.so +#--lib-xcb-randr /usr/lib/libxcb-randr.so +#--lib-xcb /usr/lib/libxcb.so +#--lib-Xrandr /usr/lib/libXrandr.so +#--lib-X11 /usr/lib/libX11.so +#--lib-gio /usr/lib/libgio-2.0.so +#--lib-DConf /usr/lib/libdconf.so +#--lib-DBus /usr/lib/libdbus-1.so +#--lib-XFConf /usr/lib/libxfconf-0.so +#--lib-sqlite3 /usr/lib/libsqlite3.so +#--lib-rpm /usr/lib/librpm.so +#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so +#--lib-z /usr/lib/libz.so +#--lib-chafa /usr/lib/libchafa.so +#--lib-egl /usr/lib/libEGL.so +#--lib-glx /usr/lib/libGLX.so +#--lib-osmesa /usr/lib/libOSMesa.so +#--lib-opencl /usr/lib/libOpenCL.so +#--lib-cjson /usr/lib/libcjson.so +#--lib-freetype /data/data/com.termux/files/usr/lib diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..5d172a9 --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,181 @@ +set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" +## Source .profile to apply its values +# source .profile + +# .profile (for fish) + +if not set -q EDITOR + set -gx EDITOR 'nvim' +end +if not set -q VISUAL + set -gx VISUAL 'nvim' +end +if not set -q PAGER + set -gx PAGER 'less' +end +if not set -q BAT_PAGER + set -gx BAT_PAGER 'less -RF' +end + +if not set -q LANG + set -gx LANG 'de_AT.UTF-8' +end + +if test -d $HOME/go + set -gx -p PATH $HOME/go/bin + set -gx GOPATH $HOME/go +end + +if not set -q LESS + # -X to disable mouse-scroling + set -gx LESS '-g -i -M -R -S -w -z-4' +end + +# ## Add john git dir "/run" to PATH +# if test -d ~/git/john/run +# if not contains -- ~/git/john/run $PATH +# set -p PATH ~/git/john/run +# end +# end + +## Add ~/.local/bin to PATH +if test -d ~/.local/bin + if not contains -- ~/.local/bin $PATH + set -p PATH ~/.local/bin + end +end + +## add ~/bin to PATH +if test -d ~/bin + if not contains -- ~/bin $PATH + set -p PATH ~/bin + end +end + +## Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang +function __history_previous_command + switch (commandline -t) + case "!" + commandline -t $history[1]; commandline -f repaint + case "*" + commandline -i ! + end +end + +function __history_previous_command_arguments + switch (commandline -t) + case "!" + commandline -t "" + commandline -f history-token-search-backward + case "*" + commandline -i '$' + end +end + +if [ "$fish_key_bindings" = fish_vi_key_bindings ]; + bind -Minsert ! __history_previous_command + bind -Minsert '$' __history_previous_command_arguments +else + bind ! __history_previous_command + bind '$' __history_previous_command_arguments +end + +## Fish command history +function history + builtin history --show-time='%F %T ' +end + +#function backup --argument filename +# cp $filename $filename.bak +#end + +## Useful aliases +# Replace ls with exa +# alias ls='exa -al --color=always --group-directories-first' # preferred listing +# alias la='exa -a --color=always --group-directories-first' # all files and dirs +# alias ll='exa -l --color=always --group-directories-first' # long format +# alias lt='exa -aT --color=always --group-directories-first' # tree listing +# alias l.="exa -a | egrep '^\.'" + +# Replace some more things with better alternatives +#[ ! -x /usr/bin/bat ] && [ -x /usr/bin/cat ] && alias cat='bat' + +# Common use +alias aup="pamac upgrade --aur" +#alias grubup="sudo update-grub" +alias fixpacman="sudo rm /var/lib/pacman/db.lck" +#alias tarnow='tar -acf ' +#alias untar='tar -zxvf ' +alias wget='wget -c ' +alias psmem='ps auxf | sort -nr -k 4' +alias psmem10='ps auxf | sort -nr -k 4 | head -10' +alias upd='sudo reflector --latest 5 --age 2 --fastest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlist && sudo pacman -Syu && fish_update_completions && sudo updatedb' +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' +alias ......='cd ../../../../..' +alias dir='dir --color=auto' +alias vdir='vdir --color=auto' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias hw='hwinfo --short' # Hardware Info +alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB (expac must be installed) +alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages +# +## Get fastest mirrors +alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist" +alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist" +alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist" +alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist" + +#Cleanup orphaned packages +alias cleanup='sudo pacman -Rns (pacman -Qtdq)' + +#get the error messages from journalctl +alias jctl="journalctl -p 3 -xb" + +#Recent Installed Packages +alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" + +alias nvmi=nvim + +# Run paleofetch if session is interactive +if status --is-interactive + # if command -vq fastfetch + # fastfetch + # end + if command -vq randomquote.pl + randomquote.pl + echo + end +end + +if type -q "zeit" + set -x ZEIT_DB ~/.config/zeit.db +end + +if type -q "geld" + set -x GELD_DB ~/.config/geld.db +end + +# Ensure that GPG Agent is used as the SSH agent +set -e SSH_AUTH_SOCK +#set -U -x SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh +set -U -x SSH_AUTH_SOCK /run/user/(id -u)/gnupg/S.gpg-agent.ssh + +set -x GPG_TTY (tty) + +gpg-connect-agent updatestartuptty /bye >/dev/null + +# Start or re-use a gpg-agent. +#gpgconf --launch gpg-agent + +## Hide welcome message +set fish_greeting +set VIRTUAL_ENV_DISABLE_PROMPT "1" + +## Starship prompt +#source ("/usr/bin/starship" init fish --print-full-init | psub) +starship init fish | source diff --git a/.config/fish/functions/config.fish b/.config/fish/functions/config.fish new file mode 100644 index 0000000..513abde --- /dev/null +++ b/.config/fish/functions/config.fish @@ -0,0 +1,5 @@ +function config --description "Add file to dotfiles repository" + # Author: Dominic Reich + + git --git-dir=$HOME/dotfiles --work-tree=$HOME $argv +end diff --git a/.config/fish/functions/decode-gqrx.fish b/.config/fish/functions/decode-gqrx.fish new file mode 100644 index 0000000..ccb25de --- /dev/null +++ b/.config/fish/functions/decode-gqrx.fish @@ -0,0 +1,3 @@ +function decode-gqrx --description "Reads packets from Gqrx via UDP and plays audio" + socat stdout udp-listen:9999 | dsdccx -i - -fa -o - | play -q -t s16 -r 8k -c 1 - +end \ No newline at end of file diff --git a/.config/fish/functions/dmrdecode.fish b/.config/fish/functions/dmrdecode.fish new file mode 100644 index 0000000..2f4aff7 --- /dev/null +++ b/.config/fish/functions/dmrdecode.fish @@ -0,0 +1,12 @@ +function dmrdecode --description "Decodes DMR signals on $argv frequency" + if test (count $argv) = 1 + if test "$argv[1]" -gt 430000000 -a "$argv[1]" -lt 447000000 + rtl_fm -f $argv[1] -s 22050 | dsdccx -i - -o - -fr | play -q -t s16 -r 8k -c 1 - + else + echo "Incorrect frequency!" + end + else + echo "Which frequency?" + echo "Use: dmrdecode " + end +end diff --git a/.config/fish/functions/dr.fish b/.config/fish/functions/dr.fish new file mode 100644 index 0000000..d26afa9 --- /dev/null +++ b/.config/fish/functions/dr.fish @@ -0,0 +1,3 @@ +function dr + cd ~/sites/oe7drt-website/ $argv; +end diff --git a/.config/fish/functions/f.fish b/.config/fish/functions/f.fish new file mode 100644 index 0000000..b97ba43 --- /dev/null +++ b/.config/fish/functions/f.fish @@ -0,0 +1,3 @@ +function f + FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git' FZF_DEFAULT_OPTS="--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD --color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96 --color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD --preview 'bat --style=numbers --color=always --line-range :500 {}'" fzf --height 60% --layout reverse --info inline --border --color 'border:#b48ead' $argv +end diff --git a/.config/fish/functions/hs.fish b/.config/fish/functions/hs.fish new file mode 100644 index 0000000..d0a2687 --- /dev/null +++ b/.config/fish/functions/hs.fish @@ -0,0 +1,3 @@ +function hs + hugo server -DEF --cleanDestinationDir --bind 0.0.0.0 --baseURL http://(ip -4 addr|grep 'inet 192'|awk '{print $2}'|cut -d/ -f1) $argv; +end diff --git a/.config/fish/functions/hsf.fish b/.config/fish/functions/hsf.fish new file mode 100644 index 0000000..5f10e83 --- /dev/null +++ b/.config/fish/functions/hsf.fish @@ -0,0 +1,3 @@ +function hsf + hugo server -DEF --cleanDestinationDir --port 8080 --bind 0.0.0.0 --baseURL http://(ip -4 addr| grep 'inet 192' | awk '{print $2}'|cut -d/ -f1) $argv; +end diff --git a/.config/fish/functions/jopti.fish b/.config/fish/functions/jopti.fish new file mode 100644 index 0000000..20ef9b1 --- /dev/null +++ b/.config/fish/functions/jopti.fish @@ -0,0 +1,36 @@ +function jopti --description "Optimizes .jpg files" + # Author: Dominic, OE7DRT + # 2021-08-07 + set -e missing + + for program in jpegtran + if \! command -v $program > /dev/null + set -a missing $program + continue + end + end + + if test -n "$missing" + echo "Could not find executables: $missing" + return 1 + end + + if test -z $argv[1] + echo "usage: jopti " + return 1 + end + + set count (count $argv) + + for i in (seq 1 $count) + if test ! -f $argv[$i] + echo "Could not read file $argv[$i]..." + continue + end + + jpegtran -copy none -optimize -progressive -outfile "$argv[$i]" "$argv[$i]" + #optipng -nb -nc "$argv[$i]"; + #advpng -z4 "$argv[$i]"; + #pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow "$argv[$i]"; + end +end diff --git a/.config/fish/functions/ls.fish b/.config/fish/functions/ls.fish new file mode 100644 index 0000000..8ba1090 --- /dev/null +++ b/.config/fish/functions/ls.fish @@ -0,0 +1,3 @@ +function ls + lsd $argv +end diff --git a/.config/fish/functions/mpv.fish b/.config/fish/functions/mpv.fish new file mode 100644 index 0000000..4cb6fb6 --- /dev/null +++ b/.config/fish/functions/mpv.fish @@ -0,0 +1,3 @@ +function mpv + env __NV_PRIME_RENDER_OFFLOAD=1 mpv $argv +end diff --git a/.config/fish/functions/n.fish b/.config/fish/functions/n.fish new file mode 100644 index 0000000..4462548 --- /dev/null +++ b/.config/fish/functions/n.fish @@ -0,0 +1,3 @@ +function n + neofetch $argv +end diff --git a/.config/fish/functions/opti.fish b/.config/fish/functions/opti.fish new file mode 100644 index 0000000..303a2b9 --- /dev/null +++ b/.config/fish/functions/opti.fish @@ -0,0 +1,35 @@ +function opti --description "Optimizes .png files" + # Author: Dominic, OE7DRT + # 2021-04-17 + set -e missing + + for program in optipng advpng pngcrush + if \! command -v $program > /dev/null + set -a missing $program + continue + end + end + + if test -n "$missing" + echo "Could not find executables: $missing" + return 1 + end + + if test -z $argv[1] + echo "usage: opti " + return 1 + end + + set count (count $argv) + + for i in (seq 1 $count) + if test ! -f $argv[$i] + echo "Could not read file $argv[$i]..." + continue + end + + optipng -nb -nc "$argv[$i]"; + advpng -z4 "$argv[$i]"; + pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow "$argv[$i]"; + end +end diff --git a/.config/fish/functions/owf.fish b/.config/fish/functions/owf.fish new file mode 100644 index 0000000..37953bc --- /dev/null +++ b/.config/fish/functions/owf.fish @@ -0,0 +1,11 @@ +function owf + set path (f) + if test "$path" = "" + else if [ "$path" != "" ] + if test -d $path + $path + else + xdg-open $path + end + end +end diff --git a/.config/fish/functions/pocsag-gqrx.fish b/.config/fish/functions/pocsag-gqrx.fish new file mode 100644 index 0000000..d5f7210 --- /dev/null +++ b/.config/fish/functions/pocsag-gqrx.fish @@ -0,0 +1,5 @@ +function pocsag-gqrx + socat stdout udp-listen:9999 | sox -t raw -esigned-integer -b 16 \ + -r 48000 - -esigned-integer -b 16 -r 22050 -t raw - | multimon-ng -t raw \ + -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -f alpha - +end \ No newline at end of file diff --git a/.config/fish/functions/pocsag-rtl.fish b/.config/fish/functions/pocsag-rtl.fish new file mode 100644 index 0000000..07b9a84 --- /dev/null +++ b/.config/fish/functions/pocsag-rtl.fish @@ -0,0 +1,5 @@ +function pocsag-rtl --description "Prints incoming DAPNET messages on 438.025MHz" + #rtl_fm -f 438025000 -s 22050 | multimon-ng -t raw -q - | egrep "^[A-Z0-9]+:" + rtl_fm -f 438025000 -s 22050 | multimon-ng -t raw -q -a POCSAG512 \ + -a POCSAG1200 -a POCSAG2400 -f alpha - +end \ No newline at end of file diff --git a/.config/fish/functions/r.fish b/.config/fish/functions/r.fish new file mode 100644 index 0000000..5ba5682 --- /dev/null +++ b/.config/fish/functions/r.fish @@ -0,0 +1,3 @@ +function r + ranger $argv +end diff --git a/.config/fish/functions/rot1.fish b/.config/fish/functions/rot1.fish new file mode 100644 index 0000000..b782109 --- /dev/null +++ b/.config/fish/functions/rot1.fish @@ -0,0 +1,3 @@ +function rot1 --description "decodes a ROT-1 string" + echo "$argv" | tr 'b-za-aB-ZA-A' 'a-zA-Z' +end \ No newline at end of file diff --git a/.config/fish/functions/rundspruch-oe.fish b/.config/fish/functions/rundspruch-oe.fish new file mode 100644 index 0000000..c0b1543 --- /dev/null +++ b/.config/fish/functions/rundspruch-oe.fish @@ -0,0 +1,25 @@ +function rundspruch-oe --description "Aufzeichnen des OE-Rundspruchs in ~/Musik/Rundsprueche/OE" + set date (date +"%d.%B %Y") + set title "OE-Rundspruch vom $date" + set filename oe-rundspruch-(date +%Y-%m-%d).mp3 + + ffmpeg -y -i "https://live.datamatix.at:9040/;stream.mp3" \ + -c:a libmp3lame -q:a 9 \ + -map_metadata -1 -id3v2_version 4 \ + -metadata TPE2="ÖVSV OE Rundspruch Team" \ + -metadata TPE1="ÖVSV" \ + -metadata TIT2="$title" \ + -metadata TIT3="Das Team: YL Sylvia OE1YXS, OM Nicolas OE1NBS, OM Wolfgang OE1WBS" \ + -metadata TDEN=(date -I) \ + -metadata TALB="OE-Rundspruch" \ + -metadata LINK="http://oersp.oevsv.at/" \ + -metadata TENC="Dominic Reich, OE7DRT, https://oe7drt.com" \ + -metadata COMM="Stream: https://live.datamatix.at:9040/;stream.mp3" \ + $HOME/Musik/Rundsprueche/OE/$filename + + mpc update + mpc add Rundsprueche/OE/$filename + #mpc searchplay $title + + set -e date title filename +end diff --git a/.config/fish/functions/rundspruch-oe1.fish b/.config/fish/functions/rundspruch-oe1.fish new file mode 100644 index 0000000..64c221c --- /dev/null +++ b/.config/fish/functions/rundspruch-oe1.fish @@ -0,0 +1,26 @@ +function rundspruch-oe1 --description "Aufzeichnen des Wien-Rundspruchs in ~/Musik/Rundsprueche/OE1" + set date (date +"%d.%B %Y") + set title "OE1-Rundspruch vom $date" + set filename oe1-rundspruch-(date +%Y-%m-%d).mp3 + + ffmpeg -y -i "https://www.oe1-oevsv.at/oe1-bulletin" \ + -c:a libmp3lame -q:a 9 \ + -map_metadata -1 -id3v2_version 4 \ + -metadata TPE2="ÖVSV OE1 Rundspruch Team" \ + -metadata TPE1="ÖVSV" \ + -metadata TIT2="$title" \ + -metadata TIT3="Das Team: YL Karin OE1SKC, OM Roland OE1RSA, OM Andreas OE1ADS" \ + -metadata TDEN=(date -I) \ + -metadata TALB="OE1-Rundspruch" \ + -metadata LINK="https://wrsp.oe1-oevsv.at/" \ + -metadata TENC="Dominic Reich, OE7DRT, https://oe7drt.com" \ + -metadata COMM="Stream: https://www.oe1-oevsv.at/oe1-bulletin" \ + $HOME/Musik/Rundsprueche/OE1/$filename + + mpc update + mpc add Rundsprueche/OE1/$filename + #mpc searchplay $title + + set -e date title filename +end + diff --git a/.config/fish/functions/rundspruch-oe1xuu.fish b/.config/fish/functions/rundspruch-oe1xuu.fish new file mode 100644 index 0000000..5b3e21f --- /dev/null +++ b/.config/fish/functions/rundspruch-oe1xuu.fish @@ -0,0 +1,25 @@ +function rundspruch-oe1xuu --description "Aufzeichnen der Relaisaktivität von OE1XUU in ~/Musik/Rundsprueche/OE1XUU" + set date (date +"%d.%B %Y %H:%M:%S") + set title "OE1XUU Repeater-Aktivität vom $date" + set filename oe1xuu-(date +%Y-%m-%d-%H%M%S).mp3 + + ffmpeg -y -i "https://www.oe1-oevsv.at/oe1xuu-repeater" \ + -c:a libmp3lame -q:a 9 \ + -map_metadata -1 -id3v2_version 4 \ + -metadata TPE2="ÖVSV OE1XUU Repeater" \ + -metadata TPE1="ÖVSV" \ + -metadata TIT2="$title" \ + -metadata TIT3="OE1XUU SysOp: OM Andy OE1BAD" \ + -metadata TDEN=(date -I) \ + -metadata TALB="OE1XUU Repeater" \ + -metadata LINK="https://www.oevsv.at/funkbetrieb/livestreams/" \ + -metadata TENC="Dominic Reich, OE7DRT, https://oe7drt.com" \ + -metadata COMM="Stream: https://www.oe1-oevsv.at/oe1xuu-repeater" \ + $HOME/Musik/Rundsprueche/OE1XUU/$filename + + mpc update + mpc add Rundsprueche/OE1XUU/$filename + #mpc searchplay $title + + set -e date title filename +end diff --git a/.config/fish/functions/sc.fish b/.config/fish/functions/sc.fish new file mode 100644 index 0000000..0547c9a --- /dev/null +++ b/.config/fish/functions/sc.fish @@ -0,0 +1,3 @@ +function sc + screen -DR Hooray $argv +end diff --git a/.config/fish/functions/tm.fish b/.config/fish/functions/tm.fish new file mode 100644 index 0000000..b64414c --- /dev/null +++ b/.config/fish/functions/tm.fish @@ -0,0 +1,3 @@ +function tm + tmux -u new-session -A -s Eve $argv +end diff --git a/.config/fish/functions/vi.fish b/.config/fish/functions/vi.fish new file mode 100644 index 0000000..f6d1c7c --- /dev/null +++ b/.config/fish/functions/vi.fish @@ -0,0 +1,3 @@ +function vi + nvim $argv +end diff --git a/.config/fish/functions/vidrotate.fish b/.config/fish/functions/vidrotate.fish new file mode 100644 index 0000000..74d3f0d --- /dev/null +++ b/.config/fish/functions/vidrotate.fish @@ -0,0 +1,17 @@ +function vidrotate --description "Rotates a video file by 90° with ffmpeg" + if test (count $argv) -lt 2 -o "$argv[1]" = "--help" + set pname (basename (status -f)) + echo "usage: $pname " + return 1 + end + + set infile $argv[1] + set outfile $argv[2] + + if test ! -r $infile + echo "Could not read $infile" + return 1 + end + + ffmpeg -i $infile -map_metadata 0 -metadata:s:v rotate="90" -c copy $outfile +end \ No newline at end of file diff --git a/.config/fish/functions/xdg-get.fish b/.config/fish/functions/xdg-get.fish new file mode 100644 index 0000000..ddb4fd5 --- /dev/null +++ b/.config/fish/functions/xdg-get.fish @@ -0,0 +1,8 @@ +function xdg-get + set filename (f) + if test "$filename" = "" + else + set program (xdg-mime query default (xdg-mime query filetype $filename)) + echo "Open with $program" + end +end diff --git a/.config/fish/functions/xdg-set.fish b/.config/fish/functions/xdg-set.fish new file mode 100644 index 0000000..4faa6a8 --- /dev/null +++ b/.config/fish/functions/xdg-set.fish @@ -0,0 +1,15 @@ +function xdg-set + set filename (f) + if test "$filename" = "" + else + set beforeprogram (xdg-mime query default (xdg-mime query filetype $filename)) + set program (find /usr/share/applications/ -type f | f) + if test "$program" = "" + else + echo "Open with $beforeprogram before changing" + xdg-mime default (echo $program | sed 's/.*\///g') (xdg-mime query filetype $filename) + set afterprogram (xdg-mime query default (xdg-mime query filetype $filename)) + echo "Open with $afterprogram after change" + end + end +end diff --git a/.config/fish/functions/yl.fish b/.config/fish/functions/yl.fish new file mode 100644 index 0000000..860a3c2 --- /dev/null +++ b/.config/fish/functions/yl.fish @@ -0,0 +1,3 @@ +function yl + yt-dlp -x --audio-format mp3 --embed-thumbnail $argv +end diff --git a/.config/fish/functions/ysfdecode.fish b/.config/fish/functions/ysfdecode.fish new file mode 100644 index 0000000..6ce0ee7 --- /dev/null +++ b/.config/fish/functions/ysfdecode.fish @@ -0,0 +1,12 @@ +function ysfdecode --description "Decodes YSF signals on $argv frequency" + if test (count $argv) = 1 + if test "$argv[1]" -gt 430000000 -a "$argv[1]" -lt 447000000 + rtl_fm -f $argv[1] -s 22050 | dsdccx -i - -o - -fy | play -q -t s16 -r 8k -c 1 - + else + echo "Incorrect frequency!" + end + else + echo "Which frequency?" + echo "Use: dmrdecode " + end +end \ No newline at end of file diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..6e05a81 --- /dev/null +++ b/.config/git/config @@ -0,0 +1,377 @@ +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║____________________________________________________________________________║ +# ║_____________/\\\\\\\\\\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\\\__________________║ +# ║____________/\\\//////////__\/////\\\///__\///////\\\/////__________________║ +# ║____________/\\\_________________\/\\\___________\/\\\______________________║ +# ║____________\/\\\____/\\\\\\\_____\/\\\___________\/\\\_____________________║ +# ║_____________\/\\\___\/////\\\_____\/\\\___________\/\\\____________________║ +# ║______________\/\\\_______\/\\\_____\/\\\___________\/\\\___________________║ +# ║_______________\/\\\_______\/\\\_____\/\\\___________\/\\\__________________║ +# ║________________\//\\\\\\\\\\\\/___/\\\\\\\\\\\_______\/\\\_________________║ +# ║__________________\////////////____\///////////________\///_________________║ +# ║____________________________________________________________________________║ +# ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ General ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[user] + name = Dominic Reich + email = dominic@noreply.oe7drt.com + signingkey = BC9D6AE1A3BE169A + +[core] + fileMode = true + ignoreCase = false + symlinks = true + compression = 9 + excludesFile = ~/.config/git/ignore + attributesFile = ~/.config/git/attributes + hooksPath = ~/.config/git/hooks + pager = delta + editor = nvim + +[format] + signOff = yes + +[gpg] + program = gpg + format = openpgp + +[init] + defaultBranch = master + +[commit] + gpgSign = true + verbose = true + +[fetch] + prune = true + parallel = 3 + +[submodule] + fetchJobs = 3 + +[pull] + rebase = true + +[push] + gpgSign = if-asked + default = simple + autoSetupRemote = true + followTags = yes + +[help] + autoCorrect = prompt + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Colors ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[color] + ui = true + +[color "branch"] + current = yellow + local = blue + remote = yellow + upstream = magenta + plain = cyan + +[color "diff"] + meta = blue + frag = magenta + old = red + new = green + whitespace = magenta + +[color "status"] + added = cyan + changed = yellow + untracked = red + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Delta (https://dandavison.github.io/delta/) ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[delta] + navigate = true + features = style + +[delta "style"] + side-by-side = true + commit-decoration-style = "blue" box + dark = true + file-decoration-style = none + file-style = cyan + file-added-label = [+] + file-copied-label = [=] + file-modified-label = [~] + file-removed-label = [-] + file-renamed-label = [>] + hunk-header-decoration-style = "#022b45" box ul + hunk-header-file-style = "blue" + hunk-header-line-number-style = "yellow" + hunk-header-style = file line-number syntax + line-numbers = true + line-numbers-left-style = "#022b45" + line-numbers-minus-style = "#80002a" + line-numbers-plus-style = "#003300" + line-numbers-right-style = "#022b45" + line-numbers-zero-style = "#999999" + minus-emph-style = normal "#80002a" + minus-style = normal "#330011" + plus-emph-style = syntax "#003300" + plus-style = syntax "#001a00" + whitespace-error-style = reverse red + syntax-theme = Nord + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Merging & Diffing ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[merge] + tool = nvimdiff + +[mergetool] + prompt = true + +[mergetool "nvimdiff"] + cmd = nvim -d "$LOCAL" "$REMOTE" "$MERGED" -c 'wincmd w' -c 'wincmd J' + +[interactive] + diffFilter = delta --color-only + +[difftool] + prompt = false + +[diff] + tool = nvimdiff + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ GitHub ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[url "ssh://git@github.com/"] + insteadOf = https://github.com/ + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ GitLab ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[url "ssh://git@gitlab.com/"] + insteadOf = https://gitlab.com/ + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Codeberg ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[url "ssh://git@codeberg.org/"] + insteadOf = https://codeberg.org/ + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ sr.ht ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[url "ssh://git@git.sr.ht/"] + insteadOf = https://git.sr.ht/ + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ sendemail ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +#[sendemail] +# annotate = yes +# smtpserver = 127.0.0.1 +# smtpuser = marius@xn--gckvb8fzb.com +# smtpencryption = tls +# smtpserverport = 1025 +# smtpsslcertpath = +# +#[credential "smtp://marius%40xn--gckvb8fzb.com@127.0.0.1%3a1025"] +# helper = !pass smtp/marius@xn--gckvb8fzb.com + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ rerere ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[rerere] + enabled = true + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Git Flow ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[gitflow "branch"] + master = master + develop = develop + +[gitflow "prefix"] + feature = feature/ + release = release/ + hotfix = hotfix/ + bugfix = bugfix/ + support = support/ + versiontag = v + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ go.mod replace ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[filter "gomodreplace"] + clean = rg -U -v 'replace ((?s)\\(.*\\)|.*)' + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ LFS ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Aliases ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ +[alias] + a = "add" + aa = "add --all" + ce = "git commit --allow-empty" + am = "am" + ama = "am --abort" + amc = "am --continue" + ams = "am --skip" + amscp = "am --show-current-patch" + ap = "apply" + apa = "add --patch" + apt = "apply --3way" + au = "add --update" + av = "add --verbose" + b = "branch" + bD = "branch -D" + ba = "branch -a" + bd = "branch -d" + bl = "blame -b -w" + bnm = "branch --no-merged" + br = "branch --remote" + bs = "bisect" + bsb = "bisect bad" + bsg = "bisect good" + bsr = "bisect reset" + bss = "bisect start" + c = "commit -v" + ca = "commit -v -a" + cam = "commit -a -m" + cas = "commit -a -s" + casm = "commit -a -s -m" + cb = "checkout -b" + cf = "config --list" + cl = "clone --recurse-submodules" + clnid = "clean -id" + cmsg = "commit -m" + cn = "commit -v --no-edit" + co = "checkout" + cor = "checkout --recurse-submodules" + count = "shortlog -sn" + cp = "cherry-pick" + cpa = "cherry-pick --abort" + cpc = "cherry-pick --continue" + cs = "commit -S" + csm = "commit -s -m" + css = "commit -S -s" + cssm = "commit -S -s -m" + d = "diff" + dca = "diff --cached" + dcw = "diff --cached --word-diff" + ds = "diff --staged" + dt = "diff-tree --no-commit-id --name-only -r" + dup = "diff @{upstream}" + dw = "diff --word-diff" + f = "fetch" + fa = "fetch --all --prune --jobs=10" + fg = "ls-files | grep" + fl = "flow" + flf = "flow feature" + flff = "flow feature finish" + flfp = "flow feature publish" + flfpll = "flow feature pull" + flfs = "flow feature start" + flh = "flow hotfix" + flhf = "flow hotfix finish" + flhp = "flow hotfix publish" + flhs = "flow hotfix start" + fli = "flow init" + flr = "flow release" + flrf = "flow release finish" + flrp = "flow release publish" + flrs = "flow release start" + fo = "fetch origin" + hh = "help" + ign = "update-index --assume-unchanged" + ignd = "ls-files -v | grep "^[[:lower:]]"" + l = "pull" + lg = "log --stat" + lgg = "log --graph" + lgga = "log --graph --decorate --all" + lgm = "log --graph --max-count=10" + lgp = "log --stat -p" + lo = "log --oneline --decorate" + logg = "log --oneline --decorate --graph" + loga = "log --oneline --decorate --graph --all" + m = "merge" + ma = "merge --abort" + mtl = "mergetool --no-prompt" + mtlvim = "mergetool --no-prompt --tool=nvimdiff" + p = "push" + pd = "push --dry-run" + pf = "push --force-with-lease" + poat = "push origin --all && git push origin --tags" + pr = "pull --rebase" + pristine = "reset --hard && git clean -dffx" + pu = "push upstream" + pv = "push -v" + r = "remote" + ra = "remote add" + rb = "rebase" + rba = "rebase --abort" + rbc = "rebase --continue" + rbi = "rebase -i" + rbo = "rebase --onto" + rbs = "rebase --skip" + rep = "grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}" + rev = "revert" + rh = "reset" + rhh = "reset --hard" + rmc = "rm --cached" + rmv = "remote rename" + rrm = "remote remove" + rs = "restore" + rset = "remote set-url" + rss = "restore --source" + rst = "restore --staged" + ru = "reset --" + rup = "remote update" + rv = "remote -v" + sb = "status -sb" + sd = "svn dcommit" + sh = "show" + si = "submodule init" + sps = "show --pretty=short --show-signature" + sr = "svn rebase" + ss = "status -s" + st = "status" + sta = "stash push" + staa = "stash apply" + stall = "stash --all" + stc = "stash clear" + std = "stash drop" + stl = "stash list" + stp = "stash pop" + sts = "stash show --text" + su = "submodule update" + sw = "switch" + swc = "switch -c" + ts = "tag -s" + tv = "tag | sort -V" + unign = "update-index --no-assume-unchanged" + up = "pull --rebase" + upa = "pull --rebase --autostash" + upav = "pull --rebase --autostash -v" + upv = "pull --rebase -v" + wch = "whatchanged -p --abbrev-commit --pretty=medium" + wt = "worktree" + wta = "worktree add" + wtls = "worktree list" + wtmv = "worktree move" + wtrm = "worktree remove" + diff --git a/.config/git/ignore b/.config/git/ignore new file mode 100644 index 0000000..1893cb0 --- /dev/null +++ b/.config/git/ignore @@ -0,0 +1,52 @@ +# Node +npm-debug.log + +# Mac +.DS_Store +._* +.Spotlight-V100 + +# Windows +Thumbs.db +ehthumbs.db +desktop.ini + +# IDE +.vscode +.idea +.iml +*.sublime-workspace + +# Temporary +*~ +*.bak +*.swp +*.swo + +# General +log/ +*.log + +# Compiled +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc +*.pyo + +# Packages +*.7z +*.dmg +*.iso +*.jar +*.rar +*.zip +*.msi + +# Databases +*.sql +*.sqlite + diff --git a/.config/gtk-2.0/gtkfilechooser.ini b/.config/gtk-2.0/gtkfilechooser.ini new file mode 100644 index 0000000..cd9ee48 --- /dev/null +++ b/.config/gtk-2.0/gtkfilechooser.ini @@ -0,0 +1,11 @@ +[Filechooser Settings] +LocationMode=path-bar +ShowHidden=false +ShowSizeColumn=true +GeometryX=456 +GeometryY=207 +GeometryWidth=1008 +GeometryHeight=692 +SortColumn=name +SortOrder=ascending +StartupMode=recent diff --git a/.config/gtk-3.0/bookmarks b/.config/gtk-3.0/bookmarks new file mode 100644 index 0000000..f111265 --- /dev/null +++ b/.config/gtk-3.0/bookmarks @@ -0,0 +1,3 @@ +file:///home/dominic/Downloads +file:///mnt mnt +file:///home/dominic/sites/oe7drt-website diff --git a/.config/gtk-3.0/settings.ini b/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..0849d38 --- /dev/null +++ b/.config/gtk-3.0/settings.ini @@ -0,0 +1,13 @@ +[Settings] +gtk-theme-name=deepin-dark +gtk-icon-theme-name=Adwaita +#gtk-font-name=Cantarell 11 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull diff --git a/.config/i3/backup b/.config/i3/backup new file mode 100644 index 0000000..e27a935 --- /dev/null +++ b/.config/i3/backup @@ -0,0 +1,194 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 14 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +exec --no-startup-id autotiling -l 2 + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +#tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec alacritty + +# kill focused window +bindsym $mod+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id dmenu_run +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop + +exec --no-startup-id xinput set-prop 10 307 1 + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+odiaeresis focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+odiaeresis move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym odiaeresis resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} diff --git a/.config/i3/config b/.config/i3/config new file mode 100644 index 0000000..e06bbbb --- /dev/null +++ b/.config/i3/config @@ -0,0 +1,497 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +# Set mod key (Mod1=, Mod4=) +set $mod Mod4 + +# set default desktop layout (default is tiling) +# workspace_layout tabbed + +# Configure border style +default_border pixel 1 +default_floating_border normal + +# Hide borders +hide_edge_borders none +#hide_edge_borders smart_no_gaps + +# change borders +#bindsym $mod+u border none +#bindsym $mod+y border pixel 1 +#bindsym $mod+n border normal + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +#font xft:URWGothic-Book 11 +#font pango:monospace 14 +font pango:FantasqueSansMono Nerd Font 14 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 13 + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +# "dex" is not installed? +#exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -c 000000 --nofork + +# Touchpad toggle +set $notify_touchpad dunstify -i input-touchpad-symbolic.symbolic "Touchpad toggled" +bindsym XF86TouchpadToggle exec --no-startup-id tuxedo-touchpad-toggle && $notify_touchpad + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +set $notify_volume dunstify -i audio-speakers-symbolic.symbolic "Volume set to $(wpctl get-volume @DEFAULT_AUDIO_SINK@)" +set $notify_brightness dunstify -i video-display-symbolic.symbolic "Brightness set to $(light -G)" +#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +#bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +bindsym XF86AudioRaiseVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+ && $refresh_i3status && $notify_volume +bindsym XF86AudioLowerVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%- && $refresh_i3status && $notify_volume +bindsym XF86AudioMute exec --no-startup-id wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && $refresh_i3status && $notify_volume +bindsym XF86AudioMicMute exec --no-startup-id wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle && $refresh_i3status && $notify_volume + +# Screen brightness controls +# bindsym XF86MonBrightnessUp exec --no-startup-id "xbacklight -inc 10; notify-send 'brightness up'" +# bindsym XF86MonBrightnessDown exec --no-startup-id "xbacklight -dec 10; notify-send 'brightness down'" +bindsym XF86MonBrightnessUp exec --no-startup-id light -A 5 && $notify_brightness +bindsym XF86MonBrightnessDown exec --no-startup-id light -U 5 && $notify_brightness + +bindsym --release Print exec --no-startup-id scrot $HOME/Bilder/scrot-%Y%m%y-%H%M%S.png -q 100 -e 'optipng -nb -nc $f && advpng -z4 $f && pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow $f' +bindsym --release $mod+Print exec --no-startup-id scrot $HOME/Bilder/scrot-%Y%m%y-%H%M%S.png -q 100 -f -i -s -e 'optipng -nb -nc $f && advpng -z4 $f && pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow $f' + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +#tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec --no-startup-id alacritty + +# restart logid daemon (hangs usually on boot) +bindsym $mod+Shift+Return exec --no-startup-id (sudo systemctl restart logid && notify-send -u normal "Restarted logiops daemon") || notify-send -u critical "Could not restart logiops daemon!" + +# some general short cuts :D +bindsym $mod+Shift+m exec --no-startup-id alacritty --config-file ~/.config/alacritty/neomutt.yml --class Neomutt -e neomutt + +# kill focused window +bindsym $mod+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id dmenu_run -i -p 'Arch Linux' -fn 'FantasqueSansMono Nerd Font:bold:pixelsize=22' +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec --no-startup-id "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +#bindsym $mod+odiaeresis move right +#bindsym $mod+semicolon focus right +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +#bindsym $mod+Shift+odiaeresis move right +#bindsym $mod+Shift+semicolon move right +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# workspace back and forth (with/without active container) +workspace_auto_back_and_forth yes +bindsym $mod+b workspace back_and_forth +bindsym $mod+Shift+b move container to workspace back_and_forth; workspace back_and_forth + +# split in horizontal orientation +#bindsym $mod+h split h;exec --no-startup-id notify-send 'tile horizontally' + +# split in vertical orientation +#bindsym $mod+v split v;exec --no-startup-id notify-send 'tile vertically' + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# toggle sticky +bindsym $mod+Shift+s sticky toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +bindsym $mod+Shift+d focus child + +# move the currently focused window to the scratchpad +bindsym $mod+Shift+minus move scratchpad + +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +bindsym $mod+minus scratchpad show + +#navigate workspaces next / previous +bindsym $mod+Ctrl+Right workspace next +bindsym $mod+Ctrl+Left workspace prev + + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +# to display names or symbols instead of plain workspace numbers you can use +# something like: set $ws1 1:mail +# set $ws2 2: +set $ws1 1:[ home ] +set $ws2 2:[ mail ] +set $ws3 3:[ www ] +set $ws4 4:[ dev ] +set $ws5 5:[ main ] +set $ws6 6:[ second ] +set $ws7 7:[ seven ] +set $ws8 8:[ eight ] +set $ws9 9:[ steam ] + +# switch to workspace +bindsym $mod+1 workspace $ws1 +bindsym $mod+2 workspace $ws2 +bindsym $mod+3 workspace $ws3 +bindsym $mod+4 workspace $ws4 +bindsym $mod+5 workspace $ws5 +bindsym $mod+6 workspace $ws6 +bindsym $mod+7 workspace $ws7 +bindsym $mod+8 workspace $ws8 +bindsym $mod+9 workspace $ws9 + +# Move focused container to workspace +bindsym $mod+Ctrl+1 move container to workspace $ws1 +bindsym $mod+Ctrl+2 move container to workspace $ws2 +bindsym $mod+Ctrl+3 move container to workspace $ws3 +bindsym $mod+Ctrl+4 move container to workspace $ws4 +bindsym $mod+Ctrl+5 move container to workspace $ws5 +bindsym $mod+Ctrl+6 move container to workspace $ws6 +bindsym $mod+Ctrl+7 move container to workspace $ws7 +bindsym $mod+Ctrl+8 move container to workspace $ws8 +bindsym $mod+Ctrl+9 move container to workspace $ws9 + +# Move to workspace with focused container +bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1 +bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2 +bindsym $mod+Shift+3 move container to workspace $ws3; workspace $ws3 +bindsym $mod+Shift+4 move container to workspace $ws4; workspace $ws4 +bindsym $mod+Shift+5 move container to workspace $ws5; workspace $ws5 +bindsym $mod+Shift+6 move container to workspace $ws6; workspace $ws6 +bindsym $mod+Shift+7 move container to workspace $ws7; workspace $ws7 +bindsym $mod+Shift+8 move container to workspace $ws8; workspace $ws8 +bindsym $mod+Shift+9 move container to workspace $ws9; workspace $ws9 + +# Open applications on specific workspaces +# assign [class="Thunderbird"] $ws1 +# assign [class="Pale moon"] $ws2 +# assign [class="Pcmanfm"] $ws3 +# assign [class="Skype"] $ws5 + +assign [class="Neomutt"] $ws2 +assign [class="LibreWolf"] $ws3 +assign [class="neovide"] $ws4 +assign [class="(?i)steam*"] $ws9 +for_window [class="(?i)steam*"] floating enable +#for_window [class="Steam"] floating enable + +# Open specific applications in floating mode +#for_window [title="alsamixer"] floating enable border pixel 1 +#for_window [class="calamares"] floating enable border normal +#for_window [class="Clipgrab"] floating enable +#for_window [title="File Transfer*"] floating enable +#for_window [class="fpakman"] floating enable +#for_window [class="Galculator"] floating enable border pixel 1 +#for_window [class="GParted"] floating enable border normal +#for_window [title="i3_help"] floating enable sticky enable border normal +#for_window [class="Lightdm-settings"] floating enable +#for_window [class="Lxappearance"] floating enable sticky enable border normal +#for_window [class="Manjaro-hello"] floating enable +#for_window [class="Manjaro Settings Manager"] floating enable border normal +#for_window [title="MuseScore: Play Panel"] floating enable +#for_window [class="Nitrogen"] floating enable sticky enable border normal +#for_window [class="Oblogout"] fullscreen enable +#for_window [class="octopi"] floating enable +#for_window [title="About Pale Moon"] floating enable +#for_window [class="Pamac-manager"] floating enable +#for_window [class="Pavucontrol"] floating enable +#for_window [class="qt5ct"] floating enable sticky enable border normal +#for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal +#for_window [class="Simple-scan"] floating enable border normal +#for_window [class="(?i)System-config-printer.py"] floating enable border normal +#for_window [class="Skype"] floating enable border normal +#for_window [class="Timeset-gui"] floating enable border normal +#for_window [class="(?i)virtualbox"] floating enable border normal +#for_window [class="Xfburn"] floating enable + +# switch to workspace with urgent window automatically +for_window [urgent=latest] focus + +# reload the configuration file +bindsym $mod+Shift+c reload + +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart + +# exit i3 (logs you out of your X session) +#bindsym $mod+Shift+e exec --no-startup-id "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# Set shut down, restart and locking features +bindsym $mod+0 mode "$mode_system" +set $mode_system (l)ock, (e)xit, switch_(u)ser, (s)uspend, (h)ibernate, (r)eboot, (Shift+s)hutdown +mode "$mode_system" { + bindsym l exec --no-startup-id i3exit lock, mode "default" + bindsym s exec --no-startup-id i3exit suspend, mode "default" + bindsym u exec --no-startup-id i3exit switch_user, mode "default" + # bindsym e exec --no-startup-id i3exit logout, mode "default" + bindsym e exec --no-startup-id pkill X + bindsym h exec --no-startup-id i3exit hibernate, mode "default" + bindsym r exec --no-startup-id i3exit reboot, mode "default" + bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" + + # exit system mode: "Enter" or "Escape" + bindsym Return mode "default" + bindsym Escape mode "default" +} + +# Resize window (you can also use the mouse for that) +bindsym $mod+r mode "resize" +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym h resize shrink width 5 px or 5 ppt + bindsym j resize grow height 5 px or 5 ppt + bindsym k resize shrink height 5 px or 5 ppt + bindsym l resize grow width 5 px or 5 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 5 px or 5 ppt + bindsym Down resize grow height 5 px or 5 ppt + bindsym Up resize shrink height 5 px or 5 ppt + bindsym Right resize grow width 5 px or 5 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +# Lock screen +#bindsym $mod+9 exec --no-startup-id blurlock + +# Autostart applications +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# USB Stick management +exec --no-startup-id udiskie --no-automount --notify --tray + +# enable touchpad tap to click +# done this in X11 config /etx/X11/xorg....d/ +#exec --no-startup-id xinput set-prop 11 306 1 +#exec --no-startup-id xinput set-prop 11 314 1 + +# enable logid (needs a restart, don't know why, works not without restart) +# exec --no-startup-id ~/bin/logi-restart.sh + +exec_always --no-startup-id autotiling -l 2 +exec --no-startup-id numlockx on +#exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 +# TODO disabled this for now +#exec --no-startup-id /sbin/lxpolkit +exec --no-startup-id nitrogen --restore; sleep 1; picom -b --vsync +#exec --no-startup-id manjaro-hello +#exec --no-startup-id nm-applet +#exec --no-startup-id xfce4-power-manager +#exec --no-startup-id pamac-tray +#exec --no-startup-id clipit +# exec --no-startup-id blueman-applet +# exec_always --no-startup-id sbxkb +#exec --no-startup-id start_conky_maia +# exec --no-startup-id start_conky_green +# exec --no-startup-id xautolock -time 10 -locker blurlock +#exec_always --no-startup-id ff-theme-util +#exec_always --no-startup-id fix_xcursor + +# Color palette used for the terminal ( ~/.Xresources file ) +# Colors are gathered based on the documentation: +# https://i3wm.org/docs/userguide.html#xresources +# Change the variable name at the place you want to match the color +# of your terminal like this: +# [example] +# If you want your bar to have the same background color as your +# terminal background change the line 362 from: +# background #14191D +# to: +# background $term_background +# Same logic applied to everything else. +set_from_resource $term_background background +set_from_resource $term_foreground foreground +set_from_resource $term_color0 color0 +set_from_resource $term_color1 color1 +set_from_resource $term_color2 color2 +set_from_resource $term_color3 color3 +set_from_resource $term_color4 color4 +set_from_resource $term_color5 color5 +set_from_resource $term_color6 color6 +set_from_resource $term_color7 color7 +set_from_resource $term_color8 color8 +set_from_resource $term_color9 color9 +set_from_resource $term_color10 color10 +set_from_resource $term_color11 color11 +set_from_resource $term_color12 color12 +set_from_resource $term_color13 color13 +set_from_resource $term_color14 color14 +set_from_resource $term_color15 color15 + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + i3bar_command i3bar + # the deafult only this line was here... + status_command i3status + position top + +## please set your primary output first. Example: 'xrandr --output eDP1 --primary' + tray_output primary + tray_output eDP1 + + bindsym button4 nop + bindsym button5 nop +# font xft:URWGothic-Book 11 +# strip_workspace_numbers yes + +# colors { +# background #222D31 +# #background $term_background +# statusline #F9FAF9 +# separator #454947 +# +## border backgr. text +# focused_workspace #F9FAF9 #16a085 #292F34 +# active_workspace #595B5B #353836 #FDF6E3 +# inactive_workspace #595B5B #222D31 #EEE8D5 +# binding_mode #16a085 #2C2C2C #F9FAF9 +# urgent_workspace #16a085 #FDF6E3 #E5201D +# } +} + +# hide/unhide i3status bar +bindsym $mod+m bar mode toggle + +# Theme colors +# class border backgr. text indic. child_border +# client.focused #556064 #556064 #80FFF9 #FDF6E3 +# client.focused_inactive #2F3D44 #2F3D44 #1ABC9C #454948 +# client.unfocused #2F3D44 #2F3D44 #1ABC9C #454948 +# client.urgent #CB4B16 #FDF6E3 #1ABC9C #268BD2 +# client.placeholder #000000 #0c0c0c #ffffff #000000 +# +# client.background #2B2C2B + +############################# +### settings for i3-gaps: ### +############################# + +# Set inner/outer gaps +#gaps inner 14 +gaps inner 8 +gaps outer -2 + + +# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size. +# gaps inner|outer current|all set|plus|minus +# gaps inner all set 10 +# gaps outer all plus 5 + +# Smart gaps (gaps used if only more than one container on the workspace) +smart_gaps on + +# Smart borders (draw borders around container only if it is not the only container on this workspace) +# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) +smart_borders on + +# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces. +set $mode_gaps Gaps: (o) outer, (i) inner +set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) +set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) +bindsym $mod+Shift+g mode "$mode_gaps" + +mode "$mode_gaps" { + bindsym o mode "$mode_gaps_outer" + bindsym i mode "$mode_gaps_inner" + bindsym Return mode "default" + bindsym Escape mode "default" +} +mode "$mode_gaps_inner" { + bindsym plus gaps inner current plus 5 + bindsym minus gaps inner current minus 5 + bindsym 0 gaps inner current set 0 + + bindsym Shift+plus gaps inner all plus 5 + bindsym Shift+minus gaps inner all minus 5 + bindsym Shift+0 gaps inner all set 0 + + bindsym Return mode "default" + bindsym Escape mode "default" +} +mode "$mode_gaps_outer" { + bindsym plus gaps outer current plus 5 + bindsym minus gaps outer current minus 5 + bindsym 0 gaps outer current set 0 + + bindsym Shift+plus gaps outer all plus 5 + bindsym Shift+minus gaps outer all minus 5 + bindsym Shift+0 gaps outer all set 0 + + bindsym Return mode "default" + bindsym Escape mode "default" +} diff --git a/.config/mimeapps.list b/.config/mimeapps.list new file mode 100644 index 0000000..f874fa7 --- /dev/null +++ b/.config/mimeapps.list @@ -0,0 +1,11 @@ +[Default Applications] +text/html=librewolf.desktop +x-scheme-handler/http=librewolf.desktop +x-scheme-handler/https=librewolf.desktop +x-scheme-handler/about=librewolf.desktop +x-scheme-handler/unknown=librewolf.desktop +image/jpeg=feh.desktop + +[Added Associations] +audio/x-mod=mpv.desktop; +image/jpeg=feh.desktop; diff --git a/.config/mpd/mpd.conf b/.config/mpd/mpd.conf new file mode 100644 index 0000000..1fcfb12 --- /dev/null +++ b/.config/mpd/mpd.conf @@ -0,0 +1,446 @@ +# 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 "~/Musik" +#music_directory "" +# +# 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 "~/.config/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 "~/.config/mpd/database" +# +# These settings are the locations for the daemon log files for the daemon. +# These logs are great for troubleshooting, depending on your log_level +# settings. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +#log_file "~/.mpd/log" +log_file "syslog" +# +# 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. +# +#pid_file "~/.config/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 "~/.config/mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +sticker_file "~/.config/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 activiation is in use. +# +# For network +#bind_to_address "any" +# +# And for Unix Socket +bind_to_address "~/.config/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 "yes" +# +# 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 sattelite 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" +#} + +# This works, but I'll create an alias for this and use +# curl for this like +# curl --output file.mp3 http://stream-url.com/oe1-bulletin etc... +# audio_output { +# type "recorder" +# name "Recorder" +# encoder "lame" +# path "/home/dominic/record.mp3" +# bitrate "128" +# format "44100:16:1" +# } + +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +### quality "8.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 +#} + +#audio_output { +# type "pipewire" +# name "PipeWire Sound Server" +#} + +audio_output { + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" +} + +# 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 +#} + +audio_output { + type "pulse" + name "pulse audio" +} + +# 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 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/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100755 index 0000000..1502e8e --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,2 @@ +WHEEL_UP seek -5 +WHEEL_DOWN seek 5 diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf new file mode 100644 index 0000000..336ae70 --- /dev/null +++ b/.config/mpv/mpv.conf @@ -0,0 +1,147 @@ +# +# Example mpv configuration file +# +# Warning: +# +# The commented example options usually do _not_ set the default values. Call +# mpv with --list-options to see the default values for most options. There is +# no builtin or example mpv.conf with all the defaults. +# +# +# Configuration files are read system-wide from /usr/local/etc/mpv.conf +# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override +# system-wide settings, all of which are overridden by the command line. +# +# Configuration file settings and the command line options use the same +# underlying mechanisms. Most options can be put into the configuration file +# by dropping the preceding '--'. See the man page for a complete list of +# options. +# +# Lines starting with '#' are comments and are ignored. +# +# See the CONFIGURATION FILES section in the man page +# for a detailed description of the syntax. +# +# Profiles should be placed at the bottom of the configuration file to ensure +# that settings wanted as defaults are not restricted to specific profiles. + +################## +# video settings # +################## + +# Start in fullscreen mode by default. +# fs=yes + +# force starting with centered window +#geometry=50%:50% + +# don't allow a new window to have a size larger than 90% of the screen size +#autofit-larger=90%x90% + +# Do not close the window on exit. +#keep-open=yes + +# Do not wait with showing the video window until it has loaded. (This will +# resize the window once video is loaded. Also always shows a window with +# audio.) +#force-window=immediate + +# Disable the On Screen Controller (OSC). +#osc=no + +# Keep the player window on top of all other windows. +#ontop=yes + +# Specify high quality video rendering preset (for --vo=gpu only) +# Can cause performance problems with some drivers and GPUs. +#profile=gpu-hq + +# Force video to lock on the display's refresh rate, and change video and audio +# speed to some degree to ensure synchronous playback - can cause problems +# with some drivers and desktop environments. +#video-sync=display-resample + +# Enable hardware decoding if available. Often, this does not work with all +# video outputs, but should work well with default settings on most systems. +# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs +# may or may not help. +hwdec=auto +#vo=gpu +#gpu-context=wayland + +# vo=gpu-next #This will break Anime4K +gpu-api=opengl +script-opts=ytdl_hook-ytdl_path=yt-dlp + +################## +# audio settings # +################## + +# Specify default audio device. You can list devices with: --audio-device=help +# The option takes the device string (the stuff between the '...'). +#audio-device=alsa/default + +# Do not filter audio to keep pitch when changing playback speed. +#audio-pitch-correction=no + +# Output 5.1 audio natively, and upmix/downmix audio with a different format. +#audio-channels=5.1 +# Disable any automatic remix, _if_ the audio output accepts the audio format. +# of the currently played file. See caveats mentioned in the manpage. +# (The default is "auto-safe", see manpage.) +#audio-channels=auto +volume-max=250 +################## +# other settings # +################## + +# Pretend to be a web browser. Might fix playback with some streaming sites, +# but also will break with shoutcast streams. +#user-agent="Mozilla/5.0" + +# cache settings +# +# Use 150MB input cache by default. The cache is enabled for network streams only. +#cache-default=153600 +# +# Use 150MB input cache for everything, even local files. +#cache=153600 +# +# Disable the behavior that the player will pause if the cache goes below a +# certain fill size. +#cache-pause=no +# +# Read ahead about 5 seconds of audio and video packets. +#demuxer-readahead-secs=5.0 +# +# Raise readahead from demuxer-readahead-secs to this value if a cache is active. +#cache-secs=50.0 + +# Display English subtitles if available. +#slang=en + +# Play Finnish audio if available, fall back to English otherwise. +#alang=fi,en + +# Change subtitle encoding. For Arabic subtitles use 'cp1256'. +# If the file seems to be valid UTF-8, prefer UTF-8. +# (You can add '+' in front of the codepage to force it.) +#sub-codepage=cp1256 + +# You can also include other configuration files. +#include=/path/to/the/file/you/want/to/include + +############ +# Profiles # +############ + +# The options declared as part of profiles override global default settings, +# but only take effect when the profile is active. + +# The following profile can be enabled on the command line with: --profile=eye-cancer + +#[eye-cancer] +#sharpen=5 + +#keepaspect=no +save-position-on-quit diff --git a/.config/mpv/scripts/file-browser.lua b/.config/mpv/scripts/file-browser.lua new file mode 100644 index 0000000..803a5b6 --- /dev/null +++ b/.config/mpv/scripts/file-browser.lua @@ -0,0 +1,2593 @@ +--[[ + mpv-file-browser + This script allows users to browse and open files and folders entirely from within mpv. + The script uses nothing outside the mpv API, so should work identically on all platforms. + The browser can move up and down directories, start playing files and folders, or add them to the queue. + For full documentation see: https://github.com/CogentRedTester/mpv-file-browser +]] +-- + +local mp = require("mp") +local msg = require("mp.msg") +local utils = require("mp.utils") +local opt = require("mp.options") + +local o = { + --root directories + root = "~/Videos/", + + --characters to use as separators + root_separators = ",;", + + --number of entries to show on the screen at once + num_entries = 20, + + --wrap the cursor around the top and bottom of the list + wrap = false, + + --only show files compatible with mpv + filter_files = true, + + --experimental feature that recurses directories concurrently when + --appending items to the playlist + concurrent_recursion = false, + + --maximum number of recursions that can run concurrently + max_concurrency = 16, + + --enable custom keybinds + custom_keybinds = false, + + --blacklist compatible files, it's recommended to use this rather than to edit the + --compatible list directly. A semicolon separated list of extensions without spaces + extension_blacklist = "", + + --add extra file extensions + extension_whitelist = "", + + --files with these extensions will be added as additional audio tracks for the current file instead of appended to the playlist + audio_extensions = "mka,dts,dtshd,dts-hd,truehd,true-hd", + + --files with these extensions will be added as additional subtitle tracks instead of appended to the playlist + subtitle_extensions = "etf,etf8,utf-8,idx,sub,srt,rt,ssa,ass,mks,vtt,sup,scc,smi,lrc,pgs", + + --filter dot directories like .config + --most useful on linux systems + filter_dot_dirs = false, + filter_dot_files = false, + + --substitude forward slashes for backslashes when appending a local file to the playlist + --potentially useful on windows systems + substitute_backslash = false, + + --this option reverses the behaviour of the alt+ENTER keybind + --when disabled the keybind is required to enable autoload for the file + --when enabled the keybind disables autoload for the file + autoload = false, + + --if autoload is triggered by selecting the currently playing file, then + --the current file will have it's watch-later config saved before being closed + --essentially the current file will not be restarted + autoload_save_current = true, + + --when opening the browser in idle mode prefer the current working directory over the root + --note that the working directory is set as the 'current' directory regardless, so `home` will + --move the browser there even if this option is set to false + default_to_working_directory = false, + + --allows custom icons be set to fix incompatabilities with some fonts + --the `\h` character is a hard space to add padding between the symbol and the text + folder_icon = "🖿", + cursor_icon = "➤", + indent_icon = [[\h\h\h]], + + --enable addons + addons = false, + addon_directory = "~~/script-modules/file-browser-addons", + + --directory to load external modules - currently just user-input-module + module_directory = "~~/script-modules", + + --force file-browser to use a specific text alignment (default: top-left) + --uses ass tag alignment numbers: https://aegi.vmoe.info/docs/3.0/ASS_Tags/#index23h3 + --set to 0 to use the default mpv osd-align options + alignment = 7, + + --style settings + font_bold_header = true, + + font_size_header = 35, + font_size_body = 25, + font_size_wrappers = 16, + + font_name_header = "", + font_name_body = "", + font_name_wrappers = "", + font_name_folder = "", + font_name_cursor = "", + + font_colour_header = "00ccff", + font_colour_body = "ffffff", + font_colour_wrappers = "00ccff", + font_colour_cursor = "00ccff", + + font_colour_multiselect = "fcad88", + font_colour_selected = "fce788", + font_colour_playing = "33ff66", + font_colour_playing_multiselected = "22b547", +} + +opt.read_options(o, "file_browser") +utils.shared_script_property_set("file_browser-open", "no") + +-------------------------------------------------------------------------------------------------------- +-----------------------------------------Environment Setup---------------------------------------------- +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--sets the version for the file-browser API +API_VERSION = "1.3.0" + +--switch the main script to a different environment so that the +--executed lua code cannot access our global variales +if setfenv then + setfenv(1, setmetatable({}, { __index = _G })) +else + _ENV = setmetatable({}, { __index = _G }) +end + +--creates a table for the API functions +--adds one metatable redirect to prevent addon authors from accidentally breaking file-browser +local API = { API_VERSION = API_VERSION } +package.loaded["file-browser"] = setmetatable({}, { __index = API }) + +local parser_API = setmetatable({}, { __index = package.loaded["file-browser"] }) +local parse_state_API = {} + +-------------------------------------------------------------------------------------------------------- +------------------------------------------Variable Setup------------------------------------------------ +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--the osd_overlay API was not added until v0.31. The expand-path command was not added until 0.30 +local ass = mp.create_osd_overlay("ass-events") +if not ass then + return msg.error("Script requires minimum mpv version 0.31") +end + +package.path = mp.command_native({ "expand-path", o.module_directory }) .. "/?.lua;" .. package.path + +local style = { + global = o.alignment == 0 and "" or ([[{\an%d}]]):format(o.alignment), + + -- full line styles + header = ([[{\r\q2\b%s\fs%d\fn%s\c&H%s&}]]):format( + (o.font_bold_header and "1" or "0"), + o.font_size_header, + o.font_name_header, + o.font_colour_header + ), + body = ([[{\r\q2\fs%d\fn%s\c&H%s&}]]):format(o.font_size_body, o.font_name_body, o.font_colour_body), + footer_header = ([[{\r\q2\fs%d\fn%s\c&H%s&}]]):format( + o.font_size_wrappers, + o.font_name_wrappers, + o.font_colour_wrappers + ), + + --small section styles (for colours) + multiselect = ([[{\c&H%s&}]]):format(o.font_colour_multiselect), + selected = ([[{\c&H%s&}]]):format(o.font_colour_selected), + playing = ([[{\c&H%s&}]]):format(o.font_colour_playing), + playing_selected = ([[{\c&H%s&}]]):format(o.font_colour_playing_multiselected), + + --icon styles + cursor = ([[{\fn%s\c&H%s&}]]):format(o.font_name_cursor, o.font_colour_cursor), + folder = ([[{\fn%s}]]):format(o.font_name_folder), +} + +local state = { + list = {}, + selected = 1, + hidden = true, + flag_update = false, + keybinds = nil, + + parser = nil, + directory = nil, + directory_label = nil, + prev_directory = "", + co = nil, + + multiselect_start = nil, + initial_selection = nil, + selection = {}, +} + +--the parser table actually contains 3 entries for each parser +--a numeric entry which represents the priority of the parsers and has the parser object as the value +--a string entry representing the id of each parser and with the parser object as the value +--and a table entry with the parser itself as the key and a table value in the form { id = %s, index = %d } +local parsers = {} + +--this table contains the parse_state tables for every parse operation indexed with the coroutine used for the parse +--this table has weakly referenced keys, meaning that once the coroutine for a parse is no-longer used by anything that +--field in the table will be removed by the garbage collector +local parse_states = setmetatable({}, { __mode = "k" }) + +local extensions = {} +local sub_extensions = {} +local audio_extensions = {} +local parseable_extensions = {} + +local dvd_device = nil +local current_file = { + directory = nil, + name = nil, + path = nil, +} + +local root = nil + +--default list of compatible file extensions +--adding an item to this list is a valid request on github +local compatible_file_extensions = { + "264", + "265", + "3g2", + "3ga", + "3ga2", + "3gp", + "3gp2", + "3gpp", + "3iv", + "a52", + "aac", + "adt", + "adts", + "ahn", + "aif", + "aifc", + "aiff", + "amr", + "ape", + "asf", + "au", + "avc", + "avi", + "awb", + "ay", + "bmp", + "cue", + "divx", + "dts", + "dtshd", + "dts-hd", + "dv", + "dvr", + "dvr-ms", + "eac3", + "evo", + "evob", + "f4a", + "flac", + "flc", + "fli", + "flic", + "flv", + "gbs", + "gif", + "gxf", + "gym", + "h264", + "h265", + "hdmov", + "hdv", + "hes", + "hevc", + "jpeg", + "jpg", + "kss", + "lpcm", + "m1a", + "m1v", + "m2a", + "m2t", + "m2ts", + "m2v", + "m3u", + "m3u8", + "m4a", + "m4v", + "mk3d", + "mka", + "mkv", + "mlp", + "mod", + "mov", + "mp1", + "mp2", + "mp2v", + "mp3", + "mp4", + "mp4v", + "mp4v", + "mpa", + "mpe", + "mpeg", + "mpeg2", + "mpeg4", + "mpg", + "mpg4", + "mpv", + "mpv2", + "mts", + "mtv", + "mxf", + "nsf", + "nsfe", + "nsv", + "nut", + "oga", + "ogg", + "ogm", + "ogv", + "ogx", + "opus", + "pcm", + "pls", + "png", + "qt", + "ra", + "ram", + "rm", + "rmvb", + "sap", + "snd", + "spc", + "spx", + "svg", + "thd", + "thd+ac3", + "tif", + "tiff", + "tod", + "trp", + "truehd", + "true-hd", + "ts", + "tsa", + "tsv", + "tta", + "tts", + "vfw", + "vgm", + "vgz", + "vob", + "vro", + "wav", + "weba", + "webm", + "webp", + "wm", + "wma", + "wmv", + "wtv", + "wv", + "x264", + "x265", + "xvid", + "y4m", + "yuv", +} + +-------------------------------------------------------------------------------------------------------- +--------------------------------------Cache Implementation---------------------------------------------- +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--metatable of methods to manage the cache +local __cache = {} + +__cache.cached_values = { + "directory", + "directory_label", + "list", + "selected", + "selection", + "parser", + "empty_text", + "co", +} + +--inserts latest state values onto the cache stack +function __cache:push() + local t = {} + for _, value in ipairs(self.cached_values) do + t[value] = state[value] + end + table.insert(self, t) +end + +function __cache:pop() + table.remove(self) +end + +function __cache:apply() + local t = self[#self] + for _, value in ipairs(self.cached_values) do + state[value] = t[value] + end +end + +function __cache:clear() + for i = 1, #self do + self[i] = nil + end +end + +local cache = setmetatable({}, { __index = __cache }) + +-------------------------------------------------------------------------------------------------------- +-----------------------------------------Utility Functions---------------------------------------------- +---------------------------------------Part of the addon API-------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +API.coroutine = {} +local ABORT_ERROR = { + msg = "browser is no longer waiting for list - aborting parse", +} + +--implements table.pack if on lua 5.1 +if not table.pack then + table.unpack = unpack + function table.pack(...) + local t = { ... } + t.n = select("#", ...) + return t + end +end + +--prints an error message and a stack trace +--accepts an error object and optionally a coroutine +--can be passed directly to xpcall +function API.traceback(errmsg, co) + if co then + msg.warn(debug.traceback(co)) + else + msg.warn(debug.traceback("", 2)) + end + msg.error(errmsg) +end + +--prints an error if a coroutine returns an error +--unlike the next function this one still returns the results of coroutine.resume() +function API.coroutine.resume_catch(...) + local returns = table.pack(coroutine.resume(...)) + if not returns[1] and returns[2] ~= ABORT_ERROR then + API.traceback(returns[2], select(1, ...)) + end + return table.unpack(returns, 1, returns.n) +end + +--resumes a coroutine and prints an error if it was not sucessful +function API.coroutine.resume_err(...) + local success, err = coroutine.resume(...) + if not success and err ~= ABORT_ERROR then + API.traceback(err, select(1, ...)) + end + return success +end + +--in lua 5.1 there is only one return value which will be nil if run from the main thread +--in lua 5.2 main will be true if running from the main thread +function API.coroutine.assert(err) + local co, main = coroutine.running() + assert(not main and co, err or "error - function must be executed from within a coroutine") + return co +end + +--creates a callback fuction to resume the current coroutine +function API.coroutine.callback() + local co = API.coroutine.assert("cannot create a coroutine callback for the main thread") + return function(...) + return API.coroutine.resume_err(co, ...) + end +end + +--puts the current coroutine to sleep for the given number of seconds +function API.coroutine.sleep(n) + mp.add_timeout(n, API.coroutine.callback()) + coroutine.yield() +end + +--runs the given function in a coroutine, passing through any additional arguments +--this is for triggering an event in a coroutine +function API.coroutine.run(fn, ...) + local co = coroutine.create(fn) + API.coroutine.resume_err(co, ...) +end + +--get the full path for the current file +function API.get_full_path(item, dir) + if item.path then + return item.path + end + return (dir or state.directory) .. item.name +end + +--gets the path for a new subdirectory, redirects if the path field is set +--returns the new directory path and a boolean specifying if a redirect happened +function API.get_new_directory(item, directory) + if item.path and item.redirect ~= false then + return item.path, true + end + if directory == "" then + return item.name + end + if string.sub(directory, -1) == "/" then + return directory .. item.name + end + return directory .. "/" .. item.name +end + +--returns the file extension of the given file +function API.get_extension(filename, def) + return string.lower(filename):match("%.([^%./]+)$") or def +end + +--returns the protocol scheme of the given url, or nil if there is none +function API.get_protocol(filename, def) + return string.lower(filename):match("^(%a[%w+-.]*)://") or def +end + +--formats strings for ass handling +--this function is based on a similar function from https://github.com/mpv-player/mpv/blob/master/player/lua/console.lua#L110 +function API.ass_escape(str, replace_newline) + if replace_newline == true then + replace_newline = "\\\239\187\191n" + end + + --escape the invalid single characters + str = string.gsub(str, "[\\{}\n]", { + -- There is no escape for '\' in ASS (I think?) but '\' is used verbatim if + -- it isn't followed by a recognised character, so add a zero-width + -- non-breaking space + ["\\"] = "\\\239\187\191", + ["{"] = "\\{", + ["}"] = "\\}", + -- Precede newlines with a ZWNBSP to prevent ASS's weird collapsing of + -- consecutive newlines + ["\n"] = "\239\187\191\\N", + }) + + -- Turn leading spaces into hard spaces to prevent ASS from stripping them + str = str:gsub("\\N ", "\\N\\h") + str = str:gsub("^ ", "\\h") + + if replace_newline then + str = str:gsub("\\N", replace_newline) + end + return str +end + +--escape lua pattern characters +function API.pattern_escape(str) + return string.gsub(str, "([%^%$%(%)%%%.%[%]%*%+%-])", "%%%1") +end + +--standardises filepaths across systems +function API.fix_path(str, is_directory) + str = string.gsub(str, [[\]], [[/]]) + str = str:gsub([[/./]], [[/]]) + if is_directory and str:sub(-1) ~= "/" then + str = str .. "/" + end + return str +end + +--wrapper for utils.join_path to handle protocols +function API.join_path(working, relative) + return API.get_protocol(relative) and relative or utils.join_path(working, relative) +end + +--sorts the table lexicographically ignoring case and accounting for leading/non-leading zeroes +--the number format functionality was proposed by github user twophyro, and was presumably taken +--from here: http://notebook.kulchenko.com/algorithms/alphanumeric-natural-sorting-for-humans-in-lua +function API.sort(t) + local function padnum(d) + local r = string.match(d, "0*(.+)") + return ("%03d%s"):format(#r, r) + end + + --appends the letter d or f to the start of the comparison to sort directories and folders as well + table.sort(t, function(a, b) + return a.type:sub(1, 1) .. (a.label or a.name):lower():gsub("%d+", padnum) + < b.type:sub(1, 1) .. (b.label or b.name):lower():gsub("%d+", padnum) + end) + return t +end + +function API.valid_dir(dir) + if o.filter_dot_dirs and string.sub(dir, 1, 1) == "." then + return false + end + return true +end + +function API.valid_file(file) + if o.filter_dot_files and (string.sub(file, 1, 1) == ".") then + return false + end + if o.filter_files and not extensions[API.get_extension(file, "")] then + return false + end + return true +end + +--returns whether or not the item can be parsed +function API.parseable_item(item) + return item.type == "dir" or parseable_extensions[API.get_extension(item.name, "")] +end + +--removes items and folders from the list +--this is for addons which can't filter things during their normal processing +function API.filter(t) + local max = #t + local top = 1 + for i = 1, max do + local temp = t[i] + t[i] = nil + + if + (temp.type == "dir" and API.valid_dir(temp.label or temp.name)) + or (temp.type == "file" and API.valid_file(temp.label or temp.name)) + then + t[top] = temp + top = top + 1 + end + end + return t +end + +--returns a string iterator that uses the root separators +function API.iterate_opt(str) + return string.gmatch(str, "([^" .. API.pattern_escape(o.root_separators) .. "]+)") +end + +--sorts a table into an array of selected items in the correct order +--if a predicate function is passed, then the item will only be added to +--the table if the function returns true +function API.sort_keys(t, include_item) + local keys = {} + for k in pairs(t) do + local item = state.list[k] + if not include_item or include_item(item) then + item.index = k + keys[#keys + 1] = item + end + end + + table.sort(keys, function(a, b) + return a.index < b.index + end) + return keys +end + +local invalid_types = { + userdata = true, + thread = true, + ["function"] = true, +} + +local invalid_key_types = { + boolean = true, + table = true, + ["nil"] = true, +} +setmetatable(invalid_key_types, { __index = invalid_types }) + +--recursively removes elements of the table which would cause +--utils.format_json to throw an error +local function json_safe_recursive(t) + if type(t) ~= "table" then + return t + end + + local invalid_ktypes = setmetatable({}, { __index = invalid_key_types }) + local arr_length = #t + if arr_length > 0 then + invalid_ktypes.string = true + setmetatable(t, { type = "ARRAY" }) + else + invalid_ktypes.number = true + setmetatable(t, { type = "MAP" }) + end + + for key, value in pairs(t) do + local ktype = type(key) + local vtype = type(value) + + if invalid_ktypes[ktype] or invalid_types[vtype] then + t[key] = nil + elseif ktype == "number" and key > arr_length then + t[key] = nil + else + t[key] = json_safe_recursive(t[key]) + end + end + return t +end + +--formats a table into a json string but ensures there are no invalid datatypes inside the table first +function API.format_json_safe(t) + --operate on a copy of the table to prevent any data loss in the original table + t = json_safe_recursive(API.copy_table(t)) + local success, result, err = pcall(utils.format_json, t) + if success then + return result, err + else + return nil, result + end +end + +--copies a table without leaving any references to the original +--uses a structured clone algorithm to maintain cyclic references +local function copy_table_recursive(t, references) + if type(t) ~= "table" then + return t + end + if references[t] then + return references[t] + end + + local mt = { + __original = t, + __index = getmetatable(t), + } + local copy = setmetatable({}, mt) + references[t] = copy + + for key, value in pairs(t) do + key = copy_table_recursive(key, references) + copy[key] = copy_table_recursive(value, references) + end + return copy +end + +--a wrapper around copy_table to provide the reference table +function API.copy_table(t) + --this is to handle cyclic table references + return copy_table_recursive(t, {}) +end + +-------------------------------------------------------------------------------------------------------- +------------------------------------Parser Object Implementation---------------------------------------- +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--parser object for the root +--this object is not added to the parsers table so that scripts cannot get access to +--the root table, which is returned directly by parse() +local root_parser = { + name = "root", + priority = math.huge, + + --if this is being called then all other parsers have failed and we've fallen back to root + can_parse = function() + return true + end, + + --we return the root directory exactly as setup + parse = function(self) + return root, { + sorted = true, + filtered = true, + escaped = true, + parser = self, + directory = "", + } + end, +} + +--parser ofject for native filesystems +local file_parser = { + name = "file", + priority = 110, + + --as the default parser we'll always attempt to use it if all others fail + can_parse = function(_, directory) + return true + end, + + --scans the given directory using the mp.utils.readdir function + parse = function(self, directory) + local new_list = {} + local list1 = utils.readdir(directory, "dirs") + if list1 == nil then + return nil + end + + --sorts folders and formats them into the list of directories + for i = 1, #list1 do + local item = list1[i] + + --filters hidden dot directories for linux + if self.valid_dir(item) then + msg.trace(item .. "/") + table.insert(new_list, { name = item .. "/", type = "dir" }) + end + end + + --appends files to the list of directory items + local list2 = utils.readdir(directory, "files") + for i = 1, #list2 do + local item = list2[i] + + --only adds whitelisted files to the browser + if self.valid_file(item) then + msg.trace(item) + table.insert(new_list, { name = item, type = "file" }) + end + end + return API.sort(new_list), { filtered = true, sorted = true } + end, +} + +-------------------------------------------------------------------------------------------------------- +-----------------------------------------List Formatting------------------------------------------------ +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--appends the entered text to the overlay +local function append(text) + if text == nil then + return + end + ass.data = ass.data .. text +end + +--appends a newline character to the osd +local function newline() + ass.data = ass.data .. "\\N" +end + +--detects whether or not to highlight the given entry as being played +local function highlight_entry(v) + if current_file.name == nil then + return false + end + if API.parseable_item(v) then + return current_file.directory:find(API.get_full_path(v), 1, true) + else + return current_file.path == API.get_full_path(v) + end +end + +--saves the directory and name of the currently playing file +local function update_current_directory(_, filepath) + --if we're in idle mode then we want to open the working directory + if filepath == nil then + current_file.directory = API.fix_path(mp.get_property("working-directory", ""), true) + current_file.name = nil + current_file.path = nil + return + elseif filepath:find("dvd://") == 1 then + filepath = dvd_device .. filepath:match("dvd://(.*)") + end + + local workingDirectory = mp.get_property("working-directory", "") + local exact_path = API.join_path(workingDirectory, filepath) + exact_path = API.fix_path(exact_path, false) + current_file.directory, current_file.name = utils.split_path(exact_path) + current_file.path = exact_path +end + +--refreshes the ass text using the contents of the list +local function update_ass() + if state.hidden then + state.flag_update = true + return + end + + ass.data = style.global + + local dir_name = state.directory_label or state.directory + if dir_name == "" then + dir_name = "ROOT" + end + append(style.header) + append(API.ass_escape(dir_name, style.cursor .. "\\\239\187\191n" .. style.header)) + append("\\N ----------------------------------------------------") + newline() + + if #state.list < 1 then + append(state.empty_text) + ass:update() + return + end + + local start = 1 + local finish = start + o.num_entries - 1 + + --handling cursor positioning + local mid = math.ceil(o.num_entries / 2) + 1 + if state.selected + mid > finish then + local offset = state.selected - finish + mid + + --if we've overshot the end of the list then undo some of the offset + if finish + offset > #state.list then + offset = offset - ((finish + offset) - #state.list) + end + + start = start + offset + finish = finish + offset + end + + --making sure that we don't overstep the boundaries + if start < 1 then + start = 1 + end + local overflow = finish < #state.list + --this is necessary when the number of items in the dir is less than the max + if not overflow then + finish = #state.list + end + + --adding a header to show there are items above in the list + if start > 1 then + append(style.footer_header .. (start - 1) .. " item(s) above\\N\\N") + end + + for i = start, finish do + local v = state.list[i] + local playing_file = highlight_entry(v) + append(style.body) + + --handles custom styles for different entries + if i == state.selected then + append(style.cursor) + append((state.multiselect_start and style.multiselect or "") .. o.cursor_icon) + append("\\h" .. style.body) + else + append(o.indent_icon .. "\\h" .. style.body) + end + + --sets the selection colour scheme + local multiselected = state.selection[i] + if multiselected then + append(style.multiselect) + elseif i == state.selected then + append(style.selected) + end + + --prints the currently-playing icon and style + if playing_file and multiselected then + append(style.playing_selected) + elseif playing_file then + append(style.playing) + end + + --sets the folder icon + if v.type == "dir" then + append(style.folder .. o.folder_icon .. "\\h" .. "{\\fn" .. o.font_name_body .. "}") + end + + --adds the actual name of the item + append(v.ass or API.ass_escape(v.label or v.name, true)) + newline() + end + + if overflow then + append("\\N" .. style.footer_header .. #state.list - finish .. " item(s) remaining") + end + ass:update() +end + +-------------------------------------------------------------------------------------------------------- +--------------------------------Scroll/Select Implementation-------------------------------------------- +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--disables multiselect +local function disable_select_mode() + state.multiselect_start = nil + state.initial_selection = nil +end + +--enables multiselect +local function enable_select_mode() + state.multiselect_start = state.selected + state.initial_selection = API.copy_table(state.selection) +end + +--calculates what drag behaviour is required for that specific movement +local function drag_select(original_pos, new_pos) + if original_pos == new_pos then + return + end + + local setting = state.selection[state.multiselect_start] + for i = original_pos, new_pos, (new_pos > original_pos and 1 or -1) do + --if we're moving the cursor away from the starting point then set the selection + --otherwise restore the original selection + if i > state.multiselect_start then + if new_pos > original_pos then + state.selection[i] = setting + elseif i ~= new_pos then + state.selection[i] = state.initial_selection[i] + end + elseif i < state.multiselect_start then + if new_pos < original_pos then + state.selection[i] = setting + elseif i ~= new_pos then + state.selection[i] = state.initial_selection[i] + end + end + end +end + +--moves the selector up and down the list by the entered amount +local function scroll(n, wrap) + local num_items = #state.list + if num_items == 0 then + return + end + + local original_pos = state.selected + + if original_pos + n > num_items then + state.selected = wrap and 1 or num_items + elseif original_pos + n < 1 then + state.selected = wrap and num_items or 1 + else + state.selected = original_pos + n + end + + if state.multiselect_start then + drag_select(original_pos, state.selected) + end + update_ass() +end + +--toggles the selection +local function toggle_selection() + if not state.list[state.selected] then + return + end + state.selection[state.selected] = not state.selection[state.selected] or nil + update_ass() +end + +--select all items in the list +local function select_all() + for i, _ in ipairs(state.list) do + state.selection[i] = true + end + update_ass() +end + +--toggles select mode +local function toggle_select_mode() + if state.multiselect_start == nil then + enable_select_mode() + toggle_selection() + else + disable_select_mode() + update_ass() + end +end + +-------------------------------------------------------------------------------------------------------- +-----------------------------------------Directory Movement--------------------------------------------- +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--scans the list for which item to select by default +--chooses the folder that the script just moved out of +--or, otherwise, the item highlighted as currently playing +local function select_prev_directory() + if state.prev_directory:find(state.directory, 1, true) == 1 then + local i = 1 + while state.list[i] and API.parseable_item(state.list[i]) do + if state.prev_directory:find(API.get_full_path(state.list[i]), 1, true) then + state.selected = i + return + end + i = i + 1 + end + end + + for i, item in ipairs(state.list) do + if highlight_entry(item) then + state.selected = i + return + end + end +end + +--parses the given directory or defers to the next parser if nil is returned +local function choose_and_parse(directory, index) + msg.debug("finding parser for", directory) + local parser, list, opts + local parse_state = API.get_parse_state() + while list == nil and not parse_state.already_deferred and index <= #parsers do + parser = parsers[index] + if parser:can_parse(directory, parse_state) then + msg.debug("attempting parser:", parser:get_id()) + list, opts = parser:parse(directory, parse_state) + end + index = index + 1 + end + if not list then + return nil, {} + end + + msg.debug("list returned from:", parser:get_id()) + opts = opts or {} + if list then + opts.id = opts.id or parser:get_id() + end + return list, opts +end + +--sets up the parse_state table and runs the parse operation +local function run_parse(directory, parse_state) + msg.verbose("scanning files in", directory) + parse_state.directory = directory + local co = coroutine.running() + + setmetatable(parse_state, { __index = parse_state_API }) + if directory == "" then + return root_parser:parse() + end + + parse_states[co] = parse_state + local list, opts = choose_and_parse(directory, 1) + + if list == nil then + return msg.debug("no successful parsers found") + end + opts.parser = parsers[opts.id] + + if not opts.filtered then + API.filter(list) + end + if not opts.sorted then + API.sort(list) + end + return list, opts +end + +--returns the contents of the given directory using the given parse state +--if a coroutine has already been used for a parse then create a new coroutine so that +--the every parse operation has a unique thread ID +local function parse_directory(directory, parse_state) + local co = API.coroutine.assert( + "scan_directory must be executed from within a coroutine - aborting scan " .. utils.to_string(parse_state) + ) + if not parse_states[co] then + return run_parse(directory, parse_state) + end + + --if this coroutine is already is use by another parse operation then we create a new + --one and hand execution over to that + local new_co = coroutine.create(function() + API.coroutine.resume_err(co, run_parse(directory, parse_state)) + end) + + --queue the new coroutine on the mpv event queue + mp.add_timeout(0, function() + local success, err = coroutine.resume(new_co) + if not success then + API.traceback(err, new_co) + API.coroutine.resume_err(co) + end + end) + return parse_states[co]:yield() +end + +--sends update requests to the different parsers +local function update_list() + msg.verbose("opening directory: " .. state.directory) + + state.selected = 1 + state.selection = {} + + --loads the current directry from the cache to save loading time + --there will be a way to forcibly reload the current directory at some point + --the cache is in the form of a stack, items are taken off the stack when the dir moves up + if cache[1] and cache[#cache].directory == state.directory then + msg.verbose("found directory in cache") + cache:apply() + state.prev_directory = state.directory + return + end + local directory = state.directory + local list, opts = parse_directory(state.directory, { source = "browser" }) + + --if the running coroutine isn't the one stored in the state variable, then the user + --changed directories while the coroutine was paused, and this operation should be aborted + if coroutine.running() ~= state.co then + msg.verbose(ABORT_ERROR.msg) + msg.debug("expected:", state.directory, "received:", directory) + return + end + + --apply fallbacks if the scan failed + if not list and cache[1] then + --switches settings back to the previously opened directory + --to the user it will be like the directory never changed + msg.warn("could not read directory", state.directory) + cache:apply() + return + elseif not list then + msg.warn("could not read directory", state.directory) + list, opts = root_parser:parse() + end + + state.list = list + state.parser = opts.parser + + --this only matters when displaying the list on the screen, so it doesn't need to be in the scan function + if not opts.escaped then + for i = 1, #list do + list[i].ass = list[i].ass or API.ass_escape(list[i].label or list[i].name, true) + end + end + + --setting custom options from parsers + state.directory_label = opts.directory_label + state.empty_text = opts.empty_text or state.empty_text + + --we assume that directory is only changed when redirecting to a different location + --therefore, the cache should be wiped + if opts.directory then + state.directory = opts.directory + cache:clear() + end + + if opts.selected_index then + state.selected = opts.selected_index or state.selected + if state.selected > #state.list then + state.selected = #state.list + elseif state.selected < 1 then + state.selected = 1 + end + end + + select_prev_directory() + state.prev_directory = state.directory +end + +--rescans the folder and updates the list +local function update(moving_adjacent) + --we can only make assumptions about the directory label when moving from adjacent directories + if not moving_adjacent then + state.directory_label = nil + cache:clear() + end + + state.empty_text = "~" + state.list = {} + disable_select_mode() + update_ass() + state.empty_text = "empty directory" + + --the directory is always handled within a coroutine to allow addons to + --pause execution for asynchronous operations + state.co = coroutine.create(function() + update_list() + update_ass() + end) + API.coroutine.resume_err(state.co) +end + +--the base function for moving to a directory +local function goto_directory(directory) + state.directory = directory + update() +end + +--loads the root list +local function goto_root() + msg.verbose("jumping to root") + goto_directory("") +end + +--switches to the directory of the currently playing file +local function goto_current_dir() + msg.verbose("jumping to current directory") + goto_directory(current_file.directory) +end + +--moves up a directory +local function up_dir() + local dir = state.directory:reverse() + local index = dir:find("[/\\]") + + while index == 1 do + dir = dir:sub(2) + index = dir:find("[/\\]") + end + + if index == nil then + state.directory = "" + else + state.directory = dir:sub(index):reverse() + end + + --we can make some assumptions about the next directory label when moving up or down + if state.directory_label then + state.directory_label = state.directory_label:match("^(.+/)[^/]+/$") + end + + update(true) + cache:pop() +end + +--moves down a directory +local function down_dir() + local current = state.list[state.selected] + if not current or not API.parseable_item(current) then + return + end + + cache:push() + local directory, redirected = API.get_new_directory(current, state.directory) + state.directory = directory + + --we can make some assumptions about the next directory label when moving up or down + if state.directory_label then + state.directory_label = state.directory_label .. (current.label or current.name) + end + update(not redirected) +end + +------------------------------------------------------------------------------------------ +------------------------------------Browser Controls-------------------------------------- +------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------ + +--opens the browser +local function open() + for _, v in ipairs(state.keybinds) do + mp.add_forced_key_binding(v[1], "dynamic/" .. v[2], v[3], v[4]) + end + + utils.shared_script_property_set("file_browser-open", "yes") + state.hidden = false + if state.directory == nil then + local path = mp.get_property("path") + update_current_directory(nil, path) + if path or o.default_to_working_directory then + goto_current_dir() + else + goto_root() + end + return + end + + if state.flag_update then + update_current_directory(nil, mp.get_property("path")) + end + if not state.flag_update then + ass:update() + else + state.flag_update = false + update_ass() + end +end + +--closes the list and sets the hidden flag +local function close() + for _, v in ipairs(state.keybinds) do + mp.remove_key_binding("dynamic/" .. v[2]) + end + + utils.shared_script_property_set("file_browser-open", "no") + state.hidden = true + ass:remove() +end + +--toggles the list +local function toggle() + if state.hidden then + open() + else + close() + end +end + +--run when the escape key is used +local function escape() + --if multiple items are selection cancel the + --selection instead of closing the browser + if next(state.selection) or state.multiselect_start then + state.selection = {} + disable_select_mode() + update_ass() + return + end + close() +end + +--opens a specific directory +local function browse_directory(directory) + if not directory then + return + end + directory = mp.command_native({ "expand-path", directory }, "") + -- directory = join_path( mp.get_property("working-directory", ""), directory ) + + if directory ~= "" then + directory = API.fix_path(directory, true) + end + msg.verbose("recieved directory from script message: " .. directory) + + if directory == "dvd://" then + directory = dvd_device + end + goto_directory(directory) + open() +end + +------------------------------------------------------------------------------------------ +---------------------------------File/Playlist Opening------------------------------------ +------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------ + +--adds a file to the playlist and changes the flag to `append-play` in preparation +--for future items +local function loadfile(file, opts) + if o.substitute_backslash and not API.get_protocol(file) then + file = file:gsub("/", "\\") + end + + if opts.flag == "replace" then + msg.verbose("Playling file", file) + else + msg.verbose("Appending", file, "to the playlist") + end + + if not mp.commandv("loadfile", file, opts.flag) then + msg.warn(file) + end + opts.flag = "append-play" + opts.items_appended = opts.items_appended + 1 +end + +--this function recursively loads directories concurrently in separate coroutines +--results are saved in a tree of tables that allows asynchronous access +local function concurrent_loadlist_parse(directory, load_opts, prev_dirs, item_t) + --prevents infinite recursion from the item.path or opts.directory fields + if prev_dirs[directory] then + return + end + prev_dirs[directory] = true + + local list, list_opts = parse_directory(directory, { source = "loadlist" }) + if list == root then + return + end + + --if we can't parse the directory then append it and hope mpv fares better + if list == nil then + msg.warn("Could not parse", directory, "appending to playlist anyway") + item_t.type = "file" + return + end + + directory = list_opts.directory or directory + if directory == "" then + return + end + + --we must declare these before we start loading sublists otherwise the append thread will + --need to wait until the whole list is loaded (when synchronous IO is used) + item_t._sublist = list or {} + list._directory = directory + + --launches new parse operations for directories, each in a different coroutine + for _, item in ipairs(list) do + if API.parseable_item(item) then + API.coroutine.run( + concurrent_loadlist_wrapper, + API.get_new_directory(item, directory), + load_opts, + prev_dirs, + item + ) + end + end + return true +end + +--a wrapper function that ensures the concurrent_loadlist_parse is run correctly +function concurrent_loadlist_wrapper(directory, opts, prev_dirs, item) + --ensures that only a set number of concurrent parses are operating at any one time. + --the mpv event queue is seemingly limited to 1000 items, but only async mpv actions like + --command_native_async should use that, events like mp.add_timeout (which coroutine.sleep() uses) should + --be handled enturely on the Lua side with a table, which has a significantly larger maximum size. + while opts.concurrency > o.max_concurrency do + API.coroutine.sleep(0.1) + end + opts.concurrency = opts.concurrency + 1 + + local success = concurrent_loadlist_parse(directory, opts, prev_dirs, item) + opts.concurrency = opts.concurrency - 1 + if not success then + item._sublist = {} + end + if coroutine.status(opts.co) == "suspended" then + API.coroutine.resume_err(opts.co) + end +end + +--recursively appends items to the playlist, acts as a consumer to the previous functions producer; +--if the next directory has not been parsed this function will yield until the parse has completed +local function concurrent_loadlist_append(list, load_opts) + local directory = list._directory + + for _, item in ipairs(list) do + if + not sub_extensions[API.get_extension(item.name, "")] + and not audio_extensions[API.get_extension(item.name, "")] + then + while not item._sublist and API.parseable_item(item) do + coroutine.yield() + end + + if API.parseable_item(item) then + concurrent_loadlist_append(item._sublist, load_opts) + else + loadfile(API.get_full_path(item, directory), load_opts) + end + end + end +end + +--recursive function to load directories using the script custom parsers +--returns true if any items were appended to the playlist +local function custom_loadlist_recursive(directory, load_opts, prev_dirs) + --prevents infinite recursion from the item.path or opts.directory fields + if prev_dirs[directory] then + return + end + prev_dirs[directory] = true + + local list, opts = parse_directory(directory, { source = "loadlist" }) + if list == root then + return + end + + --if we can't parse the directory then append it and hope mpv fares better + if list == nil then + msg.warn("Could not parse", directory, "appending to playlist anyway") + loadfile(directory, load_opts.flag) + return true + end + + directory = opts.directory or directory + if directory == "" then + return + end + + for _, item in ipairs(list) do + if + not sub_extensions[API.get_extension(item.name, "")] + and not audio_extensions[API.get_extension(item.name, "")] + then + if API.parseable_item(item) then + custom_loadlist_recursive(API.get_new_directory(item, directory), load_opts, prev_dirs) + else + local path = API.get_full_path(item, directory) + loadfile(path, load_opts) + end + end + end +end + +--a wrapper for the custom_loadlist_recursive function +local function loadlist(item, opts) + local dir = API.get_full_path(item, opts.directory) + local num_items = opts.items_appended + + if o.concurrent_recursion then + item = API.copy_table(item) + opts.co = API.coroutine.assert() + opts.concurrency = 0 + + --we need the current coroutine to suspend before we run the first parse operation, so + --we schedule the coroutine to run on the mpv event queue + mp.add_timeout(0, function() + API.coroutine.run(concurrent_loadlist_wrapper, dir, opts, {}, item) + end) + concurrent_loadlist_append({ item, _directory = opts.directory }, opts) + else + custom_loadlist_recursive(dir, opts, {}) + end + + if opts.items_appended == num_items then + msg.warn(dir, "contained no valid files") + end +end + +--load playlist entries before and after the currently playing file +local function autoload_dir(path, opts) + if o.autoload_save_current and path == current_file.path then + mp.commandv("write-watch-later-config") + end + + --loads the currently selected file, clearing the playlist in the process + loadfile(path, opts) + + local pos = 1 + local file_count = 0 + for _, item in ipairs(state.list) do + if + item.type == "file" + and not sub_extensions[API.get_extension(item.name, "")] + and not audio_extensions[API.get_extension(item.name, "")] + then + local p = API.get_full_path(item) + + if p == path then + pos = file_count + else + loadfile(p, opts) + end + + file_count = file_count + 1 + end + end + mp.commandv("playlist-move", 0, pos + 1) +end + +--runs the loadfile or loadlist command +local function open_item(item, opts) + if API.parseable_item(item) then + return loadlist(item, opts) + end + + local path = API.get_full_path(item, opts.directory) + if sub_extensions[API.get_extension(item.name, "")] then + mp.commandv("sub-add", path, opts.flag == "replace" and "select" or "auto") + elseif audio_extensions[API.get_extension(item.name, "")] then + mp.commandv("audio-add", path, opts.flag == "replace" and "select" or "auto") + else + if opts.autoload then + autoload_dir(path, opts) + else + loadfile(path, opts) + end + end +end + +--handles the open options as a coroutine +--once loadfile has been run we can no-longer guarantee synchronous execution - the state values may change +--therefore, we must ensure that any state values that could be used after a loadfile call are saved beforehand +local function open_file_coroutine(opts) + if not state.list[state.selected] then + return + end + if opts.flag == "replace" then + close() + end + + --we want to set the idle option to yes to ensure that if the first item + --fails to load then the player has a chance to attempt to load further items (for async append operations) + local idle = mp.get_property("idle", "once") + mp.set_property("idle", "yes") + + --handles multi-selection behaviour + if next(state.selection) then + local selection = API.sort_keys(state.selection) + --reset the selection after + state.selection = {} + + disable_select_mode() + update_ass() + + --the currently selected file will be loaded according to the flag + --the flag variable will be switched to append once a file is loaded + for i = 1, #selection do + open_item(selection[i], opts) + end + else + local item = state.list[state.selected] + if opts.flag == "replace" then + down_dir() + end + open_item(item, opts) + end + + if mp.get_property("idle") == "yes" then + mp.set_property("idle", idle) + end +end + +--opens the selelected file(s) +local function open_file(flag, autoload) + API.coroutine.run(open_file_coroutine, { + flag = flag, + autoload = (autoload ~= o.autoload and flag == "replace"), + directory = state.directory, + items_appended = 0, + }) +end + +------------------------------------------------------------------------------------------ +----------------------------------Keybind Implementation---------------------------------- +------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------ + +state.keybinds = { + { + "ENTER", + "play", + function() + open_file("replace", false) + end, + }, + { + "Shift+ENTER", + "play_append", + function() + open_file("append-play", false) + end, + }, + { + "Alt+ENTER", + "play_autoload", + function() + open_file("replace", true) + end, + }, + { "ESC", "close", escape }, + { "RIGHT", "down_dir", down_dir }, + { "LEFT", "up_dir", up_dir }, + { + "DOWN", + "scroll_down", + function() + scroll(1, o.wrap) + end, + { repeatable = true }, + }, + { + "UP", + "scroll_up", + function() + scroll(-1, o.wrap) + end, + { repeatable = true }, + }, + { + "PGDWN", + "page_down", + function() + scroll(o.num_entries) + end, + { repeatable = true }, + }, + { + "PGUP", + "page_up", + function() + scroll(-o.num_entries) + end, + { repeatable = true }, + }, + { + "Shift+PGDWN", + "list_bottom", + function() + scroll(math.huge) + end, + }, + { + "Shift+PGUP", + "list_top", + function() + scroll(-math.huge) + end, + }, + { "HOME", "goto_current", goto_current_dir }, + { "Shift+HOME", "goto_root", goto_root }, + { + "Ctrl+r", + "reload", + function() + cache:clear() + update() + end, + }, + { "s", "select_mode", toggle_select_mode }, + { "S", "select_item", toggle_selection }, + { "Ctrl+a", "select_all", select_all }, +} + +--characters used for custom keybind codes +local CUSTOM_KEYBIND_CODES = "%fFnNpPdDrR" + +--a map of key-keybinds - only saves the latest keybind if multiple have the same key code +local top_level_keys = {} + +--format the item string for either single or multiple items +local function create_item_string(cmd, items, funct) + if not items[1] then + return + end + + local str = funct(items[1]) + for i = 2, #items do + str = str .. (cmd["concat-string"] or " ") .. funct(items[i]) + end + return str +end + +--iterates through the command table and substitutes special +--character codes for the correct strings used for custom functions +local function format_command_table(cmd, items, state) + local copy = {} + for i = 1, #cmd.command do + copy[i] = {} + + for j = 1, #cmd.command[i] do + copy[i][j] = cmd.command[i][j]:gsub("%%[" .. CUSTOM_KEYBIND_CODES .. "]", { + ["%%"] = "%", + ["%f"] = create_item_string(cmd, items, function(item) + return item and API.get_full_path(item, state.directory) or "" + end), + ["%F"] = create_item_string(cmd, items, function(item) + return string.format("%q", item and API.get_full_path(item, state.directory) or "") + end), + ["%n"] = create_item_string(cmd, items, function(item) + return item and (item.label or item.name) or "" + end), + ["%N"] = create_item_string(cmd, items, function(item) + return string.format("%q", item and (item.label or item.name) or "") + end), + ["%p"] = state.directory or "", + ["%P"] = string.format("%q", state.directory or ""), + ["%d"] = (state.directory_label or state.directory):match("([^/]+)/?$") or "", + ["%D"] = string.format("%q", (state.directory_label or state.directory):match("([^/]+)/$") or ""), + ["%r"] = state.parser.keybind_name or state.parser.name or "", + ["%R"] = string.format("%q", state.parser.keybind_name or state.parser.name or ""), + }) + end + end + return copy +end + +--runs all of the commands in the command table +--key.command must be an array of command tables compatible with mp.command_native +--items must be an array of multiple items (when multi-type ~= concat the array will be 1 long) +local function run_custom_command(cmd, items, state) + local custom_cmds = cmd.codes and format_command_table(cmd, items, state) or cmd.command + + for _, cmd in ipairs(custom_cmds) do + msg.debug("running command:", utils.to_string(cmd)) + mp.command_native(cmd) + end +end + +--runs one of the custom commands +local function custom_command(cmd, state, co) + if cmd.parser and cmd.parser ~= (state.parser.keybind_name or state.parser.name) then + return false + end + + --the function terminates here if we are running the command on a single item + if not (cmd.multiselect and next(state.selection)) then + if cmd.filter then + if not state.list[state.selected] then + return false + end + if state.list[state.selected].type ~= cmd.filter then + return false + end + end + + --if the directory is empty, and this command needs to work on an item, then abort and fallback to the next command + if cmd.codes and not state.list[state.selected] then + if cmd.codes["%f"] or cmd.codes["%F"] or cmd.codes["%n"] or cmd.codes["%N"] then + return false + end + end + + run_custom_command(cmd, { state.list[state.selected] }, state) + return true + end + + --runs the command on all multi-selected items + local selection = API.sort_keys(state.selection, function(item) + return not cmd.filter or item.type == cmd.filter + end) + if not next(selection) then + return false + end + + if cmd["multi-type"] == "concat" then + run_custom_command(cmd, selection, state) + elseif cmd["multi-type"] == "repeat" then + for i, _ in ipairs(selection) do + run_custom_command(cmd, { selection[i] }, state) + + if cmd.delay then + mp.add_timeout(cmd.delay, function() + API.coroutine.resume_err(co) + end) + coroutine.yield() + end + end + end + + --we passthrough by default if the command is not run on every selected item + if cmd.passthrough ~= nil then + return + end + + local num_selection = 0 + for _ in pairs(state.selection) do + num_selection = num_selection + 1 + end + return #selection == num_selection +end + +--recursively runs the keybind functions, passing down through the chain +--of keybinds with the same key value +local function run_keybind_recursive(keybind, state, co) + msg.trace("Attempting custom command:", utils.to_string(keybind)) + + --these are for the default keybinds, or from addons which use direct functions + local addon_fn = type(keybind.command) == "function" + local fn = addon_fn and keybind.command or custom_command + + if keybind.passthrough ~= nil then + fn(keybind, addon_fn and API.copy_table(state) or state, co) + if keybind.passthrough == true and keybind.prev_key then + run_keybind_recursive(keybind.prev_key, state, co) + end + else + if fn(keybind, state, co) == false and keybind.prev_key then + run_keybind_recursive(keybind.prev_key, state, co) + end + end +end + +--a wrapper to run a custom keybind as a lua coroutine +local function run_keybind_coroutine(key) + msg.debug("Received custom keybind " .. key.key) + local co = coroutine.create(run_keybind_recursive) + + local state_copy = { + directory = state.directory, + directory_label = state.directory_label, + list = state.list, --the list should remain unchanged once it has been saved to the global state, new directories get new tables + selected = state.selected, + selection = API.copy_table(state.selection), + parser = state.parser, + } + local success, err = coroutine.resume(co, key, state_copy, co) + if not success then + msg.error("error running keybind:", utils.to_string(key)) + API.traceback(err, co) + end +end + +--scans the given command table to identify if they contain any custom keybind codes +local function scan_for_codes(command_table, codes) + if type(command_table) ~= "table" then + return codes + end + for _, value in pairs(command_table) do + local type = type(value) + if type == "table" then + scan_for_codes(value, codes) + elseif type == "string" then + value:gsub("%%[" .. CUSTOM_KEYBIND_CODES .. "]", function(code) + codes[code] = true + end) + end + end + return codes +end + +--inserting the custom keybind into the keybind array for declaration when file-browser is opened +--custom keybinds with matching names will overwrite eachother +local function insert_custom_keybind(keybind) + --we'll always save the keybinds as either an array of command arrays or a function + if type(keybind.command) == "table" and type(keybind.command[1]) ~= "table" then + keybind.command = { keybind.command } + end + + keybind.codes = scan_for_codes(keybind.command, {}) + if not next(keybind.codes) then + keybind.codes = nil + end + keybind.prev_key = top_level_keys[keybind.key] + + table.insert(state.keybinds, { + keybind.key, + keybind.name, + function() + run_keybind_coroutine(keybind) + end, + keybind.flags or {}, + }) + top_level_keys[keybind.key] = keybind +end + +--loading the custom keybinds +--can either load keybinds from the config file, from addons, or from both +local function setup_keybinds() + if not o.custom_keybinds and not o.addons then + return + end + + --this is to make the default keybinds compatible with passthrough from custom keybinds + for _, keybind in ipairs(state.keybinds) do + top_level_keys[keybind[1]] = { key = keybind[1], name = keybind[2], command = keybind[3], flags = keybind[4] } + end + + --this loads keybinds from addons + if o.addons then + for i = #parsers, 1, -1 do + local parser = parsers[i] + if parser.keybinds then + for i, keybind in ipairs(parser.keybinds) do + --if addons use the native array command format, then we need to convert them over to the custom command format + if not keybind.key then + keybind = { key = keybind[1], name = keybind[2], command = keybind[3], flags = keybind[4] } + else + keybind = API.copy_table(keybind) + end + + keybind.name = parsers[parser].id .. "/" .. (keybind.name or tostring(i)) + insert_custom_keybind(keybind) + end + end + end + end + + --loads custom keybinds from file-browser-keybinds.json + if o.custom_keybinds then + local path = mp.command_native({ "expand-path", "~~/script-opts" }) .. "/file-browser-keybinds.json" + local custom_keybinds, err = io.open(path) + if not custom_keybinds then + return error(err) + end + + local json = custom_keybinds:read("*a") + custom_keybinds:close() + + json = utils.parse_json(json) + if not json then + return error("invalid json syntax for " .. path) + end + + for i, keybind in ipairs(json) do + keybind.name = "custom/" .. (keybind.name or tostring(i)) + insert_custom_keybind(keybind) + end + end +end + +-------------------------------------------------------------------------------------------------------- +-------------------------------------------API Functions------------------------------------------------ +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +--these functions we'll provide as-is +API.redraw = update_ass +API.rescan = update +API.browse_directory = browse_directory + +function API.clear_cache() + cache:clear() +end + +--a wrapper around scan_directory for addon API +function API.parse_directory(directory, parse_state) + if not parse_state then + parse_state = { source = "addon" } + elseif not parse_state.source then + parse_state.source = "addon" + end + return parse_directory(directory, parse_state) +end + +--register file extensions which can be opened by the browser +function API.register_parseable_extension(ext) + parseable_extensions[string.lower(ext)] = true +end +function API.remove_parseable_extension(ext) + parseable_extensions[string.lower(ext)] = nil +end + +--add a compatible extension to show through the filter, only applies if run during the setup() method +function API.add_default_extension(ext) + table.insert(compatible_file_extensions, ext) +end + +--add item to root at position pos +function API.insert_root_item(item, pos) + msg.verbose("adding item to root", item.label or item.name) + item.ass = item.ass or API.ass_escape(item.label or item.name) + item.type = "dir" + table.insert(root, pos or (#root + 1), item) +end + +--providing getter and setter functions so that addons can't modify things directly +function API.get_script_opts() + return API.copy_table(o) +end +function API.get_opt(key) + return o[key] +end +function API.get_extensions() + return API.copy_table(extensions) +end +function API.get_sub_extensions() + return API.copy_table(sub_extensions) +end +function API.get_audio_extensions() + return API.copy_table(audio_extensions) +end +function API.get_parseable_extensions() + return API.copy_table(parseable_extensions) +end +function API.get_state() + return API.copy_table(state) +end +function API.get_dvd_device() + return dvd_device +end +function API.get_parsers() + return API.copy_table(parsers) +end +function API.get_root() + return API.copy_table(root) +end +function API.get_directory() + return state.directory +end +function API.get_list() + return API.copy_table(state.list) +end +function API.get_current_file() + return API.copy_table(current_file) +end +function API.get_current_parser() + return state.parser:get_id() +end +function API.get_current_parser_keyname() + return state.parser.keybind_name or state.parser.name +end +function API.get_selected_index() + return state.selected +end +function API.get_selected_item() + return API.copy_table(state.list[state.selected]) +end +function API.get_open_status() + return not state.hidden +end +function API.get_parse_state(co) + return parse_states[co or coroutine.running() or ""] +end + +function API.set_empty_text(str) + state.empty_text = str + API.redraw() +end + +function API.set_selected_index(index) + if type(index) ~= "number" then + return false + end + if index < 1 then + index = 1 + end + if index > #state.list then + index = #state.list + end + state.selected = index + API.redraw() + return index +end + +function parser_API:get_index() + return parsers[self].index +end +function parser_API:get_id() + return parsers[self].id +end + +--runs choose_and_parse starting from the next parser +function parser_API:defer(directory) + msg.trace("deferring to other parsers...") + local list, opts = choose_and_parse(directory, self:get_index() + 1) + API.get_parse_state().already_deferred = true + return list, opts +end + +--a wrapper around coroutine.yield that aborts the coroutine if +--the parse request was cancelled by the user +--the coroutine is +function parse_state_API:yield(...) + local co = coroutine.running() + local is_browser = co == state.co + if self.source == "browser" and not is_browser then + msg.error("current coroutine does not match browser's expected coroutine - did you unsafely yield before this?") + error("current coroutine does not match browser's expected coroutine - aborting the parse") + end + + local result = table.pack(coroutine.yield(...)) + if is_browser and co ~= state.co then + msg.verbose("browser no longer waiting for list - aborting parse for", self.directory) + error(ABORT_ERROR) + end + return unpack(result, 1, result.n) +end + +--checks if the current coroutine is the one handling the browser's request +function parse_state_API:is_coroutine_current() + return coroutine.running() == state.co +end + +-------------------------------------------------------------------------------------------------------- +-----------------------------------------Setup Functions------------------------------------------------ +-------------------------------------------------------------------------------------------------------- +-------------------------------------------------------------------------------------------------------- + +local API_MAJOR, API_MINOR, API_PATCH = API_VERSION:match("(%d+)%.(%d+)%.(%d+)") + +--checks if the given parser has a valid version number +local function check_api_version(parser) + local version = parser.version or "1.0.0" + + local major, minor = version:match("(%d+)%.(%d+)") + + if not major or not minor then + return msg.error("Invalid version number") + elseif major ~= API_MAJOR then + return msg.error( + "parser", + parser.name, + "has wrong major version number, expected", + ("v%d.x.x"):format(API_MAJOR), + "got", + "v" .. version + ) + elseif minor > API_MINOR then + msg.warn( + "parser", + parser.name, + "has newer minor version number than API, expected", + ("v%d.%d.x"):format(API_MAJOR, API_MINOR), + "got", + "v" .. version + ) + end + return true +end + +--create a unique id for the given parser +local function set_parser_id(parser) + local name = parser.name + if parsers[name] then + local n = 2 + name = parser.name .. "_" .. n + while parsers[name] do + n = n + 1 + name = parser.name .. "_" .. n + end + end + + parsers[name] = parser + parsers[parser] = { id = name } +end + +local function redirect_table(t) + return setmetatable({}, { __index = t }) +end + +--loads an addon in a separate environment +local function load_addon(path) + local name_sqbr = string.format("[%s]", path:match("/([^/]*)%.lua$")) + local addon_environment = redirect_table(_G) + addon_environment._G = addon_environment + + --gives each addon custom debug messages + addon_environment.package = redirect_table(addon_environment.package) + addon_environment.package.loaded = redirect_table(addon_environment.package.loaded) + local msg_module = { + log = function(level, ...) + msg.log(level, name_sqbr, ...) + end, + fatal = function(...) + return msg.fatal(name_sqbr, ...) + end, + error = function(...) + return msg.error(name_sqbr, ...) + end, + warn = function(...) + return msg.warn(name_sqbr, ...) + end, + info = function(...) + return msg.info(name_sqbr, ...) + end, + verbose = function(...) + return msg.verbose(name_sqbr, ...) + end, + debug = function(...) + return msg.debug(name_sqbr, ...) + end, + trace = function(...) + return msg.trace(name_sqbr, ...) + end, + } + addon_environment.print = msg_module.info + + addon_environment.require = function(module) + if module == "mp.msg" then + return msg_module + end + return require(module) + end + + local chunk, err + if setfenv then + --since I stupidly named a function loadfile I need to specify the global one + --I've been using the name too long to want to change it now + chunk, err = _G.loadfile(path) + if not chunk then + return msg.error(err) + end + setfenv(chunk, addon_environment) + else + chunk, err = _G.loadfile(path, "bt", addon_environment) + if not chunk then + return msg.error(err) + end + end + + local success, result = xpcall(chunk, API.traceback) + return success and result or nil +end + +--setup an internal or external parser +local function setup_parser(parser, file) + parser = setmetatable(parser, { __index = parser_API }) + parser.name = parser.name or file:gsub("%-browser%.lua$", ""):gsub("%.lua$", "") + + set_parser_id(parser) + if not check_api_version(parser) then + return msg.error("aborting load of parser", parser:get_id(), "from", file) + end + + msg.verbose("imported parser", parser:get_id(), "from", file) + + --sets missing functions + if not parser.can_parse then + if parser.parse then + parser.can_parse = function() + return true + end + else + parser.can_parse = function() + return false + end + end + end + + if parser.priority == nil then + parser.priority = 0 + end + if type(parser.priority) ~= "number" then + return msg.error("parser", parser:get_id(), "needs a numeric priority") + end + + table.insert(parsers, parser) +end + +--load an external addon +local function setup_addon(file, path) + if file:sub(-4) ~= ".lua" then + return msg.verbose(path, "is not a lua file - aborting addon setup") + end + + local addon_parsers = load_addon(path) + if not addon_parsers or type(addon_parsers) ~= "table" then + return msg.error("addon", path, "did not return a table") + end + + --if the table contains a priority key then we assume it isn't an array of parsers + if not addon_parsers[1] then + addon_parsers = { addon_parsers } + end + + for _, parser in ipairs(addon_parsers) do + setup_parser(parser, file) + end +end + +--loading external addons +local function setup_addons() + local addon_dir = mp.command_native({ "expand-path", o.addon_directory .. "/" }) + local files = utils.readdir(addon_dir) + if not files then + error("could not read addon directory") + end + + for _, file in ipairs(files) do + setup_addon(file, addon_dir .. file) + end + table.sort(parsers, function(a, b) + return a.priority < b.priority + end) + + --we want to store the indexes of the parsers + for i = #parsers, 1, -1 do + parsers[parsers[i]].index = i + end + + --we want to run the setup functions for each addon + for index, parser in ipairs(parsers) do + if parser.setup then + local success = xpcall(function() + parser:setup() + end, API.traceback) + if not success then + msg.error( + "parser", + parser:get_id(), + "threw an error in the setup method - removing from list of parsers" + ) + table.remove(parsers, index) + end + end + end +end + +--sets up the compatible extensions list +local function setup_extensions_list() + --setting up subtitle extensions + for ext in API.iterate_opt(o.subtitle_extensions:lower()) do + sub_extensions[ext] = true + extensions[ext] = true + end + + --setting up audio extensions + for ext in API.iterate_opt(o.audio_extensions:lower()) do + audio_extensions[ext] = true + extensions[ext] = true + end + + --adding file extensions to the set + for _, ext in ipairs(compatible_file_extensions) do + extensions[ext] = true + end + + --adding extra extensions on the whitelist + for str in API.iterate_opt(o.extension_whitelist:lower()) do + extensions[str] = true + end + + --removing extensions that are in the blacklist + for str in API.iterate_opt(o.extension_blacklist:lower()) do + extensions[str] = nil + end +end + +--splits the string into a table on the semicolons +local function setup_root() + root = {} + for str in API.iterate_opt(o.root) do + local path = mp.command_native({ "expand-path", str }) + path = API.fix_path(path, true) + + local temp = { name = path, type = "dir", label = str, ass = API.ass_escape(str, true) } + + root[#root + 1] = temp + end +end + +setup_root() + +setup_parser(file_parser, "file-browser.lua") +if o.addons then + --all of the API functions need to be defined before this point for the addons to be able to access them safely + setup_addons() +end + +--these need to be below the addon setup in case any parsers add custom entries +setup_extensions_list() +setup_keybinds() + +------------------------------------------------------------------------------------------ +------------------------------Other Script Compatability---------------------------------- +------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------ + +local function scan_directory_json(directory, response_str) + if not directory then + msg.error("did not receive a directory string") + return + end + if not response_str then + msg.error("did not receive a response string") + return + end + + directory = mp.command_native({ "expand-path", directory }, "") + if directory ~= "" then + directory = API.fix_path(directory, true) + end + msg.verbose( + ("recieved %q from 'get-directory-contents' script message - returning result to %q"):format( + directory, + response_str + ) + ) + + local list, opts = parse_directory(directory, { source = "script-message" }) + opts.API_VERSION = API_VERSION + + local err + list, err = API.format_json_safe(list) + if not list then + msg.error(err) + end + + opts, err = API.format_json_safe(opts) + if not opts then + msg.error(err) + end + + mp.commandv("script-message", response_str, list or "", opts or "") +end + +pcall(function() + local input = require("user-input-module") + mp.add_key_binding("Alt+o", "browse-directory/get-user-input", function() + input.get_user_input(browse_directory, { request_text = "open directory:" }) + end) +end) + +------------------------------------------------------------------------------------------ +--------------------------------mpv API Callbacks----------------------------------------- +------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------ + +--we don't want to add any overhead when the browser isn't open +mp.observe_property("path", "string", function(_, path) + if not state.hidden then + update_current_directory(_, path) + update_ass() + else + state.flag_update = true + end +end) + +--updates the dvd_device +mp.observe_property("dvd-device", "string", function(_, device) + if not device or device == "" then + device = "/dev/dvd/" + end + dvd_device = API.fix_path(device, true) +end) + +--declares the keybind to open the browser +mp.add_key_binding("MENU", "browse-files", toggle) +mp.add_key_binding("Ctrl+o", "open-browser", open) + +--allows keybinds/other scripts to auto-open specific directories +mp.register_script_message("browse-directory", browse_directory) + +--allows other scripts to request directory contents from file-browser +mp.register_script_message("get-directory-contents", function(directory, response_str) + API.coroutine.run(scan_directory_json, directory, response_str) +end) diff --git a/.config/ncmpcpp/bindings b/.config/ncmpcpp/bindings new file mode 100644 index 0000000..a72425a --- /dev/null +++ b/.config/ncmpcpp/bindings @@ -0,0 +1,561 @@ +############################################################## +## This is the example bindings file. Copy it to ## +## $XDG_CONFIG_HOME/ncmpcpp/bindings or ~/.ncmpcpp/bindings ## +## and set up your preferences. ## +############################################################## +## +##### General rules ##### +## +## 1) Because each action has runtime checks whether it's +## ok to run it, a few actions can be bound to one key. +## Actions will be bound in order given in configuration +## file. When a key is pressed, first action in order +## will test itself whether it's possible to run it. If +## test succeeds, action is executed and other actions +## bound to this key are ignored. If it doesn't, next +## action in order tests itself etc. +## +## 2) It's possible to bind more that one action at once +## to a key. It can be done using the following syntax: +## +## def_key "key" +## action1 +## action2 +## ... +## +## This creates a chain of actions. When such chain is +## executed, each action in chain is run until the end of +## chain is reached or one of its actions fails to execute +## due to its requirements not being met. If multiple actions +## and/or chains are bound to the same key, they will be +## consecutively run until one of them gets fully executed. +## +## 3) When ncmpcpp starts, bindings configuration file is +## parsed and then ncmpcpp provides "missing pieces" +## of default keybindings. If you want to disable some +## bindings, there is a special action called 'dummy' +## for that purpose. Eg. if you want to disable ability +## to crop playlists, you need to put the following +## into configuration file: +## +## def_key "C" +## dummy +## +## After that ncmpcpp will not bind any default action +## to this key. +## +## 4) To let you write simple macros, the following special +## actions are provided: +## +## - push_character "character" - pushes given special +## character into input queue, so it will be immediately +## picked by ncmpcpp upon next call to readKey function. +## Accepted values: mouse, up, down, page_up, page_down, +## home, end, space, enter, insert, delete, left, right, +## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\, +## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace. +## In addition, most of these names can be prefixed with +## alt-/ctrl-/shift- to be recognized with the appropriate +## modifier key(s). +## +## - push_characters "string" - pushes given string into +## input queue. +## +## - require_runnable "action" - checks whether given action +## is runnable and fails if it isn't. This is especially +## useful when mixed with previous two functions. Consider +## the following macro definition: +## +## def_key "key" +## push_characters "custom_filter" +## apply_filter +## +## If apply_filter can't be currently run, we end up with +## sequence of characters in input queue which will be +## treated just as we typed them. This may lead to unexpected +## results (in this case 'c' will most likely clear current +## playlist, 'u' will trigger database update, 's' will stop +## playback etc.). To prevent such thing from happening, we +## need to change above definition to this one: +## +## def_key "key" +## require_runnable "apply_filter" +## push_characters "custom_filter" +## apply_filter +## +## Here, first we test whether apply_filter can be actually run +## before we stuff characters into input queue, so if condition +## is not met, whole chain is aborted and we're fine. +## +## - require_screen "screen" - checks whether given screen is +## currently active. accepted values: browser, clock, help, +## media_library, outputs, playlist, playlist_editor, +## search_engine, tag_editor, visualizer, last_fm, lyrics, +## selected_items_adder, server_info, song_info, +## sort_playlist_dialog, tiny_tag_editor. +## +## - run_external_command "command" - runs given command using +## system() function. +## +## - run_external_console_command "command" - runs given console +## command using system() function. +## +## +## 5) In addition to binding to a key, you can also bind actions +## or chains of actions to a command. If it comes to commands, +## syntax is very similar to defining keys. Here goes example +## definition of a command: +## +## def_command "quit" [deferred] +## stop +## quit +## +## If you execute the above command (which can be done by +## invoking action execute_command, typing 'quit' and pressing +## enter), ncmpcpp will stop the player and then quit. Note the +## presence of word 'deferred' enclosed in square brackets. It +## tells ncmpcpp to wait for confirmation (ie. pressing enter) +## after you typed quit. Instead of 'deferred', 'immediate' +## could be used. Then ncmpcpp will not wait for confirmation +## (enter) and will execute the command the moment it sees it. +## +## Note: while command chains are executed, internal environment +## update (which includes current window refresh and mpd status +## update) is not performed for performance reasons. However, it +## may be desirable to do so in some situration. Therefore it's +## possible to invoke by hand by performing 'update enviroment' +## action. +## +## Note: There is a difference between: +## +## def_key "key" +## action1 +## +## def_key "key" +## action2 +## +## and +## +## def_key "key" +## action1 +## action2 +## +## First one binds two single actions to the same key whilst +## second one defines a chain of actions. The behavior of +## these two is different and is described in (1) and (2). +## +## Note: Function def_key accepts non-ascii characters. +## + +def_key "l" + next_column +def_key "h" + previous_column +def_key "k" + scroll_up +def_key "j" + scroll_down + +##### List of unbound actions ##### +## +## The following actions are not bound to any key/command: +## +## - set_volume +## - load +## +# +#def_key "mouse" +# mouse_event +# +#def_key "up" +# scroll_up +# +#def_key "shift-up" +# select_item +# scroll_up +# +#def_key "down" +# scroll_down +# +#def_key "shift-down" +# select_item +# scroll_down +# +#def_key "[" +# scroll_up_album +# +#def_key "]" +# scroll_down_album +# +#def_key "{" +# scroll_up_artist +# +#def_key "}" +# scroll_down_artist +# +#def_key "page_up" +# page_up +# +#def_key "page_down" +# page_down +# +#def_key "home" +# move_home +# +#def_key "end" +# move_end +# +#def_key "insert" +# select_item +# +#def_key "enter" +# enter_directory +# +#def_key "enter" +# toggle_output +# +#def_key "enter" +# run_action +# +#def_key "enter" +# play_item +# +#def_key "space" +# add_item_to_playlist +# +#def_key "space" +# toggle_lyrics_update_on_song_change +# +#def_key "space" +# toggle_visualization_type +# +#def_key "delete" +# delete_playlist_items +# +#def_key "delete" +# delete_browser_items +# +#def_key "delete" +# delete_stored_playlist +# +#def_key "right" +# next_column +# +#def_key "right" +# slave_screen +# +#def_key "right" +# volume_up +# +#def_key "+" +# volume_up +# +#def_key "left" +# previous_column +# +#def_key "left" +# master_screen +# +#def_key "left" +# volume_down +# +#def_key "-" +# volume_down +# +#def_key ":" +# execute_command +# +#def_key "tab" +# next_screen +# +#def_key "shift-tab" +# previous_screen +# +#def_key "f1" +# show_help +# +#def_key "1" +# show_playlist +# +#def_key "2" +# show_browser +# +#def_key "2" +# change_browse_mode +# +#def_key "3" +# show_search_engine +# +#def_key "3" +# reset_search_engine +# +#def_key "4" +# show_media_library +# +#def_key "4" +# toggle_media_library_columns_mode +# +#def_key "5" +# show_playlist_editor +# +#def_key "6" +# show_tag_editor +# +#def_key "7" +# show_outputs +# +#def_key "8" +# show_visualizer +# +#def_key "=" +# show_clock +# +#def_key "@" +# show_server_info +# +#def_key "s" +# stop +# +#def_key "p" +# pause +# +#def_key ">" +# next +# +#def_key "<" +# previous +# +#def_key "ctrl-h" +# jump_to_parent_directory +# +#def_key "ctrl-h" +# replay_song +# +#def_key "backspace" +# jump_to_parent_directory +# +#def_key "backspace" +# replay_song +# +#def_key "backspace" +# play +# +#def_key "f" +# seek_forward +# +#def_key "b" +# seek_backward +# +#def_key "r" +# toggle_repeat +# +#def_key "z" +# toggle_random +# +#def_key "y" +# save_tag_changes +# +#def_key "y" +# start_searching +# +#def_key "y" +# toggle_single +# +#def_key "R" +# toggle_consume +# +#def_key "Y" +# toggle_replay_gain_mode +# +#def_key "T" +# toggle_add_mode +# +#def_key "|" +# toggle_mouse +# +#def_key "#" +# toggle_bitrate_visibility +# +#def_key "Z" +# shuffle +# +#def_key "x" +# toggle_crossfade +# +#def_key "X" +# set_crossfade +# +#def_key "u" +# update_database +# +#def_key "ctrl-s" +# sort_playlist +# +#def_key "ctrl-s" +# toggle_browser_sort_mode +# +#def_key "ctrl-s" +# toggle_media_library_sort_mode +# +#def_key "ctrl-r" +# reverse_playlist +# +#def_key "ctrl-f" +# apply_filter +# +#def_key "ctrl-_" +# select_found_items +# +#def_key "/" +# find +# +#def_key "/" +# find_item_forward +# +#def_key "?" +# find +# +#def_key "?" +# find_item_backward +# +#def_key "." +# next_found_item +# +#def_key "," +# previous_found_item +# +#def_key "w" +# toggle_find_mode +# +#def_key "e" +# edit_song +# +#def_key "e" +# edit_library_tag +# +#def_key "e" +# edit_library_album +# +#def_key "e" +# edit_directory_name +# +#def_key "e" +# edit_playlist_name +# +#def_key "e" +# edit_lyrics +# +#def_key "i" +# show_song_info +# +#def_key "I" +# show_artist_info +# +#def_key "g" +# jump_to_position_in_song +# +#def_key "l" +# show_lyrics +# +#def_key "ctrl-v" +# select_range +# +#def_key "v" +# reverse_selection +# +#def_key "V" +# remove_selection +# +#def_key "B" +# select_album +# +#def_key "a" +# add_selected_items +# +#def_key "c" +# clear_playlist +# +#def_key "c" +# clear_main_playlist +# +#def_key "C" +# crop_playlist +# +#def_key "C" +# crop_main_playlist +# +#def_key "m" +# move_sort_order_up +# +#def_key "m" +# move_selected_items_up +# +#def_key "n" +# move_sort_order_down +# +#def_key "n" +# move_selected_items_down +# +#def_key "M" +# move_selected_items_to +# +#def_key "A" +# add +# +#def_key "S" +# save_playlist +# +#def_key "o" +# jump_to_playing_song +# +#def_key "G" +# jump_to_browser +# +#def_key "G" +# jump_to_playlist_editor +# +#def_key "~" +# jump_to_media_library +# +#def_key "E" +# jump_to_tag_editor +# +#def_key "U" +# toggle_playing_song_centering +# +#def_key "P" +# toggle_display_mode +# +#def_key "\\" +# toggle_interface +# +#def_key "!" +# toggle_separators_between_albums +# +#def_key "L" +# toggle_lyrics_fetcher +# +#def_key "F" +# fetch_lyrics_in_background +# +#def_key "alt-l" +# toggle_fetching_lyrics_in_background +# +#def_key "ctrl-l" +# toggle_screen_lock +# +#def_key "`" +# toggle_library_tag_type +# +#def_key "`" +# refetch_lyrics +# +#def_key "`" +# add_random_items +# +#def_key "ctrl-p" +# set_selected_items_priority +# +#def_key "q" +# quit +# diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config new file mode 100644 index 0000000..83a05ca --- /dev/null +++ b/.config/ncmpcpp/config @@ -0,0 +1,598 @@ +############################################################## +## This is an example configuration file. Copy it to ## +## $XDG_CONFIG_HOME/ncmpcpp/config or $HOME/.ncmpcpp/config ## +## and set up your preferences. ## +############################################################## +# +##### directories ###### +## +## Directory for storing ncmpcpp related files. Changing it is useful if you +## want to store everything somewhere else and provide command line setting for +## alternative location to config file which defines that while launching +## ncmpcpp. +## +# +#ncmpcpp_directory = ~/.config/ncmpcpp +# +## +## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other +## MPD clients (eg. ncmpc) also use that location. +## +# +#lyrics_directory = ~/.lyrics +# +##### connection settings ##### +# +#mpd_host = localhost +# +#mpd_port = 6600 +# +#mpd_connection_timeout = 5 +# +## Needed for tag editor and file operations to work. +## +#mpd_music_dir = ~/music +# +mpd_crossfade_time = 3 +# +# Exclude pattern for random song action +# http://www.boost.org/doc/libs/1_46_1/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html +#random_exclude_pattern = "^(temp|midi_songs).*" +# +##### music visualizer ##### +## +## In order to make music visualizer work with MPD you need to use the fifo +## output. Its format parameter has to be set to 44100:16:1 for mono +## visualization or 44100:16:2 for stereo visualization. As an example here is +## the relevant section for mpd.conf: +## +## audio_output { +## type "fifo" +## name "Visualizer feed" +## path "/tmp/mpd.fifo" +## format "44100:16:2" +## } +## +## If the visualization on occasion diverges from the audio output, please set +## 'buffer_time' parameter of your audio output in mpd.conf to '100000' (100ms) +## or less to prevent that from happening. +## +## Note: If you're using Mopidy, an address of a udpsink gstreamer's output is +## also accepted. For example, the following section in mopidy.conf: +## +## [audio] +## output = tee name=t ! queue ! autoaudiosink t. +## ! queue ! audio/x-raw,rate=44100,channels=2,format=S16LE +## ! udpsink host=localhost port=5555 +## +## will make localhost:5555 available as a source of data for the stereo +## visualizer. +## +# +#visualizer_data_source = /tmp/mpd.fifo +# +## +## Note: Below parameter is needed for ncmpcpp to determine which output +## provides data for visualizer and reset it at the beginning of visualization +## to synchronize with audio. +## +# +#visualizer_output_name = Visualizer feed +# +## +## If you set format to 44100:16:2, make it 'yes'. +## +#visualizer_in_stereo = yes +# +## +## Note: set below to >=10 only if you have synchronization issues with +## visualization and audio. +## +# +#visualizer_sync_interval = 0 +# +## +## Note: To enable spectrum frequency visualization you need to compile ncmpcpp +## with fftw3 support. +## +# +## Available values: spectrum, wave, wave_filled, ellipse. +## +#visualizer_type = spectrum +# +#visualizer_fps = 60 +# +#visualizer_autoscale = no +# +#visualizer_look = ●▮ +# +#visualizer_color = blue, cyan, green, yellow, magenta, red +# +## Alternative subset of 256 colors for terminals that support it. +## +#visualizer_color = 47, 83, 119, 155, 191, 227, 221, 215, 209, 203, 197, 161 +# +## +## Note: The next few visualization options apply to the spectrum visualizer. +## +# +## Use unicode block characters for a smoother, more continuous look. +## This will override the visualizer_look option. With transparent terminals +## and visualizer_in_stereo set, artifacts may be visible on the bottom half of +## the visualization. +# +#visualizer_spectrum_smooth_look = yes +# +## A value between 1 and 5 inclusive. Specifying a larger value makes the +## visualizer look at a larger slice of time, which results in less jumpy +## visualizer output. +# +#visualizer_spectrum_dft_size = 2 +# +#visualizer_spectrum_gain = 10 +# +## Left-most frequency of visualizer in Hz, must be less than HZ MAX +# +#visualizer_spectrum_hz_min = 20 +# +## Right-most frequency of visualizer in Hz, must be greater than HZ MIN +# +#visualizer_spectrum_hz_max = 20000 +# +##### system encoding ##### +## +## ncmpcpp should detect your charset encoding but if it failed to do so, you +## can specify charset encoding you are using here. +## +## Note: You can see whether your ncmpcpp build supports charset detection by +## checking output of `ncmpcpp --version`. +## +## Note: Since MPD uses UTF-8 by default, setting this option makes sense only +## if your encoding is different. +## +# +#system_encoding = "" +# +##### delays ##### +# +## Time of inactivity (in seconds) after playlist highlighting will be disabled +## (0 = always on). +## +#playlist_disable_highlight_delay = 5 +# +## Defines how long messages are supposed to be visible. +## +#message_delay_time = 5 +# +##### song format ##### +## +## For a song format you can use: +## +## %l - length +## %f - filename +## %D - directory +## %a - artist +## %A - album artist +## %t - title +## %b - album +## %y - date +## %n - track number (01/12 -> 01) +## %N - full track info (01/12 -> 01/12) +## %g - genre +## %c - composer +## %p - performer +## %d - disc +## %C - comment +## %P - priority +## $R - begin right alignment +## +## If you want to make sure that a part of the format is displayed only when +## certain tags are present, you can archieve it by grouping them with brackets, +## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are +## present or '' otherwise. It is also possible to define a list of +## alternatives by providing several groups and separating them with '|', +## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is +## not present. +## +## Note: If you want to set limit on maximal length of a tag, just put the +## appropriate number between % and character that defines tag type, e.g. to +## make album take max. 20 terminal cells, use '%20b'. +## +## In addition, formats support markers used for text attributes. They are +## followed by character '$'. After that you can put: +## +## - 0 - default window color (discards all other colors) +## - 1 - black +## - 2 - red +## - 3 - green +## - 4 - yellow +## - 5 - blue +## - 6 - magenta +## - 7 - cyan +## - 8 - white +## - 9 - end of current color +## - b - bold text +## - u - underline text +## - r - reverse colors +## - a - use alternative character set +## +## If you don't want to use a non-color attribute anymore, just put it again, +## but this time insert character '/' between '$' and attribute character, +## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with +## reversed colors. +## +## If you want to use 256 colors and/or background colors in formats (the naming +## scheme is described below in section about color definitions), it can be done +## with the syntax $(COLOR), e.g. to set the artist tag to one of the +## non-standard colors and make it have yellow background, you need to write +## $(197_yellow)%a$(end). Note that for standard colors this is interchangable +## with attributes listed above. +## +## Note: colors can be nested. +## +# +#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3%l$9} +# +#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f} +# +#song_library_format = {%n - }{%t}|{%f} +# +#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b +# +#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} +# +#current_item_prefix = $(yellow)$r +# +#current_item_suffix = $/r$(end) +# +#current_item_inactive_column_prefix = $(white)$r +# +#current_item_inactive_column_suffix = $/r$(end) +# +#now_playing_prefix = $b +# +#now_playing_suffix = $/b +# +#browser_playlist_prefix = "$2playlist$9 " +# +#selected_item_prefix = $6 +# +#selected_item_suffix = $9 +# +#modified_item_prefix = $3> $9 +# +## +## Note: attributes are not supported for the following variables. +## +#song_window_title_format = {%a - }{%t}|{%f} +## +## Note: Below variables are used for sorting songs in browser. The sort mode +## determines how songs are sorted, and can be used in combination with a sort +## format to specify a custom sorting format. Available values for +## browser_sort_mode are "type", "name", "mtime", "format" and "none". +## +# +#browser_sort_mode = type +# +#browser_sort_format = {%a - }{%t}|{%f} {%l} +# +##### columns settings ##### +## +## syntax of song columns list format is "column column etc." +## +## - syntax for each column is: +## +## (width of the column)[color of the column]{displayed tag} +## +## Note: Width is by default in %, if you want a column to have fixed size, add +## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of +## screen (so the real width will depend on actual screen size), whereas +## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen +## is. +## +## - color is optional (if you want the default one, leave the field empty). +## +## Note: You can give a column additional attributes by putting appropriate +## character after displayed tag character. Available attributes are: +## +## - r - column will be right aligned +## - E - if tag is empty, empty tag marker won't be displayed +## +## You can also: +## +## - give a column custom name by putting it after attributes, separated with +## character ':', e.g. {lr:Length} gives you right aligned column of lengths +## named "Length". +## +## - define sequence of tags, that have to be displayed in case predecessor is +## empty in a way similar to the one in classic song format, i.e. using '|' +## character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to +## display artist tag and then composer and performer if previous ones are not +## available. +## +# +#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l} +# +##### various settings ##### +# +## +## Note: Custom command that will be executed each time song changes. Useful for +## notifications etc. +## +#execute_on_song_change = "" +# +## +## Note: Custom command that will be executed each time player state +## changes. The environment variable MPD_PLAYER_STATE is set to the current +## state (either unknown, play, pause, or stop) for its duration. +## +# +#execute_on_player_state_change = "" +# +#playlist_show_mpd_host = no +# +#playlist_show_remaining_time = no +# +#playlist_shorten_total_times = no +# +#playlist_separate_albums = no +# +## +## Note: Possible display modes: classic, columns. +## +#playlist_display_mode = columns +# +#browser_display_mode = classic +# +#search_engine_display_mode = classic +# +#playlist_editor_display_mode = classic +# +#discard_colors_if_item_is_selected = yes +# +#show_duplicate_tags = yes +# +#incremental_seeking = yes +# +#seek_time = 1 +# +#volume_change_step = 2 +# +#autocenter_mode = no +# +#centered_cursor = no +# +## +## Note: You can specify third character which will be used to build 'empty' +## part of progressbar. +## +#progressbar_look = => +# +## Available values: database, playlist. +## +#default_place_to_search_in = database +# +## Available values: classic, alternative. +## +#user_interface = classic +# +#data_fetching_delay = yes +# +## Available values: artist, album_artist, date, genre, composer, performer. +## +#media_library_primary_tag = artist +# +#media_library_albums_split_by_date = yes +# +#media_library_hide_album_dates = no +# +## Available values: wrapped, normal. +## +#default_find_mode = wrapped +# +#default_tag_editor_pattern = %n - %t +# +#header_visibility = yes +# +#statusbar_visibility = yes +# +## Show the "Connected to ..." message on startup +#connected_message_on_startup = yes +# +#titles_visibility = yes +# +#header_text_scrolling = yes +# +#cyclic_scrolling = no +# +#lyrics_fetchers = azlyrics, genius, musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet +# +#follow_now_playing_lyrics = no +# +#fetch_lyrics_for_current_song_in_background = no +# +#store_lyrics_in_song_dir = no +# +#generate_win32_compatible_filenames = yes +# +#allow_for_physical_item_deletion = no +# +## +## Note: If you set this variable, ncmpcpp will try to get info from last.fm in +## language you set and if it fails, it will fall back to english. Otherwise it +## will use english the first time. +## +## Note: Language has to be expressed as an ISO 639 alpha-2 code. +## +#lastfm_preferred_language = en +# +#space_add_mode = add_remove +# +#show_hidden_files_in_local_browser = no +# +## +## How shall screen switcher work? +## +## - "previous" - switch between the current and previous screen. +## - "screen1,...,screenN" - switch between given sequence of screens. +## +## Screens available for use: help, playlist, browser, search_engine, +## media_library, playlist_editor, tag_editor, outputs, visualizer, clock, +## lyrics, last_fm. +## +#screen_switcher_mode = playlist, browser +# +## +## Note: You can define startup screen by choosing screen from the list above. +## +#startup_screen = playlist +# +## +## Note: You can define startup slave screen by choosing screen from the list +## above or an empty value for no slave screen. +## +#startup_slave_screen = "" +# +#startup_slave_screen_focus = no +# +## +## Default width of locked screen (in %). Acceptable values are from 20 to 80. +## +# +#locked_screen_width_part = 50 +# +#ask_for_locked_screen_width_part = yes +# +#jump_to_now_playing_song_at_start = yes +# +#ask_before_clearing_playlists = yes +# +#clock_display_seconds = no +# +#display_volume_level = yes +# +#display_bitrate = no +# +#display_remaining_time = no +# +## Available values: none, basic, extended, perl. +## +#regular_expressions = perl +# +## +## Note: if below is enabled, ncmpcpp will ignore leading "The" word while +## sorting items in browser, tags in media library, etc. +## +#ignore_leading_the = no +# +## +## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and +## filtering lists. This takes an effect only if boost was compiled with ICU +## support. +## +#ignore_diacritics = no +# +#block_search_constraints_change_if_items_found = yes +# +#mouse_support = yes +# +#mouse_list_scroll_whole_page = no +# +#lines_scrolled = 5 +# +#empty_tag_marker = +# +#tags_separator = " | " +# +#tag_editor_extended_numeration = no +# +#media_library_sort_by_mtime = no +# +#enable_window_title = yes +# +## +## Note: You can choose default search mode for search engine. Available modes +## are: +## +## - 1 - use mpd built-in searching (no regexes, pattern matching) +## +## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but +## if your mpd is on a remote machine, downloading big database to process +## it can take a while +## +## - 3 - match only exact values (this mode uses mpd function for searching in +## database and local one for searching in current playlist) +## +# +#search_engine_default_search_mode = 1 +# +#external_editor = nano +# +## Note: set to yes if external editor is a console application. +## +#use_console_editor = yes +# +##### colors definitions ##### +## +## It is possible to set a background color by setting a color value +## "_", e.g. red_black will set foregound color to red +## and background color to black. +## +## In addition, for terminals that support 256 colors it is possible to set one +## of them by using a number in range [1, 256] instead of color name, +## e.g. numerical value corresponding to red_black is 2_1. To find out if the +## terminal supports 256 colors, run ncmpcpp and check out the bottom of the +## help screen for list of available colors and their numerical values. +## +## What is more, there are two special values for the background color: +## "transparent" and "current". The first one explicitly sets the background to +## be transparent, while the second one allows you to preserve current +## background color and change only the foreground one. It's used implicitly +## when background color is not specified. +## +## Moreover, it is possible to attach format information to selected color +## variables by appending to their end a colon followed by one or more format +## flags, e.g. black:b or red:ur. The following variables support this syntax: +## visualizer_color, color1, color2, empty_tag_color, volume_color, +## state_line_color, state_flags_color, progressbar_color, +## progressbar_elapsed_color, player_state_color, statusbar_time_color, +## alternative_ui_separator_color. +## +## Note: due to technical limitations of older ncurses version, if 256 colors +## are used there is a possibility that you'll be able to use only colors with +## transparent background. +# +#colors_enabled = yes +# +#empty_tag_color = cyan +# +#header_window_color = default +# +#volume_color = default +# +#state_line_color = default +# +#state_flags_color = default:b +# +#main_window_color = yellow +# +#color1 = white +# +#color2 = green +# +#progressbar_color = black:b +# +#progressbar_elapsed_color = green:b +# +#statusbar_color = default +# +#statusbar_time_color = default:b +# +#player_state_color = default:b +# +#alternative_ui_separator_color = black:b +# +#window_border_color = green +# +#active_window_border = red +# diff --git a/.config/neofetch/config.conf b/.config/neofetch/config.conf new file mode 100644 index 0000000..572bf0b --- /dev/null +++ b/.config/neofetch/config.conf @@ -0,0 +1,135 @@ +# Source: https://github.com/chick2d/neofetch-themes +# Configuration made by Chick + +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info + +# I used custom seperators as the older one looked not very properly proportioned + +print_info() { + prin "${cl4}┌─────────\n Software Information \n──────────┐" +# info " ​ ​  " users + info " ​ ​  " distro +# Just get your distro's logo off nerdfonts.com + info " ​ ​  " kernel +# info " ​ ​  " de + info " ​ ​  " wm + info " ​ ​  " shell + info " ​ ​  " term +# info " ​ ​ │  " font + # info " ​ ​  " theme + info " ​ ​  " icons + info " ​ ​  " packages + info " ​ ​  " uptime +# info " ​ ​  " gpu_driver # Linux/macOS only +# info " ​ ​  " cpu_usage +# info " ​ ​ ﱘ " song + # [[ "$player" ]] && prin "Music Player" "$player" +# info " ​ ​  " local_ip +# info " ​ ​  " public_ip + info " ​ ​  " locale # This only works on glibc systems. + prin "${cl4}├─────────\n Hardware Information \n──────────┤" + info " ​ ​  " model + info " ​ ​  " cpu + info " ​ ​ ﬙ " gpu +# info " ​ ​  " disk + info " ​ ​ 塞" memory + info " ​ ​  " resolution +# info " ​ ​ 󱈑 " battery + prin "${cl4}└─────────────────────────────────────────┘" + info cols +prin "\n \n \n \n \n ${cl3} \n \n ${cl5} \n \n ${cl2} \n \n ${cl6} \n \n ${cl4} \n \n ${cl1} \n \n ${cl7} \n \n ${cl0}" +} + +kernel_shorthand="on" +distro_shorthand="off" +os_arch="off" +uptime_shorthand="on" +memory_percent="on" +package_managers="on" +shell_path="off" +shell_version="on" +speed_type="bios_limit" +speed_shorthand="on" +cpu_brand="off" +cpu_speed="off" +cpu_cores="logical" +cpu_temp="off" +gpu_brand="off" +gpu_type="all" +refresh_rate="on" +gtk_shorthand="on" +gtk2="on" +gtk3="on" +public_ip_host="http://ident.me" +public_ip_timeout=2 +disk_show=('/') +music_player="vlc" +song_format="%artist% - %title%" +song_shorthand="off" +colors=(distro) +bold="on" +underline_enabled="on" +underline_char="-" +separator="  " +color_blocks="off" +block_range=(0 15) # Colorblocks + +# Colors for custom colorblocks +magenta="\033[1;35m" +green="\033[1;32m" +white="\033[1;37m" +blue="\033[1;34m" +red="\033[1;31m" +black="\033[1;40;30m" +yellow="\033[1;33m" +cyan="\033[1;36m" +reset="\033[0m" +bgyellow="\033[1;43;33m" +bgwhite="\033[1;47;37m" +cl0="${reset}" +cl1="${magenta}" +cl2="${green}" +cl3="${white}" +cl4="${blue}" +cl5="${red}" +cl6="${yellow}" +cl7="${cyan}" +cl8="${black}" +cl9="${bgyellow}" +cl10="${bgwhite}" + +block_width=4 +block_height=1 + +bar_char_elapsed="-" +bar_char_total="=" +bar_border="on" +bar_length=15 +bar_color_elapsed="distro" +bar_color_total="distro" + +cpu_display="on" +memory_display="on" +battery_display="on" +disk_display="on" + +image_backend="ascii" +#image_source="$HOME/" +image_size="auto" +image_loop="off" + +aascii_distro="auto" +ascii_colors=(distro) +ascii_bold="on" + +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" +crop_mode="normal" +crop_offset="center" + +gap=2 + +yoffset=0 +xoffset=0 + +stdout="off" diff --git a/.config/neomutt/colours b/.config/neomutt/colours new file mode 100644 index 0000000..788666f --- /dev/null +++ b/.config/neomutt/colours @@ -0,0 +1,45 @@ + +############################################################################### +# Dracula Theme for Mutt: https://draculatheme.com/ +# +# @author Paul Townsend + +# general ------------ foreground ---- background ----------------------------- +#color error color231 color212 +color error black color212 +color indicator color231 color241 +color markers color210 default +color message default default +color normal default default +color prompt default default +color search color84 default +color status color141 color236 +color tilde color231 default +color tree color141 default + +# message index ------ foreground ---- background ----------------------------- +color index color210 default ~D # deleted messages +color index color84 default ~F # flagged messages +color index color117 default ~N # new messages +color index color212 default ~Q # messages which have been replied to +color index color215 default ~T # tagged messages +color index color141 default ~v # messages part of a collapsed thread + +# message headers ---- foreground ---- background ----------------------------- +color hdrdefault color117 default +color header color231 default ^Subject:.* + +# message body ------- foreground ---- background ----------------------------- +color attachment color228 default +color body color231 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses +color body color228 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs +color body color231 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text +color body color231 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text +color body color231 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text +color quoted color117 default +color quoted1 color61 default +color quoted2 color84 default +color quoted3 color215 default +color quoted4 color212 default +color signature color212 default + diff --git a/.config/neomutt/gpg.rc b/.config/neomutt/gpg.rc new file mode 100644 index 0000000..3d25f82 --- /dev/null +++ b/.config/neomutt/gpg.rc @@ -0,0 +1,120 @@ +# %p The empty string when no passphrase is needed, +# the string "PGPPASSFD=0" if one is needed. +# +# This is mostly used in conditional % sequences. +# +# %f Most PGP commands operate on a single file or a file +# containing a message. %f expands to this file's name. +# +# %s When verifying signatures, there is another temporary file +# containing the detached signature. %s expands to this +# file's name. +# +# %a In "signing" contexts, this expands to the value of the +# configuration variable $pgp_sign_as, if set, otherwise +# $pgp_default_key. You probably need to +# use this within a conditional % sequence. +# +# %r In many contexts, neomutt passes key IDs to pgp. %r expands to +# a list of key IDs. + +# Section A: Key Management + +# The default key for encryption (used by $pgp_self_encrypt and +# $postpone_encrypt). +# +# It will also be used for signing unless $pgp_sign_as is set to a +# key. +# +# Unless your key does not have encryption capability, uncomment this +# line and replace the keyid with your own. +# +set pgp_default_key="0xBC9D6AE1A3BE169A" + +# If you have a separate signing key, or your key _only_ has signing +# capability, uncomment this line and replace the keyid with your +# signing keyid. +# +set pgp_sign_as="0xBC9D6AE1A3BE169A" + + +# Section B: Commands + +# Note that we explicitly set the comment armor header since GnuPG, when used +# in some localiaztion environments, generates 8bit data in that header, thereby +# breaking PGP/MIME. + +# decode application/pgp +# +set pgp_decode_command="gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# Verify a signature +# +set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" + +# Decrypt an attachment +# +set pgp_decrypt_command="gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - --decrypt %f" + +# Create a PGP/MIME signed attachment +# +# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" +# +set pgp_sign_command="gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --detach-sign %f" + +# Create a application/pgp inline signed message. This style is obsolete but still needed for Hushmail recipients and some MUAs. +# +# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" +# +set pgp_clearsign_command="gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --clearsign %f" + +# Create an encrypted attachment (note that some users include the --always-trust option here) +# +# set pgp_encrypt_only_command="/usr/lib/neomutt/pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +# +set pgp_encrypt_only_command="/usr/lib/neomutt/pgpewrap gpg --batch --quiet --no-verbose --output - --textmode --armor --encrypt -- --recipient %r -- %f" + +# Create an encrypted and signed attachment (note that some users include the --always-trust option here) +# +# set pgp_encrypt_sign_command="/usr/lib/neomutt/pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +# +set pgp_encrypt_sign_command="/usr/lib/neomutt/pgpewrap gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - %?a?--local-user %a? --armor --sign --encrypt -- --recipient %r -- %f" + +# Import a key into the public key ring +# +set pgp_import_command="gpg --no-verbose --import %f" + +# Export a key from the public key ring +# +set pgp_export_command="gpg --no-verbose --armor --export %r" + +# Verify a key +# +set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r" + +# Read in the public key ring +# note: the second --with-fingerprint adds fingerprints to subkeys +# +set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" + +# Read in the secret key ring +# note: the second --with-fingerprint adds fingerprints to subkeys +# +set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" + +# Fetch keys +# set pgp_getkeys_command="pkspxycwrap %r" + +# pattern for good signature - may need to be adapted to locale! +# OK, here's a version which uses gnupg's message catalog: +# set pgp_good_sign="^gpgv?: Good signature from" +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" +# +# Output pattern to indicate a valid signature using --status-fd messages +set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" + +# Output pattern to verify a decryption occurred +# This is now deprecated by pgp_check_gpg_decrypt_status_fd: +# set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY" +set pgp_check_gpg_decrypt_status_fd + diff --git a/.config/neomutt/mailcap b/.config/neomutt/mailcap new file mode 100644 index 0000000..9f229c8 --- /dev/null +++ b/.config/neomutt/mailcap @@ -0,0 +1,21 @@ +image/*; sxiv -a -b %s; copiousoutput +#image/*; feh %s; copiousoutput +#text/plain; $EDITOR %s +#text/plain; nvim %s +text/plain; bat %s; copiousoutput +#text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput +#text/html; firefox --private-window '%s' &; test=test -n "$DISPLAY"; needsterminal +#text/html; lynx -g '%s'; test=test -n "$DISPLAY"; needsterminal +#text/html; links -g -force-html '%s'; test=test -n "$DISPLAY"; +text/html; chromium --new-window --incognito '%s'; nametemplate=%s.html; test=test -n "$DISPLAY" +#text/html; nyxt '%s'; test=test -n "$DISPLAY"; +text/html; w3m; nametemplate=%s.html; needsterminal +text/html; w3m -graph -o display_borders=1 -o color=1 -o display_image=1 -o auto_image=1 -dump -I %{charset} -T text/html; copiousoutput +#audio/*; vlc %s +#video/*; vlc %s +audio/*; mpv %s +video/*; mpv %s +application/pdf; mupdf %s +#application/pdf; zathura %s +application/pgp-encrypted; gpg -d '%s'; copiousoutput + diff --git a/.config/neomutt/sidebar b/.config/neomutt/sidebar new file mode 100644 index 0000000..efdec48 --- /dev/null +++ b/.config/neomutt/sidebar @@ -0,0 +1,103 @@ +# Example NeoMutt config file for the sidebar feature. + +# -------------------------------------------------------------------------- +# VARIABLES – shown with their default values +# -------------------------------------------------------------------------- +# Should the Sidebar be shown? +set sidebar_visible = yes +# How wide should the Sidebar be in screen columns? + +# Note: Some characters, e.g. Chinese, take up two columns each. +set sidebar_width = 22 +# Should the mailbox paths be abbreviated? +set sidebar_short_path = no +# Number of top-level mailbox path subdirectories to truncate for display +set sidebar_component_depth = 0 +# When abbreviating mailbox path names, use any of these characters as path +# separators. Only the part after the last separators will be shown. +# For file folders '/' is good. For IMAP folders, often '.' is useful. +set sidebar_delim_chars = '/.' +# If the mailbox path is abbreviated, should it be indented? +set sidebar_folder_indent = no +# Indent mailbox paths with this string. +set sidebar_indent_string = ' ' +# Make the Sidebar only display mailboxes that contain new, or flagged, +# mail. +set sidebar_new_mail_only = no +# Any mailboxes that are whitelisted will always be visible, even if the +# sidebar_new_mail_only option is enabled. +set sidebar_non_empty_mailbox_only = no +# Only show mailboxes that contain some mail +#sidebar_whitelist '/home/user/mailbox1' +sidebar_whitelist '/home/dominic/mail/fastmail' +#sidebar_whitelist '/home/user/mailbox2' +# When searching for mailboxes containing new mail, should the search wrap +# around when it reaches the end of the list? +set sidebar_next_new_wrap = no +# Show the Sidebar on the right-hand side of the screen +set sidebar_on_right = no +# The character to use as the divider between the Sidebar and the other NeoMutt +# panels. +set sidebar_divider_char = '|' +# Enable extended mailbox mode to calculate total, new, and flagged +# message counts for each mailbox. +#set mail_check_stats +# Display the Sidebar mailboxes using this format string. +#set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S' +set sidebar_format = '%B %* %!%n' +# Sort the mailboxes in the Sidebar using this method: +# count – total number of messages +# flagged – number of flagged messages +# new – number of new messages +# path – mailbox path +# unsorted – do not sort the mailboxes +set sidebar_sort_method = 'unsorted' +# -------------------------------------------------------------------------- +# FUNCTIONS – shown with an example mapping +# -------------------------------------------------------------------------- +# Move the highlight to the previous mailbox +bind index,pager \Cp sidebar-prev +# Move the highlight to the next mailbox +bind index,pager \Cn sidebar-next +# Open the highlighted mailbox +bind index,pager \Co sidebar-open +# Move the highlight to the previous page +# This is useful if you have a LOT of mailboxes. +bind index,pager sidebar-page-up +# Move the highlight to the next page +# This is useful if you have a LOT of mailboxes. +bind index,pager sidebar-page-down +# Move the highlight to the previous mailbox containing new, or flagged, +# mail. +bind index,pager sidebar-prev-new +# Move the highlight to the next mailbox containing new, or flagged, mail. +bind index,pager sidebar-next-new +# Toggle the visibility of the Sidebar. +bind index,pager B sidebar-toggle-visible +# -------------------------------------------------------------------------- +# COLORS – some unpleasant examples are given +# -------------------------------------------------------------------------- +# Note: All color operations are of the form: +# color OBJECT FOREGROUND BACKGROUND +# Color of the current, open, mailbox +# Note: This is a general NeoMutt option which colors all selected items. +color indicator cyan black +# Sidebar-specific color of the selected item +color sidebar_indicator cyan black +# Color of the highlighted, but not open, mailbox. +color sidebar_highlight black color8 +# Color of the divider separating the Sidebar from NeoMutt panels +color sidebar_divider color8 black +# Color to give mailboxes containing flagged mail +color sidebar_flagged red black +# Color to give mailboxes containing new mail +color sidebar_new green black +# Color to give mailboxes containing no new/flagged mail, etc. +color sidebar_ordinary color245 default +# Color to give the spool_file mailbox +color sidebar_spool_file color207 default +# Color to give mailboxes containing no unread mail +color sidebar_unread color136 default +# -------------------------------------------------------------------------- + +# vim: syntax=neomuttrc diff --git a/.config/nitrogen/bg-saved.cfg b/.config/nitrogen/bg-saved.cfg new file mode 100644 index 0000000..136ccee --- /dev/null +++ b/.config/nitrogen/bg-saved.cfg @@ -0,0 +1,4 @@ +[xin_-1] +file=/home/dominic/Bilder/backgrounds/architecture.jpg +mode=5 +bgcolor=#002a36 diff --git a/.config/nitrogen/nitrogen.cfg b/.config/nitrogen/nitrogen.cfg new file mode 100644 index 0000000..f6788cd --- /dev/null +++ b/.config/nitrogen/nitrogen.cfg @@ -0,0 +1,12 @@ +[geometry] +posx=267 +posy=304 +sizex=760 +sizey=547 + +[nitrogen] +view=icon +recurse=true +sort=alpha +icon_caps=false +dirs=/home/dominic/Bilder/backgrounds; diff --git a/.config/nvim/.netrwhist b/.config/nvim/.netrwhist new file mode 100644 index 0000000..dcc819a --- /dev/null +++ b/.config/nvim/.netrwhist @@ -0,0 +1,3 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhistcnt =1 +let g:netrw_dirhist_1='/home/mrus' diff --git a/.config/nvim/colors/iceberg.vim b/.config/nvim/colors/iceberg.vim new file mode 100644 index 0000000..5eab051 --- /dev/null +++ b/.config/nvim/colors/iceberg.vim @@ -0,0 +1,455 @@ +" _________________________________________ +" \_ _/ ____| ____| ___ \ ____| ___ \ ___/ +" | | |____| ____| ___ < ____| __ / |__ \ +" /___\_____|_____|_____/_____|_| \_\_____/ +" +" File: iceberg.vim +" Maintainer: cocopon +" Modified: 2022-04-26 21:56+0900 +" License: MIT + + +if !has('gui_running') && &t_Co < 256 + finish +endif + +hi clear +if exists('syntax_on') + syntax reset +endif + +let g:colors_name = 'iceberg' + +if &background == 'light' + hi Normal ctermbg=254 ctermfg=237 guibg=#e8e9ec guifg=#33374c + hi ColorColumn cterm=NONE ctermbg=253 ctermfg=NONE guibg=#dcdfe7 guifg=NONE + hi CursorColumn cterm=NONE ctermbg=253 ctermfg=NONE guibg=#dcdfe7 guifg=NONE + hi CursorLine cterm=NONE ctermbg=253 ctermfg=NONE guibg=#dcdfe7 guifg=NONE + hi Comment ctermfg=244 guifg=#8389a3 + hi Conceal ctermbg=254 ctermfg=244 guibg=#e8e9ec guifg=#8389a3 + hi Constant ctermfg=97 guifg=#7759b4 + hi Cursor ctermbg=237 ctermfg=254 guibg=#33374c guifg=#e8e9ec + hi CursorLineNr cterm=NONE ctermbg=251 ctermfg=237 guibg=#cad0de guifg=#576a9e + hi Delimiter ctermfg=237 guifg=#33374c + hi DiffAdd ctermbg=79 ctermfg=23 guibg=#d4dbd1 guifg=#475946 + hi DiffChange ctermbg=116 ctermfg=24 guibg=#ced9e1 guifg=#375570 + hi DiffDelete cterm=NONE ctermbg=181 ctermfg=89 gui=NONE guibg=#e3d2da guifg=#70415e + hi DiffText cterm=NONE ctermbg=73 ctermfg=24 gui=NONE guibg=#acc5d3 guifg=#33374c + hi Directory ctermfg=31 guifg=#3f83a6 + hi Error ctermbg=254 ctermfg=125 guibg=#e8e9ec guifg=#cc517a + hi ErrorMsg ctermbg=254 ctermfg=125 guibg=#e8e9ec guifg=#cc517a + hi WarningMsg ctermbg=254 ctermfg=125 guibg=#e8e9ec guifg=#cc517a + hi EndOfBuffer ctermfg=251 guifg=#cbcfda + hi NonText ctermfg=251 guifg=#cbcfda + hi Whitespace ctermfg=251 guifg=#cbcfda + hi Folded ctermbg=253 ctermfg=243 guibg=#dcdfe7 guifg=#788098 + hi FoldColumn ctermbg=253 ctermfg=248 guibg=#dcdfe7 guifg=#9fa7bd + hi Function ctermfg=25 guifg=#2d539e + hi Identifier cterm=NONE ctermfg=31 guifg=#3f83a6 + hi Ignore ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE + hi Include ctermfg=25 guifg=#2d539e + hi IncSearch cterm=reverse ctermfg=NONE gui=reverse guifg=NONE term=reverse + hi LineNr ctermbg=253 ctermfg=248 guibg=#dcdfe7 guifg=#9fa7bd + hi MatchParen ctermbg=250 ctermfg=0 guibg=#bec0c9 guifg=#33374c + hi ModeMsg ctermfg=244 guifg=#8389a3 + hi MoreMsg ctermfg=64 guifg=#668e3d + hi Operator ctermfg=25 guifg=#2d539e + hi Pmenu ctermbg=251 ctermfg=237 guibg=#cad0de guifg=#33374c + hi PmenuSbar ctermbg=251 ctermfg=NONE guibg=#cad0de guifg=NONE + hi PmenuSel ctermbg=248 ctermfg=235 guibg=#a7b2cd guifg=#33374c + hi PmenuThumb ctermbg=237 ctermfg=NONE guibg=#33374c guifg=NONE + hi PreProc ctermfg=64 guifg=#668e3d + hi Question ctermfg=64 guifg=#668e3d + hi QuickFixLine ctermbg=251 ctermfg=237 guibg=#c9cdd7 guifg=#33374c + hi Search ctermbg=180 ctermfg=94 guibg=#eac6ad guifg=#85512c + hi SignColumn ctermbg=253 ctermfg=248 guibg=#dcdfe7 guifg=#9fa7bd + hi Special ctermfg=64 guifg=#668e3d + hi SpecialKey ctermfg=248 guifg=#a5b0d3 + hi SpellBad ctermbg=181 ctermfg=237 gui=undercurl guifg=NONE guisp=#cc517a + hi SpellCap ctermbg=117 ctermfg=237 gui=undercurl guifg=NONE guisp=#2d539e + hi SpellLocal ctermbg=116 ctermfg=237 gui=undercurl guifg=NONE guisp=#3f83a6 + hi SpellRare ctermbg=110 ctermfg=237 gui=undercurl guifg=NONE guisp=#7759b4 + hi Statement ctermfg=25 gui=NONE guifg=#2d539e + hi StatusLine cterm=reverse ctermbg=252 ctermfg=243 gui=reverse guibg=#e8e9ec guifg=#757ca3 term=reverse + hi StatusLineTerm cterm=reverse ctermbg=252 ctermfg=243 gui=reverse guibg=#e8e9ec guifg=#757ca3 term=reverse + hi StatusLineNC cterm=reverse ctermbg=244 ctermfg=251 gui=reverse guibg=#8b98b6 guifg=#cad0de + hi StatusLineTermNC cterm=reverse ctermbg=244 ctermfg=251 gui=reverse guibg=#8b98b6 guifg=#cad0de + hi StorageClass ctermfg=25 guifg=#2d539e + hi String ctermfg=31 guifg=#3f83a6 + hi Structure ctermfg=25 guifg=#2d539e + hi TabLine cterm=NONE ctermbg=251 ctermfg=244 gui=NONE guibg=#cad0de guifg=#8b98b6 + hi TabLineFill cterm=reverse ctermbg=244 ctermfg=251 gui=reverse guibg=#8b98b6 guifg=#cad0de + hi TabLineSel cterm=NONE ctermbg=254 ctermfg=237 gui=NONE guibg=#e8e9ec guifg=#606374 + hi TermCursorNC ctermbg=244 ctermfg=254 guibg=#8389a3 guifg=#e8e9ec + hi Title ctermfg=130 gui=NONE guifg=#c57339 + hi Todo ctermbg=254 ctermfg=64 guibg=#d4dbd1 guifg=#668e3d + hi Type ctermfg=25 gui=NONE guifg=#2d539e + hi Underlined cterm=underline ctermfg=25 gui=underline guifg=#2d539e term=underline + hi VertSplit cterm=NONE ctermbg=251 ctermfg=251 gui=NONE guibg=#cad0de guifg=#cad0de + hi Visual ctermbg=251 ctermfg=NONE guibg=#c9cdd7 guifg=NONE + hi VisualNOS ctermbg=251 ctermfg=NONE guibg=#c9cdd7 guifg=NONE + hi WildMenu ctermbg=235 ctermfg=252 guibg=#32364c guifg=#e8e9ec + hi icebergNormalFg ctermfg=237 guifg=#33374c + hi diffAdded ctermfg=64 guifg=#668e3d + hi diffRemoved ctermfg=125 guifg=#cc517a + hi ALEErrorSign ctermbg=253 ctermfg=125 guibg=#dcdfe7 guifg=#cc517a + hi ALEWarningSign ctermbg=253 ctermfg=130 guibg=#dcdfe7 guifg=#c57339 + hi ALEVirtualTextError ctermfg=125 guifg=#cc517a + hi ALEVirtualTextWarning ctermfg=130 guifg=#c57339 + hi CtrlPMode1 ctermbg=247 ctermfg=252 guibg=#9fa6c0 guifg=#e8e9ec + hi EasyMotionShade ctermfg=250 guifg=#bbbecd + hi EasyMotionTarget ctermfg=64 guifg=#668e3d + hi EasyMotionTarget2First ctermfg=130 guifg=#c57339 + hi EasyMotionTarget2Second ctermfg=130 guifg=#c57339 + hi GitGutterAdd ctermbg=253 ctermfg=64 guibg=#dcdfe7 guifg=#668e3d + hi GitGutterChange ctermbg=253 ctermfg=31 guibg=#dcdfe7 guifg=#3f83a6 + hi GitGutterChangeDelete ctermbg=253 ctermfg=31 guibg=#dcdfe7 guifg=#3f83a6 + hi GitGutterDelete ctermbg=253 ctermfg=125 guibg=#dcdfe7 guifg=#cc517a + hi gitmessengerEndOfBuffer ctermbg=253 ctermfg=248 guibg=#dcdfe7 guifg=#9fa7bd + hi gitmessengerPopupNormal ctermbg=253 ctermfg=237 guibg=#dcdfe7 guifg=#33374c + hi Sneak ctermbg=97 ctermfg=254 guibg=#7759b4 guifg=#e8e9ec + hi SneakScope ctermbg=251 ctermfg=244 guibg=#c9cdd7 guifg=#8389a3 + hi SyntasticErrorSign ctermbg=253 ctermfg=125 guibg=#dcdfe7 guifg=#cc517a + hi SyntasticStyleErrorSign ctermbg=253 ctermfg=125 guibg=#dcdfe7 guifg=#cc517a + hi SyntasticStyleWarningSign ctermbg=253 ctermfg=130 guibg=#dcdfe7 guifg=#c57339 + hi SyntasticWarningSign ctermbg=253 ctermfg=130 guibg=#dcdfe7 guifg=#c57339 + hi TSFunction ctermfg=237 guifg=#505695 + hi TSFunctionBuiltin ctermfg=237 guifg=#505695 + hi TSFunctionMacro ctermfg=237 guifg=#505695 + hi TSMethod ctermfg=237 guifg=#505695 + hi TSURI cterm=underline ctermfg=31 gui=underline guifg=#3f83a6 term=underline + hi ZenSpace ctermbg=125 guibg=#cc517a + hi DiagnosticUnderlineInfo cterm=underline ctermfg=31 gui=underline guisp=#3f83a6 term=underline + hi DiagnosticInfo ctermfg=31 guifg=#3f83a6 + hi DiagnosticSignInfo ctermbg=253 ctermfg=31 guibg=#dcdfe7 guifg=#3f83a6 + hi DiagnosticUnderlineHint cterm=underline ctermfg=244 gui=underline guisp=#8389a3 term=underline + hi DiagnosticHint ctermfg=244 guifg=#8389a3 + hi DiagnosticSignHint ctermbg=253 ctermfg=244 guibg=#dcdfe7 guifg=#8389a3 + hi DiagnosticUnderlineWarn cterm=underline ctermfg=130 gui=underline guisp=#c57339 term=underline + hi DiagnosticWarn ctermfg=130 guifg=#c57339 + hi DiagnosticSignWarn ctermbg=253 ctermfg=130 guibg=#dcdfe7 guifg=#c57339 + hi DiagnosticUnderlineError cterm=underline ctermfg=125 gui=underline guisp=#cc517a term=underline + hi DiagnosticError ctermfg=125 guifg=#cc517a + hi DiagnosticSignError ctermbg=253 ctermfg=125 guibg=#dcdfe7 guifg=#cc517a + hi DiagnosticFloatingHint ctermbg=251 ctermfg=237 guibg=#cad0de guifg=#33374c + hi icebergALAccentRed ctermfg=125 guifg=#cc517a + + if has('nvim') + let g:terminal_color_0 = '#dcdfe7' + let g:terminal_color_1 = '#cc517a' + let g:terminal_color_2 = '#668e3d' + let g:terminal_color_3 = '#c57339' + let g:terminal_color_4 = '#2d539e' + let g:terminal_color_5 = '#7759b4' + let g:terminal_color_6 = '#3f83a6' + let g:terminal_color_7 = '#33374c' + let g:terminal_color_8 = '#8389a3' + let g:terminal_color_9 = '#cc3768' + let g:terminal_color_10 = '#598030' + let g:terminal_color_11 = '#b6662d' + let g:terminal_color_12 = '#22478e' + let g:terminal_color_13 = '#6845ad' + let g:terminal_color_14 = '#327698' + let g:terminal_color_15 = '#262a3f' + else + let g:terminal_ansi_colors = ['#dcdfe7', '#cc517a', '#668e3d', '#c57339', '#2d539e', '#7759b4', '#3f83a6', '#33374c', '#8389a3', '#cc3768', '#598030', '#b6662d', '#22478e', '#6845ad', '#327698', '#262a3f'] + endif +else + hi Normal ctermbg=234 ctermfg=252 guibg=#161821 guifg=#c6c8d1 + hi ColorColumn cterm=NONE ctermbg=235 ctermfg=NONE guibg=#1e2132 guifg=NONE + hi CursorColumn cterm=NONE ctermbg=235 ctermfg=NONE guibg=#1e2132 guifg=NONE + hi CursorLine cterm=NONE ctermbg=235 ctermfg=NONE guibg=#1e2132 guifg=NONE + hi Comment ctermfg=242 guifg=#6b7089 + hi Conceal ctermbg=234 ctermfg=242 guibg=#161821 guifg=#6b7089 + hi Constant ctermfg=140 guifg=#a093c7 + hi Cursor ctermbg=252 ctermfg=234 guibg=#c6c8d1 guifg=#161821 + hi CursorLineNr cterm=NONE ctermbg=237 ctermfg=253 guibg=#2a3158 guifg=#cdd1e6 + hi Delimiter ctermfg=252 guifg=#c6c8d1 + hi DiffAdd ctermbg=29 ctermfg=158 guibg=#45493e guifg=#c0c5b9 + hi DiffChange ctermbg=23 ctermfg=159 guibg=#384851 guifg=#b3c3cc + hi DiffDelete cterm=NONE ctermbg=95 ctermfg=224 gui=NONE guibg=#53343b guifg=#ceb0b6 + hi DiffText cterm=NONE ctermbg=30 ctermfg=195 gui=NONE guibg=#5b7881 guifg=#c6c8d1 + hi Directory ctermfg=109 guifg=#89b8c2 + hi Error ctermbg=234 ctermfg=203 guibg=#161821 guifg=#e27878 + hi ErrorMsg ctermbg=234 ctermfg=203 guibg=#161821 guifg=#e27878 + hi WarningMsg ctermbg=234 ctermfg=203 guibg=#161821 guifg=#e27878 + hi EndOfBuffer ctermfg=236 guifg=#242940 + hi NonText ctermfg=236 guifg=#242940 + hi Whitespace ctermfg=236 guifg=#242940 + hi Folded ctermbg=235 ctermfg=245 guibg=#1e2132 guifg=#686f9a + hi FoldColumn ctermbg=235 ctermfg=239 guibg=#1e2132 guifg=#444b71 + hi Function ctermfg=110 guifg=#84a0c6 + hi Identifier cterm=NONE ctermfg=109 guifg=#89b8c2 + hi Ignore ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE + hi Include ctermfg=110 guifg=#84a0c6 + hi IncSearch cterm=reverse ctermfg=NONE gui=reverse guifg=NONE term=reverse + hi LineNr ctermbg=235 ctermfg=239 guibg=#1e2132 guifg=#444b71 + hi MatchParen ctermbg=237 ctermfg=255 guibg=#3e445e guifg=#ffffff + hi ModeMsg ctermfg=242 guifg=#6b7089 + hi MoreMsg ctermfg=150 guifg=#b4be82 + hi Operator ctermfg=110 guifg=#84a0c6 + hi Pmenu ctermbg=236 ctermfg=251 guibg=#3d425b guifg=#c6c8d1 + hi PmenuSbar ctermbg=236 ctermfg=NONE guibg=#3d425b guifg=NONE + hi PmenuSel ctermbg=240 ctermfg=255 guibg=#5b6389 guifg=#eff0f4 + hi PmenuThumb ctermbg=251 ctermfg=NONE guibg=#c6c8d1 guifg=NONE + hi PreProc ctermfg=150 guifg=#b4be82 + hi Question ctermfg=150 guifg=#b4be82 + hi QuickFixLine ctermbg=236 ctermfg=252 guibg=#272c42 guifg=#c6c8d1 + hi Search ctermbg=216 ctermfg=234 guibg=#e4aa80 guifg=#392313 + hi SignColumn ctermbg=235 ctermfg=239 guibg=#1e2132 guifg=#444b71 + hi Special ctermfg=150 guifg=#b4be82 + hi SpecialKey ctermfg=240 guifg=#515e97 + hi SpellBad ctermbg=95 ctermfg=252 gui=undercurl guifg=NONE guisp=#e27878 + hi SpellCap ctermbg=24 ctermfg=252 gui=undercurl guifg=NONE guisp=#84a0c6 + hi SpellLocal ctermbg=23 ctermfg=252 gui=undercurl guifg=NONE guisp=#89b8c2 + hi SpellRare ctermbg=97 ctermfg=252 gui=undercurl guifg=NONE guisp=#a093c7 + hi Statement ctermfg=110 gui=NONE guifg=#84a0c6 + hi StatusLine cterm=reverse ctermbg=234 ctermfg=245 gui=reverse guibg=#17171b guifg=#818596 term=reverse + hi StatusLineTerm cterm=reverse ctermbg=234 ctermfg=245 gui=reverse guibg=#17171b guifg=#818596 term=reverse + hi StatusLineNC cterm=reverse ctermbg=238 ctermfg=233 gui=reverse guibg=#3e445e guifg=#0f1117 + hi StatusLineTermNC cterm=reverse ctermbg=238 ctermfg=233 gui=reverse guibg=#3e445e guifg=#0f1117 + hi StorageClass ctermfg=110 guifg=#84a0c6 + hi String ctermfg=109 guifg=#89b8c2 + hi Structure ctermfg=110 guifg=#84a0c6 + hi TabLine cterm=NONE ctermbg=233 ctermfg=238 gui=NONE guibg=#0f1117 guifg=#3e445e + hi TabLineFill cterm=reverse ctermbg=238 ctermfg=233 gui=reverse guibg=#3e445e guifg=#0f1117 + hi TabLineSel cterm=NONE ctermbg=234 ctermfg=252 gui=NONE guibg=#161821 guifg=#9a9ca5 + hi TermCursorNC ctermbg=242 ctermfg=234 guibg=#6b7089 guifg=#161821 + hi Title ctermfg=216 gui=NONE guifg=#e2a478 + hi Todo ctermbg=234 ctermfg=150 guibg=#45493e guifg=#b4be82 + hi Type ctermfg=110 gui=NONE guifg=#84a0c6 + hi Underlined cterm=underline ctermfg=110 gui=underline guifg=#84a0c6 term=underline + hi VertSplit cterm=NONE ctermbg=233 ctermfg=233 gui=NONE guibg=#0f1117 guifg=#0f1117 + hi Visual ctermbg=236 ctermfg=NONE guibg=#272c42 guifg=NONE + hi VisualNOS ctermbg=236 ctermfg=NONE guibg=#272c42 guifg=NONE + hi WildMenu ctermbg=255 ctermfg=234 guibg=#d4d5db guifg=#17171b + hi icebergNormalFg ctermfg=252 guifg=#c6c8d1 + hi diffAdded ctermfg=150 guifg=#b4be82 + hi diffRemoved ctermfg=203 guifg=#e27878 + hi ALEErrorSign ctermbg=235 ctermfg=203 guibg=#1e2132 guifg=#e27878 + hi ALEWarningSign ctermbg=235 ctermfg=216 guibg=#1e2132 guifg=#e2a478 + hi ALEVirtualTextError ctermfg=203 guifg=#e27878 + hi ALEVirtualTextWarning ctermfg=216 guifg=#e2a478 + hi CtrlPMode1 ctermbg=236 ctermfg=242 guibg=#2e313f guifg=#6b7089 + hi EasyMotionShade ctermfg=239 guifg=#3d425b + hi EasyMotionTarget ctermfg=150 guifg=#b4be82 + hi EasyMotionTarget2First ctermfg=216 guifg=#e2a478 + hi EasyMotionTarget2Second ctermfg=216 guifg=#e2a478 + hi GitGutterAdd ctermbg=235 ctermfg=150 guibg=#1e2132 guifg=#b4be82 + hi GitGutterChange ctermbg=235 ctermfg=109 guibg=#1e2132 guifg=#89b8c2 + hi GitGutterChangeDelete ctermbg=235 ctermfg=109 guibg=#1e2132 guifg=#89b8c2 + hi GitGutterDelete ctermbg=235 ctermfg=203 guibg=#1e2132 guifg=#e27878 + hi gitmessengerEndOfBuffer ctermbg=235 ctermfg=239 guibg=#1e2132 guifg=#444b71 + hi gitmessengerPopupNormal ctermbg=235 ctermfg=252 guibg=#1e2132 guifg=#c6c8d1 + hi Sneak ctermbg=140 ctermfg=234 guibg=#a093c7 guifg=#161821 + hi SneakScope ctermbg=236 ctermfg=242 guibg=#272c42 guifg=#6b7089 + hi SyntasticErrorSign ctermbg=235 ctermfg=203 guibg=#1e2132 guifg=#e27878 + hi SyntasticStyleErrorSign ctermbg=235 ctermfg=203 guibg=#1e2132 guifg=#e27878 + hi SyntasticStyleWarningSign ctermbg=235 ctermfg=216 guibg=#1e2132 guifg=#e2a478 + hi SyntasticWarningSign ctermbg=235 ctermfg=216 guibg=#1e2132 guifg=#e2a478 + hi TSFunction ctermfg=252 guifg=#a3adcb + hi TSFunctionBuiltin ctermfg=252 guifg=#a3adcb + hi TSFunctionMacro ctermfg=252 guifg=#a3adcb + hi TSMethod ctermfg=252 guifg=#a3adcb + hi TSURI cterm=underline ctermfg=109 gui=underline guifg=#89b8c2 term=underline + hi ZenSpace ctermbg=203 guibg=#e27878 + hi DiagnosticUnderlineInfo cterm=underline ctermfg=109 gui=underline guisp=#89b8c2 term=underline + hi DiagnosticInfo ctermfg=109 guifg=#89b8c2 + hi DiagnosticSignInfo ctermbg=235 ctermfg=109 guibg=#1e2132 guifg=#89b8c2 + hi DiagnosticUnderlineHint cterm=underline ctermfg=242 gui=underline guisp=#6b7089 term=underline + hi DiagnosticHint ctermfg=242 guifg=#6b7089 + hi DiagnosticSignHint ctermbg=235 ctermfg=242 guibg=#1e2132 guifg=#6b7089 + hi DiagnosticUnderlineWarn cterm=underline ctermfg=216 gui=underline guisp=#e2a478 term=underline + hi DiagnosticWarn ctermfg=216 guifg=#e2a478 + hi DiagnosticSignWarn ctermbg=235 ctermfg=216 guibg=#1e2132 guifg=#e2a478 + hi DiagnosticUnderlineError cterm=underline ctermfg=203 gui=underline guisp=#e27878 term=underline + hi DiagnosticError ctermfg=203 guifg=#e27878 + hi DiagnosticSignError ctermbg=235 ctermfg=203 guibg=#1e2132 guifg=#e27878 + hi DiagnosticFloatingHint ctermbg=236 ctermfg=251 guibg=#3d425b guifg=#c6c8d1 + hi icebergALAccentRed ctermfg=203 guifg=#e27878 + + if has('nvim') + let g:terminal_color_0 = '#1e2132' + let g:terminal_color_1 = '#e27878' + let g:terminal_color_2 = '#b4be82' + let g:terminal_color_3 = '#e2a478' + let g:terminal_color_4 = '#84a0c6' + let g:terminal_color_5 = '#a093c7' + let g:terminal_color_6 = '#89b8c2' + let g:terminal_color_7 = '#c6c8d1' + let g:terminal_color_8 = '#6b7089' + let g:terminal_color_9 = '#e98989' + let g:terminal_color_10 = '#c0ca8e' + let g:terminal_color_11 = '#e9b189' + let g:terminal_color_12 = '#91acd1' + let g:terminal_color_13 = '#ada0d3' + let g:terminal_color_14 = '#95c4ce' + let g:terminal_color_15 = '#d2d4de' + else + let g:terminal_ansi_colors = ['#1e2132', '#e27878', '#b4be82', '#e2a478', '#84a0c6', '#a093c7', '#89b8c2', '#c6c8d1', '#6b7089', '#e98989', '#c0ca8e', '#e9b189', '#91acd1', '#ada0d3', '#95c4ce', '#d2d4de'] + endif +endif + +hi! link TermCursor Cursor +hi! link ToolbarButton TabLineSel +hi! link ToolbarLine TabLineFill +hi! link cssBraces Delimiter +hi! link cssClassName Special +hi! link cssClassNameDot icebergNormalFg +hi! link cssPseudoClassId Special +hi! link cssTagName Statement +hi! link helpHyperTextJump Constant +hi! link htmlArg Constant +hi! link htmlEndTag Statement +hi! link htmlTag Statement +hi! link jsonQuote icebergNormalFg +hi! link phpVarSelector Identifier +hi! link pythonFunction Title +hi! link rubyDefine Statement +hi! link rubyFunction Title +hi! link rubyInterpolationDelimiter String +hi! link rubySharpBang Comment +hi! link rubyStringDelimiter String +hi! link rustFuncCall icebergNormalFg +hi! link rustFuncName Title +hi! link rustType Constant +hi! link sassClass Special +hi! link shFunction icebergNormalFg +hi! link vimContinue Comment +hi! link vimFuncSID vimFunction +hi! link vimFuncVar icebergNormalFg +hi! link vimFunction Title +hi! link vimGroup Statement +hi! link vimHiGroup Statement +hi! link vimHiTerm Identifier +hi! link vimMapModKey Special +hi! link vimOption Identifier +hi! link vimVar icebergNormalFg +hi! link xmlAttrib Constant +hi! link xmlAttribPunct Statement +hi! link xmlEndTag Statement +hi! link xmlNamespace Statement +hi! link xmlTag Statement +hi! link xmlTagName Statement +hi! link yamlKeyValueDelimiter Delimiter +hi! link CtrlPPrtCursor Cursor +hi! link CtrlPMatch Title +hi! link CtrlPMode2 StatusLine +hi! link deniteMatched icebergNormalFg +hi! link deniteMatchedChar Title +hi! link elixirBlockDefinition Statement +hi! link elixirDefine Statement +hi! link elixirDocSigilDelimiter String +hi! link elixirDocTest String +hi! link elixirExUnitMacro Statement +hi! link elixirExceptionDefine Statement +hi! link elixirFunctionDeclaration Title +hi! link elixirKeyword Statement +hi! link elixirModuleDeclaration icebergNormalFg +hi! link elixirModuleDefine Statement +hi! link elixirPrivateDefine Statement +hi! link elixirStringDelimiter String +hi! link jsFlowMaybe icebergNormalFg +hi! link jsFlowObject icebergNormalFg +hi! link jsFlowType PreProc +hi! link graphqlName icebergNormalFg +hi! link graphqlOperator icebergNormalFg +hi! link gitmessengerHash Comment +hi! link gitmessengerHeader Statement +hi! link gitmessengerHistory Constant +hi! link jsArrowFunction Operator +hi! link jsClassDefinition icebergNormalFg +hi! link jsClassFuncName Title +hi! link jsExport Statement +hi! link jsFuncName Title +hi! link jsFutureKeys Statement +hi! link jsFuncCall icebergNormalFg +hi! link jsGlobalObjects Statement +hi! link jsModuleKeywords Statement +hi! link jsModuleOperators Statement +hi! link jsNull Constant +hi! link jsObjectFuncName Title +hi! link jsObjectKey Identifier +hi! link jsSuper Statement +hi! link jsTemplateBraces Special +hi! link jsUndefined Constant +hi! link markdownBold Special +hi! link markdownCode String +hi! link markdownCodeDelimiter String +hi! link markdownHeadingDelimiter Comment +hi! link markdownRule Comment +hi! link ngxDirective Statement +hi! link plug1 icebergNormalFg +hi! link plug2 Identifier +hi! link plugDash Comment +hi! link plugMessage Special +hi! link SignifySignAdd GitGutterAdd +hi! link SignifySignChange GitGutterChange +hi! link SignifySignChangeDelete GitGutterChangeDelete +hi! link SignifySignDelete GitGutterDelete +hi! link SignifySignDeleteFirstLine SignifySignDelete +hi! link StartifyBracket Comment +hi! link StartifyFile Identifier +hi! link StartifyFooter Constant +hi! link StartifyHeader Constant +hi! link StartifyNumber Special +hi! link StartifyPath Comment +hi! link StartifySection Statement +hi! link StartifySlash Comment +hi! link StartifySpecial icebergNormalFg +hi! link svssBraces Delimiter +hi! link swiftIdentifier icebergNormalFg +hi! link TSAttribute Special +hi! link TSBoolean Constant +hi! link TSCharacter Constant +hi! link TSComment Comment +hi! link TSConstructor icebergNormalFg +hi! link TSConditional Statement +hi! link TSConstant Constant +hi! link TSConstBuiltin Constant +hi! link TSConstMacro Constant +hi! link TSError Error +hi! link TSException Statement +hi! link TSField icebergNormalFg +hi! link TSFloat Constant +hi! link TSInclude Statement +hi! link TSKeyword Statement +hi! link TSKeywordFunction Function +hi! link TSLabel Special +hi! link TSNamespace Statement +hi! link TSNumber Constant +hi! link TSOperator icebergNormalFg +hi! link TSParameter icebergNormalFg +hi! link TSParameterReference icebergNormalFg +hi! link TSProperty TSField +hi! link TSPunctDelimiter icebergNormalFg +hi! link TSPunctBracket icebergNormalFg +hi! link TSPunctSpecial Special +hi! link TSRepeat Statement +hi! link TSString String +hi! link TSStringRegex String +hi! link TSStringEscape Special +hi! link TSTag htmlTagName +hi! link TSTagAttribute htmlArg +hi! link TSTagDelimiter htmlTagName +hi! link TSText icebergNormalFg +hi! link TSTitle Title +hi! link TSType Type +hi! link TSTypeBuiltin Type +hi! link TSVariable icebergNormalFg +hi! link TSVariableBuiltin Statement +hi! link typescriptAjaxMethods icebergNormalFg +hi! link typescriptBraces icebergNormalFg +hi! link typescriptEndColons icebergNormalFg +hi! link typescriptFuncKeyword Statement +hi! link typescriptGlobalObjects Statement +hi! link typescriptHtmlElemProperties icebergNormalFg +hi! link typescriptIdentifier Statement +hi! link typescriptMessage icebergNormalFg +hi! link typescriptNull Constant +hi! link typescriptParens icebergNormalFg + +if !has('nvim') + hi! link SpecialKey Whitespace +endif + diff --git a/.config/nvim/colors/neutral.vim b/.config/nvim/colors/neutral.vim new file mode 100644 index 0000000..9f7f5a3 --- /dev/null +++ b/.config/nvim/colors/neutral.vim @@ -0,0 +1,257 @@ +" Filename: colors/neurtral.vim + + if &background == 'dark' + + let s:guishade0 = "#000000" + let s:guishade1 = "#383839" + let s:guishade2 = "#454548" + let s:guishade3 = "#67686c" + let s:guishade4 = "#8a8a90" + let s:guishade5 = "#acadb4" + let s:guishade6 = "#cfcfd8" + let s:guishade7 = "#f1f2fc" + let s:guiaccent0 = "#ff7d78" + let s:guiaccent1 = "#feffff" + let s:guiaccent2 = "#a5a5a5" + let s:guiaccent3 = "#63a3bf" + let s:guiaccent4 = "#97becf" + let s:guiaccent5 = "#57666e" + let s:guiaccent6 = "#852d2d" + let s:guiaccent7 = "#b65252" + let s:ctermshade0 = 16 + let s:ctermshade1 = 235 + let s:ctermshade2 = 238 + let s:ctermshade3 = 102 + let s:ctermshade4 = 245 + let s:ctermshade5 = 249 + let s:ctermshade6 = 252 + let s:ctermshade7 = 231 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 231 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 122 + let s:ctermaccent4 = 117 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + + if &background == 'light' + + let s:guishade0 = "#f1f2fc" + let s:guishade1 = "#cfcfd8" + let s:guishade2 = "#acadb4" + let s:guishade3 = "#8a8a90" + let s:guishade4 = "#67686c" + let s:guishade5 = "#454548" + let s:guishade6 = "#222324" + let s:guishade7 = "#000000" + let s:guiaccent0 = "#ff7d78" + let s:guiaccent1 = "#000000" + let s:guiaccent2 = "#ffd478" + let s:guiaccent3 = "#62d9b7" + let s:guiaccent4 = "#5da3c0" + let s:guiaccent5 = "#799eff" + let s:guiaccent6 = "#d783ff" + let s:guiaccent7 = "#ff89d8" + let s:ctermshade0 = 231 + let s:ctermshade1 = 252 + let s:ctermshade2 = 249 + let s:ctermshade3 = 245 + let s:ctermshade4 = 102 + let s:ctermshade5 = 238 + let s:ctermshade6 = 235 + let s:ctermshade7 = 16 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 16 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 116 + let s:ctermaccent4 = 110 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + highlight clear + syntax reset + let g:colors_name = "neutral" + + """""""""" + " Normal " + """""""""" + + exec "hi Normal guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi Normal ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + + """"""""""""""""" + " Syntax groups " + """"""""""""""""" + + " Default + + exec "hi Comment guifg=".s:guishade2 + exec "hi Comment ctermfg=".s:ctermshade2 + exec "hi Constant guifg=".s:guiaccent3 + exec "hi Constant ctermfg=".s:ctermaccent3 + exec "hi Character guifg=".s:guiaccent4 + exec "hi Character ctermfg=".s:ctermaccent4 + exec "hi Identifier guifg=".s:guiaccent2." gui=none" + exec "hi Identifier ctermfg=".s:ctermaccent2." cterm=none" + exec "hi Statement guifg=".s:guiaccent5 + exec "hi Statement ctermfg=".s:ctermaccent5 + exec "hi PreProc guifg=".s:guiaccent6 + exec "hi PreProc ctermfg=".s:ctermaccent6 + exec "hi Type guifg=".s:guiaccent7 + exec "hi Type ctermfg=".s:ctermaccent7 + exec "hi Special guifg=".s:guiaccent4 + exec "hi Special ctermfg=".s:ctermaccent4 + exec "hi Underlined guifg=".s:guiaccent5 + exec "hi Underlined ctermfg=".s:ctermaccent5 + exec "hi Error guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Error ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Todo guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Todo ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Function guifg=".s:guiaccent1 + exec "hi Function ctermfg=".s:ctermaccent1 + + " GitGutter + + exec "hi GitGutterAdd guifg=".s:guiaccent3 + exec "hi GitGutterAdd ctermfg=".s:ctermaccent3 + exec "hi GitGutterChange guifg=".s:guiaccent2 + exec "hi GitGutterChange ctermfg=".s:ctermaccent2 + exec "hi GitGutterChangeDelete guifg=".s:guiaccent2 + exec "hi GitGutterChangeDelete ctermfg=".s:ctermaccent2 + exec "hi GitGutterDelete guifg=".s:guiaccent0 + exec "hi GitGutterDelete ctermfg=".s:ctermaccent0 + + " fugitive + + exec "hi gitcommitComment guifg=".s:guishade3 + exec "hi gitcommitComment ctermfg=".s:ctermshade3 + exec "hi gitcommitOnBranch guifg=".s:guishade3 + exec "hi gitcommitOnBranch ctermfg=".s:ctermshade3 + exec "hi gitcommitHeader guifg=".s:guishade5 + exec "hi gitcommitHeader ctermfg=".s:ctermshade5 + exec "hi gitcommitHead guifg=".s:guishade3 + exec "hi gitcommitHead ctermfg=".s:ctermshade3 + exec "hi gitcommitSelectedType guifg=".s:guiaccent3 + exec "hi gitcommitSelectedType ctermfg=".s:ctermaccent3 + exec "hi gitcommitSelectedFile guifg=".s:guiaccent3 + exec "hi gitcommitSelectedFile ctermfg=".s:ctermaccent3 + exec "hi gitcommitDiscardedType guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedType ctermfg=".s:ctermaccent2 + exec "hi gitcommitDiscardedFile guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedFile ctermfg=".s:ctermaccent2 + exec "hi gitcommitUntrackedFile guifg=".s:guiaccent0 + exec "hi gitcommitUntrackedFile ctermfg=".s:ctermaccent0 + + """"""""""""""""""""""" + " Highlighting Groups " + """"""""""""""""""""""" + + " Default + + exec "hi ColorColumn guibg=".s:guishade1 + exec "hi ColorColumn ctermbg=".s:ctermshade1 + exec "hi Conceal guifg=".s:guishade2 + exec "hi Conceal ctermfg=".s:ctermshade2 + exec "hi Cursor guifg=".s:guishade0 + exec "hi Cursor ctermfg=".s:ctermshade0 + exec "hi CursorColumn guibg=".s:guishade1 + exec "hi CursorColumn ctermbg=".s:ctermshade1 + exec "hi CursorLine guibg=".s:guishade1 + exec "hi CursorLine ctermbg=".s:ctermshade1." cterm=none" + exec "hi Directory guifg=".s:guiaccent5 + exec "hi Directory ctermfg=".s:ctermaccent5 + exec "hi DiffAdd guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi DiffAdd ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi DiffChange guifg=".s:guiaccent2." guibg=".s:guishade1 + exec "hi DiffChange ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade1 + exec "hi DiffDelete guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi DiffDelete ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi DiffText guifg=".s:guiaccent2." guibg=".s:guishade2 + exec "hi DiffText ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade2 + exec "hi ErrorMsg guifg=".s:guishade7." guibg=".s:guiaccent0 + exec "hi ErrorMsg ctermfg=".s:ctermshade7." ctermbg=".s:ctermaccent0 + exec "hi VertSplit guifg=".s:guishade0." guibg=".s:guishade3 + exec "hi VertSplit ctermfg=".s:ctermshade0." ctermbg=".s:ctermshade3 + exec "hi Folded guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi Folded ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi FoldColumn guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi FoldColumn ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi SignColumn guibg=none" + exec "hi SignColumn ctermbg=none" + exec "hi IncSearch guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi IncSearch ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi LineNr guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi LineNr ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi CursorLineNr guifg=".s:guishade3." guibg=".s:guishade1 + exec "hi CursorLineNr ctermfg=".s:ctermshade3." ctermbg=".s:ctermshade1 + exec "hi MatchParen guibg=".s:guishade2 + exec "hi MatchParen ctermbg=".s:ctermshade2 + exec "hi MoreMsg guifg=".s:guishade0." guibg=".s:guiaccent4 + exec "hi MoreMsg ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent4 + exec "hi NonText guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi NonText ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi Pmenu guifg=".s:guishade6." guibg=".s:guishade1 + exec "hi Pmenu ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade1 + exec "hi PmenuSel guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi PmenuSel ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + exec "hi PmenuSbar guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi PmenuSbar ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi PmenuThumb guifg=".s:guiaccent0." guibg=".s:guishade2 + exec "hi PmenuThumb ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade2 + exec "hi Question guifg=".s:guishade7." guibg=".s:guishade1 + exec "hi Question ctermfg=".s:ctermshade7." ctermbg=".s:ctermshade1 + exec "hi Search guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi Search ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi SpecialKey guifg=".s:guiaccent7." guibg=".s:guishade0 + exec "hi SpecialKey ctermfg=".s:ctermaccent7." ctermbg=".s:ctermshade0 + exec "hi SpellBad guifg=".s:guiaccent0 + exec "hi SpellBad ctermfg=".s:ctermaccent0." ctermbg=NONE cterm=undercurl" + exec "hi SpellCap guifg=".s:guiaccent2 + exec "hi SpellCap ctermfg=".s:ctermaccent2." ctermbg=NONE cterm=undercurl" + exec "hi SpellLocal guifg=".s:guiaccent4 + exec "hi SpellLocal ctermfg=".s:ctermaccent4 + exec "hi SpellRare guifg=".s:guiaccent1 + exec "hi SpellRare ctermfg=".s:ctermaccent1 + exec "hi StatusLine guifg=".s:guishade4." guibg=".s:guishade1." gui=none" + exec "hi StatusLine ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1." cterm=none" + exec "hi TabLine guifg=".s:guishade5." guibg=".s:guishade1 + exec "hi TabLine ctermfg=".s:ctermshade5." ctermbg=".s:ctermshade1 + exec "hi TabLineFill guibg=".s:guishade1 + exec "hi TabLineFill ctermbg=".s:ctermshade1 + exec "hi TabLineSel guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi TabLineSel ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + exec "hi Title guifg=".s:guiaccent5 + exec "hi Title ctermfg=".s:ctermaccent5 + exec "hi Visual guibg=".s:guishade1 + exec "hi Visual ctermbg=".s:ctermshade1 + exec "hi VisualNOS guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi VisualNOS ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi WarningMsg guifg=".s:guiaccent0 + exec "hi WarningMsg ctermfg=".s:ctermaccent0 + exec "hi WildMenu guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi WildMenu ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + + " NERDTree + + exec "hi NERDTreeExecFile guifg=".s:guiaccent4 + exec "hi NERDTreeExecFile ctermfg=".s:ctermaccent4 + exec "hi NERDTreeDirSlash guifg=".s:guiaccent5 + exec "hi NERDTreeDirSlash ctermfg=".s:ctermaccent5 + exec "hi NERDTreeCWD guifg=".s:guiaccent0 + exec "hi NERDTreeCWD ctermfg=".s:ctermaccent0 + + """""""""""" + " Clean up " + """""""""""" + + unlet s:guishade0 s:guishade1 s:guishade2 s:guishade3 s:guishade4 s:guishade5 s:guishade6 s:guishade7 s:guiaccent0 s:guiaccent1 s:guiaccent2 s:guiaccent3 s:guiaccent4 s:guiaccent5 s:guiaccent6 s:guiaccent7 + unlet s:ctermshade0 s:ctermshade1 s:ctermshade2 s:ctermshade3 s:ctermshade4 s:ctermshade5 s:ctermshade6 s:ctermshade7 s:ctermaccent0 s:ctermaccent1 s:ctermaccent2 s:ctermaccent3 s:ctermaccent4 s:ctermaccent5 s:ctermaccent6 s:ctermaccent7 diff --git a/.config/nvim/colors/sea.vim b/.config/nvim/colors/sea.vim new file mode 100644 index 0000000..7c390cc --- /dev/null +++ b/.config/nvim/colors/sea.vim @@ -0,0 +1,257 @@ +" Filename: colors/sea.vim + + if &background == 'dark' + + let s:guishade0 = "#333366" + let s:guishade1 = "#6666cc" + let s:guishade2 = "#0099cc" + let s:guishade3 = "#3366cc" + let s:guishade4 = "#006699" + let s:guishade5 = "#0066ff" + let s:guishade6 = "#669999" + let s:guishade7 = "#99cccc" + let s:guiaccent0 = "#333399" + let s:guiaccent1 = "#9999ff" + let s:guiaccent2 = "#00ccff" + let s:guiaccent3 = "#6699ff" + let s:guiaccent4 = "#0099cc" + let s:guiaccent5 = "#0099ff" + let s:guiaccent6 = "#66cccc" + let s:guiaccent7 = "#ccffff" + let s:ctermshade0 = 16 + let s:ctermshade1 = 235 + let s:ctermshade2 = 238 + let s:ctermshade3 = 102 + let s:ctermshade4 = 245 + let s:ctermshade5 = 249 + let s:ctermshade6 = 252 + let s:ctermshade7 = 231 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 231 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 122 + let s:ctermaccent4 = 117 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + + if &background == 'light' + + let s:guishade0 = "#f1f2fc" + let s:guishade1 = "#cfcfd8" + let s:guishade2 = "#acadb4" + let s:guishade3 = "#8a8a90" + let s:guishade4 = "#67686c" + let s:guishade5 = "#454548" + let s:guishade6 = "#222324" + let s:guishade7 = "#000000" + let s:guiaccent0 = "#ff7d78" + let s:guiaccent1 = "#000000" + let s:guiaccent2 = "#ffd478" + let s:guiaccent3 = "#62d9b7" + let s:guiaccent4 = "#5da3c0" + let s:guiaccent5 = "#799eff" + let s:guiaccent6 = "#d783ff" + let s:guiaccent7 = "#ff89d8" + let s:ctermshade0 = 231 + let s:ctermshade1 = 252 + let s:ctermshade2 = 249 + let s:ctermshade3 = 245 + let s:ctermshade4 = 102 + let s:ctermshade5 = 238 + let s:ctermshade6 = 235 + let s:ctermshade7 = 16 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 16 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 116 + let s:ctermaccent4 = 110 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + highlight clear + syntax reset + let g:colors_name = "sea" + + """""""""" + " Normal " + """""""""" + + exec "hi Normal guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi Normal ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + + """"""""""""""""" + " Syntax groups " + """"""""""""""""" + + " Default + + exec "hi Comment guifg=".s:guishade2 + exec "hi Comment ctermfg=".s:ctermshade2 + exec "hi Constant guifg=".s:guiaccent3 + exec "hi Constant ctermfg=".s:ctermaccent3 + exec "hi Character guifg=".s:guiaccent4 + exec "hi Character ctermfg=".s:ctermaccent4 + exec "hi Identifier guifg=".s:guiaccent2." gui=none" + exec "hi Identifier ctermfg=".s:ctermaccent2." cterm=none" + exec "hi Statement guifg=".s:guiaccent5 + exec "hi Statement ctermfg=".s:ctermaccent5 + exec "hi PreProc guifg=".s:guiaccent6 + exec "hi PreProc ctermfg=".s:ctermaccent6 + exec "hi Type guifg=".s:guiaccent7 + exec "hi Type ctermfg=".s:ctermaccent7 + exec "hi Special guifg=".s:guiaccent4 + exec "hi Special ctermfg=".s:ctermaccent4 + exec "hi Underlined guifg=".s:guiaccent5 + exec "hi Underlined ctermfg=".s:ctermaccent5 + exec "hi Error guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Error ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Todo guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Todo ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Function guifg=".s:guiaccent1 + exec "hi Function ctermfg=".s:ctermaccent1 + + " GitGutter + + exec "hi GitGutterAdd guifg=".s:guiaccent3 + exec "hi GitGutterAdd ctermfg=".s:ctermaccent3 + exec "hi GitGutterChange guifg=".s:guiaccent2 + exec "hi GitGutterChange ctermfg=".s:ctermaccent2 + exec "hi GitGutterChangeDelete guifg=".s:guiaccent2 + exec "hi GitGutterChangeDelete ctermfg=".s:ctermaccent2 + exec "hi GitGutterDelete guifg=".s:guiaccent0 + exec "hi GitGutterDelete ctermfg=".s:ctermaccent0 + + " fugitive + + exec "hi gitcommitComment guifg=".s:guishade3 + exec "hi gitcommitComment ctermfg=".s:ctermshade3 + exec "hi gitcommitOnBranch guifg=".s:guishade3 + exec "hi gitcommitOnBranch ctermfg=".s:ctermshade3 + exec "hi gitcommitHeader guifg=".s:guishade5 + exec "hi gitcommitHeader ctermfg=".s:ctermshade5 + exec "hi gitcommitHead guifg=".s:guishade3 + exec "hi gitcommitHead ctermfg=".s:ctermshade3 + exec "hi gitcommitSelectedType guifg=".s:guiaccent3 + exec "hi gitcommitSelectedType ctermfg=".s:ctermaccent3 + exec "hi gitcommitSelectedFile guifg=".s:guiaccent3 + exec "hi gitcommitSelectedFile ctermfg=".s:ctermaccent3 + exec "hi gitcommitDiscardedType guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedType ctermfg=".s:ctermaccent2 + exec "hi gitcommitDiscardedFile guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedFile ctermfg=".s:ctermaccent2 + exec "hi gitcommitUntrackedFile guifg=".s:guiaccent0 + exec "hi gitcommitUntrackedFile ctermfg=".s:ctermaccent0 + + """"""""""""""""""""""" + " Highlighting Groups " + """"""""""""""""""""""" + + " Default + + exec "hi ColorColumn guibg=".s:guishade1 + exec "hi ColorColumn ctermbg=".s:ctermshade1 + exec "hi Conceal guifg=".s:guishade2 + exec "hi Conceal ctermfg=".s:ctermshade2 + exec "hi Cursor guifg=".s:guishade0 + exec "hi Cursor ctermfg=".s:ctermshade0 + exec "hi CursorColumn guibg=".s:guishade1 + exec "hi CursorColumn ctermbg=".s:ctermshade1 + exec "hi CursorLine guibg=".s:guishade1 + exec "hi CursorLine ctermbg=".s:ctermshade1." cterm=none" + exec "hi Directory guifg=".s:guiaccent5 + exec "hi Directory ctermfg=".s:ctermaccent5 + exec "hi DiffAdd guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi DiffAdd ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi DiffChange guifg=".s:guiaccent2." guibg=".s:guishade1 + exec "hi DiffChange ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade1 + exec "hi DiffDelete guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi DiffDelete ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi DiffText guifg=".s:guiaccent2." guibg=".s:guishade2 + exec "hi DiffText ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade2 + exec "hi ErrorMsg guifg=".s:guishade7." guibg=".s:guiaccent0 + exec "hi ErrorMsg ctermfg=".s:ctermshade7." ctermbg=".s:ctermaccent0 + exec "hi VertSplit guifg=".s:guishade0." guibg=".s:guishade3 + exec "hi VertSplit ctermfg=".s:ctermshade0." ctermbg=".s:ctermshade3 + exec "hi Folded guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi Folded ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi FoldColumn guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi FoldColumn ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi SignColumn guibg=none" + exec "hi SignColumn ctermbg=none" + exec "hi IncSearch guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi IncSearch ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi LineNr guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi LineNr ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi CursorLineNr guifg=".s:guishade3." guibg=".s:guishade1 + exec "hi CursorLineNr ctermfg=".s:ctermshade3." ctermbg=".s:ctermshade1 + exec "hi MatchParen guibg=".s:guishade2 + exec "hi MatchParen ctermbg=".s:ctermshade2 + exec "hi MoreMsg guifg=".s:guishade0." guibg=".s:guiaccent4 + exec "hi MoreMsg ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent4 + exec "hi NonText guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi NonText ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi Pmenu guifg=".s:guishade6." guibg=".s:guishade1 + exec "hi Pmenu ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade1 + exec "hi PmenuSel guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi PmenuSel ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + exec "hi PmenuSbar guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi PmenuSbar ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi PmenuThumb guifg=".s:guiaccent0." guibg=".s:guishade2 + exec "hi PmenuThumb ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade2 + exec "hi Question guifg=".s:guishade7." guibg=".s:guishade1 + exec "hi Question ctermfg=".s:ctermshade7." ctermbg=".s:ctermshade1 + exec "hi Search guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi Search ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi SpecialKey guifg=".s:guiaccent7." guibg=".s:guishade0 + exec "hi SpecialKey ctermfg=".s:ctermaccent7." ctermbg=".s:ctermshade0 + exec "hi SpellBad guifg=".s:guiaccent0 + exec "hi SpellBad ctermfg=".s:ctermaccent0." ctermbg=NONE cterm=undercurl" + exec "hi SpellCap guifg=".s:guiaccent2 + exec "hi SpellCap ctermfg=".s:ctermaccent2." ctermbg=NONE cterm=undercurl" + exec "hi SpellLocal guifg=".s:guiaccent4 + exec "hi SpellLocal ctermfg=".s:ctermaccent4 + exec "hi SpellRare guifg=".s:guiaccent1 + exec "hi SpellRare ctermfg=".s:ctermaccent1 + exec "hi StatusLine guifg=".s:guishade4." guibg=".s:guishade1." gui=none" + exec "hi StatusLine ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1." cterm=none" + exec "hi TabLine guifg=".s:guishade5." guibg=".s:guishade1 + exec "hi TabLine ctermfg=".s:ctermshade5." ctermbg=".s:ctermshade1 + exec "hi TabLineFill guibg=".s:guishade1 + exec "hi TabLineFill ctermbg=".s:ctermshade1 + exec "hi TabLineSel guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi TabLineSel ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + exec "hi Title guifg=".s:guiaccent5 + exec "hi Title ctermfg=".s:ctermaccent5 + exec "hi Visual guibg=".s:guishade1 + exec "hi Visual ctermbg=".s:ctermshade1 + exec "hi VisualNOS guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi VisualNOS ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi WarningMsg guifg=".s:guiaccent0 + exec "hi WarningMsg ctermfg=".s:ctermaccent0 + exec "hi WildMenu guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi WildMenu ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + + " NERDTree + + exec "hi NERDTreeExecFile guifg=".s:guiaccent4 + exec "hi NERDTreeExecFile ctermfg=".s:ctermaccent4 + exec "hi NERDTreeDirSlash guifg=".s:guiaccent5 + exec "hi NERDTreeDirSlash ctermfg=".s:ctermaccent5 + exec "hi NERDTreeCWD guifg=".s:guiaccent0 + exec "hi NERDTreeCWD ctermfg=".s:ctermaccent0 + + """""""""""" + " Clean up " + """""""""""" + + unlet s:guishade0 s:guishade1 s:guishade2 s:guishade3 s:guishade4 s:guishade5 s:guishade6 s:guishade7 s:guiaccent0 s:guiaccent1 s:guiaccent2 s:guiaccent3 s:guiaccent4 s:guiaccent5 s:guiaccent6 s:guiaccent7 + unlet s:ctermshade0 s:ctermshade1 s:ctermshade2 s:ctermshade3 s:ctermshade4 s:ctermshade5 s:ctermshade6 s:ctermshade7 s:ctermaccent0 s:ctermaccent1 s:ctermaccent2 s:ctermaccent3 s:ctermaccent4 s:ctermaccent5 s:ctermaccent6 s:ctermaccent7 diff --git a/.config/nvim/colors/tech49.vim b/.config/nvim/colors/tech49.vim new file mode 100644 index 0000000..77294f4 --- /dev/null +++ b/.config/nvim/colors/tech49.vim @@ -0,0 +1,159 @@ +" Vim color file +" Converted from Textmate theme Tech49 using Coloration v0.3.3 (http://github.com/sickill/coloration) + +set background=dark +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "Tech49" + +hi Cursor ctermfg=0 ctermbg=NONE cterm=NONE guifg=#000000 guibg=NONE gui=NONE +hi Visual ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi CursorLine ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi CursorColumn ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi ColorColumn ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi LineNr ctermfg=59 ctermbg=NONE cterm=NONE guifg=#566766 guibg=NONE gui=NONE +hi VertSplit ctermfg=59 ctermbg=NONE cterm=NONE guifg=#323c3b guibg=NONE gui=NONE +hi MatchParen ctermfg=187 ctermbg=NONE cterm=underline guifg=#d1dbaf guibg=NONE gui=underline +hi StatusLine ctermfg=152 ctermbg=NONE cterm=bold guifg=#accecb guibg=NONE gui=bold +hi StatusLineNC ctermfg=152 ctermbg=NONE cterm=NONE guifg=#accecb guibg=NONE gui=NONE +hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#000000 guibg=NONE gui=NONE +hi PmenuSel ctermfg=0 ctermbg=NONE cterm=NONE guifg=#accecb guibg=NONE gui=NONE +hi IncSearch ctermfg=0 ctermbg=NONE cterm=NONE guifg=#000000 guibg=NONE gui=NONE +hi Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline +hi Directory ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi Folded ctermfg=59 ctermbg=NONE cterm=NONE guifg=#3f5459 guibg=NONE gui=NONE + +hi SpellBad ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=underline +hi Normal ctermfg=152 ctermbg=NONE cterm=NONE guifg=#accecb guibg=NONE gui=NONE +hi Boolean ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi Character ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi Comment ctermfg=59 ctermbg=NONE cterm=NONE guifg=#3f5459 guibg=NONE gui=NONE +hi Conditional ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi Define ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi DiffAdd ctermfg=152 ctermbg=NONE cterm=bold guifg=#accecb guibg=NONE gui=bold +hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#830000 guibg=NONE gui=NONE +hi DiffChange ctermfg=152 ctermbg=NONE cterm=NONE guifg=#accecb guibg=NONE gui=NONE +hi DiffText ctermfg=152 ctermbg=NONE cterm=bold guifg=#accecb guibg=NONE gui=bold +hi ErrorMsg ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8a291b guibg=NONE gui=NONE +hi WarningMsg ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8a291b guibg=NONE gui=NONE +hi Float ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi Function ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi Identifier ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi Keyword ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi Label ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi NonText ctermfg=23 ctermbg=NONE cterm=NONE guifg=#2d3a3c guibg=NONE gui=NONE +hi Number ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi Operator ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi PreProc ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi Special ctermfg=152 ctermbg=NONE cterm=NONE guifg=#accecb guibg=NONE gui=NONE +hi SpecialKey ctermfg=23 ctermbg=NONE cterm=NONE guifg=#2d3a3c guibg=NONE gui=NONE +hi Statement ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi StorageClass ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi String ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi Tag ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi Title ctermfg=152 ctermbg=NONE cterm=bold guifg=#accecb guibg=NONE gui=bold +hi Todo ctermfg=59 ctermbg=NONE cterm=inverse,bold guifg=#3f5459 guibg=NONE gui=inverse,bold +hi Type ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline + +hi rubyClass ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi rubyFunction ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubySymbol ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi rubyConstant ctermfg=195 ctermbg=NONE cterm=bold guifg=#d9fefd guibg=NONE gui=bold +hi rubyStringDelimiter ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi rubyBlockParameter ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi rubyInstanceVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyInclude ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyGlobalVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyRegexp ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyRegexpDelimiter ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyEscape ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi rubyControl ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi rubyClassVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyOperator ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyException ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyPseudoVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi rubyRailsUserClass ctermfg=195 ctermbg=NONE cterm=bold guifg=#d9fefd guibg=NONE gui=bold +hi rubyRailsARAssociationMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyRailsARMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyRailsRenderMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi rubyRailsMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE + +hi erubyDelimiter ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi erubyComment ctermfg=59 ctermbg=NONE cterm=NONE guifg=#3f5459 guibg=NONE gui=NONE +hi erubyRailsMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE + +hi htmlTag ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi htmlEndTag ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi htmlTagName ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi htmlArg ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi htmlSpecialChar ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE + +hi javaScriptFunction ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi javaScriptRailsFunction ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE + +hi yamlKey ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi yamlAnchor ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi yamlAlias ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi yamlDocumentHeader ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE + +hi cssURL ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi cssFunctionName ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi cssColor ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi cssPseudoClassId ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi cssClassName ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi cssValueLength ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi cssCommonAttr ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE + +hi pythonClass ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi pythonFunction ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi pythonSymbol ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi pythonConstant ctermfg=195 ctermbg=NONE cterm=bold guifg=#d9fefd guibg=NONE gui=bold +hi pythonStringDelimiter ctermfg=144 ctermbg=NONE cterm=NONE guifg=#9ea485 guibg=NONE gui=NONE +hi pythonBlockParameter ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi pythonInstanceVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonInclude ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonGlobalVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonBuiltin ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonRegexp ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonRegexpDelimiter ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonEscape ctermfg=209 ctermbg=NONE cterm=NONE guifg=#ff815c guibg=NONE gui=NONE +hi pythonControl ctermfg=187 ctermbg=NONE cterm=NONE guifg=#d1dbaf guibg=NONE gui=NONE +hi pythonClassVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonOperator ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonException ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonPseudoVariable ctermfg=230 ctermbg=NONE cterm=NONE guifg=#fefedb guibg=NONE gui=NONE +hi pythonRailsUserClass ctermfg=195 ctermbg=NONE cterm=bold guifg=#d9fefd guibg=NONE gui=bold +hi pythonRailsARAssociationMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonRailsARMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonRailsRenderMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE +hi pythonRailsMethod ctermfg=116 ctermbg=NONE cterm=NONE guifg=#78cfde guibg=NONE gui=NONE + + +hi DiffAdd guifg=black guibg=NONE gui=NONE +hi DiffChange guifg=black guibg=NONE gui=NONE +hi DiffDelete guifg=black guibg=NONE gui=NONE +hi DiffText guifg=black guibg=NONE gui=NONE + +hi clear SignifyLineAdd +hi clear SignifyLineChange +hi clear SignifyLineDelete + +hi SignifyLineAdd ctermfg=NONE ctermbg=NONE cterm=NONE guibg=NONE guifg=#c4fefd gui=NONE +hi SignifyLineChange ctermfg=NONE ctermbg=NONE cterm=NONE guibg=NONE guifg=#fcffc7 gui=NONE +hi SignifyLineDelete ctermfg=NONE ctermbg=NONE cterm=NONE guibg=NONE guifg=#ff815a gui=NONE + +hi Pmenu guibg=NONE guifg=#000000 gui=NONE +hi PmenuSel guibg=NONE guifg=#000000 gui=NONE +hi PmenuSBar guibg=NONE guifg=NONE gui=NONE +hi PmenuThumb guibg=NONE guifg=#000000 gui=NONE + diff --git a/.config/nvim/colors/vap0r.vim b/.config/nvim/colors/vap0r.vim new file mode 100644 index 0000000..5299e73 --- /dev/null +++ b/.config/nvim/colors/vap0r.vim @@ -0,0 +1,269 @@ +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ __ __ ________ ______ ______ ______ ║ +" ║ /_/\ /_/\ /_______/\ /_____/\ /_____/\ /_____/\ ║ +" ║ \:\ \\ \ \\::: _ \ \\:::_ \ \\:::_ \ \\:::_ \ \ ║ +" ║ \:\ \\ \ \\::(_) \ \\:(_) \ \\:\ \ \ \\:(_) ) )_ ║ +" ║ \:\_/.:\ \\:: __ \ \\: ___\/ \:\ \ \ \\: __ `\ \ ║ +" ║ \ ..::/ / \:.\ \ \ \\ \ \ \:\_\ \ \\ \ `\ \ \ ║ +" ║ \___/_( \__\/\__\/ \_\/ \_____\/ \_\/ \_\/ ║ +" ║ ║ +" ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +" ║ ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ +" Filename: colors/vap0r.vim + + if &background == 'dark' + + let s:guishade0 = "#000000" + let s:guishade1 = "#383839" + let s:guishade2 = "#454548" + let s:guishade3 = "#67686c" + let s:guishade4 = "#8a8a90" + let s:guishade5 = "#acadb4" + let s:guishade6 = "#cfcfd8" + let s:guishade7 = "#f1f2fc" + let s:guiaccent0 = "#ff7d78" + let s:guiaccent1 = "#feffff" + let s:guiaccent2 = "#ffd478" + let s:guiaccent3 = "#65E0BD" + let s:guiaccent4 = "#75d5ff" + let s:guiaccent5 = "#799eff" + let s:guiaccent6 = "#d783ff" + let s:guiaccent7 = "#ff89d8" + let s:ctermshade0 = 16 + let s:ctermshade1 = 235 + let s:ctermshade2 = 238 + let s:ctermshade3 = 102 + let s:ctermshade4 = 245 + let s:ctermshade5 = 249 + let s:ctermshade6 = 252 + let s:ctermshade7 = 231 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 231 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 122 + let s:ctermaccent4 = 117 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + + if &background == 'light' + + let s:guishade0 = "#f1f2fc" + let s:guishade1 = "#cfcfd8" + let s:guishade2 = "#acadb4" + let s:guishade3 = "#8a8a90" + let s:guishade4 = "#67686c" + let s:guishade5 = "#454548" + let s:guishade6 = "#222324" + let s:guishade7 = "#000000" + let s:guiaccent0 = "#ff7d78" + let s:guiaccent1 = "#000000" + let s:guiaccent2 = "#ffd478" + let s:guiaccent3 = "#62d9b7" + let s:guiaccent4 = "#5da3c0" + let s:guiaccent5 = "#799eff" + let s:guiaccent6 = "#d783ff" + let s:guiaccent7 = "#ff89d8" + let s:ctermshade0 = 231 + let s:ctermshade1 = 252 + let s:ctermshade2 = 249 + let s:ctermshade3 = 245 + let s:ctermshade4 = 102 + let s:ctermshade5 = 238 + let s:ctermshade6 = 235 + let s:ctermshade7 = 16 + let s:ctermaccent0 = 210 + let s:ctermaccent1 = 16 + let s:ctermaccent2 = 222 + let s:ctermaccent3 = 116 + let s:ctermaccent4 = 110 + let s:ctermaccent5 = 111 + let s:ctermaccent6 = 183 + let s:ctermaccent7 = 218 + + endif + + + highlight clear + syntax reset + let g:colors_name = "vap0r" + + """""""""" + " Normal " + """""""""" + + exec "hi Normal guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi Normal ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + + """"""""""""""""" + " Syntax groups " + """"""""""""""""" + + " Default + + exec "hi Comment guifg=".s:guishade2 + exec "hi Comment ctermfg=".s:ctermshade2 + exec "hi Constant guifg=".s:guiaccent3 + exec "hi Constant ctermfg=".s:ctermaccent3 + exec "hi Character guifg=".s:guiaccent4 + exec "hi Character ctermfg=".s:ctermaccent4 + exec "hi Identifier guifg=".s:guiaccent2." gui=none" + exec "hi Identifier ctermfg=".s:ctermaccent2." cterm=none" + exec "hi Statement guifg=".s:guiaccent5 + exec "hi Statement ctermfg=".s:ctermaccent5 + exec "hi PreProc guifg=".s:guiaccent6 + exec "hi PreProc ctermfg=".s:ctermaccent6 + exec "hi Type guifg=".s:guiaccent7 + exec "hi Type ctermfg=".s:ctermaccent7 + exec "hi Special guifg=".s:guiaccent4 + exec "hi Special ctermfg=".s:ctermaccent4 + exec "hi Underlined guifg=".s:guiaccent5 + exec "hi Underlined ctermfg=".s:ctermaccent5 + exec "hi Error guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Error ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Todo guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi Todo ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi Function guifg=".s:guiaccent1 + exec "hi Function ctermfg=".s:ctermaccent1 + + " GitGutter + + exec "hi GitGutterAdd guifg=".s:guiaccent3 + exec "hi GitGutterAdd ctermfg=".s:ctermaccent3 + exec "hi GitGutterChange guifg=".s:guiaccent2 + exec "hi GitGutterChange ctermfg=".s:ctermaccent2 + exec "hi GitGutterChangeDelete guifg=".s:guiaccent2 + exec "hi GitGutterChangeDelete ctermfg=".s:ctermaccent2 + exec "hi GitGutterDelete guifg=".s:guiaccent0 + exec "hi GitGutterDelete ctermfg=".s:ctermaccent0 + + " fugitive + + exec "hi gitcommitComment guifg=".s:guishade3 + exec "hi gitcommitComment ctermfg=".s:ctermshade3 + exec "hi gitcommitOnBranch guifg=".s:guishade3 + exec "hi gitcommitOnBranch ctermfg=".s:ctermshade3 + exec "hi gitcommitHeader guifg=".s:guishade5 + exec "hi gitcommitHeader ctermfg=".s:ctermshade5 + exec "hi gitcommitHead guifg=".s:guishade3 + exec "hi gitcommitHead ctermfg=".s:ctermshade3 + exec "hi gitcommitSelectedType guifg=".s:guiaccent3 + exec "hi gitcommitSelectedType ctermfg=".s:ctermaccent3 + exec "hi gitcommitSelectedFile guifg=".s:guiaccent3 + exec "hi gitcommitSelectedFile ctermfg=".s:ctermaccent3 + exec "hi gitcommitDiscardedType guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedType ctermfg=".s:ctermaccent2 + exec "hi gitcommitDiscardedFile guifg=".s:guiaccent2 + exec "hi gitcommitDiscardedFile ctermfg=".s:ctermaccent2 + exec "hi gitcommitUntrackedFile guifg=".s:guiaccent0 + exec "hi gitcommitUntrackedFile ctermfg=".s:ctermaccent0 + + """"""""""""""""""""""" + " Highlighting Groups " + """"""""""""""""""""""" + + " Default + + exec "hi ColorColumn guibg=".s:guishade1 + exec "hi ColorColumn ctermbg=".s:ctermshade1 + exec "hi Conceal guifg=".s:guishade2 + exec "hi Conceal ctermfg=".s:ctermshade2 + exec "hi Cursor guifg=".s:guishade0 + exec "hi Cursor ctermfg=".s:ctermshade0 + exec "hi CursorColumn guibg=".s:guishade1 + exec "hi CursorColumn ctermbg=".s:ctermshade1 + exec "hi CursorLine guibg=".s:guishade1 + exec "hi CursorLine ctermbg=".s:ctermshade1." cterm=none" + exec "hi Directory guifg=".s:guiaccent5 + exec "hi Directory ctermfg=".s:ctermaccent5 + exec "hi DiffAdd guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi DiffAdd ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi DiffChange guifg=".s:guiaccent2." guibg=".s:guishade1 + exec "hi DiffChange ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade1 + exec "hi DiffDelete guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi DiffDelete ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi DiffText guifg=".s:guiaccent2." guibg=".s:guishade2 + exec "hi DiffText ctermfg=".s:ctermaccent2." ctermbg=".s:ctermshade2 + exec "hi ErrorMsg guifg=".s:guishade7." guibg=".s:guiaccent0 + exec "hi ErrorMsg ctermfg=".s:ctermshade7." ctermbg=".s:ctermaccent0 + exec "hi VertSplit guifg=".s:guishade0." guibg=".s:guishade3 + exec "hi VertSplit ctermfg=".s:ctermshade0." ctermbg=".s:ctermshade3 + exec "hi Folded guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi Folded ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi FoldColumn guifg=".s:guishade4." guibg=".s:guishade1 + exec "hi FoldColumn ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1 + exec "hi SignColumn guibg=none" + exec "hi SignColumn ctermbg=none" + exec "hi IncSearch guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi IncSearch ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi LineNr guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi LineNr ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi CursorLineNr guifg=".s:guishade3." guibg=".s:guishade1 + exec "hi CursorLineNr ctermfg=".s:ctermshade3." ctermbg=".s:ctermshade1 + exec "hi MatchParen guibg=".s:guishade2 + exec "hi MatchParen ctermbg=".s:ctermshade2 + exec "hi MoreMsg guifg=".s:guishade0." guibg=".s:guiaccent4 + exec "hi MoreMsg ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent4 + exec "hi NonText guifg=".s:guishade2." guibg=".s:guishade0 + exec "hi NonText ctermfg=".s:ctermshade2." ctermbg=".s:ctermshade0 + exec "hi Pmenu guifg=".s:guishade6." guibg=".s:guishade1 + exec "hi Pmenu ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade1 + exec "hi PmenuSel guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi PmenuSel ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + exec "hi PmenuSbar guifg=".s:guiaccent3." guibg=".s:guishade1 + exec "hi PmenuSbar ctermfg=".s:ctermaccent3." ctermbg=".s:ctermshade1 + exec "hi PmenuThumb guifg=".s:guiaccent0." guibg=".s:guishade2 + exec "hi PmenuThumb ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade2 + exec "hi Question guifg=".s:guishade7." guibg=".s:guishade1 + exec "hi Question ctermfg=".s:ctermshade7." ctermbg=".s:ctermshade1 + exec "hi Search guifg=".s:guishade0." guibg=".s:guiaccent2 + exec "hi Search ctermfg=".s:ctermshade0." ctermbg=".s:ctermaccent2 + exec "hi SpecialKey guifg=".s:guiaccent7." guibg=".s:guishade0 + exec "hi SpecialKey ctermfg=".s:ctermaccent7." ctermbg=".s:ctermshade0 + exec "hi SpellBad guifg=".s:guiaccent0 + exec "hi SpellBad ctermfg=".s:ctermaccent0." ctermbg=NONE cterm=undercurl" + exec "hi SpellCap guifg=".s:guiaccent2 + exec "hi SpellCap ctermfg=".s:ctermaccent2." ctermbg=NONE cterm=undercurl" + exec "hi SpellLocal guifg=".s:guiaccent4 + exec "hi SpellLocal ctermfg=".s:ctermaccent4 + exec "hi SpellRare guifg=".s:guiaccent1 + exec "hi SpellRare ctermfg=".s:ctermaccent1 + exec "hi StatusLine guifg=".s:guishade4." guibg=".s:guishade1." gui=none" + exec "hi StatusLine ctermfg=".s:ctermshade4." ctermbg=".s:ctermshade1." cterm=none" + exec "hi TabLine guifg=".s:guishade5." guibg=".s:guishade1 + exec "hi TabLine ctermfg=".s:ctermshade5." ctermbg=".s:ctermshade1 + exec "hi TabLineFill guibg=".s:guishade1 + exec "hi TabLineFill ctermbg=".s:ctermshade1 + exec "hi TabLineSel guifg=".s:guishade6." guibg=".s:guishade0 + exec "hi TabLineSel ctermfg=".s:ctermshade6." ctermbg=".s:ctermshade0 + exec "hi Title guifg=".s:guiaccent5 + exec "hi Title ctermfg=".s:ctermaccent5 + exec "hi Visual guibg=".s:guishade1 + exec "hi Visual ctermbg=".s:ctermshade1 + exec "hi VisualNOS guifg=".s:guiaccent0." guibg=".s:guishade1 + exec "hi VisualNOS ctermfg=".s:ctermaccent0." ctermbg=".s:ctermshade1 + exec "hi WarningMsg guifg=".s:guiaccent0 + exec "hi WarningMsg ctermfg=".s:ctermaccent0 + exec "hi WildMenu guifg=".s:guiaccent4." guibg=".s:guishade1 + exec "hi WildMenu ctermfg=".s:ctermaccent4." ctermbg=".s:ctermshade1 + + " NERDTree + + exec "hi NERDTreeExecFile guifg=".s:guiaccent4 + exec "hi NERDTreeExecFile ctermfg=".s:ctermaccent4 + exec "hi NERDTreeDirSlash guifg=".s:guiaccent5 + exec "hi NERDTreeDirSlash ctermfg=".s:ctermaccent5 + exec "hi NERDTreeCWD guifg=".s:guiaccent0 + exec "hi NERDTreeCWD ctermfg=".s:ctermaccent0 + + """""""""""" + " Clean up " + """""""""""" + + unlet s:guishade0 s:guishade1 s:guishade2 s:guishade3 s:guishade4 s:guishade5 s:guishade6 s:guishade7 s:guiaccent0 s:guiaccent1 s:guiaccent2 s:guiaccent3 s:guiaccent4 s:guiaccent5 s:guiaccent6 s:guiaccent7 + unlet s:ctermshade0 s:ctermshade1 s:ctermshade2 s:ctermshade3 s:ctermshade4 s:ctermshade5 s:ctermshade6 s:ctermshade7 s:ctermaccent0 s:ctermaccent1 s:ctermaccent2 s:ctermaccent3 s:ctermaccent4 s:ctermaccent5 s:ctermaccent6 s:ctermaccent7 diff --git a/.config/nvim/colors/wal.vim b/.config/nvim/colors/wal.vim new file mode 100644 index 0000000..6864ab5 --- /dev/null +++ b/.config/nvim/colors/wal.vim @@ -0,0 +1,197 @@ +" wal.vim -- Vim color scheme. +" Author: Dylan Araps +" Webpage: https://github.com/dylanaraps/wal +" Description: A colorscheme that uses your terminal colors, made to work with 'wal'. + +hi clear +set background=dark + +if exists('syntax_on') + syntax reset +endif + +" Colorscheme name +let g:colors_name = 'wal' + +" highlight groups {{{ + +" set t_Co=16 +hi Normal ctermbg=NONE ctermfg=7 +hi NonText ctermbg=NONE ctermfg=0 +hi Comment ctermbg=NONE ctermfg=8 +hi Conceal ctermbg=NONE +hi Constant ctermbg=NONE ctermfg=3 +hi Error ctermbg=1 ctermfg=7 +hi Identifier ctermbg=NONE ctermfg=1 cterm=BOLD +hi Ignore ctermbg=8 ctermfg=0 +hi PreProc ctermbg=NONE ctermfg=3 +hi Special ctermbg=NONE ctermfg=6 +hi Statement ctermbg=NONE ctermfg=1 +hi String ctermbg=NONE ctermfg=2 +hi Number ctermbg=NONE ctermfg=3 +hi Todo ctermbg=2 ctermfg=0 +hi Type ctermbg=NONE ctermfg=3 +hi Underlined ctermbg=NONE ctermfg=1 cterm=underline +hi StatusLine ctermbg=7 ctermfg=0 +hi StatusLineNC ctermbg=8 ctermfg=0 +hi TabLine ctermbg=NONE ctermfg=8 +hi TabLineFill ctermbg=NONE ctermfg=8 +hi TabLineSel ctermbg=4 ctermfg=0 +hi TermCursorNC ctermbg=3 ctermfg=0 +hi VertSplit ctermbg=8 ctermfg=0 +hi Title ctermbg=NONE ctermfg=4 +hi CursorLine ctermbg=2 ctermfg=0 +hi LineNr ctermbg=NONE ctermfg=8 +hi CursorLineNr ctermbg=NONE ctermfg=8 +hi helpLeadBlank ctermbg=NONE ctermfg=7 +hi helpNormal ctermbg=NONE ctermfg=7 +hi Visual ctermbg=0 ctermfg=15 cterm=reverse term=reverse +hi VisualNOS ctermbg=NONE ctermfg=1 +hi Pmenu ctermbg=8 ctermfg=7 +hi PmenuSbar ctermbg=6 ctermfg=7 +hi PmenuSel ctermbg=4 ctermfg=0 +hi PmenuThumb ctermbg=8 ctermfg=8 +hi FoldColumn ctermbg=NONE ctermfg=7 +hi Folded ctermbg=NONE ctermfg=8 +hi WildMenu ctermbg=2 ctermfg=0 +hi SpecialKey ctermbg=NONE ctermfg=8 +hi DiffAdd ctermbg=NONE ctermfg=2 +hi DiffChange ctermbg=NONE ctermfg=8 +hi DiffDelete ctermbg=NONE ctermfg=1 +hi DiffText ctermbg=NONE ctermfg=4 +hi IncSearch ctermbg=3 ctermfg=0 +hi Search ctermbg=3 ctermfg=0 +hi Directory ctermbg=NONE ctermfg=4 +hi MatchParen ctermbg=1 ctermfg=8 +hi ColorColumn ctermbg=4 ctermfg=0 +hi signColumn ctermbg=NONE ctermfg=4 +hi ErrorMsg ctermbg=NONE ctermfg=8 +hi ModeMsg ctermbg=NONE ctermfg=2 +hi MoreMsg ctermbg=NONE ctermfg=2 +hi Question ctermbg=NONE ctermfg=4 +hi WarningMsg ctermbg=1 ctermfg=0 +hi Cursor ctermbg=NONE ctermfg=8 +hi Structure ctermbg=NONE ctermfg=5 +hi CursorColumn ctermbg=8 ctermfg=7 +hi ModeMsg ctermbg=NONE ctermfg=7 +hi SpellBad ctermbg=NONE ctermfg=1 cterm=underline +hi SpellCap ctermbg=NONE ctermfg=4 cterm=underline +hi SpellLocal ctermbg=NONE ctermfg=5 cterm=underline +hi SpellRare ctermbg=NONE ctermfg=6 cterm=underline +hi Boolean ctermbg=NONE ctermfg=5 +hi Character ctermbg=NONE ctermfg=1 +hi Conditional ctermbg=NONE ctermfg=5 +hi Define ctermbg=NONE ctermfg=5 +hi Delimiter ctermbg=NONE ctermfg=5 +hi Float ctermbg=NONE ctermfg=5 +hi Include ctermbg=NONE ctermfg=4 +hi Keyword ctermbg=NONE ctermfg=5 +hi Label ctermbg=NONE ctermfg=3 +hi Operator ctermbg=NONE ctermfg=7 +hi Repeat ctermbg=NONE ctermfg=3 +hi SpecialChar ctermbg=NONE ctermfg=5 +hi Tag ctermbg=NONE ctermfg=3 +hi Typedef ctermbg=NONE ctermfg=3 +hi vimUserCommand ctermbg=NONE ctermfg=1 cterm=BOLD + hi link vimMap vimUserCommand + hi link vimLet vimUserCommand + hi link vimCommand vimUserCommand + hi link vimFTCmd vimUserCommand + hi link vimAutoCmd vimUserCommand + hi link vimNotFunc vimUserCommand +hi vimNotation ctermbg=NONE ctermfg=4 +hi vimMapModKey ctermbg=NONE ctermfg=4 +hi vimBracket ctermbg=NONE ctermfg=7 +hi vimCommentString ctermbg=NONE ctermfg=8 +hi htmlLink ctermbg=NONE ctermfg=1 cterm=underline +hi htmlBold ctermbg=NONE ctermfg=3 cterm=BOLD +hi htmlItalic ctermbg=NONE ctermfg=5 +hi htmlEndTag ctermbg=NONE ctermfg=7 +hi htmlTag ctermbg=NONE ctermfg=7 +hi htmlTagName ctermbg=NONE ctermfg=1 cterm=BOLD +hi htmlH1 ctermbg=NONE ctermfg=7 + hi link htmlH2 htmlH1 + hi link htmlH3 htmlH1 + hi link htmlH4 htmlH1 + hi link htmlH5 htmlH1 + hi link htmlH6 htmlH1 +hi cssMultiColumnAttr ctermbg=NONE ctermfg=2 + hi link cssFontAttr cssMultiColumnAttr + hi link cssFlexibleBoxAttr cssMultiColumnAttr +hi cssBraces ctermbg=NONE ctermfg=7 + hi link cssAttrComma cssBraces +hi cssValueLength ctermbg=NONE ctermfg=7 +hi cssUnitDecorators ctermbg=NONE ctermfg=7 +hi cssValueNumber ctermbg=NONE ctermfg=7 + hi link cssValueLength cssValueNumber +hi cssNoise ctermbg=NONE ctermfg=8 +hi cssTagName ctermbg=NONE ctermfg=1 +hi cssFunctionName ctermbg=NONE ctermfg=4 +hi scssSelectorChar ctermbg=NONE ctermfg=7 +hi scssAttribute ctermbg=NONE ctermfg=7 + hi link scssDefinition cssNoise +hi sassidChar ctermbg=NONE ctermfg=1 +hi sassClassChar ctermbg=NONE ctermfg=5 +hi sassInclude ctermbg=NONE ctermfg=5 +hi sassMixing ctermbg=NONE ctermfg=5 +hi sassMixinName ctermbg=NONE ctermfg=4 +hi javaScript ctermbg=NONE ctermfg=7 +hi javaScriptBraces ctermbg=NONE ctermfg=7 +hi javaScriptNumber ctermbg=NONE ctermfg=5 +hi markdownH1 ctermbg=NONE ctermfg=7 + hi link markdownH2 markdownH1 + hi link markdownH3 markdownH1 + hi link markdownH4 markdownH1 + hi link markdownH5 markdownH1 + hi link markdownH6 markdownH1 +hi markdownAutomaticLink ctermbg=NONE ctermfg=2 cterm=underline + hi link markdownUrl markdownAutomaticLink +hi markdownError ctermbg=NONE ctermfg=7 +hi markdownCode ctermbg=NONE ctermfg=3 +hi markdownCodeBlock ctermbg=NONE ctermfg=3 +hi markdownCodeDelimiter ctermbg=NONE ctermfg=5 +hi markdownItalic cterm=Italic +hi markdownBold cterm=Bold +hi xdefaultsValue ctermbg=NONE ctermfg=7 +hi rubyInclude ctermbg=NONE ctermfg=4 +hi rubyDefine ctermbg=NONE ctermfg=5 +hi rubyFunction ctermbg=NONE ctermfg=4 +hi rubyStringDelimiter ctermbg=NONE ctermfg=2 +hi rubyInteger ctermbg=NONE ctermfg=3 +hi rubyAttribute ctermbg=NONE ctermfg=4 +hi rubyConstant ctermbg=NONE ctermfg=3 +hi rubyInterpolation ctermbg=NONE ctermfg=2 +hi rubyInterpolationDelimiter ctermbg=NONE ctermfg=3 +hi rubyRegexp ctermbg=NONE ctermfg=6 +hi rubySymbol ctermbg=NONE ctermfg=2 +hi rubyTodo ctermbg=NONE ctermfg=8 +hi rubyRegexpAnchor ctermbg=NONE ctermfg=7 + hi link rubyRegexpQuantifier rubyRegexpAnchor +hi pythonOperator ctermbg=NONE ctermfg=5 +hi pythonFunction ctermbg=NONE ctermfg=4 +hi pythonRepeat ctermbg=NONE ctermfg=5 +hi pythonStatement ctermbg=NONE ctermfg=1 cterm=Bold +hi pythonBuiltIn ctermbg=NONE ctermfg=4 +hi phpMemberSelector ctermbg=NONE ctermfg=7 +hi phpComparison ctermbg=NONE ctermfg=7 +hi phpParent ctermbg=NONE ctermfg=7 +hi cOperator ctermbg=NONE ctermfg=6 +hi cPreCondit ctermbg=NONE ctermfg=5 +hi SignifySignAdd ctermbg=NONE ctermfg=2 +hi SignifySignChange ctermbg=NONE ctermfg=4 +hi SignifySignDelete ctermbg=NONE ctermfg=1 +hi NERDTreeDirSlash ctermbg=NONE ctermfg=4 +hi NERDTreeExecFile ctermbg=NONE ctermfg=7 +hi ALEErrorSign ctermbg=NONE ctermfg=1 +hi ALEWarningSign ctermbg=NONE ctermfg=3 +hi ALEError ctermbg=NONE ctermfg=1 +hi ALEWarning ctermbg=NONE ctermfg=3 + +" }}} + +" Plugin options {{{ + +let g:limelight_conceal_ctermfg = 8 + +" }}} + diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..7bd982a --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,1209 @@ +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ ║ +" ║ ██╗ ██╗██╗███╗ ███╗ ║ +" ║ ██║ ██║██║████╗ ████║ ║ +" ║ ██║ ██║██║██╔████╔██║ ║ +" ║ ╚██╗ ██╔╝██║██║╚██╔╝██║ ║ +" ║ ╚████╔╝ ██║██║ ╚═╝ ██║ ║ +" ║ ╚═══╝ ╚═╝╚═╝ ╚═╝ ║ +" ║ ║ +" ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +" ║ ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ +" +" TODO: https://kinbiko.com/posts/2021-08-23-rewriting-vimrc-in-lua/ +" +set nocompatible +filetype off + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Plugs ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +call plug#begin('~/.local/share/nvim/plugged') + +Plug 'editorconfig/editorconfig-vim' + +Plug 'neovim/nvim-lspconfig' +Plug 'onsails/lspkind.nvim' +Plug 'hrsh7th/cmp-nvim-lsp' +Plug 'hrsh7th/cmp-buffer' +Plug 'hrsh7th/cmp-path' +Plug 'hrsh7th/cmp-cmdline' +Plug 'hrsh7th/nvim-cmp' + +Plug 'hrsh7th/cmp-vsnip' +Plug 'hrsh7th/vim-vsnip' + +Plug 'jose-elias-alvarez/null-ls.nvim' + +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + +Plug 'lambdalisue/fern.vim' +Plug 'lambdalisue/nerdfont.vim' +Plug 'lambdalisue/fern-renderer-nerdfont.vim' +Plug 'lambdalisue/fern-git-status.vim' +Plug 'lambdalisue/fern-hijack.vim' +Plug 'lambdalisue/fern-bookmark.vim' +Plug 'lambdalisue/fern-mapping-git.vim' +Plug 'ggandor/leap.nvim' +Plug 'ggandor/lightspeed.nvim' +Plug 'lambdalisue/glyph-palette.vim' +Plug 'numToStr/Comment.nvim' +Plug 'lewis6991/gitsigns.nvim' +Plug 'godlygeek/tabular' +Plug 'junegunn/goyo.vim' +Plug 'Yggdroot/indentLine' +Plug 'mg979/vim-visual-multi', {'branch': 'master'} +Plug 'itchyny/lightline.vim' +Plug 'wfxr/minimap.vim' +Plug 'jamessan/vim-gnupg' +Plug 'glepnir/dashboard-nvim' +Plug 'robertbasic/vim-hugo-helper' +Plug 'windwp/nvim-autopairs' +Plug 'tpope/vim-abolish' +Plug 'lervag/wiki.vim' +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'simnalamburt/vim-mundo' +Plug 'kyazdani42/nvim-web-devicons' +" Plug 'folke/trouble.nvim' +Plug 'mhartington/formatter.nvim' +Plug 'folke/which-key.nvim' +" Plug 'RRethy/nvim-base16' +" Plug 'danilamihailov/beacon.nvim' + +" Syntax / Language integrations +"Plug 'plasticboy/vim-markdown' +Plug 'leafgarland/typescript-vim' +Plug 'elixir-lang/vim-elixir' +Plug 'fatih/vim-go' +Plug 'rust-lang/rust.vim' +Plug 'cespare/vim-toml', {'branch': 'main'} +Plug 'moll/vim-node' +Plug 'docker/docker' +Plug 'evanleck/vim-svelte', {'branch': 'main'} +Plug 'vim-scripts/dbext.vim' +Plug 'ledger/vim-ledger' +Plug 'chrisbra/Colorizer' + +call plug#end() + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Configuration ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +filetype plugin indent on +filetype plugin on + +if has('autocmd') + filetype plugin indent on +endif +if has('syntax') && !exists('g:syntax_on') + syntax enable +endif + +" Jeez, who even wants that ... +set mouse= + +set clipboard=unnamed,unnamedplus + +set encoding=utf-8 +set autoindent +set number +set backspace=indent,eol,start +set showmatch +set showmode +set smarttab +set complete-=i +set nrformats-=octal +set shiftround +set ttimeout +set ttimeoutlen=50 +set timeoutlen=500 + +set incsearch + +set laststatus=2 +set ruler +set showcmd +set wildmenu + +set autoread + +" 2 spaces tab, expand tabs to spaces +set tabstop=2 shiftwidth=2 expandtab + +"set listchars=tab:▒░,trail:▓ +set listchars=tab:⇥\ ,trail:˽,extends:→ + +set list + +set number relativenumber +" set number + +set hlsearch + +" highlight the current line +set cursorline + +" ignore case when searching ... +set ignorecase + +" ... unless the search contains mixed case, then don't ignore +set smartcase + +" begin scrolling x lines before bottom +set scrolloff=10 + +set hidden + +set nobackup +set nowritebackup +set noswapfile +set fileformats=unix,dos,mac +set completeopt=menu,menuone,noselect +set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,**/node_modules/** + +"set spelllang=en,ro,es,fr,de,cjk +set spelllang=en,es,de +set spellsuggest=best,9 + +if exists("+colorcolumn") + set colorcolumn=80 +endif + +if maparg('', 'n') ==# '' + nnoremap :nohlsearch +endif + +inoremap u + +noremap :update +vnoremap :update +inoremap :update + +"inoremap + +"map / + +vnoremap > +vnoremap < + +"nnoremap >0 +"nnoremap <0 + +vmap gc + +vmap S + +vmap d +vmap p +vmap y + +"nnoremap d "_d +"vnoremap d "_d + +nnoremap :Files + +nnoremap :undo +inoremap :undo +nnoremap :redo +inoremap :redo + +inoremap V + +inoremap ggVG +inoremap o + +nnoremap :tabprevious +inoremap :tabpreviousi +nnoremap :tabnext +inoremap :tabnexti +nnoremap :tabnew +inoremap :tabnewi +nnoremap :tabclose +inoremap :tabclosei + +nnoremap :tabn 1 +inoremap :tabn 1i +nnoremap :tabn 2 +inoremap :tabn 2i +nnoremap :tabn 3 +inoremap :tabn 3i +nnoremap :tabn 4 +inoremap :tabn 4i +nnoremap :tabn 5 +inoremap :tabn 5i +nnoremap :tabn 6 +inoremap :tabn 6i +nnoremap :tabn 7 +inoremap :tabn 7i +nnoremap :tabn 8 +inoremap :tabn 8i +nnoremap :tabn 9 +inoremap :tabn 9i +nnoremap :tabn 10 +inoremap :tabn 10i + +map \ : +let mapleader = ',' + +nnoremap p :set paste +nnoremap o :set nopaste + +" Double press Ctrl+q to force quit, discarding changes +noremap :qa! +inoremap :qa! + +" Single press Ctrl+q to quit, get notified of changes +noremap :qa +inoremap :qa + +" Reformat current paragraph +noremap ` gq} +" Reformat everything to EOF +noremap ~ gqG +" Auto formatting per syntax +nnoremap fj :%!python -m json.tool + +let g:VM_maps = {} +let g:VM_maps['Find Under'] = '' +let g:VM_maps['Find Subword Under'] = '' +let g:VM_maps["Select Cursor Down"] = '' +let g:VM_maps["Select Cursor Up"] = '' + +let g:tcomment#replacements_xml={} +let g:vim_markdown_folding_disabled = 1 + +" save window position on exit +autocmd BufWinLeave + \ *.* mkview + +" restore window position +autocmd BufWinEnter + \ *.* silent! loadview + +" set markdown filetype +autocmd BufRead,BufNewFile + \ *.md set filetype=markdown + +" set textwidth=80 for types and enable spell +autocmd BufRead,BufNewFile + \ *.{md,txt} + \ setlocal tw=80 | + \ setlocal colorcolumn=80 | + \ setlocal fo=awqtc | + \ setlocal comments+=nb:> | + \ setlocal spell + +" set json filetyep +autocmd BufRead,BufNewFile + \ .{jscs,jshint,eslint}rc set filetype=json + +" set sh filetype +autocmd BufRead,BufNewFile + \ aliases.local,zshrc.local,.zshrc,*/zsh/configs/* set filetype=sh + +" set gitconfig filetyep +autocmd BufRead,BufNewFile + \ gitconfig.local,.gitconfig set filetype=gitconfig + +" set tmux filetype +autocmd BufRead,BufNewFile + \ tmux.conf.local,tmux.conf,.tmux.conf set filetype=tmux + +" set vim filetype +autocmd BufRead,BufNewFile + \ vimrc.local,.vimrc,init.vim set filetype=vim + +" set neomutt settings +autocmd BufRead,BufNewFile + \ {neomutt-*,*.eml} + \ setlocal tw=72 | + \ setlocal colorcolumn=72 | + \ setlocal fo=awq | + \ setlocal comments+=nb:> | + \ setlocal spell | + \ match ErrorMsg '\s\+$' + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Theme ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +if has('termguicolors') + set termguicolors +endif +if (has('nvim')) + let $NVIM_TUI_ENABLE_TRUE_COLOR = 1 +endif +set t_Co=256 + +colorscheme iceberg +" lua << EOF +" require('base16-colorscheme').setup({ +" base00 = '#161616', +" base01 = '#262626', +" base02 = '#393939', +" base03 = '#525252', +" base04 = '#6F6F6F', +" base05 = '#FAFAFA', +" base06 = '#FAFAFA', +" base07 = '#FFFFFF', +" base08 = '#be95ff', +" base09 = '#3ddbd9', +" base0A = '#0043ce', +" base0B = '#33b1ff', +" base0C = '#ff7eb6', +" base0D = '#42be65', +" base0E = '#be95ff', +" base0F = '#3ddbd9', +" }) +" EOF + +" OVERRIDES +highlight Normal ctermbg=none guibg=none +highlight NonText ctermbg=none guibg=none +highlight ColorColumn cterm=reverse ctermbg=238 ctermfg=233 + \ gui=reverse guibg=#3e445e guifg=#0f1117 +highlight EndOfBuffer ctermbg=none guibg=none +highlight LineNr ctermbg=none guibg=none + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ indentLine ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:indentLine_enabled = 1 +let g:indentLine_char = '⋮' +let g:indentLine_first_char = '⋮' +let g:indentLine_showFirstIndentLevel = 1 +let g:indentLine_setColors = 1 +let g:indentLine_setConceal = 0 +let g:indentLine_fileTypeExclude = ['dashboard'] + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Neovide ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +if exists("g:neovide") + set mouse=a + set guifont=FiraCode\ Nerd\ Font:h10 + let g:neovide_cursor_antialiasing=v:true + ""let g:neovide_fullscreen=v:true + let g:neovide_refresh_rate=60 + let g:neovide_refresh_rate_idle=5 + "let g:neovide_keyboard_layout="qwerty" + let g:neovide_keyboard_layout="qwertz" + let g:neovide_cursor_animation_length=0.01 + " let g:neovide_cursor_animation_length=0.05 + let g:neovide_cursor_trail_length=0.2 + let g:neovide_transparency=0.9 +endif + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Lightline ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:lightline = { + \ 'colorscheme': 'iceberg', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename', 'gitsign', 'modified' ] ], + \ 'right': [ + \ [ 'lineinfo' ], [ 'percent' ], + \ [ 'indent', 'textwidth', 'fileformat', + \ 'fileencoding', 'filetype', 'branch' ] + \ ] + \ }, + \ 'component': { + \ 'indent': '%{&expandtab?"spaces":"tabs"}:%{&expandtab?&shiftwidth:&tabstop}', + \ 'textwidth': '%{&textwidth}', + \ 'gitsign': '%{get(b:,"gitsigns_status","")}', + \ 'branch': '%{get(b:,"gitsigns_head","")}', + \ }, + \ } +set noshowmode + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Fern ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +" fern-renderer-nerdfont +let g:fern#renderer = "nerdfont" + +" fern-git-status +" Disable listing ignored files/directories +let g:fern_git_status#disable_ignored = 0 +" Disable listing untracked files +let g:fern_git_status#disable_untracked = 0 +" Disable listing status of submodules +let g:fern_git_status#disable_submodules = 0 +" Disable listing status of directories +let g:fern_git_status#disable_directories = 0 + +" glyph-palette +augroup my-glyph-palette + autocmd! * + autocmd FileType fern call glyph_palette#apply() + autocmd FileType nerdtree,startify call glyph_palette#apply() +augroup END + +let g:fern#disable_default_mappings = 0 +let g:fern#disable_drawer_smart_quit = 0 + +noremap :Fern . -drawer -width=35 -toggle +noremap d :Fern . -drawer -width=35 -toggle +"noremap f :Fern . -drawer -reveal=% -width=35 +noremap . :Fern %:h -drawer -width=35 + +noremap :Fern bookmark:/// -drawer -width=35 -toggle +noremap b :Fern bookmark:/// -drawer -width=35 -toggle + +function! FernInit() abort + nmap + \ (fern-my-open-expand-collapse) + \ fern#smart#leaf( + \ "\(fern-action-open:select)", + \ "\(fern-action-expand)", + \ "\(fern-action-collapse)", + \ ) + nmap (fern-my-open-expand-collapse) + "nmap <2-LeftMouse> (fern-my-open-expand-collapse) + nmap m (fern-action-mark:toggle)j + nmap N (fern-action-new-file) + nmap K (fern-action-new-dir) + nmap D (fern-action-remove) + nmap V (fern-action-move) + nmap R (fern-action-rename) + nmap s (fern-action-open:split) + nmap v (fern-action-open:vsplit) + nmap r (fern-action-reload) + nmap d (fern-action-hidden:toggle) + nmap < (fern-action-leave) + nmap > (fern-action-enter) +endfunction + +augroup FernEvents + autocmd! + autocmd FileType fern call FernInit() +augroup END + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ EditorConfig ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] +let g:EditorConfig_max_line_indicator = "line" +au FileType gitcommit let b:EditorConfig_disable = 1 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ GitSigns ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua < f :Format + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ rust.vim ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:rust_clip_command = 'wl-copy' + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ cmp ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua <'] = (function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end), + [''] = (function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + }, { + { name = 'buffer' }, + }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol', + maxwidth = 50, + }) + } + }) + + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, + }, { + { name = 'buffer' }, + }) + }) + + cmp.setup.filetype('markdown', { + enabled = false + }) + + -- Use buffer source for `/` (if enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline('/', { + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + + cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) + + local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) + + require('lspconfig')['gopls'].setup { + capabilities = capabilities + } + require('lspconfig')['clangd'].setup { + capabilities = capabilities + } + require('lspconfig')['denols'].setup { + capabilities = capabilities + } + require('lspconfig')['elixirls'].setup { + capabilities = capabilities; + cmd = { "/home/mrus/projects/github/elixir-ls/release/language_server.sh" }; + } + require('lspconfig')['pylsp'].setup { + capabilities = capabilities + } + require('lspconfig')['rust_analyzer'].setup { + capabilities = capabilities + } + require('lspconfig')['rls'].setup { + capabilities = capabilities + } + require('lspconfig')['sorbet'].setup { + capabilities = capabilities; + cmd = { "bundle", "exec", "srb", "tc", "--lsp" }; + } + require('lspconfig')['sqls'].setup { + capabilities = capabilities + } + require('lspconfig')['terraformls'].setup { + capabilities = capabilities + } + require('lspconfig')['tflint'].setup { + capabilities = capabilities + } + require('lspconfig')['bashls'].setup { + capabilities = capabilities + } + require('lspconfig')['cssls'].setup { + capabilities = capabilities + } + require('lspconfig')['dockerls'].setup { + capabilities = capabilities + } + require('lspconfig')['graphql'].setup { + capabilities = capabilities + } + require('lspconfig')['html'].setup { + capabilities = capabilities + } + require('lspconfig')['jsonls'].setup { + capabilities = capabilities + } + require('lspconfig')['stylelint_lsp'].setup { + capabilities = capabilities + } + require('lspconfig')['svelte'].setup { + capabilities = capabilities + } + require('lspconfig')['tsserver'].setup { + capabilities = capabilities + } + require('lspconfig')['vimls'].setup { + capabilities = capabilities + } + require('lspconfig')['yamlls'].setup { + capabilities = capabilities + } + require('lspconfig')['zls'].setup { + capabilities = capabilities; + cmd = { "/home/mrus/projects/github/zls/zig-out/bin/zls" }; + } +EOF + +highlight link CompeDocumentation NormalFloat +highlight link CmpDocumentation NormalFloat + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ null-ls ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua << EOF +require("null-ls").setup({ + sources = { + require("null-ls").builtins.diagnostics.vale, + }, +}) +EOF + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Treesitter ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua << EOF +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { + "bash", + "c", + "cmake", + "comment", + "cpp", + "css", + "dockerfile", + "eex", + "elixir", + "erlang", + "go", + "gomod", + "graphql", + "haskell", + "hcl", + "html", + "http", + "javascript", + "json", + "lua", + "make", + "markdown", + "nix", + "regex", + "ruby", + "rust", + "scss", + "svelte", + "toml", + "typescript", + "vim", + "yaml", + "zig" + }, + + sync_install = false, + ignore_install = {}, + + highlight = { + enable = true, + disable = {}, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, +} +EOF + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Leap ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ +" Conflicts with a lot of mappings (e.g. x), needs further investigation +" lua require('leap').add_default_mappings() + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Telescope ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +nnoremap lua require('telescope.builtin').find_files() +nnoremap lua require('telescope.builtin').live_grep() +nnoremap fb lua require('telescope.builtin').buffers() +nnoremap fh lua require('telescope.builtin').help_tags() +nnoremap lr lua require('telescope.builtin').lsp_references() + +nnoremap lua require('telescope.builtin').fd() +inoremap lua require('telescope.builtin').fd() + +" nnoremap Telescope find_files +" nnoremap Telescope live_grep +" nnoremap fb Telescope buffers +" nnoremap fh Telescope help_tags +" nnoremap lr Telescope lsp_references +" +" nnoremap Telescope fd +" inoremap Telescope fd + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Minimap ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:minimap_width = 10 +let g:minimap_auto_start = 0 +let g:minimap_auto_start_win_enter = 0 +let g:minimap_block_filetypes = ['fern', 'fugitive', 'nerdtree', 'tagbar' ] +let g:minimap_block_buftypes = [ +\'fern', 'nofile', 'nowrite', 'quickfix', 'terminal', 'prompt' +\] +let g:minimap_highlight_search = 1 +let g:minimap_highlight_range = 1 +let g:minimap_git_colors = 1 + +noremap :MinimapToggle:MinimapRescan:MinimapRefresh + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ lexima ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:lexima_enable_basic_rules = 1 +let g:lexima_enable_newline_rules = 1 +let g:lexima_enable_endwise_rules = 1 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Mundo ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +nnoremap :MundoToggle + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ GPG ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +autocmd User GnuPG setl textwidth=72 +let g:GPGFilePattern = '*.\(gpg\|asc\|pgp\)\(.wiki\|.md\)\=' + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Dashboard ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua << EOF +local home = os.getenv('HOME') + local db = require('dashboard') + db.preview_command = '/bin/cat' + db.preview_file_path = home .. '/.config/nvim/motd' + db.preview_file_width = 76 + db.preview_file_height = 32 + db.custom_center = { + { + icon = ' ', + desc = 'New file', + shortcut = 'SPC n f', + action = 'enew' + }, + { + icon = ' ', + desc = 'Recently opened files ', + action = 'DashboardFindHistory', + shortcut = 'SPC f h' + }, + { + icon = ' ', + desc = 'Find File ', + action = 'Telescope find_files find_command=rg,--hidden,--files', + shortcut = 'SPC f f' + }, + { + icon = ' ', + desc ='File Browser ', + action = 'Telescope file_browser', + shortcut = 'SPC f b' + }, + { + icon = ' ', + desc = 'Find word ', + aciton = 'DashboardFindWord', + shortcut = 'SPC f w' + }, + } + db.custom_footer = nil +EOF + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ trouble.vim ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +"lua << EOF +" require("trouble").setup { +" position = "bottom", -- position of the list can be: bottom, top, left, right +" height = 10, -- height of the trouble list when position is top or bottom +" width = 50, -- width of the list when position is left or right +" icons = true, -- use devicons for filenames +" mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" +" fold_open = "", -- icon used for open folds +" fold_closed = "", -- icon used for closed folds +" group = true, -- group results by file +" padding = true, -- add an extra new line on top of the list +" action_keys = { -- key mappings for actions in the trouble list +" -- map to {} to remove a mapping, for example: +" -- close = {}, +" close = "q", -- close the list +" cancel = "", -- cancel the preview and get back to your last window / buffer / cursor +" refresh = "r", -- manually refresh +" jump = {"", ""}, -- jump to the diagnostic or open / close folds +" open_split = { "" }, -- open buffer in new split +" open_vsplit = { "" }, -- open buffer in new vsplit +" open_tab = { "" }, -- open buffer in new tab +" jump_close = {"o"}, -- jump to the diagnostic and close the list +" toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode +" toggle_preview = "P", -- toggle auto_preview +" hover = "K", -- opens a small popup with the full multiline message +" preview = "p", -- preview the diagnostic location +" close_folds = {"zM", "zm"}, -- close all folds +" open_folds = {"zR", "zr"}, -- open all folds +" toggle_fold = {"zA", "za"}, -- toggle fold of current file +" previous = "k", -- preview item +" next = "j" -- next item +" }, +" indent_lines = true, -- add an indent guide below the fold icons +" auto_open = true, -- automatically open the list when you have diagnostics +" auto_close = false, -- automatically close the list when you have no diagnostics +" auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window +" auto_fold = false, -- automatically fold a file trouble list at creation +" auto_jump = {"lsp_definitions"}, -- for the given modes, automatically jump if there is only a single result +" signs = { +" -- icons / text used for a diagnostic +" error = "", +" warning = "", +" hint = "", +" information = "", +" other = "﫠" +" }, +" use_diagnostic_signs = true -- enabling this will use the signs defined in your lsp client +" } +"EOF + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ HugoHelper ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:hugohelper_update_lastmod_on_write = 1 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Wiki.vim ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:wiki_root = '~/cloud/notes' +let g:wiki_filetypes = ['md'] +let g:wiki_link_extension = '.md' +let g:wiki_link_target_type = 'md' + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ vim-go ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +" let g:go_fmt_autosave=0 +" let g:go_mod_fmt_autosave=0 +" let g:go_imports_autosave = 0 +" let g:go_asmfmt_autosave=0 +" let g:go_def_mapping_enabled = 0 +" au FileType go map (go-build) + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Svelte ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:svelte_indent_script = 0 +let g:svelte_indent_style = 0 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Typescript ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:typescript_indent_disable = 1 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Dbext ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +let g:dbext_default_menu_mode = 0 + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Which Key ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua << EOF + require("which-key").setup { + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + spelling = { + enabled = false, -- enabling this will show WhichKey when pressing z= to select spelling suggestions + suggestions = 20, -- how many suggestions should be shown in the list? + }, + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + presets = { + operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true, -- bindings for prefixed with g + }, + }, + -- add operators that will trigger motion and text object completion + -- to enable all native operators, set the preset / operators plugin above + operators = { gc = "Comments" }, + key_labels = { + -- override the label used to display some keys. It doesn't effect WK in any other way. + -- For example: + -- [""] = "SPC", + -- [""] = "RET", + -- [""] = "TAB", + }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+", -- symbol prepended to a group + }, + popup_mappings = { + scroll_down = '', -- binding to scroll down inside the popup + scroll_up = '', -- binding to scroll up inside the popup + }, + window = { + border = "none", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0 + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "left", -- align columns left, center or right + }, + ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label + hidden = { "", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate + show_help = true, -- show help message on the command line when the popup is visible + triggers = "auto", -- automatically setup triggers + -- triggers = {""} -- or specify a list manually + triggers_blacklist = { + -- list of mode / prefixes that should never be hooked by WhichKey + -- this is mostly relevant for key maps that start with a native binding + -- most people should not need to change this + i = { "j", "k" }, + v = { "j", "k" }, + }, + } +EOF + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Comment ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +lua << EOF +require('Comment').setup({ + ---Add a space b/w comment and the line + padding = true, + ---Whether the cursor should stay at its position + sticky = true, + ---Lines to be ignored while (un)comment + ignore = nil, + ---LHS of toggle mappings in NORMAL mode + toggler = { + ---Line-comment toggle keymap + line = 'gcc', + ---Block-comment toggle keymap + block = 'gbc', + }, + ---LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + ---Line-comment keymap + line = 'gc', + ---Block-comment keymap + block = 'gb', + }, + ---LHS of extra mappings + extra = { + ---Add comment on the line above + above = 'gcO', + ---Add comment on the line below + below = 'gco', + ---Add comment at the end of line + eol = 'gcA', + }, + ---Enable keybindings + mappings = { + ---Operator-pending mapping; + ---`gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + basic = true, + ---Extra mapping; + ---`gco`, `gcO`, `gcA` + extra = true, + ---Extended mapping; + ---`g>` `g<` `g>[count]{motion}` `g<[count]{motion}` + extended = false, + }, + ---Function to call before (un)comment + pre_hook = nil, + ---Function to call after (un)comment + post_hook = nil, +}) +EOF +nmap gcc +vmap gc + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Reader ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +function s:vertopen_url() + normal! "uyiW + let mycommand = "reader " . @u + execute "vertical terminal " . mycommand +endfunction +noremap vertopen_url : call vertopen_url() +nmap gx vertopen_url + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Custom commands ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +" Color picker +vnoremap c=system('yad --color --init-color' . shellescape(@")) +nnoremap :put =system('yad --color') +inoremap :put =system('yad --color') + + +" ╔════════════════════════════════════════════════════════════════════════════╗ +" ║ Custom replacements ║ +" ╚════════════════════════════════════════════════════════════════════════════╝ + +nnoremap dt"h"=strftime('%Y-%m-%dT%H:%M:%S%z')p +inoremap =strftime('%Y-%m-%dT%H:%M:%S%z') + +inoreabbrev mariusu マリウス +inoreabbrev mariusucom xn--gckvb8fzb.com + diff --git a/.config/nvim/motd b/.config/nvim/motd new file mode 100644 index 0000000..e69de29 diff --git a/.config/pcmanfm/default/pcmanfm.conf b/.config/pcmanfm/default/pcmanfm.conf new file mode 100644 index 0000000..021e870 --- /dev/null +++ b/.config/pcmanfm/default/pcmanfm.conf @@ -0,0 +1,26 @@ +[config] +bm_open_method=0 + +[volume] +mount_on_startup=0 +mount_removable=0 +autorun=1 + +[ui] +always_show_tabs=0 +max_tab_chars=32 +win_width=1920 +win_height=1054 +splitter_pos=150 +media_in_new_tab=0 +desktop_folder_new_win=0 +change_tab_on_drop=1 +close_on_unmount=1 +focus_previous=0 +side_pane_mode=places +view_mode=icon +show_hidden=0 +sort=name;ascending; +toolbar=newtab;navigation;home; +show_statusbar=1 +pathbar_mode_buttons=0 diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf new file mode 100644 index 0000000..8cc999f --- /dev/null +++ b/.config/picom/picom.conf @@ -0,0 +1,267 @@ +# Thank you code_nomad: http://9m.no/ꪯ鵞 +# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton + +################################# +# +# Backend +# +################################# + +# Backend to use: "xrender" or "glx". +# GLX backend is typically much faster but depends on a sane driver. +backend = "glx"; + +################################# +# +# GLX backend +# +################################# + +glx-no-stencil = true; + +# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. +# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, +# but a 20% increase when only 1/4 is. +# My tests on nouveau show terrible slowdown. +glx-copy-from-front = false; + +# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. +# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. +# May break VSync and is not available on some drivers. +# Overrides --glx-copy-from-front. +# glx-use-copysubbuffermesa = true; + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). +# Recommended if it works. +# glx-no-rebind-pixmap = true; + +# GLX backend: GLX buffer swap method we assume. +# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). +# undefined is the slowest and the safest, and the default value. +# copy is fastest, but may fail on some drivers, +# 2-6 are gradually slower but safer (6 is still faster than 0). +# Usually, double buffer means 2, triple buffer means 3. +# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. +# Useless with --glx-use-copysubbuffermesa. +# Partially breaks --resize-damage. +# Defaults to undefined. +#glx-swap-method = "undefined"; #deprecated ! +#use-damage = true + +################################# +# +# Shadows +# +################################# + +# Enabled client-side shadows on windows. +shadow = true; +# The blur radius for shadows. (default 12) +shadow-radius = 5; +# The left offset for shadows. (default -15) +shadow-offset-x = 1; +# The top offset for shadows. (default -15) +shadow-offset-y = 1; +# The translucency for shadows. (default .75) +shadow-opacity = 0.3; + +# Set if you want different colour shadows +# shadow-red = 0.0; +# shadow-green = 0.0; +# shadow-blue = 0.0; + +# The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches +# (most applications are fine, only apps that do weird things with xshapes or argb are affected). +# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. +shadow-exclude = [ + "! name~=''", + "name = 'Notification'", + "name = 'Plank'", + "name = 'Docky'", + "name = 'Kupfer'", + "name = 'xfce4-notifyd'", + "name *= 'VLC'", + "name *= 'compton'", + "name *= 'picom'", + "name *= 'Chromium'", + "name *= 'Chrome'", + "class_g = 'Firefox' && argb", + "class_g = 'Conky'", + "class_g = 'Kupfer'", + "class_g = 'Synapse'", + "class_g ?= 'Notify-osd'", + "class_g ?= 'Cairo-dock'", + "class_g ?= 'Xfce4-notifyd'", + "class_g ?= 'Xfce4-power-manager'", + "class_g ?= 'Dmenu'", +# "class_g ?= 'Dunst'", +# disables shadows on i3 frames + "class_g ?= 'i3-frame'", + "_GTK_FRAME_EXTENTS@:c", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; +# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) +shadow-ignore-shaped = false; + +################################# +# +# Opacity +# +################################# + +inactive-opacity = 1; +active-opacity = 1; +frame-opacity = 1; +inactive-opacity-override = false; + +# Dim inactive windows. (0.0 - 1.0) +# inactive-dim = 0.2; +# Do not let dimness adjust based on window opacity. +# inactive-dim-fixed = true; +# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. +# blur-background = true; +# Blur background of opaque windows with transparent frames as well. +# blur-background-frame = true; +# Do not let blur radius adjust based on window opacity. +blur-background-fixed = false; +blur-background-exclude = [ + "window_type = 'dock'", + "window_type = 'desktop'" +]; + +################################# +# +# Fading +# +################################# + +# Fade windows during opacity changes. +fading = false; +# The time between steps in a fade in milliseconds. (default 10). +fade-delta = 1; +# Opacity change between steps while fading in. (default 0.028). +fade-in-step = 0.03; +# Opacity change between steps while fading out. (default 0.03). +fade-out-step = 0.03; +# Fade windows in/out when opening/closing +# no-fading-openclose = true; + +# Specify a list of conditions of windows that should not be faded. +fade-exclude = [ ]; + +################################# +# +# Other +# +################################# + +# Try to detect WM windows and mark them as active. +mark-wmwin-focused = true; +# Mark all non-WM but override-redirect windows active (e.g. menus). +mark-ovredir-focused = true; +# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. +# Usually more reliable but depends on a EWMH-compliant WM. +use-ewmh-active-win = true; +# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. +detect-rounded-corners = true; + +# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. +# This prevents opacity being ignored for some apps. +# For example without this enabled my xfce4-notifyd is 100% opacity no matter what. +detect-client-opacity = true; + +# Specify refresh rate of the screen. +# If not specified or 0, picom will try detecting this with X RandR extension. +#refresh-rate = 0; + +# Vertical synchronization: match the refresh rate of the monitor +vsync = false; + +# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. +# Reported to have no effect, though. +dbe = false; + +# Limit picom to repaint at most once every 1 / refresh_rate second to boost performance. +# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +#sw-opti = true; + +# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. +# Known to cause flickering when redirecting/unredirecting windows. +unredir-if-possible = true; + +# Specify a list of conditions of windows that should always be considered focused. +focus-exclude = [ "class_g = 'Cairo-clock'" ]; + +# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. +detect-transient = true; +# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. +# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. +detect-client-leader = true; + +################################# +# +# Window type settings +# +################################# + +wintypes : +{ + tooltip : + { + fade = true; + shadow = false; + opacity = 0.85; + focus = true; + }; + fullscreen : + { + fade = true; + shadow = false; + opacity = 1; + focus = true; + }; +}; + +###################### +# +# XSync +# See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d +# +###################### + +# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users. +xrender-sync-fence = true; + +#opacity-rule = [ +#"99:name *?= 'Call'", +#"99:class_g = 'Chromium'", +#"99:name *?= 'Conky'", +#"99:class_g = 'Darktable'", +#"50:class_g = 'Dmenu'", +#"99:name *?= 'Event'", +#"99:class_g = 'Firefox'", +#"99:class_g = 'GIMP'", +#"99:name *?= 'Image'", +#"99:class_g = 'Lazpaint'", +#"99:class_g = 'Midori'", +#"99:name *?= 'Minitube'", +#"99:class_g = 'Mousepad'", +#"99:name *?= 'MuseScore'", +#"90:name *?= 'Page Info'", +#"99:name *?= 'Pale Moon'", +#"90:name *?= 'Panel'", +#"99:class_g = 'Pinta'", +#"90:name *?= 'Restart'", +#"99:name *?= 'sudo'", +#"99:name *?= 'Screenshot'", +#"99:class_g = 'Viewnior'", +#"99:class_g = 'VirtualBox'", +#"99:name *?= 'VLC'", +#"99:name *?= 'Write'", +#"93:class_g = 'URxvt' && !_NET_WM_STATE@:32a", +#"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", +#"96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" +#]; + diff --git a/.config/pikaur.conf b/.config/pikaur.conf new file mode 100644 index 0000000..3dad848 --- /dev/null +++ b/.config/pikaur.conf @@ -0,0 +1,50 @@ +[sync] +alwaysshowpkgorigin = no +develpkgsexpiration = -1 +upgradesorting = versiondiff +showdownloadsize = no +ignoreoutofdateaurupgrades = no + +[build] +keepbuilddir = no +keepdevbuilddir = yes +keepbuilddeps = no +gpgdir = +skipfailedbuild = no +alwaysusedynamicusers = no +ignorearch = no + +[review] +noedit = no +donteditbydefault = no +nodiff = no +gitdiffargs = --ignore-space-change,--ignore-all-space +diffpager = auto +hidedifffiles = .SRCINFO + +[colors] +version = 10 +versiondiffold = 11 +versiondiffnew = 9 + +[ui] +requireenterconfirm = yes +printcommands = no +aursearchsorting = hottest +displaylastupdated = no +groupbyrepository = yes +reversesearchsorting = no +warnaboutpackageupdates = + +[misc] +sudoloopinterval = 59 +pacmanpath = pacman +privilegeescalationtool = sudo + +[network] +aururl = https://aur.archlinux.org +newsurl = https://www.archlinux.org/feeds/news/ +socks5proxy = +aurhttpproxy = +aurhttpsproxy = + diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py new file mode 100644 index 0000000..60d8676 --- /dev/null +++ b/.config/ranger/commands.py @@ -0,0 +1,38 @@ +from ranger.api.commands import Command + +class paste_as_root(Command): + def execute(self): + if self.fm.do_cut: + self.fm.execute_console('shell sudo mv %c .') + else: + self.fm.execute_console('shell sudo cp -r %c .') + +class fzf_select(Command): + """ + :fzf_select + + Find a file using fzf. + + With a prefix argument select only directories. + + See: https://github.com/junegunn/fzf + """ + def execute(self): + import subprocess + import os.path + if self.quantifier: + # match only directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to file'" + else: + # match files and directories + command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ + -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to filemap fzf_select'" + fzf = self.fm.execute_command(command, universal_newlines=True, stdout=subprocess.PIPE) + stdout, stderr = fzf.communicate() + if fzf.returncode == 0: + fzf_file = os.path.abspath(stdout.rstrip('\n')) + if os.path.isdir(fzf_file): + self.fm.cd(fzf_file) + else: + self.fm.select_file(fzf_file) \ No newline at end of file diff --git a/.config/ranger/devicons.py b/.config/ranger/devicons.py new file mode 100644 index 0000000..216c673 --- /dev/null +++ b/.config/ranger/devicons.py @@ -0,0 +1,219 @@ +#!/usr/bin/python +# coding=UTF-8 +# These glyphs, and the mapping of file extensions to glyphs +# has been copied from the vimscript code that is present in +# https://github.com/ryanoasis/vim-devicons +import re; +import os; + +# all those glyphs will show as weird squares if you don't have the correct patched font +# My advice is to use NerdFonts which can be found here: +# https://github.com/ryanoasis/nerd-fonts +file_node_extensions = { + '7z' : '', + 'ai' : '', + 'apk' : '', + 'avi' : '', + 'bat' : '', + 'bmp' : '', + 'bz2' : '', + 'c' : '', + 'c++' : '', + 'cab' : '', + 'cc' : '', + 'clj' : '', + 'cljc' : '', + 'cljs' : '', + 'coffee' : '', + 'conf' : '', + 'cp' : '', + 'cpio' : '', + 'cpp' : '', + 'css' : '', + 'cxx' : '', + 'd' : '', + 'dart' : '', + 'db' : '', + 'deb' : '', + 'diff' : '', + 'dump' : '', + 'edn' : '', + 'ejs' : '', + 'epub' : '', + 'erl' : '', + 'f#' : '', + 'fish' : '', + 'flac' : '', + 'flv' : '', + 'fs' : '', + 'fsi' : '', + 'fsscript' : '', + 'fsx' : '', + 'gem' : '', + 'gif' : '', + 'go' : '', + 'gz' : '', + 'gzip' : '', + 'hbs' : '', + 'hrl' : '', + 'hs' : '', + 'htm' : '', + 'html' : '', + 'ico' : '', + 'ini' : '', + 'java' : '', + 'jl' : '', + 'jpeg' : '', + 'jpg' : '', + 'js' : '', + 'json' : '', + 'jsx' : '', + 'less' : '', + 'lha' : '', + 'lhs' : '', + 'log' : '', + 'lua' : '', + 'lzh' : '', + 'lzma' : '', + 'markdown' : '', + 'md' : '', + 'mkv' : '', + 'ml' : 'λ', + 'mli' : 'λ', + 'mov' : '', + 'mp3' : '', + 'mp4' : '', + 'mpeg' : '', + 'mpg' : '', + 'mustache' : '', + 'ogg' : '', + 'pdf' : '', + 'php' : '', + 'pl' : '', + 'pm' : '', + 'png' : '', + 'psb' : '', + 'psd' : '', + 'py' : '', + 'pyc' : '', + 'pyd' : '', + 'pyo' : '', + 'rar' : '', + 'rb' : '', + 'rc' : '', + 'rlib' : '', + 'rpm' : '', + 'rs' : '', + 'rss' : '', + 'scala' : '', + 'scss' : '', + 'sh' : '', + 'slim' : '', + 'sln' : '', + 'sql' : '', + 'styl' : '', + 'suo' : '', + 't' : '', + 'tar' : '', + 'tgz' : '', + 'ts' : '', + 'twig' : '', + 'vim' : '', + 'vimrc' : '', + 'wav' : '', + 'xml' : '', + 'xul' : '', + 'xz' : '', + 'yml' : '', + 'zip' : '', +} + +dir_node_exact_matches = { +# English + '.git' : '', + 'Desktop' : '', + 'Documents' : '', + 'Downloads' : '', + 'Dropbox' : '', + 'Music' : '', + 'Pictures' : '', + 'Public' : '', + 'Templates' : '', + 'Videos' : '', +# French + 'Bureau' : '', + 'Documents' : '', + 'Images' : '', + 'Musique' : '', + 'Publique' : '', + 'Téléchargements' : '', + 'Vidéos' : '', +# Portuguese + 'Documentos' : '', + 'Imagens' : '', + 'Modelos' : '', + 'Música' : '', + 'Público' : '', + 'Vídeos' : '', + 'Área de trabalho' : '', +# Italian + 'Documenti' : '', + 'Immagini' : '', + 'Modelli' : '', + 'Musica' : '', + 'Pubblici' : '', + 'Scaricati' : '', + 'Scrivania' : '', + 'Video' : '', +# German + 'Bilder' : '', + 'Dokumente' : '', + 'Musik' : '', + 'Schreibtisch' : '', + 'Vorlagen' : '', + 'Öffentlich' : '', +} + +file_node_exact_matches = { + '.Xdefaults' : '', + '.Xresources' : '', + '.bashprofile' : '', + '.bashrc' : '', + '.dmrc' : '', + '.ds_store' : '', + '.fasd' : '', + '.gitconfig' : '', + '.gitignore' : '', + '.jack-settings' : '', + '.mime.types' : '', + '.nvidia-settings-rc' : '', + '.pam_environment' : '', + '.profile' : '', + '.recently-used' : '', + '.selected_editor' : '', + '.vimrc' : '', + '.xinputrc' : '', + 'config' : '', + 'dropbox' : '', + 'exact-match-case-sensitive-1.txt' : 'X1', + 'exact-match-case-sensitive-2' : 'X2', + 'favicon.ico' : '', + 'gruntfile.coffee' : '', + 'gruntfile.js' : '', + 'gruntfile.ls' : '', + 'gulpfile.coffee' : '', + 'gulpfile.js' : '', + 'gulpfile.ls' : '', + 'ini' : '', + 'ledger' : '', + 'license' : '', + 'mimeapps.list' : '', + 'node_modules' : '', + 'procfile' : '', + 'react.jsx' : '', + 'user-dirs.dirs' : '', +} + +def devicon(file): + if file.is_directory: return dir_node_exact_matches.get(file.relative_path, '') + return file_node_exact_matches.get(file.relative_path, file_node_extensions.get(file.extension, '')) \ No newline at end of file diff --git a/.config/ranger/plugins/__init__.py b/.config/ranger/plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/.config/ranger/plugins/devicons_linemode.py b/.config/ranger/plugins/devicons_linemode.py new file mode 100644 index 0000000..37e1fa5 --- /dev/null +++ b/.config/ranger/plugins/devicons_linemode.py @@ -0,0 +1,22 @@ +import os +terminal=terminal=os.getenv('TERM') +if terminal != 'linux': + import ranger.api + from ranger.core.linemode import LinemodeBase + from devicons import * + + @ranger.api.register_linemode + class DevIconsLinemode(LinemodeBase): + name = "devicons" + + uses_metadata = False + + def filetitle(self, file, metadata): + return devicon(file) + ' ' + file.relative_path + + @ranger.api.register_linemode + class DevIconsLinemodeFile(LinemodeBase): + name = "filename" + + def filetitle(self, file, metadata): + return devicon(file) + ' ' + file.relative_path \ No newline at end of file diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf new file mode 100644 index 0000000..cb7692b --- /dev/null +++ b/.config/ranger/rc.conf @@ -0,0 +1,620 @@ +# =================================================================== +# This file contains the default startup commands for ranger. +# To change them, it is recommended to create the file +# ~/.config/ranger/rc.conf and add your custom commands there. +# +# If you copy this whole file there, you may want to set the environment +# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. +# +# The purpose of this file is mainly to define keybindings and settings. +# For running more complex python code, please create a plugin in "plugins/" or +# a command in "commands.py". +# +# Each line is a command that will be run before the user interface +# is initialized. As a result, you can not use commands which rely +# on the UI such as :delete or :mark. +# =================================================================== + +# =================================================================== +# == Options +# =================================================================== + +# Which viewmode should be used? Possible values are: +# miller: Use miller columns which show multiple levels of the hierarchy +# multipane: Midnight-commander like multipane view showing all tabs next +# to each other +set viewmode miller +#set viewmode multipane + +# How many columns are there, and what are their relative widths? +set column_ratios 1,3,4 + +# Which files should be hidden? (regular expression) +set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ + +# Show hidden files? You can toggle this by typing 'zh' +set show_hidden false + +# Ask for a confirmation when running the "delete" command? +# Valid values are "always", "never", "multiple" (default) +# With "multiple", ranger will ask only if you delete multiple files at once. +set confirm_on_delete never + +# Which script is used to generate file previews? +# ranger ships with scope.sh, a script that calls external programs (see +# README.md for dependencies) to preview images, archives, etc. +set preview_script ~/.config/ranger/scope.sh + +# Use the external preview script or display simple plain text or image previews? +set use_preview_script true + +# Automatically count files in the directory, even before entering them? +set automatically_count_files true + +# Open all images in this directory when running certain image viewers +# like feh or sxiv? You can still open selected files by marking them. +set open_all_images true + +# Be aware of version control systems and display information. +set vcs_aware false + +# State of the three backends git, hg, bzr. The possible states are +# disabled, local (only show local info), enabled (show local and remote +# information). +set vcs_backend_git enabled +set vcs_backend_hg disabled +set vcs_backend_bzr disabled + +# Use one of the supported image preview protocols +set preview_images true + +# Set the preview image method. Supported methods: +# +# * w3m (default): +# Preview images in full color with the external command "w3mimgpreview"? +# This requires the console web browser "w3m" and a supported terminal. +# It has been successfully tested with "xterm" and "urxvt" without tmux. +# +# * iterm2: +# Preview images in full color using iTerm2 image previews +# (http://iterm2.com/images.html). This requires using iTerm2 compiled +# with image preview support. +# +# * urxvt: +# Preview images in full color using urxvt image backgrounds. This +# requires using urxvt compiled with pixbuf support. +# +# * urxvt-full: +# The same as urxvt but utilizing not only the preview pane but the +# whole terminal window. +set preview_images_method ueberzug + +# Use a unicode "..." character to mark cut-off filenames? +set unicode_ellipsis false + +# Show dotfiles in the bookmark preview box? +set show_hidden_bookmarks true + +# Which colorscheme to use? These colorschemes are available by default: +# default, jungle, snow, solarized +set colorscheme default + +# Preview files on the rightmost column? +# And collapse (shrink) the last column if there is nothing to preview? +set preview_files true +set preview_directories true +set collapse_preview true + +# Save the console history on exit? +set save_console_history true + +# Draw the status bar on top of the browser window (default: bottom) +set status_bar_on_top false + +# Draw a progress bar in the status bar which displays the average state of all +# currently running tasks which support progress bars? +set draw_progress_bar_in_status_bar true + +# Draw borders around columns? +set draw_borders true + +# Display the directory name in tabs? +set dirname_in_tabs false + +# Enable the mouse support? +set mouse_enabled true + +# Display the file size in the main column or status bar? +set display_size_in_main_column true +set display_size_in_status_bar true + +# Display files tags in all columns or only in main column? +set display_tags_in_all_columns true + +# Set a title for the window? +set update_title false + +# Set the title to "ranger" in the tmux program? +set update_tmux_title false + +# Shorten the title if it gets long? The number defines how many +# directories are displayed at once, 0 turns off this feature. +set shorten_title 3 + +# Abbreviate $HOME with ~ in the titlebar (first line) of ranger? +set tilde_in_titlebar false + +# How many directory-changes or console-commands should be kept in history? +set max_history_size 20 +set max_console_history_size 50 + +# Try to keep so much space between the top/bottom border when scrolling: +set scroll_offset 8 + +# Flush the input after each key hit? (Noticeable when ranger lags) +set flushinput true + +# Padding on the right when there's no preview? +# This allows you to click into the space to run the file. +set padding_right true + +# Save bookmarks (used with mX and `X) instantly? +# This helps to synchronize bookmarks between multiple ranger +# instances but leads to *slight* performance loss. +# When false, bookmarks are saved when ranger is exited. +set autosave_bookmarks true + +# You can display the "real" cumulative size of directories by using the +# command :get_cumulative_size or typing "dc". The size is expensive to +# calculate and will not be updated automatically. You can choose +# to update it automatically though by turning on this option: +set autoupdate_cumulative_size false + +# Turning this on makes sense for screen readers: +set show_cursor false + +# One of: size, natural, basename, atime, ctime, mtime, type, random +set sort natural + +# Additional sorting options +set sort_reverse false +set sort_case_insensitive true +set sort_directories_first true +set sort_unicode false + +# Enable this if key combinations with the Alt Key don't work for you. +# (Especially on xterm) +set xterm_alt_key false + +# Whether to include bookmarks in cd command +set cd_bookmarks true + +# Avoid previewing files larger than this size, in bytes. Use a value of 0 to +# disable this feature. +set preview_max_size 0 + +# Add the highlighted file to the path in the titlebar +set show_selection_in_titlebar true + +# The delay that ranger idly waits for user input, in milliseconds, with a +# resolution of 100ms. Lower delay reduces lag between directory updates but +# increases CPU load. +set idle_delay 2000 + +# When the metadata manager module looks for metadata, should it only look for +# a ".metadata.json" file in the current directory, or do a deep search and +# check all directories above the current one as well? +set metadata_deep_search false + +# Clear all existing filters when leaving a directory +set clear_filters_on_dir_change false + +# Disable displaying line numbers in main column +set line_numbers false + +# =================================================================== +# == Local Options +# =================================================================== +# You can set local options that only affect a single directory. + +# Examples: +# setlocal path=~/downloads sort mtime + +# =================================================================== +# == Command Aliases in the Console +# =================================================================== + +alias e edit +alias q quit +alias q! quitall +alias qa quitall +alias qall quitall +alias setl setlocal + +alias filter scout -prt +alias find scout -aeit +alias mark scout -mr +alias unmark scout -Mr +alias search scout -rs +alias search_inc scout -rts +alias travel scout -aefiklst + +# =================================================================== +# == Define keys for the browser +# =================================================================== + +# Basic +map Q quit! +map q quit +copymap q ZZ ZQ + +map R reload_cwd +map reset +map redraw_window +map abort +map change_mode normal +map ~ set viewmode! + +map i display_file +map ? help +map W display_log +map w taskview_open +map S shell $SHELL + +map : console +map ; console +map ! console shell%space +map @ console -p6 shell %%s +map # console shell -p%space +map s console shell%space +map r chain draw_possible_programs; console open_with%%space +#map f console find%space +map f console scout -ftsea%space +map cd console cd%space + +# Change the line mode +map Mf linemode filename +map Mi linemode fileinfo +map Mm linemode mtime +map Mp linemode permissions +map Ms linemode sizemtime +map Mt linemode metatitle + +# Tagging / Marking +map t tag_toggle +map ut tag_remove +map " tag_toggle tag=%any +map mark_files toggle=True +map v mark_files all=True toggle=True +map uv mark_files all=True val=False +map V toggle_visual_mode +map uV toggle_visual_mode reverse=True + +# For the nostalgics: Midnight Commander bindings +map help +map display_file +map edit +map copy +map cut +map console mkdir%space +map console delete +map exit + +# In case you work on a keyboard with dvorak layout +map move up=1 +map move down=1 +map move left=1 +map move right=1 +map move to=0 +map move to=-1 +map move down=1 pages=True +map move up=1 pages=True +map move right=1 +map console delete +map console touch%space + +# VIM-like +copymap k +copymap j +copymap h +copymap l +copymap gg +copymap G +copymap +copymap + +map J move down=0.5 pages=True +map K move up=0.5 pages=True +copymap J +copymap K + +# Jumping around +map H history_go -1 +map L history_go 1 +map ] move_parent 1 +map [ move_parent -1 +map } traverse + +map gh cd ~ +map ge cd /etc +map gu cd /usr +map gd cd /dev +map gl cd -r . +map gL cd -r %f +map go cd /opt +map gv cd /var +map gm cd /media +map gM cd /mnt +map gs cd /srv +map gr cd / +map gR eval fm.cd(ranger.RANGERDIR) +map g/ cd / +map g? cd /usr/share/doc/ranger + +# External Programs +map E edit +map du shell -p du --max-depth=1 -h --apparent-size +map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh +map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b +map yd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b +map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b + +# Filesystem Operations +map = chmod + +#map cw console rename%space +map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ") +map a rename_append +map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%")) +map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7) + +map pp paste +map po paste overwrite=True +map pP paste append=True +map pO paste overwrite=True append=True +map pl paste_symlink relative=False +map pL paste_symlink relative=True +map phl paste_hardlink +map pht paste_hardlinked_subtree +map pr paste_as_root + +map dD console delete +map xd delete + +map dd cut +map ud uncut +map da cut mode=add +map dr cut mode=remove +map dt cut mode=toggle + +map yy copy +map uy uncut +map ya copy mode=add +map yr copy mode=remove +map yt copy mode=toggle + +# Temporary workarounds +map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier) +map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier) +map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier) +map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier) +map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier) +map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier) +map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier) +map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier) + +# Searching +map / console search%space +map n search_next +map N search_next forward=False +map ct search_next order=tag +map cs search_next order=size +map ci search_next order=mimetype +map cc search_next order=ctime +map cm search_next order=mtime +map ca search_next order=atime + +# Tabs +map tab_new ~ +map tab_close +map tab_move 1 +map tab_move -1 +map tab_move 1 +map tab_move -1 +map gt tab_move 1 +map gT tab_move -1 +map gn tab_new ~ +map gc tab_close +map uq tab_restore +map tab_open 1 +map tab_open 2 +map tab_open 3 +map tab_open 4 +map tab_open 5 +map tab_open 6 +map tab_open 7 +map tab_open 8 +map tab_open 9 + +# Sorting +map or set sort_reverse! +map oz set sort=random +map os chain set sort=size; set sort_reverse=False +map ob chain set sort=basename; set sort_reverse=False +map on chain set sort=natural; set sort_reverse=False +map om chain set sort=mtime; set sort_reverse=False +map oc chain set sort=ctime; set sort_reverse=False +map oa chain set sort=atime; set sort_reverse=False +map ot chain set sort=type; set sort_reverse=False +map oe chain set sort=extension; set sort_reverse=False + +map oS chain set sort=size; set sort_reverse=True +map oB chain set sort=basename; set sort_reverse=True +map oN chain set sort=natural; set sort_reverse=True +map oM chain set sort=mtime; set sort_reverse=True +map oC chain set sort=ctime; set sort_reverse=True +map oA chain set sort=atime; set sort_reverse=True +map oT chain set sort=type; set sort_reverse=True +map oE chain set sort=extension; set sort_reverse=True + +map dc get_cumulative_size + +# Settings +map zc set collapse_preview! +map zd set sort_directories_first! +map zh set show_hidden! +map set show_hidden! +map zI set flushinput! +map zi set preview_images! +map zm set mouse_enabled! +map zp set preview_files! +map zP set preview_directories! +map zs set sort_case_insensitive! +map zu set autoupdate_cumulative_size! +map zv set use_preview_script! +map zf console filter%space + +# Bookmarks +map ` enter_bookmark %any +map ' enter_bookmark %any +map m set_bookmark %any +map um unset_bookmark %any + +map m draw_bookmarks +copymap m um ` ' + +# Generate all the chmod bindings with some python help: +eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg)) + +eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg)) +eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg)) + +# =================================================================== +# == Define keys for the console +# =================================================================== +# Note: Unmapped keys are passed directly to the console. + +# Basic +cmap eval fm.ui.console.tab() +cmap eval fm.ui.console.tab(-1) +cmap eval fm.ui.console.close() +cmap eval fm.ui.console.execute() +cmap redraw_window + +copycmap +copycmap + +# Move around +cmap eval fm.ui.console.history_move(-1) +cmap eval fm.ui.console.history_move(1) +cmap eval fm.ui.console.move(left=1) +cmap eval fm.ui.console.move(right=1) +cmap eval fm.ui.console.move(right=0, absolute=True) +cmap eval fm.ui.console.move(right=-1, absolute=True) +cmap eval fm.ui.console.move_word(left=1) +cmap eval fm.ui.console.move_word(right=1) + +# Line Editing +cmap eval fm.ui.console.delete(-1) +cmap eval fm.ui.console.delete(0) +cmap eval fm.ui.console.delete_word() +cmap eval fm.ui.console.delete_word(backward=False) +cmap eval fm.ui.console.delete_rest(1) +cmap eval fm.ui.console.delete_rest(-1) +cmap eval fm.ui.console.paste() + +# And of course the emacs way +copycmap +copycmap +copycmap +copycmap +copycmap +copycmap +copycmap +copycmap + +# Note: There are multiple ways to express backspaces. (code 263) +# and (code 127). To be sure, use both. +copycmap + +# This special expression allows typing in numerals: +cmap false + +# =================================================================== +# == Pager Keybindings +# =================================================================== + +# Movement +pmap pager_move down=1 +pmap pager_move up=1 +pmap pager_move left=4 +pmap pager_move right=4 +pmap pager_move to=0 +pmap pager_move to=-1 +pmap pager_move down=1.0 pages=True +pmap pager_move up=1.0 pages=True +pmap pager_move down=0.5 pages=True +pmap pager_move up=0.5 pages=True + +copypmap k +copypmap j +copypmap h +copypmap l +copypmap g +copypmap G +copypmap d +copypmap u +copypmap n f +copypmap p b + +# Basic +pmap redraw_window +pmap pager_close +copypmap q Q i +pmap E edit_file + +# =================================================================== +# == Taskview Keybindings +# =================================================================== + +# Movement +tmap taskview_move up=1 +tmap taskview_move down=1 +tmap taskview_move to=0 +tmap taskview_move to=-1 +tmap taskview_move down=1.0 pages=True +tmap taskview_move up=1.0 pages=True +tmap taskview_move down=0.5 pages=True +tmap taskview_move up=0.5 pages=True + +copytmap k +copytmap j +copytmap g +copytmap G +copytmap u +copytmap n f +copytmap p b + +# Changing priority and deleting tasks +tmap J eval -q fm.ui.taskview.task_move(-1) +tmap K eval -q fm.ui.taskview.task_move(0) +tmap dd eval -q fm.ui.taskview.task_remove() +tmap eval -q fm.ui.taskview.task_move(-1) +tmap eval -q fm.ui.taskview.task_move(0) +tmap eval -q fm.ui.taskview.task_remove() + +# Basic +tmap redraw_window +tmap taskview_close +copytmap q Q w +default_linemode devicons + +# find +map fzf_select diff --git a/.config/ranger/scope.sh b/.config/ranger/scope.sh new file mode 100755 index 0000000..98515e0 --- /dev/null +++ b/.config/ranger/scope.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env sh +# ranger supports enhanced previews. If the option "use_preview_script" +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. + +# NOTES: This script is considered a configuration file. If you upgrade +# ranger, it will be left untouched. (You must update it yourself.) +# Also, ranger disables STDIN here, so interactive scripts won't work properly + +# Meanings of exit codes: +# code | meaning | action of ranger +# -----+------------+------------------------------------------- +# 0 | success | success. display stdout as preview +# 1 | no preview | failure. display no preview at all +# 2 | plain text | display the plain content of the file +# 3 | fix width | success. Don't reload when width changes +# 4 | fix height | success. Don't reload when height changes +# 5 | fix both | success. Don't ever reload +# 6 | image | success. display the image $cached points to as an image preview +# 7 | image | success. display the file directly as an image + +# Meaningful aliases for arguments: +path="$1" # Full path of the selected file +width="$2" # Width of the preview pane (number of fitting characters) +height="$3" # Height of the preview pane (number of fitting characters) +cached="$4" # Path that should be used to cache image previews +preview_images="$5" # "True" if image previews are enabled, "False" otherwise. + +maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln + +# Find out something about the file: +mimetype=$(file --mime-type -Lb "$path") +extension=$(/bin/echo "${path##*.}" | awk '{print tolower($0)}') + +# Functions: +# runs a command and saves its output into $output. Useful if you need +# the return value AND want to use the output in a pipe +try() { output=$(eval '"$@"'); } + +# writes the output of the previously used "try" command +dump() { /bin/echo "$output"; } + +# a common post-processing function used after most commands +trim() { head -n "$maxln"; } + +# wraps highlight to treat exit code 141 (killed by SIGPIPE) as success +safepipe() { "$@"; test $? = 0 -o $? = 141; } + +# Image previews, if enabled in ranger. +if [ "$preview_images" = "True" ]; then + case "$mimetype" in + # Image previews for SVG files, disabled by default. + image/svg+xml) + convert "$path" "$cached" && exit 6 || exit 1;; + # Image previews for image files. w3mimgdisplay will be called for all + # image files (unless overriden as above), but might fail for + # unsupported types. + image/*) + exit 7;; + # Image preview for video, disabled by default.: + video/*) + ffmpegthumbnailer -i "$path" -o "$cached" -s 0 && exit 6 || exit 1;; + esac +fi + +case "$extension" in + # Archive extensions: + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + try als "$path" && { dump | trim; exit 0; } + try acat "$path" && { dump | trim; exit 3; } + try bsdtar -lf "$path" && { dump | trim; exit 0; } + exit 1;; + rar) + # avoid password prompt by providing empty password + try unrar -p- lt "$path" && { dump | trim; exit 0; } || exit 1;; + 7z) + # avoid password prompt by providing empty password + try 7z -p l "$path" && { dump | trim; exit 0; } || exit 1;; + # PDF documents: + pdf) + try pdftotext -l 10 -nopgbrk -q "$path" - && \ + { dump | trim | fmt -s -w $width; exit 0; } || exit 1;; + # BitTorrent Files + torrent) + try transmission-show "$path" && { dump | trim; exit 5; } || exit 1;; + # ODT Files + odt|ods|odp|sxw) + try odt2txt "$path" && { dump | trim; exit 5; } || exit 1;; + # HTML Pages: + htm|html|xhtml) + try w3m -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try lynx -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + try elinks -dump "$path" && { dump | trim | fmt -s -w $width; exit 4; } + ;; # fall back to highlight/cat if the text browsers fail +esac + +case "$mimetype" in + # Syntax highlight for text files: + text/* | */xml) + if [ "$(tput colors)" -ge 256 ]; then + pygmentize_format=terminal256 + highlight_format=xterm256 + else + pygmentize_format=terminal + highlight_format=ansi + fi + try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } + try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } + exit 2;; + # Ascii-previews of images: + image/*) + img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + exiftool "$path" && exit 5 + # Use sed to remove spaces so the output fits into the narrow window + try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;; +esac + +exit 1 diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..a4f5800 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,73 @@ +"$schema" = 'https://starship.rs/config-schema.json' + +add_newline=false +#scan_timeout = 10 +format = '$character$username$hostname$directory' +right_format = '$terraform$git_state$git_status$git_branch$git_commit' + +[character] +success_symbol = '[▲](white)' +error_symbol = '[▲](red)' +vicmd_symbol = '[△](blue)' + +[username] +style_user = 'white bold' +style_root = 'black bold' +format = '[$user]($style) ' +disabled = false +show_always = true + +[hostname] +ssh_only = true +format = '[$ssh_symbol](bold blue)[$hostname](bold red) ' +#trim_at = '.companyname.com' +disabled = false + +[directory] +style = 'blue' + +[git_state] +format = '[\($state( $progress_current of $progress_total)\)]($style) ' +rebase = '[rebasing](bold magenta)' +merge = '[merging](bold yellow)' +revert = '[reverting](bold blue)' +cherry_pick = '[picking](bold red)' +bisect = '[bisecting](bold red)' +am = '[applying](bold green)' +am_or_rebase = '[applying/rebasing](bold yellow)' + +[git_status] +format = '([$all_status $ahead_behind]($style) )' +style = '8' +up_to_date = '' +untracked = '.' +conflicted = '#' +ahead = '⇡' +behind = '⇣' +diverged = '⇕' +stashed = '^' +modified = '*' +staged = '+' +renamed = '»' +deleted = 'x' + +[git_branch] +format = '[$symbol$branch(:$remote_branch)]($style)' +symbol = '' +style = '8' +truncation_length = 16 +truncation_symbol = '' +ignore_branches = [] + +[git_commit] +format = ' [$hash$tag]($style)' +style = '8' +only_detached = false +commit_hash_length = 6 +tag_symbol = '' + +[terraform] +format = '[$symbol$workspace]($style) ' +style = '105' +symbol = ' ' + diff --git a/.config/systemd/user/default.target.wants/mbsync.service b/.config/systemd/user/default.target.wants/mbsync.service new file mode 120000 index 0000000..97d636b --- /dev/null +++ b/.config/systemd/user/default.target.wants/mbsync.service @@ -0,0 +1 @@ +/home/dominic/.config/systemd/user/mbsync.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/mpd.service b/.config/systemd/user/default.target.wants/mpd.service new file mode 120000 index 0000000..0524f66 --- /dev/null +++ b/.config/systemd/user/default.target.wants/mpd.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/mpd.service \ No newline at end of file diff --git a/.config/systemd/user/mbsync.service b/.config/systemd/user/mbsync.service new file mode 100644 index 0000000..2e3b828 --- /dev/null +++ b/.config/systemd/user/mbsync.service @@ -0,0 +1,10 @@ +[Unit] +Description=Mailbox synchronization service + +[Service] +Type=oneshot +ExecStart=/usr/bin/mbsync -Va +ExecStartPost=/usr/bin/notmuch new + +[Install] +WantedBy=default.target diff --git a/.config/systemd/user/mbsync.timer b/.config/systemd/user/mbsync.timer new file mode 100644 index 0000000..82ebb83 --- /dev/null +++ b/.config/systemd/user/mbsync.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Mailbox synchronization timer + +[Timer] +OnBootSec=2m +OnUnitActiveSec=5m +Unit=mbsync.service + +[Install] +WantedBy=timers.target diff --git a/.config/systemd/user/pipewire-session-manager.service b/.config/systemd/user/pipewire-session-manager.service new file mode 120000 index 0000000..a092a62 --- /dev/null +++ b/.config/systemd/user/pipewire-session-manager.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/wireplumber.service \ No newline at end of file diff --git a/.config/systemd/user/pipewire.service.wants/wireplumber.service b/.config/systemd/user/pipewire.service.wants/wireplumber.service new file mode 120000 index 0000000..a092a62 --- /dev/null +++ b/.config/systemd/user/pipewire.service.wants/wireplumber.service @@ -0,0 +1 @@ +/usr/lib/systemd/user/wireplumber.service \ No newline at end of file diff --git a/.config/systemd/user/timers.target.wants/mbsync.timer b/.config/systemd/user/timers.target.wants/mbsync.timer new file mode 120000 index 0000000..244f207 --- /dev/null +++ b/.config/systemd/user/timers.target.wants/mbsync.timer @@ -0,0 +1 @@ +/home/dominic/.config/systemd/user/mbsync.timer \ No newline at end of file diff --git a/.config/urlscan/config.json b/.config/urlscan/config.json new file mode 100644 index 0000000..1b008d6 --- /dev/null +++ b/.config/urlscan/config.json @@ -0,0 +1,197 @@ +{ + "palettes": { + "nodefault": [ + [ + "header", + "white", + "dark blue", + "standout" + ], + [ + "footer", + "white", + "dark red", + "standout" + ], + [ + "search", + "white", + "dark green", + "standout" + ], + [ + "msgtext", + "", + "" + ], + [ + "msgtext:ellipses", + "light gray", + "black" + ], + [ + "urlref:number:braces", + "light gray", + "black" + ], + [ + "urlref:number", + "yellow", + "black", + "standout" + ], + [ + "urlref:url", + "white", + "black", + "standout" + ], + [ + "url:sel", + "white", + "dark blue", + "bold" + ] + ], + "bw": [ + [ + "header", + "black", + "light gray", + "standout" + ], + [ + "footer", + "black", + "light gray", + "standout" + ], + [ + "search", + "black", + "light gray", + "standout" + ], + [ + "msgtext", + "", + "" + ], + [ + "msgtext:ellipses", + "white", + "black" + ], + [ + "urlref:number:braces", + "white", + "black" + ], + [ + "urlref:number", + "white", + "black", + "standout" + ], + [ + "urlref:url", + "white", + "black", + "standout" + ], + [ + "url:sel", + "black", + "light gray", + "bold" + ] + ], + "default": [ + [ + "header", + "brown", + "black", + "standout" + ], + [ + "footer", + "white", + "dark red", + "standout" + ], + [ + "search", + "white", + "dark green", + "standout" + ], + [ + "msgtext", + "light cyan", + "black" + ], + [ + "msgtext:ellipses", + "light gray", + "black" + ], + [ + "urlref:number:braces", + "light gray", + "black" + ], + [ + "urlref:number", + "yellow", + "black", + "standout" + ], + [ + "urlref:url", + "dark green", + "black", + "standout" + ], + [ + "url:sel", + "white", + "black", + "" + ] + ] + }, + "keys": { + "/": "search_key", + "0": "digits", + "1": "digits", + "2": "digits", + "3": "digits", + "4": "digits", + "5": "digits", + "6": "digits", + "7": "digits", + "8": "digits", + "9": "digits", + "a": "add_url", + "C": "clipboard", + "c": "context", + "ctrl l": "clear_screen", + "d": "del_url", + "f1": "help_menu", + "G": "bottom", + "g": "top", + "j": "down", + "k": "up", + "P": "clipboard_pri", + "l": "link_handler", + "o": "open_queue", + "O": "open_queue_win", + "p": "palette", + "Q": "quit", + "q": "quit", + "R": "reverse", + "S": "all_shorten", + "s": "shorten", + "u": "all_escape" + } +} diff --git a/.dmrc b/.dmrc new file mode 100644 index 0000000..22a9951 --- /dev/null +++ b/.dmrc @@ -0,0 +1,2 @@ +[Desktop] +Session=i3 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..13db78e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,27 @@ +[submodule ".tmux/plugins/tmux-battery"] + path = .tmux/plugins/tmux-battery + url = https://github.com/tmux-plugins/tmux-battery.git +[submodule ".tmux/plugins/tmux-cpu"] + path = .tmux/plugins/tmux-cpu + url = https://github.com/tmux-plugins/tmux-cpu.git +[submodule ".tmux/plugins/tmux-resurrect"] + path = .tmux/plugins/tmux-resurrect + url = https://github.com/tmux-plugins/tmux-resurrect.git +[submodule ".tmux/plugins/tpm"] + path = .tmux/plugins/tpm + url = https://github.com/tmux-plugins/tpm.git +[submodule ".zprezto"] + path = .zprezto + url = git@repo.oe7drt.com:dominic/prezto.git +[submodule "git/blacklist"] + path = git/blacklist + url = git@repo.oe7drt.com:dominic/blacklist.git +[submodule "git/zeit"] + path = git/zeit + url = git@repo.oe7drt.com:dominic/zeit.git +[submodule "git/geld"] + path = git/geld + url = git@repo.oe7drt.com:dominic/geld.git +[submodule "sites/oe7drt-website"] + path = sites/oe7drt-website + url = git@repo.oe7drt.com:dominic/oe7drt-website.git diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..0354bce --- /dev/null +++ b/.gnupg/gpg-agent.conf @@ -0,0 +1,16 @@ +allow-loopback-pinentry + +# 20m = 1200 +# 1h = 3600 +# 2h = 7200 +# 4h = 14400 +# 8h = 28800 +# 12h = 43200 +# 24h = 86400 + +default-cache-ttl 14400 +max-cache-ttl 43200 + +enable-ssh-support +default-cache-ttl-ssh 43200 +max-cache-ttl-ssh 86400 diff --git a/.gnupg/sshcontrol b/.gnupg/sshcontrol new file mode 100644 index 0000000..deb9d23 --- /dev/null +++ b/.gnupg/sshcontrol @@ -0,0 +1,12 @@ +# List of allowed ssh keys. Only keys present in this file are used +# in the SSH protocol. The ssh-add tool may add new entries to this +# file to enable them; you may also add them manually. Comment +# lines, like this one, as well as empty lines are ignored. Lines do +# have a certain length limit but this is not serious limitation as +# the format of the entries is fixed and checked by gpg-agent. A +# non-comment line starts with optional white spaces, followed by the +# keygrip of the key given as 40 hex digits, optionally followed by a +# caching TTL in seconds, and another optional field for arbitrary +# flags. Prepend the keygrip with an '!' mark to disable it. + +15FAA48F261028F6E25E53EF15DA2ED3A005337F diff --git a/.gtk-bookmarks b/.gtk-bookmarks new file mode 100644 index 0000000..8eaf336 --- /dev/null +++ b/.gtk-bookmarks @@ -0,0 +1 @@ +file:///mnt mnt diff --git a/.librewolf/librewolf.overrides.cfg b/.librewolf/librewolf.overrides.cfg new file mode 100644 index 0000000..ca8699d --- /dev/null +++ b/.librewolf/librewolf.overrides.cfg @@ -0,0 +1,6 @@ +// Enable Firefox Sync +defaultPref("identity.fxaccounts.enabled", true); + +// Preserve browsing and download history +defaultPref("privacy.clearOnShutdown.history", false); +defaultPref("privacy.clearOnShutdown.downloads", false); diff --git a/.p10k.zsh b/.p10k.zsh new file mode 100644 index 0000000..dc368a0 --- /dev/null +++ b/.p10k.zsh @@ -0,0 +1,1615 @@ +# Generated by Powerlevel10k configuration wizard on 2023-01-11 at 10:11 CET. +# Based on romkatv/powerlevel10k/config/p10k-lean-8colors.zsh, checksum 16080. +# Wizard options: nerdfont-complete + powerline, large icons, ascii, lean_8colors, +# 24h time, 1 line, compact, concise, instant_prompt=verbose. +# Type `p10k configure` to generate another config. +# +# Config for Powerlevel10k with 8-color lean prompt style. Type `p10k configure` to generate +# your own config based on it. +# +# Tip: Looking for a nice color? Here's a one-liner to print colormap. +# +# for i in {0..255}; do print -Pn "%K{$i} %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done + +# Temporarily change options. +'builtin' 'local' '-a' 'p10k_config_opts' +[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases') +[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob') +[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand') +'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' + +() { + emulate -L zsh -o extended_glob + + # Unset all configuration options. This allows you to apply configuration changes without + # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`. + unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' + + # Zsh >= 5.1 is required. + autoload -Uz is-at-least && is-at-least 5.1 || return + + # The list of segments shown on the left. Fill it with the most important segments. + typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( + # os_icon # os identifier + dir # current directory + vcs # git status + prompt_char # prompt symbol + ) + + # The list of segments shown on the right. Fill it with less important segments. + # Right prompt on the last prompt line (where you are typing your commands) gets + # automatically hidden when the input line reaches it. Right prompt above the + # last prompt line gets hidden if it would overlap with left prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( + status # exit code of the last command + command_execution_time # duration of the last command + background_jobs # presence of background jobs + direnv # direnv status (https://direnv.net/) + asdf # asdf version manager (https://github.com/asdf-vm/asdf) + virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) + anaconda # conda environment (https://conda.io/) + pyenv # python environment (https://github.com/pyenv/pyenv) + goenv # go environment (https://github.com/syndbg/goenv) + nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv) + nvm # node.js version from nvm (https://github.com/nvm-sh/nvm) + nodeenv # node.js environment (https://github.com/ekalinin/nodeenv) + # node_version # node.js version + # go_version # go version (https://golang.org) + # rust_version # rustc version (https://www.rust-lang.org) + # dotnet_version # .NET version (https://dotnet.microsoft.com) + # php_version # php version (https://www.php.net/) + # laravel_version # laravel php framework version (https://laravel.com/) + # java_version # java version (https://www.java.com/) + # package # name@version from package.json (https://docs.npmjs.com/files/package.json) + rbenv # ruby version from rbenv (https://github.com/rbenv/rbenv) + rvm # ruby version from rvm (https://rvm.io) + fvm # flutter version management (https://github.com/leoafarias/fvm) + luaenv # lua version from luaenv (https://github.com/cehoffman/luaenv) + jenv # java version from jenv (https://github.com/jenv/jenv) + plenv # perl version from plenv (https://github.com/tokuhirom/plenv) + phpenv # php version from phpenv (https://github.com/phpenv/phpenv) + scalaenv # scala version from scalaenv (https://github.com/scalaenv/scalaenv) + haskell_stack # haskell version from stack (https://haskellstack.org/) + kubecontext # current kubernetes context (https://kubernetes.io/) + terraform # terraform workspace (https://www.terraform.io) + # terraform_version # terraform version (https://www.terraform.io) + aws # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) + aws_eb_env # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) + azure # azure account name (https://docs.microsoft.com/en-us/cli/azure) + gcloud # google cloud cli account and project (https://cloud.google.com/) + google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production) + toolbox # toolbox name (https://github.com/containers/toolbox) + context # user@hostname + nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) + ranger # ranger shell (https://github.com/ranger/ranger) + nnn # nnn shell (https://github.com/jarun/nnn) + xplr # xplr shell (https://github.com/sayanarijit/xplr) + vim_shell # vim shell indicator (:sh) + midnight_commander # midnight commander shell (https://midnight-commander.org/) + nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) + # vpn_ip # virtual private network indicator + # load # CPU load + # disk_usage # disk usage + # ram # free RAM + # swap # used swap + todo # todo items (https://github.com/todotxt/todo.txt-cli) + timewarrior # timewarrior tracking status (https://timewarrior.net/) + taskwarrior # taskwarrior task count (https://taskwarrior.org/) + time # current time + # ip # ip address and bandwidth usage for a specified network interface + # public_ip # public IP address + # proxy # system-wide http/https/ftp proxy + # battery # internal battery + # wifi # wifi speed + # example # example user-defined segment (see prompt_example function below) + ) + + # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you. + typeset -g POWERLEVEL9K_MODE=ascii + # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid + # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. + typeset -g POWERLEVEL9K_ICON_PADDING=none + + # Basic style options that define the overall look of your prompt. You probably don't want to + # change them. + typeset -g POWERLEVEL9K_BACKGROUND= # transparent background + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol + + # When set to true, icons appear before content on both sides of the prompt. When set + # to false, icons go after content. If empty or not set, icons go before content in the left + # prompt and after content in the right prompt. + # + # You can also override it for a specific segment: + # + # POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false + # + # Or for a specific segment in specific state: + # + # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true + + # Add an empty line before each prompt. + typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false + + # Connect left prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= + # Connect right prompt lines with these symbols. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= + typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= + + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll + # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and + # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. + typeset -g POWERLEVEL9K_SHOW_RULER=false + typeset -g POWERLEVEL9K_RULER_CHAR='-' # reasonable alternative: '·' + typeset -g POWERLEVEL9K_RULER_FOREGROUND=7 + + # Filler between left and right prompt on the first prompt line. You can set it to '·' or '-' + # to make it easier to see the alignment between left and right prompt and to separate prompt + # from command output. It serves the same purpose as ruler (see above) without increasing + # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false + # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact + # prompt. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' + if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then + # The color of the filler. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=7 + # Add a space between the end of left prompt and the filler. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' + # Add a space between the filler and the start of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' + # Start filler from the edge of the screen if there are no left segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' + # End filler on the edge of the screen if there are no right segments on the first line. + typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' + fi + + #################################[ os_icon: os identifier ]################################## + # OS identifier color. + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= + # Custom icon. + # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' + + ################################[ prompt_char: prompt symbol ]################################ + # Green prompt symbol if the last command succeeded. + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2 + # Red prompt symbol if the last command failed. + typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1 + # Default prompt symbol. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='>' + # Prompt symbol in command vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='<' + # Prompt symbol in visual vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V' + # Prompt symbol in overwrite vi mode. + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='^' + typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true + # No line terminator if prompt_char is the last segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' + # No line introducer if prompt_char is the first segment. + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + + ##################################[ dir: current directory ]################################## + # Default current directory color. + typeset -g POWERLEVEL9K_DIR_FOREGROUND=4 + # If directory is too long, shorten some of its segments to the shortest possible unique + # prefix. The shortened directory can be tab-completed to the original. + typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique + # Replace removed segment suffixes with this symbol. + typeset -g POWERLEVEL9K_SHORTEN_DELIMITER= + # Color of the shortened directory segments. + typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=4 + # Color of the anchor directory segments. Anchor segments are never shortened. The first + # segment is always an anchor. + typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=4 + # Set to true to display anchor directory segments in bold. + typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=false + # Don't shorten directories that contain any of these files. They are anchors. + local anchor_files=( + .bzr + .citc + .git + .hg + .node-version + .python-version + .go-version + .ruby-version + .lua-version + .java-version + .perl-version + .php-version + .tool-version + .shorten_folder_marker + .svn + .terraform + CVS + Cargo.toml + composer.json + go.mod + package.json + stack.yaml + ) + typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})" + # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains + # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is + # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first) + # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers + # and other directories don't. + # + # Optionally, "first" and "last" can be followed by ":" where is an integer. + # This moves the truncation point to the right (positive offset) or to the left (negative offset) + # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0" + # respectively. + typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false + # Don't shorten this many last directory segments. They are anchors. + typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + # Shorten directory if it's longer than this even if there is space for it. The value can + # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty, + # directory will be shortened only when prompt doesn't fit or when other parameters demand it + # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below). + # If set to `0`, directory will always be shortened to its minimum length. + typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this + # many columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40 + # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least + # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands. + typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50 + # If set to true, embed a hyperlink into the directory. Useful for quickly + # opening a directory in the file manager simply by clicking the link. + # Can also be handy when the directory is shortened, as it allows you to see + # the full directory that was used in previous commands. + typeset -g POWERLEVEL9K_DIR_HYPERLINK=false + + # Enable special styling for non-writable directories. See POWERLEVEL9K_LOCK_ICON and + # POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v2 + + # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON + # and POWERLEVEL9K_DIR_CLASSES below. + typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3 + + # The default icon shown next to non-writable and non-existent directories when + # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3. + # typeset -g POWERLEVEL9K_LOCK_ICON='⭐' + + # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different + # directories. It must be an array with 3 * N elements. Each triplet consists of: + # + # 1. A pattern against which the current directory ($PWD) is matched. Matching is done with + # extended_glob option enabled. + # 2. Directory class for the purpose of styling. + # 3. An empty string. + # + # Triplets are tried in order. The first triplet whose pattern matches $PWD wins. + # + # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories + # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_DIR_CLASSES=( + # '~/work(|/*)' WORK '' + # '~(|/*)' HOME '' + # '*' DEFAULT '') + # + # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one + # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or + # WORK_NON_EXISTENT. + # + # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an + # option to define custom colors and icons for different directory classes. + # + # # Styling for WORK. + # typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=4 + # + # # Styling for WORK_NOT_WRITABLE. + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=4# + # + # Styling for WORK_NON_EXISTENT. + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=4 + # typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=4 + # + # If a styling parameter isn't explicitly defined for some class, it falls back to the classless + # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls + # back to POWERLEVEL9K_DIR_FOREGROUND. + # + typeset -g POWERLEVEL9K_DIR_CLASSES=() + + # Custom prefix. + # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' + + #####################################[ vcs: git status ]###################################### + # Branch icon. Set this parameter to '\uF126 ' for the popular Powerline branch icon. + typeset -g POWERLEVEL9K_VCS_BRANCH_ICON= + + # Untracked files icon. It's really a question mark, your font isn't broken. + # Change the value of this parameter to show a different icon. + typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?' + + # Formatter for Git status. + # + # Example output: master wip <42>42 *42 merge ~42 +42 !42 ?42. + # + # You can edit the function to customize how Git status looks. + # + # VCS_STATUS_* parameters are set by gitstatus plugin. See reference: + # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. + function my_git_formatter() { + emulate -L zsh + + if [[ -n $P9K_CONTENT ]]; then + # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from + # gitstatus plugin). VCS_STATUS_* parameters are not available in this case. + typeset -g my_git_format=$P9K_CONTENT + return + fi + + if (( $1 )); then + # Styling for up-to-date Git status. + local meta='%f' # default foreground + local clean='%2F' # green foreground + local modified='%3F' # yellow foreground + local untracked='%4F' # blue foreground + local conflicted='%1F' # red foreground + else + # Styling for incomplete and stale Git status. + local meta='%f' # default foreground + local clean='%f' # default foreground + local modified='%f' # default foreground + local untracked='%f' # default foreground + local conflicted='%f' # default foreground + fi + + local res + + if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then + local branch=${(V)VCS_STATUS_LOCAL_BRANCH} + # If local branch name is at most 32 characters long, show it in full. + # Otherwise show the first 12 .. the last 12. + # Tip: To always show local branch name in full without truncation, delete the next line. + (( $#branch > 32 )) && branch[13,-13]=".." # <-- this line + res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}" + fi + + if [[ -n $VCS_STATUS_TAG + # Show tag only if not on a branch. + # Tip: To always show tag, delete the next line. + && -z $VCS_STATUS_LOCAL_BRANCH # <-- this line + ]]; then + local tag=${(V)VCS_STATUS_TAG} + # If tag name is at most 32 characters long, show it in full. + # Otherwise show the first 12 .. the last 12. + # Tip: To always show tag name in full without truncation, delete the next line. + (( $#tag > 32 )) && tag[13,-13]=".." # <-- this line + res+="${meta}#${clean}${tag//\%/%%}" + fi + + # Display the current Git commit if there is no branch and no tag. + # Tip: To always display the current Git commit, delete the next line. + [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] && # <-- this line + res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}" + + # Show tracking branch name if it differs from local branch. + if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then + res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}" + fi + + # Display "wip" if the latest commit's summary contains "wip" or "WIP". + if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then + res+=" ${modified}wip" + fi + + # <42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}<${VCS_STATUS_COMMITS_BEHIND}" + # >42 if ahead of the remote; no leading space if also behind the remote: <42>42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}>${VCS_STATUS_COMMITS_AHEAD}" + # <-42 if behind the push remote. + (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}<-${VCS_STATUS_PUSH_COMMITS_BEHIND}" + (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " + # ->42 if ahead of the push remote; no leading space if also behind: <-42->42. + (( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}->${VCS_STATUS_PUSH_COMMITS_AHEAD}" + # *42 if have stashes. + (( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}" + # 'merge' if the repo is in an unusual state. + [[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}" + # ~42 if have merge conflicts. + (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}" + # +42 if have staged changes. + (( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}" + # !42 if have unstaged changes. + (( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}" + # ?42 if have untracked files. It's really a question mark, your font isn't broken. + # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon. + # Remove the next line if you don't want to see untracked files at all. + (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}" + # "-" if the number of unstaged files is unknown. This can happen due to + # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower + # than the number of files in the Git index, or due to bash.showDirtyState being set to false + # in the repository config. The number of staged and untracked files may also be unknown + # in this case. + (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}-" + + typeset -g my_git_format=$res + } + functions -M my_git_formatter 2>/dev/null + + # Don't count the number of unstaged, untracked and conflicted files in Git repositories with + # more than this many files in the index. Negative value means infinity. + # + # If you are working in Git repositories with tens of millions of files and seeing performance + # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output + # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's + # config: `git config bash.showDirtyState false`. + typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1 + + # Don't show Git status in prompt for repositories whose workdir matches this pattern. + # For example, if set to '~', the Git repository at $HOME/.git will be ignored. + # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'. + typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~' + + # Disable the default Git status formatting. + typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true + # Install our own Git status formatter. + typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter(1)))+${my_git_format}}' + typeset -g POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${$((my_git_formatter(0)))+${my_git_format}}' + # Enable counters for staged, unstaged, etc. + typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1 + + # Icon color. + typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=2 + typeset -g POWERLEVEL9K_VCS_LOADING_VISUAL_IDENTIFIER_COLOR= + # Custom icon. + typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION= + # Custom prefix. + # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' + + # Show status of repositories of these types. You can add svn and/or hg if you are + # using them. If you do, your prompt may become slow even when your current directory + # isn't in an svn or hg reposotiry. + typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) + + # These settings are used for repositories other than Git or when gitstatusd fails and + # Powerlevel10k has to fall back to using vcs_info. + typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND=2 + typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=2 + typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=3 + + ##########################[ status: exit code of the last command ]########################### + # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and + # style them independently from the regular OK and ERROR state. + typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true + + # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as + # it will signify success by turning green. + typeset -g POWERLEVEL9K_STATUS_OK=false + typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='ok' + + # Status when some part of a pipe command fails but the overall exit status is zero. It may look + # like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2 + typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='ok' + + # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as + # it will signify error by turning red. + typeset -g POWERLEVEL9K_STATUS_ERROR=false + typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=1 + typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='err' + + # Status when the last command was terminated by a signal. + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=1 + # Use terse signal names: "INT" instead of "SIGINT(2)". + typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false + typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION= + + # Status when some part of a pipe command fails and the overall exit status is also non-zero. + # It may look like this: 1|0. + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=1 + typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='err' + + ###################[ command_execution_time: duration of the last command ]################### + # Show duration of the last command if takes at least this many seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3 + # Show this many fractional digits. Zero means round to seconds. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 + # Execution time color. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=3 + # Duration format: 1d 2h 3m 4s. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' + # Custom icon. + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION= + # Custom prefix. + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' + + #######################[ background_jobs: presence of background jobs ]####################### + # Don't show the number of background jobs. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false + # Background jobs color. + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ direnv: direnv status (https://direnv.net/) ]######################## + # Direnv color. + typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]############### + # Default asdf color. Only used to display tools for which there is no color override (see below). + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND. + typeset -g POWERLEVEL9K_ASDF_FOREGROUND=6 + + # There are four parameters that can be used to hide asdf tools. Each parameter describes + # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at + # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to + # hide a tool, it gets shown. + # + # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and + # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands: + # + # asdf local python 3.8.1 + # asdf global python 3.8.1 + # + # After running both commands the current python version is 3.8.1 and its source is "local" as + # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false, + # it'll hide python version in this case because 3.8.1 is the same as the global version. + # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't + # contain "local". + + # Hide tool versions that don't come from one of these sources. + # + # Available sources: + # + # - shell `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable" + # - local `asdf current` says "set by /some/not/home/directory/file" + # - global `asdf current` says "set by /home/username/file" + # + # Note: If this parameter is set to (shell local global), it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES. + typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global) + + # If set to false, hide tool versions that are the same as global. + # + # Note: The name of this parameter doesn't reflect its meaning at all. + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW. + typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false + + # If set to false, hide tool versions that are equal to "system". + # + # Note: If this parameter is set to true, it won't hide tools. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM. + typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true + + # If set to non-empty value, hide tools unless there is a file matching the specified file pattern + # in the current directory, or its parent directory, or its grandparent directory, and so on. + # + # Note: If this parameter is set to empty value, it won't hide tools. + # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments. + # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB. + # + # Example: Hide nodejs version when there is no package.json and no *.js files in the current + # directory, in `..`, in `../..` and so on. + # + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json' + typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB= + + # Ruby version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Python version from asdf. + typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Go version from asdf. + typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Node.js version from asdf. + typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Rust version from asdf. + typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar' + + # .NET Core version from asdf. + typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Flutter version from asdf. + typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Lua version from asdf. + typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Java version from asdf. + typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=4 + # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Perl version from asdf. + typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Erlang version from asdf. + typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=1 + # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Elixir version from asdf. + typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Postgres version from asdf. + typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=6 + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar' + + # PHP version from asdf. + typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=5 + # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Haskell version from asdf. + typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=3 + # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' + + # Julia version from asdf. + typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=2 + # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar' + + ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]########### + # NordVPN connection indicator color. + typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=6 + # Hide NordVPN connection indicator when not connected. + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION= + typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION= + # Custom icon. + # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]################## + # Ranger shell color. + typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### + # Nnn shell color. + typeset -g POWERLEVEL9K_NNN_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]################## + # xplr shell color. + typeset -g POWERLEVEL9K_XPLR_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########################[ vim_shell: vim shell indicator (:sh) ]########################### + # Vim shell indicator color. + typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]###### + # Midnight Commander shell color. + typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]## + # Nix shell color. + typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=4 + + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. + # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ disk_usage: disk usage ]################################## + # Colors for different levels of disk usage. + typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=2 + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=3 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=1 + # Thresholds for different levels of disk usage (percentage points). + typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90 + typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95 + # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent. + typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false + # Custom icon. + # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ ram: free RAM ]####################################### + # RAM color. + typeset -g POWERLEVEL9K_RAM_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################################[ swap: used swap ]###################################### + # Swap color. + typeset -g POWERLEVEL9K_SWAP_FOREGROUND=3 + # Custom icon. + # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ######################################[ load: CPU load ]###################################### + # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15. + typeset -g POWERLEVEL9K_LOAD_WHICH=5 + # Load color when load is under 50%. + typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=2 + # Load color when load is between 50% and 70%. + typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=3 + # Load color when load is over 70%. + typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################ + # Todo color. + typeset -g POWERLEVEL9K_TODO_FOREGROUND=4 + # Hide todo when the total number of tasks is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true + # Hide todo when the number of tasks after filtering is zero. + typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false + + # Todo format. The following parameters are available within the expansion. + # + # - P9K_TODO_TOTAL_TASK_COUNT The total number of tasks. + # - P9K_TODO_FILTERED_TASK_COUNT The number of tasks after filtering. + # + # These variables correspond to the last line of the output of `todo.sh -p ls`: + # + # TODO: 24 of 42 tasks shown + # + # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT. + # + # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############ + # Timewarrior color. + typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=4 + # If the tracked task is longer than 24 characters, truncate and append "..". + # Tip: To always display tasks without truncation, delete the following parameter. + # Tip: To hide task names and display just the icon when time tracking is enabled, set the + # value of the following parameter to "". + typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+..}' + + # Custom icon. + # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]############## + # Taskwarrior color. + typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=6 + + # Taskwarrior segment format. The following parameters are available within the expansion. + # + # - P9K_TASKWARRIOR_PENDING_COUNT The number of pending tasks: `task +PENDING count`. + # - P9K_TASKWARRIOR_OVERDUE_COUNT The number of overdue tasks: `task +OVERDUE count`. + # + # Zero values are represented as empty parameters. + # + # The default format: + # + # '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT' + # + # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT' + + # Custom icon. + # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##################################[ context: user@hostname ]################################## + # Context color when running with privileges. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1 + # Context color in SSH without privileges. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=7 + # Default context color (no privileges, no SSH). + typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=7 + + # Context format when running with privileges: bold user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%B%n@%m' + # Context format when in SSH without privileges: user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m' + # Default context format (no privileges, no SSH): user@hostname. + typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m' + + # Don't show context unless running with privileges or in SSH. + # Tip: Remove the next line to always show context. + typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION= + + # Custom icon. + # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' + + ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### + # Python virtual environment color. + typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=6 + # Don't show Python version next to the virtual environment name. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false + # If set to "false", won't show virtualenv if pyenv is already shown. + # If set to "if-different", won't show virtualenv if it's the same as pyenv. + typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false + # Separate environment name from Python version only with a space. + typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ anaconda: conda environment (https://conda.io/) ]###################### + # Anaconda environment color. + typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=6 + + # Anaconda segment format. The following parameters are available within the expansion. + # + # - CONDA_PREFIX Absolute path to the active Anaconda/Miniconda environment. + # - CONDA_DEFAULT_ENV Name of the active Anaconda/Miniconda environment. + # - CONDA_PROMPT_MODIFIER Configurable prompt modifier (see below). + # - P9K_ANACONDA_PYTHON_VERSION Current python version (python --version). + # + # CONDA_PROMPT_MODIFIER can be configured with the following command: + # + # conda config --set env_prompt '({default_env}) ' + # + # The last argument is a Python format string that can use the following variables: + # + # - prefix The same as CONDA_PREFIX. + # - default_env The same as CONDA_DEFAULT_ENV. + # - name The last segment of CONDA_PREFIX. + # - stacked_env Comma-separated list of names in the environment stack. The first element is + # always the same as default_env. + # + # Note: '({default_env}) ' is the default value of env_prompt. + # + # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER + # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former + # is empty. + typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}' + + # Custom icon. + # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################ + # Pyenv color. + typeset -g POWERLEVEL9K_PYENV_FOREGROUND=6 + # Hide python version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global) + # If set to false, hide python version if it's the same as global: + # $(pyenv version-name) == $(pyenv global). + typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide python version if it's equal to "system". + typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true + + # Pyenv segment format. The following parameters are available within the expansion. + # + # - P9K_CONTENT Current pyenv environment (pyenv version-name). + # - P9K_PYENV_PYTHON_VERSION Current python version (python --version). + # + # The default format has the following logic: + # + # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or + # starts with "$P9K_PYENV_PYTHON_VERSION/". + # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION". + typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}' + + # Custom icon. + # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################ + # Goenv color. + typeset -g POWERLEVEL9K_GOENV_FOREGROUND=6 + # Hide go version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global) + # If set to false, hide go version if it's the same as global: + # $(goenv version-name) == $(goenv global). + typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide go version if it's equal to "system". + typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]########## + # Nodenv color. + typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2 + # Hide node version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global) + # If set to false, hide node version if it's the same as global: + # $(nodenv version-name) == $(nodenv global). + typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### + # Nvm color. + typeset -g POWERLEVEL9K_NVM_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############ + # Nodeenv color. + typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2 + # Don't show Node version next to the environment name. + typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false + # Separate environment name from Node version only with a space. + typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER= + # Custom icon. + # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##############################[ node_version: node.js version ]############################### + # Node version color. + typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=2 + # Show node version only when in a directory tree containing package.json. + typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ go_version: go version (https://golang.org) ]######################## + # Go version color. + typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=6 + # Show go version only when in a go project subdirectory. + typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #################[ rust_version: rustc version (https://www.rust-lang.org) ]################## + # Rust version color. + typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=4 + # Show rust version only when in a rust project subdirectory. + typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################ + # .NET version color. + typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=5 + # Show .NET version only when in a .NET project subdirectory. + typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #####################[ php_version: php version (https://www.php.net/) ]###################### + # PHP version color. + typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=5 + # Show PHP version only when in a PHP project subdirectory. + typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]########### + # Laravel version color. + typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1 + # Custom icon. + # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ java_version: java version (https://www.java.com/) ]#################### + # Java version color. + typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=4 + # Show java version only when in a java project subdirectory. + typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true + # Show brief version. + typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false + # Custom icon. + # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]#### + # Package color. + typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=6 + # Package format. The following parameters are available within the expansion. + # + # - P9K_PACKAGE_NAME The value of `name` field in package.json. + # - P9K_PACKAGE_VERSION The value of `version` field in package.json. + # + # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}' + # Custom icon. + # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]############## + # Rbenv color. + typeset -g POWERLEVEL9K_RBENV_FOREGROUND=1 + # Hide ruby version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global) + # If set to false, hide ruby version if it's the same as global: + # $(rbenv version-name) == $(rbenv global). + typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide ruby version if it's equal to "system". + typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######################[ rvm: ruby version from rvm (https://rvm.io) ]######################## + # Rvm color. + typeset -g POWERLEVEL9K_RVM_FOREGROUND=1 + # Don't show @gemset at the end. + typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false + # Don't show ruby- at the front. + typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false + # Custom icon. + # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############ + # Fvm color. + typeset -g POWERLEVEL9K_FVM_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]########### + # Lua color. + typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=4 + # Hide lua version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global) + # If set to false, hide lua version if it's the same as global: + # $(luaenv version-name) == $(luaenv global). + typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide lua version if it's equal to "system". + typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################ + # Java color. + typeset -g POWERLEVEL9K_JENV_FOREGROUND=4 + # Hide java version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global) + # If set to false, hide java version if it's the same as global: + # $(jenv version-name) == $(jenv global). + typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide java version if it's equal to "system". + typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############ + # Perl color. + typeset -g POWERLEVEL9K_PLENV_FOREGROUND=6 + # Hide perl version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global) + # If set to false, hide perl version if it's the same as global: + # $(plenv version-name) == $(plenv global). + typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide perl version if it's equal to "system". + typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############ + # PHP color. + typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=5 + # Hide php version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global) + # If set to false, hide php version if it's the same as global: + # $(phpenv version-name) == $(phpenv global). + typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide php version if it's equal to "system". + typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]####### + # Scala color. + typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=1 + # Hide scala version if it doesn't come from one of these sources. + typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global) + # If set to false, hide scala version if it's the same as global: + # $(scalaenv version-name) == $(scalaenv global). + typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false + # If set to false, hide scala version if it's equal to "system". + typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true + # Custom icon. + # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]########### + # Haskell color. + typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=3 + # Hide haskell version if it doesn't come from one of these sources. + # + # shell: version is set by STACK_YAML + # local: version is set by stack.yaml up the directory tree + # global: version is set by the implicit global project (~/.stack/global-project/stack.yaml) + typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local) + # If set to false, hide haskell version if it's the same as in the implicit global project. + typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true + # Custom icon. + # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# + # Show kubecontext only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show kubecontext. + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern' + + # Kubernetes context classes for the purpose of using different colors, icons and expansions with + # different contexts. + # + # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current kubernetes context gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current kubernetes context is "deathray-testing/default", its class is TEST + # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=3 + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=5 + # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext + # segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # Within the expansion the following parameters are always available: + # + # - P9K_CONTENT The content that would've been displayed if there was no content + # expansion defined. + # - P9K_KUBECONTEXT_NAME The current context's name. Corresponds to column NAME in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_CLUSTER The current context's cluster. Corresponds to column CLUSTER in the + # output of `kubectl config get-contexts`. + # - P9K_KUBECONTEXT_NAMESPACE The current context's namespace. Corresponds to column NAMESPACE + # in the output of `kubectl config get-contexts`. If there is no + # namespace, the parameter is set to "default". + # - P9K_KUBECONTEXT_USER The current context's user. Corresponds to column AUTHINFO in the + # output of `kubectl config get-contexts`. + # + # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS), + # the following extra parameters are available: + # + # - P9K_KUBECONTEXT_CLOUD_NAME Either "gke" or "eks". + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT Account/project ID. + # - P9K_KUBECONTEXT_CLOUD_ZONE Availability zone. + # - P9K_KUBECONTEXT_CLOUD_CLUSTER Cluster. + # + # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example, + # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=gke + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + # + # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01": + # + # - P9K_KUBECONTEXT_CLOUD_NAME=eks + # - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012 + # - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1 + # - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01 + typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION= + # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME. + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}' + # Append the current context's namespace if it's not "default". + POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' + + # Custom prefix. + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# + # Show aws only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show aws. + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current AWS profile gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' DEFAULT) + # + # If your current AWS profile is "company_test", its class is TEST + # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=2 + # typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AWS_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=3 + # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # AWS segment format. The following parameters are available within the expansion. + # + # - P9K_AWS_PROFILE The name of the current AWS profile. + # - P9K_AWS_REGION The region associated with the current AWS profile. + typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}' + + #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]# + # AWS Elastic Beanstalk environment color. + typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]########## + # Show azure only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show azure. + typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + # Azure account name color. + typeset -g POWERLEVEL9K_AZURE_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### + # Show gcloud only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show gcloud. + typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil' + # Google cloud color. + typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=4 + + # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or + # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative + # enough. You can use the following parameters in the expansions. Each of them corresponds to the + # output of `gcloud` tool. + # + # Parameter | Source + # -------------------------|-------------------------------------------------------------------- + # P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)' + # P9K_GCLOUD_ACCOUNT | gcloud config get-value account + # P9K_GCLOUD_PROJECT_ID | gcloud config get-value project + # P9K_GCLOUD_PROJECT_NAME | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)' + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'. + # + # Obtaining project name requires sending a request to Google servers. This can take a long time + # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud + # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets + # set and gcloud prompt segment transitions to state COMPLETE. + # + # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL + # and COMPLETE. You can also hide gcloud in state PARTIAL by setting + # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and + # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty. + typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}' + typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}' + + # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name + # this often. Negative value disables periodic polling. In this mode project name is retrieved + # only when the current configuration, account or project id changes. + typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60 + + # Custom icon. + # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]# + # Show google_app_cred only when the command you are typing invokes one of these tools. + # Tip: Remove the next line to always show google_app_cred. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt' + + # Google application credentials classes for the purpose of using different colors, icons and + # expansions with different credentials. + # + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first + # element in each pair defines a pattern against which the current kubernetes context gets + # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion + # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION + # parameters, you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order. + # The first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD + # '*:*test*:*' TEST + # '*' DEFAULT) + # + # If your current Google application credentials is "service_account deathray-testing x@y.com", + # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=3 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID' + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=( + # '*:*prod*:*' PROD # These values are examples that are unlikely + # '*:*test*:*' TEST # to match your needs. Customize them as needed. + '*' DEFAULT) + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=5 + # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by + # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion. + # + # You can use the following parameters in the expansion. Each of them corresponds to one of the + # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS. + # + # Parameter | JSON key file field + # ---------------------------------+--------------- + # P9K_GOOGLE_APP_CRED_TYPE | type + # P9K_GOOGLE_APP_CRED_PROJECT_ID | project_id + # P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email + # + # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'. + typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}' + + ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]############### + # Toolbox color. + typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=3 + # Don't display the name of the toolbox if it matches fedora-toolbox-*. + typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}' + # Custom icon. + # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' + # Custom prefix. + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' + + ###############################[ public_ip: public IP address ]############################### + # Public IP color. + typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=6 + # Custom icon. + # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ########################[ vpn_ip: virtual private network indicator ]######################### + # VPN IP color. + typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=3 + # When on VPN, show just an icon without the IP address. + # Tip: To display the private IP address when on VPN, remove the next line. + typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION= + # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN + # to see the name of the interface. + typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*' + # If set to true, show one segment per matching network interface. If set to false, show only + # one segment corresponding to the first matching network interface. + # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION. + typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false + # Custom icon. + # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ###########[ ip: ip address and bandwidth usage for a specified network interface ]########### + # IP color. + typeset -g POWERLEVEL9K_IP_FOREGROUND=4 + # The following parameters are accessible within the expansion: + # + # Parameter | Meaning + # ----------------------+------------------------------------------- + # P9K_IP_IP | IP address + # P9K_IP_INTERFACE | network interface + # P9K_IP_RX_BYTES | total number of bytes received + # P9K_IP_TX_BYTES | total number of bytes sent + # P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt + # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt + # P9K_IP_RX_RATE | receive rate (since last prompt) + # P9K_IP_TX_RATE | send rate (since last prompt) + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %2F<$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %3F>$P9K_IP_TX_RATE}' + # Show information for the first network interface whose name matches this regular expression. + # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. + typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' + # Custom icon. + # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #########################[ proxy: system-wide http/https/ftp proxy ]########################## + # Proxy color. + typeset -g POWERLEVEL9K_PROXY_FOREGROUND=2 + # Custom icon. + # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ################################[ battery: internal battery ]################################# + # Show battery in red when it's below this level and not connected to power supply. + typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20 + typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1 + # Show battery in green when it's charging or fully charged. + typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2 + # Show battery in yellow when it's discharging. + typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3 + # Battery pictograms going from low to high level of charge. + typeset -g POWERLEVEL9K_BATTERY_STAGES=('battery') + # Don't show the remaining time to charge/discharge. + typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false + + #####################################[ wifi: wifi speed ]##################################### + # WiFi color. + typeset -g POWERLEVEL9K_WIFI_FOREGROUND=4 + # Custom icon. + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS). + # + # # Wifi colors and icons for different signal strength levels (low to high). + # typeset -g my_wifi_fg=(4 4 4 4 4) # <-- change these values + # typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi') # <-- change these values + # + # typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps' + # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}' + # + # The following parameters are accessible within the expansions: + # + # Parameter | Meaning + # ----------------------+--------------- + # P9K_WIFI_SSID | service set identifier, a.k.a. network name + # P9K_WIFI_LINK_AUTH | authentication protocol such as "wpa2-psk" or "none"; empty if unknown + # P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second + # P9K_WIFI_RSSI | signal strength in dBm, from -120 to 0 + # P9K_WIFI_NOISE | noise in dBm, from -120 to 0 + # P9K_WIFI_BARS | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE) + + ####################################[ time: current time ]#################################### + # Current time color. + typeset -g POWERLEVEL9K_TIME_FOREGROUND=6 + # Format for the current time: 09:51:02. See `man 3 strftime`. + typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}' + # If set to true, time will update when you hit enter. This way prompts for the past + # commands will contain the start times of their commands as opposed to the default + # behavior where they contain the end times of their preceding commands. + typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false + # Custom icon. + typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION= + # Custom prefix. + # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' + + # Example of a user-defined prompt segment. Function prompt_example will be called on every + # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or + # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and green text greeting the user. + # + # Type `p10k help segment` for documentation and a more sophisticated example. + function prompt_example() { + p10k segment -f 2 -i '*' -t 'hello, %n' + } + + # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job + # is to generate the prompt segment for display in instant prompt. See + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # + # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function + # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k + # will replay these calls without actually calling instant_prompt_*. It is imperative that + # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this + # rule is not observed, the content of instant prompt will be incorrect. + # + # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If + # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt. + function instant_prompt_example() { + # Since prompt_example always makes the same `p10k segment` calls, we can call it from + # instant_prompt_example. This will give us the same `example` prompt segment in the instant + # and regular prompts. + prompt_example + } + + # User-defined prompt segments can be customized the same way as built-in segments. + # typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=208 + # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐' + + # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt + # when accepting a command line. Supported values: + # + # - off: Don't change prompt when accepting a command line. + # - always: Trim down prompt when accepting a command line. + # - same-dir: Trim down prompt when accepting a command line unless this is the first command + # typed after changing current working directory. + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off + + # Instant prompt mode. + # + # - off: Disable instant prompt. Choose this if you've tried instant prompt and found + # it incompatible with your zsh configuration files. + # - quiet: Enable instant prompt and don't print warnings when detecting console output + # during zsh initialization. Choose this if you've read and understood + # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # - verbose: Enable instant prompt and print a warning when detecting console output during + # zsh initialization. Choose this if you've never tried instant prompt, haven't + # seen the warning, or if you are unsure what this all means. + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + + # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. + # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload + # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you + # really need it. + typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true + + # If p10k is already loaded, reload configuration. + # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true. + (( ! $+functions[p10k] )) || p10k reload +} + +# Tell `p10k configure` which file it should overwrite. +typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a} + +(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]} +'builtin' 'unset' 'p10k_config_opts' diff --git a/.sig-random.txt b/.sig-random.txt new file mode 100644 index 0000000..56d4160 --- /dev/null +++ b/.sig-random.txt @@ -0,0 +1,129 @@ +The quieter you become, the more you can hear. +— Ram Dass +%% +Be yourself; everyone else is already taken. +— Oscar Wilde +%% +Be the change that you wish to see in the world. +— Mahatma Gandhi +%% +Don’t walk in front of me... I may not follow +Don’t walk behind me... I may not lead +Walk beside me... just be my friend +— Albert Camus +%% +If you tell the truth, you don't have to remember anything. +— Mark Twain +%% +To live is the rarest thing in the world. Most people exist, +that is all. +— Oscar Wilde +%% +Live as if you were to die tomorrow. Learn as if you were to +live forever. +— Mahatma Gandhi +%% +Whenever you find yourself on the side of the majority, +it is time to reform (or pause and reflect). +— Mark Twain +%% +The man who does not read has no advantage over the man who cannot read. +— Mark Twain +%% +By three methods we may learn wisdom: First, by reflection, +which is noblest; Second, by imitation, which is easiest; +and third by experience, which is the bitterest. +— Confucius +%% +They must often change, who would be constant in happiness or wisdom. +— Confucius +%% +Do the difficult things while they are easy and do the great things while +they are small. A journey of a thousand miles must begin with a single step. +— Lao Tzu +%% +The pay is good and I can walk to work. +— John F. Kennedy +%% +The beginning is the most important part of the work. +— Plato +%% +Far and away the best prize that life has to offer is the chance to +work hard at work worth doing. +— Theodore Roosevelt +%% +Our prime purpose in this life is to help others. +And if you can't help them, at least don't hurt them. +— Dalai Lama +%% +Nothing in life is to be feared, it is only to be understood. +Now is the time to understand more, so that we may fear less. +— Marie Curie +%% +Life is really simple, but we insist on making it complicated. +— Confucius +%% +We do not remember days, we remember moments. +— Cesare Pavese +%% +Do not dwell in the past, do not dream of the future, +concentrate the mind on the present moment. +— Buddha +%% +He who has a why to live can bear almost any how. +— Friedrich Nietzsche +%% +In a rich man's house there is no place to spit but his face. +— Diogenes +%% +A seed grows with no sound, but a tree falls with a huge noise. +Destruction has noise, but creation is quiet. This is the power of silence. +Grow silently. +— Confucius +%% +Be a free thinker and don't accept everything you hear as truth. +Be critical and evaluate what you believe in. +— Aristotle +%% +Excellence is never an accident. It is always the result of high intention, +sincere effort, and intelligent execution; it represents the wise choice +of many alternatives - choice, not chance, determines your destiny. +— Aristotle +%% +To appreciate the beauty of a snow flake, it is necessary to stand out in the cold. +— Aristotle +%% +The weak are always anxious for justice and equality. +The strong pay no heed to either. +— Aristotle +%% +Educating the mind without educating the heart is no education at all. +— Aristotle +%% +It is our choice of good or evil that determines our character, +not our opinion about good or evil. +— Aristotle +%% +A fool contributes nothing worth hearing and takes offense at everything. +— Aristotle +%% +Happiness is a quality of the soul… +not a function of one's material circumstances. +— Aristotle +%% +The intelligence consists not only in the knowledge +but also in the skill to apply the knowledge into practice. +— Aristotle +%% +I came here to chew ass and kick bubblegum but I have no ass +and I forgot my bubblegum at home so uhhhhhh +(found somewhere online) +%% +If you can’t measure it, you can’t improve it. +— Peter Drucker +%% +To get a good idea, get lots of ideas +— Marc Rettig +%% +I'm here to kick ass and chew bubblegum and I'm all out of bubblegum. +(found somewhere online) diff --git a/.tmux.cheatsheet b/.tmux.cheatsheet new file mode 100644 index 0000000..b1d07f3 --- /dev/null +++ b/.tmux.cheatsheet @@ -0,0 +1,187 @@ + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Sessions ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ $ tmux ┃ ┃ $ tmux ls ┃ + ┃ $ tmux new ┃ ┃ $ tmux list-sessions ┃ + ┃ $ tmux new-session ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + ┃ : new ┃ [Ctrl] + [b] [s] + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Show all sessions + Start a new session + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ $ tmux a ┃ + ┃ $ tmux new -s mysession ┃ ┃ $ tmux at ┃ + ┃ : new -s mysession ┃ ┃ $ tmux attach ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┃ $ tmux attach-session ┃ + Start a new session with the name ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + mysession Attach to last session + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ $ tmux kill-ses -t mysession ┃ ┃ $ tmux a -t mysession ┃ + ┃ $ tmux kill-session -t mysession ┃ ┃ $ tmux at -t mysession ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┃ $ tmux attach -t mysession ┃ + kill/delete session mysession ┃ $ tmux attach-session -t mysession ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ Attach to a session with the name + ┃ $ tmux kill-session -a ┃ mysession + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + kill/delete all sessions but the [Ctrl] + [b] [(] + current Move to previous session + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ [Ctrl] + [b] [)] + ┃ $ tmux kill-session -a -t mysession┃ Move to next session + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + kill/delete all sessions but + mysession + + [Ctrl] + [b] [$] + Rename session + + [Ctrl] + [b] [d] + Detach from session + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : attach -d ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Detach others on the session + (Maximize window by detach other + clients) + + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Windows ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ $ tmux new -s mysession -n mywindow┃ [Ctrl] + [b] [n] + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Next window + start a new session with the name + mysession and window mywindow [Ctrl] + [b] [0] ... [9] + Switch/select window by number + [Ctrl] + [b] [c] + Create window ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : swap-window -s 2 -t 1 ┃ + [Ctrl] + [b] [,] ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Rename current window Reorder window, swap window number + 2(src) and 1(dst) + [Ctrl] + [b] [&] + Close current window ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : swap-window -t -1 ┃ + [Ctrl] + [b] [p] ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Previous window Move current window to the left by + one position + + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Panes ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + + [Ctrl] + [b] [;] [Ctrl] + [b] [q] + Toggle last active pane Show pane numbers + + [Ctrl + [b] [%] [Ctrl] + [b] [q] [0] ... [9] + Split pane vertically Switch/select pane by number + + [Ctrl + [b] ["] [Ctrl] + [b] [z] + Split pane horizontally Toggle pane zoom + + [Ctrl + [b] [{] [Ctrl] + [b] [!] + Move the current pane left Convert pane into a window + + [Ctrl + [b] [}] [Ctrl] + [b] + [Up] + Move the current pane right [Ctrl] + [b] [Ctrl] + [Up] + [Ctrl] + [b] + [Down] + [Ctrl + [b] [Up] [Ctrl] + [b] [Ctrl] + [Down] + [Ctrl + [b] [Down] Resize current pane height + [Ctrl + [b] [Right] (holding second key is optional) + [Ctrl + [b] [Left] + Switch to pane to the direction [Ctrl] + [b] + [Right] + [Ctrl] + [b] [Ctrl] + [Right] + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ [Ctrl] + [b] + [Left] + ┃ : setw synchronize-panes ┃ [Ctrl] + [b] [Ctrl] + [Left] + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Resize current pane width + Toggle synchronize-panes (holding second key is optional) + (send command to all panes) + [Ctrl] + [b] [x] + [Ctrl] + [b] [Spacebar] Close current pane + Toggle between pane layouts + + [Ctrl] + [b] [o] + Switch to next pane + + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Copy Mode ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : setw -g mode-keys vi ┃ [/] + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Search forward + use vi keys in buffer + [?] + [Ctrl] + [b] [[] Search backward + Enter copy mode + [n] + [Ctrl] + [b] [PgUp] Next keyword occurance + Enter copy mode and scroll one + page up [N] + Previous keyword occurance + [q] + Quit mode [Spacebar] + Start selection + [g] + Go to top line [Esc] + Clear selection + [G] + Go to bottom line [Enter] + Copy selection + [Up] + Scroll up [Ctrl] + [b] []] + Paste contents of buffer_0 + [Down] + Scroll down ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : show-buffer ┃ + [h] ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Move cursor left display buffer_0 contents + + [j] ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + Move cursor down ┃ : capture-pane ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + [k] copy entire visible contents of pane + Move cursor up to a buffer + + [l] ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + Move cursor right ┃ : list-buffers ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + [w] Show all buffers + Move cursor forward one word + at a time ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : choose-buffer ┃ + [b] ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Move cursor backward one word Show all buffers and paste selected + at a time + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : save-buffer buf.txt ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Save buffer contents to buf.txt + + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : delete-buffer -b 1 ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + delete buffer_1 + + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Misc ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + [Ctrl] + [b] [:] ┃ : setw -g OPTION ┃ + Enter command mode ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Set OPTION for all windows + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ : set -g OPTION ┃ + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + Set OPTION for all sessions + + ╔════════════════════════════════════════════════════════════════════════════╗ + ║ Help ║ + ╚════════════════════════════════════════════════════════════════════════════╝ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ $ tmux info ┃ [Ctrl] + [b] [?] + ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ Show shortcuts + Show every session, window, pane, + etc... diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..effa2ce --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,131 @@ +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ ___ ___ ___ ___ ║ +# ║ /\ \ /\__\ /\__\ |\__\ ║ +# ║ \:\ \ /::| | /:/ / |:| | ║ +# ║ \:\ \ /:|:| | /:/ / |:| | ║ +# ║ /::\ \ /:/|:|__|__ /:/ / ___ |:|__|__ ║ +# ║ /:/\:\__\ /:/ |::::\__\ /:/__/ /\__\ ____/::::\__\ ║ +# ║ /:/ \/__/ \/__/~~/:/ / \:\ \ /:/ / \::::/~~/~ ║ +# ║ /:/ / /:/ / \:\ /:/ / ~~|:|~~| ║ +# ║ \/__/ /:/ / \:\/:/ / |:| | ║ +# ║ /:/ / \::/ / |:| | ║ +# ║ \/__/ \/__/ \|__| ║ +# ║ 3.1 ║ +# ║ ║ +# ║ xn--gckvb8fzb.com * github.com/mrusme * marius@xn--gckvb8fzb.com ║ +# ║ ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +set -sg escape-time 0 +unbind C-b +set-option -g prefix C-a +set-option -g update-environment "DISPLAY WAYLAND_DISPLAY SWAYSOCK SSH_AUTH_SOCK" +bind-key C-a send-prefix + +# bind -n C-k send-keys -R +bind r source-file ~/.tmux.conf + +# Enable Home / End key +bind -n End send-key C-e +bind -n Home send-key C-a + +set -g default-terminal "screen-256color" +setw -g mode-keys vi + +set-option -g history-limit 5000 + +# https://gist.github.com/mrusme/9d402b121f20ebe479588ab90de9e93f +bind ? send-keys -t.- 'cat ~/.tmux.cheatsheet' Enter + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Window/Pane management ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +bind = split-window -h +bind - split-window -v +unbind '"' +unbind % +unbind C-k + +bind Left select-pane -L +bind Right select-pane -R +bind Up select-pane -U +bind Down select-pane -D + +bind h select-pane -L +bind l select-pane -R +bind k select-pane -U +bind j select-pane -D + +bind . select-pane -t :.+ + +bind H select-pane -m \; select-pane -L \; swap-pane \; select-pane -M\; select-pane -L +bind L select-pane -m \; select-pane -R \; swap-pane \; select-pane -M\; select-pane -R +bind K select-pane -m \; select-pane -U \; swap-pane \; select-pane -M\; select-pane -U +bind J select-pane -m \; select-pane -D \; swap-pane \; select-pane -M\; select-pane -D + +bind C-c setw synchronize-panes + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Mouse ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +set -g mouse on + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Activity/bell ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +# set-option -g visual-activity on +# set-option -g visual-bell on +# set-option -g visual-silence off +# set-window-option -g monitor-activity off +# set-option -g bell-action none + + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Theme/Style ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +setw -g clock-mode-colour colour15 +setw -g mode-style fg=colour15,bg=default,none + +set -g pane-border-style fg=colour0,bg=default +set -g pane-active-border-style fg=colour207,bg=default + +# set -g status-interval 1 +set -g status-position bottom +set -g status-justify centre +set -g status-style fg=colour137,bg=default,dim +set -g status-interval 30 + +set -g status-left "#[fg=colour15]#(date +"%H:%M")#[fg=colour4] hrs " +set -ag status-left "#[fg=colour15]#(date +"%d/%m")#[fg=colour4] #(date +"%Y") " +set -g status-left-length 22 + +set -g status-right '#[fg=colour15]#{cpu_temp} #[fg=colour4]#{gpu_temp} ' +set -ag status-right '#[fg=colour15]#{battery_percentage} #[fg=colour4]#{battery_remain} ' +set -ag status-right '#[fg=colour15]#W #(if echo #W | grep -q "ssh"; then echo "#[fg=colour9]REMOTE HOST"; else echo "#[fg=colour4]#H"; fi)' +set -g status-right-length 58 + +setw -g window-status-current-style fg=colour0,bg=default,none +set -g window-status-current-format "#[fg=colour15] #W" + +setw -g window-status-style fg=colour10,bg=default,none +set -g window-status-format "#[fg=colour4] #W" + +setw -g window-status-bell-style fg=colour15,bg=default,none + +set -g message-style fg=colour0,bg=colour10,none + + +# ╔════════════════════════════════════════════════════════════════════════════╗ +# ║ Plugins ║ +# ╚════════════════════════════════════════════════════════════════════════════╝ + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-cpu' + +run -b '~/.tmux/plugins/tpm/tpm' diff --git a/.tmux/plugins/tmux-battery b/.tmux/plugins/tmux-battery new file mode 160000 index 0000000..5c52d4f --- /dev/null +++ b/.tmux/plugins/tmux-battery @@ -0,0 +1 @@ +Subproject commit 5c52d4f7f80384de0781c2277a8989ba98fae507 diff --git a/.tmux/plugins/tmux-cpu b/.tmux/plugins/tmux-cpu new file mode 160000 index 0000000..98d7871 --- /dev/null +++ b/.tmux/plugins/tmux-cpu @@ -0,0 +1 @@ +Subproject commit 98d787191bc3e8f19c3de54b96ba1caf61385861 diff --git a/.tmux/plugins/tmux-resurrect b/.tmux/plugins/tmux-resurrect new file mode 160000 index 0000000..6df0405 --- /dev/null +++ b/.tmux/plugins/tmux-resurrect @@ -0,0 +1 @@ +Subproject commit 6df04051fe14032d1825fba8fee51d9e9dc8de40 diff --git a/.tmux/plugins/tpm b/.tmux/plugins/tpm new file mode 160000 index 0000000..fdb3022 --- /dev/null +++ b/.tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit fdb30228b1dc649ab1c2086d146ef9dd0ab584e6 diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..762e7ee --- /dev/null +++ b/.vale.ini @@ -0,0 +1,10 @@ +StylesPath = .local/share/vale +MinAlertLevel = suggestion + +Packages = Microsoft, Readability, alex, proselint + +[*.md] +BasedOnStyles = Vale, alex, proselint, Readability + +[*.txt] +BasedOnStyles = Vale, Microsoft, alex, proselint, Readability diff --git a/.w3m/config b/.w3m/config new file mode 100644 index 0000000..568e0bd --- /dev/null +++ b/.w3m/config @@ -0,0 +1,163 @@ +tabstop 8 +indent_incr 4 +pixel_per_char 13 +pixel_per_line 28 +frame 0 +target_self 0 +open_tab_blank 0 +open_tab_dl_list 0 +display_link 1 +display_link_number 0 +decode_url 1 +display_lineinfo 0 +ext_dirlist 1 +dirlist_cmd file:///$LIB/dirlist.cgi +use_dictcommand 1 +dictcommand file:///$LIB/w3mdict.cgi +multicol 0 +alt_entity 0 +graphic_char 0 +display_borders 0 +disable_center 0 +fold_textarea 0 +display_ins_del 1 +ignore_null_img_alt 1 +view_unseenobject 0 +display_image 1 +pseudo_inlines 1 +auto_image 1 +max_load_image 4 +ext_image_viewer 1 +image_scale 100 +inline_img_protocol 2 +imgdisplay w3mimgdisplay +image_map_list 1 +fold_line 0 +show_lnum 0 +show_srch_str 1 +label_topline 0 +nextpage_topline 0 +color 1 +basic_color terminal +anchor_color blue +image_color green +form_color red +mark_color cyan +bg_color terminal +active_style 0 +active_color cyan +visited_anchor 0 +visited_color magenta +pagerline 10000 +use_history 1 +history 100 +save_hist 1 +confirm_qq 1 +close_tab_back 0 +mark 0 +emacs_like_lineedit 0 +space_autocomplete 0 +vi_prec_num 0 +mark_all_pages 0 +wrap_search 0 +ignorecase_search 1 +use_mouse 1 +reverse_mouse 0 +relative_wheel_scroll 0 +relative_wheel_scroll_ratio 30 +fixed_wheel_scroll_count 5 +clear_buffer 1 +decode_cte 0 +auto_uncompress 0 +preserve_timestamp 1 +keymap_file keymap +document_root +personal_document_root +cgi_bin +index_file +mime_types ~/.mime.types, /usr/etc/mime.types +mailcap ~/.w3m/mailcap, /usr/etc/w3m/mailcap +urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap +editor /usr/bin/vi +mailto_options 1 +mailer /usr/bin/mail +extbrowser /usr/bin/librewolf +extbrowser2 +extbrowser3 +extbrowser4 +extbrowser5 +extbrowser6 +extbrowser7 +extbrowser8 +extbrowser9 +bgextviewer 1 +use_lessopen 0 +passwd_file ~/.w3m/passwd +disable_secret_security_check 0 +ftppasswd +ftppass_hostnamegen 1 +pre_form_file ~/.w3m/pre_form +siteconf_file ~/.w3m/siteconf +user_agent +no_referer 0 +cross_origin_referer 1 +accept_language de;q=1.0, en;q=0.5 +accept_encoding gzip, compress, bzip, bzip2, deflate, br +accept_media text/html, text/*;q=0.5, image/* +argv_is_url 1 +retry_http 1 +default_url 1 +follow_redirection 10 +meta_refresh 0 +localhost_only 0 +dns_order 0 +nntpserver +nntpmode +max_news 50 +use_proxy 1 +http_proxy +https_proxy +gopher_proxy +ftp_proxy +no_proxy +noproxy_netaddr 1 +no_cache 0 +ssl_forbid_method 2, 3, t, 5 +ssl_min_version +ssl_cipher +ssl_verify_server 1 +ssl_cert_file +ssl_key_file +ssl_ca_path +ssl_ca_file +ssl_ca_default 1 +use_cookie 1 +show_cookie 0 +accept_cookie 1 +accept_bad_cookie 0 +cookie_reject_domains +cookie_accept_domains +cookie_avoid_wrong_number_of_dots +display_charset UTF-8 +document_charset UTF-8 +auto_detect 2 +system_charset UTF-8 +follow_locale 1 +ext_halfdump 0 +use_wide 1 +use_combining 1 +east_asian_width 0 +use_language_tag 1 +ucs_conv 1 +pre_conv 0 +search_conv 1 +fix_width_conv 1 +use_gb12345_map 0 +use_jisx0201 0 +use_jisc6226 0 +use_jisx0201k 0 +use_jisx0212 0 +use_jisx0213 0 +strict_iso2022 1 +gb18030_as_ucs 0 +simple_preserve_space 0 diff --git a/.zaliases b/.zaliases new file mode 120000 index 0000000..36c8973 --- /dev/null +++ b/.zaliases @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zaliases \ No newline at end of file diff --git a/.zlogin b/.zlogin new file mode 120000 index 0000000..540c374 --- /dev/null +++ b/.zlogin @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zlogin \ No newline at end of file diff --git a/.zlogout b/.zlogout new file mode 120000 index 0000000..7b40034 --- /dev/null +++ b/.zlogout @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zlogout \ No newline at end of file diff --git a/.zprezto b/.zprezto new file mode 160000 index 0000000..769897d --- /dev/null +++ b/.zprezto @@ -0,0 +1 @@ +Subproject commit 769897d58e197c1c169e0e0077c184f187863cf0 diff --git a/.zpreztorc b/.zpreztorc new file mode 120000 index 0000000..7152a49 --- /dev/null +++ b/.zpreztorc @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zpreztorc \ No newline at end of file diff --git a/.zprofile b/.zprofile new file mode 120000 index 0000000..828a4d1 --- /dev/null +++ b/.zprofile @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zprofile \ No newline at end of file diff --git a/.zshenv b/.zshenv new file mode 120000 index 0000000..fa7e2ef --- /dev/null +++ b/.zshenv @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zshenv \ No newline at end of file diff --git a/.zshrc b/.zshrc new file mode 120000 index 0000000..4c529a9 --- /dev/null +++ b/.zshrc @@ -0,0 +1 @@ +/home/dominic/.zprezto/runcoms/zshrc \ No newline at end of file diff --git a/bin/backup.sh b/bin/backup.sh new file mode 100755 index 0000000..50628b8 --- /dev/null +++ b/bin/backup.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Simple rsync backup script for my MacBookPro +# +# Dominic Reich, OE7DRT, dominic@mm.st + +# we don't need this, because we run sudo below… +# if [ "$EUID" -ne 0 ] +# then echo "Not root. Exiting." +# exit +# fi + +# rsync -qaR \ +# --append-verify + +# good, but not effective (another way to do this) +# sudo rsync -avzhRP --del --stats --inplace \ +# --include='/etc/***' \ +# --include='/boot/***' \ +# --include='/home/***' \ +# --include='/usr/local/***' \ +# --include='/opt/***' \ +# --include='/lib/systemd/system' \ +# --exclude='*' \ +# / nas:/volume1/NetBackup/polaris-kde-2022/ + +## The old code — since I use sudo below, I do this +## with a more privileged user in one run because I +## also want to backup some system files + +#rsync -avzh --delete-delay --stats --partial \ +# --append-verify --inplace --progress \ +# --exclude '.cache' \ +# --exclude '.gvfs' \ +# --exclude '.DS_Store' \ +# --exclude 'Thumbs.db' \ +# --exclude 'lost+found' \ +# --exclude '.Trash' \ +# --exclude '.bash_history' \ +# --exclude '.zhistory' \ +# --exclude '.local/share/Steam/steamapps/common/' \ +# --exclude 'Musik/nas/' \ +# --exclude 'NetBackup/' \ +# --exclude 'SynologyDrive/' \ +# '/home/dominic/./' nas:/volume1/NetBackup/polaris-kde-2022/sync/ + +#sudo rsync -avzhRP --del --stats --inplace \ +sudo rsync -avzhRP --del --stats \ + --exclude 'BACKUP_LINUX_DISK/***' \ + --exclude 'BACKUP_OLDMAC/***' \ + --exclude '.SynologyDrive/***' \ + --exclude 'SynologyDrive/***' \ + --exclude '.cache/***' \ + --exclude '.gvfs/***' \ + --exclude '.DS_Store' \ + --exclude 'Thumbs.db' \ + --exclude 'lost+found/***' \ + --exclude '.Trash/***' \ + --exclude 'Steam/***' \ + --exclude '_nas-*/***' \ + --exclude 'Attack/***' \ + '/./etc' \ + '/./boot' \ + '/./home' \ + '/./usr/local' \ + '/./opt' \ + '/./root' \ + '/./lib/systemd/system' \ + '/./var/lib/libvirt' \ + nas:/volume1/NetBackup/polaris-arch/./ + diff --git a/bin/call.py b/bin/call.py new file mode 100755 index 0000000..63b6db7 --- /dev/null +++ b/bin/call.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 + +"""Lookup DMR users on radioid.net + +This script fetches user information from radioid.net API and +prints them to stdout. + +Created: maybe back in 2021 +Last modified: 2023-01-02 00:07:34+0100 + +Usage: +------ + With arguments + ./call.py [callsign]|[dmrid].... + + Without arguments - but enter them when the script asks you for them + ./call.py + + +Examples: +--------- + ❯ ./call.py oe7drt oe%kbc + DMRID CALLSIGN FIRSTNAME CITY COUNTRY + 2327180 OE7DRT Dominic Laengenfeld Austria + 2327212 OE7DRT Dominic Laengenfeld Austria + 2321001 OE1KBC Kurt Wien Austria + 2321002 OE1KBC Kurt Wien Austria + 2321003 OE1KBC Kurt Wien Austria + 2328023 OE8KBC Kurt Saurachberg Austria + + ❯ ./call.py 2327212 + DMRID CALLSIGN FIRSTNAME CITY COUNTRY + 2327180 OE7DRT Dominic Laengenfeld Austria + 2327212 OE7DRT Dominic Laengenfeld Austria +""" + +import re # regex +import sys +import requests + + +def printFormatted(data: dict) -> None: + """Formats and prints to stdout. + + Expects data coming in as dict, returns nothing but + the text printed out to stdout.""" + print("{:>7.8} {:<8.8} {:12.12} {:12.12} {:13.13}".format( + str(data['id']), + data['callsign'], + data['fname'], + data['city'], + data['country'])) + + +def getFromCallsign(url: str, call: str) -> dict: + """Maps the given callsign to a DMRID + + Uses the given base-url and callsign and fetches the + connected DMRIDs. Loops over the result and executes + printFormatted to print the results to stdout.""" + r = requests.get(url + "/api/dmr/user/?callsign={}".format(call)) + for ids in range(0, r.json()['count']): + printFormatted(r.json()['results'][ids]) + + +def main(): + """main function + + Runs if script is run by itself.""" + if len(sys.argv) <= 1: + # Check if arguments were given, if not, let the user + # input some here + arguments = [] + + userinput = input("No arguments found, enter them now: ") + words = userinput.split() + for word in words: + arguments.append(word) + else: + # If arguments were given, take them and move on + arguments = sys.argv[1:] + + # Using these regex pattern to match agains valid DMRIDs + # and callsigns. The callsign pattern was taken from + # + # and slighty modifed to also allow the percent sign (%) used by + # used by radioid.net as wildmask. + dmrid_userid_patt = re.compile("^[0-9]{7}$") + dmrid_rep_patt = re.compile("^[0-9]{6}$") + # dmrid_other_patt = re.compile("^[0-9]{0,5}$") + call_patt = re.compile("^[a-zA-Z0-9%]{1,3}[0123456789%][a-zA-Z0-9%]{0,2}[a-zA-Z%]$") + + baseurl = 'https://www.radioid.net' + + print(" DMRID CALLSIGN FIRSTNAME CITY COUNTRY") + + for arg in arguments: + if dmrid_userid_patt.match(arg): + # A valid DMRID was found, so we have to lookup the + # callsign and we may get more DMRIDs for this OM + # Valid means 7 chars long, all numbers. We do not know + # yet if the id really exists. + r = requests.get(baseurl + '/api/dmr/user/?id={}'.format(arg)) + if r.status_code == 200: + # Only fetch more DMRIDs if the first one exists, + # otherwise we would try to run code on an non + # existing variable + getFromCallsign(baseurl, r.json()['results'][0]['callsign']) + + elif dmrid_rep_patt.match(arg): + # A valid repeater ID was found. Valid means, technically + # correct -> 6 characters long, all numbers + print("{} looks like a repeater. Skipping for now.".format(arg)) + + # elif dmrid_other_patt.match(arg): + # # Print a warning for numbers less than 6 characters + # print("{} is not a valid dmr id!".format(arg)) + + elif call_patt.match(arg): + getFromCallsign(baseurl, arg) + + else: + print('{} is an invalid value'.format(arg)) + + +if __name__ == "__main__": + main() diff --git a/bin/change_subject.sh b/bin/change_subject.sh new file mode 100755 index 0000000..5ba6b45 --- /dev/null +++ b/bin/change_subject.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +FILE="/tmp/mailtmp.txt" +OLD_SUBJECT="/tmp/mailsubject.txt" + +trap "rm ${FILE}; exit" SIGHUP SIGINT SIGTERM + +# create empty file +>${FILE} + +if [[ -w ${OLD_SUBJECT} ]]; then + # read subject from file + oldsubject=$(<${OLD_SUBJECT}) +else + # create empty file + >$OLD_SUBJECT + oldsubject="New subject" +fi + +# set subject line +kdialog --inputbox "New subject:" "${oldsubject}" >${OLD_SUBJECT} + +subject=$(<${OLD_SUBJECT}) + +# save mail in file +cat $* > ${FILE} + +# change subject line +sed -i "s/^Subject: \(.*\)/Subject: ${subject}/" ${FILE} + +# return file +cat ${FILE} + +# delete email file +rm ${FILE} + diff --git a/bin/cloudlogbashcat.sh b/bin/cloudlogbashcat.sh new file mode 100755 index 0000000..2fc5aca --- /dev/null +++ b/bin/cloudlogbashcat.sh @@ -0,0 +1,131 @@ +#! /bin/bash + +# cloudlogbashcat.sh +# A simple script to keep Cloudlog in synch with rigctld or flrig. +# Copyright (C) 2018 Tony Corbett, G0WFV +# +# 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 2 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +DEBUG=0 + +rigFreq=0 +rigOldFreq=1 + +rigMode="MATCH" +rigOldMode="NO MATCH" + +delay=1 + +# load in config ... +source ~/.config/cloudlogbashcat/conf + +simpleArg() { + local arg="$1" + local type=${arg%%:*} val=${arg#*:} + echo -e "${indent}<$type>$val" +} + +structArg() { + local arg="$1" + : parse wait complete ... +} + +generateRequestXml() { + method=$1; shift + echo '' + echo "" + echo " $method" + echo " " + + indent=" " + for arg; do + indent="${indent} " + case $arg in + struct:*) structArg "$arg";; + *) simpleArg "$arg";; + esac + done + + echo " " + echo "" +} + +while true; do + case $rigControlSoftware in + rigctld) + # Open FD 3 to rig control server ... + exec 3<>/dev/tcp/$host/$port + + if [[ $? -ne 0 ]]; then + echo "Unable to contact server" >&2 + exit 1 + fi + + # Get rigctld frequency, mode and bandwidth - accepts multiple commands + echo -e "fm" >&3 + read -r -u3 rigFreq + read -r -u3 rigMode + read -r -u3 rigWidth + + # Close FD 3 + exec 3>&- + ;; + + flrig) + # Get flrig frequency ... + rpcxml=$(generateRequestXml "rig.get_vfo") + rigFreq=$(curl -k $verbose --data "$rpcxml" "$host:$port" 2>/dev/null | xmllint --format --xpath '//value/text()' - 2>&1) + + if [[ $? -ne 0 ]]; then + echo "Unable to contact server" >&2 + exit 1 + fi + + # Get flrig mode ... + rpcxml=$(generateRequestXml "rig.get_mode") + rigMode=$(curl -k $verbose --data "$rpcxml" "$host:$port" 2>/dev/null | xmllint --format --xpath '//value/text()' -) + ;; + + *) + echo "Unknown rig control server type" >&2 + exit 1 + ;; + esac + + + + if [ $rigFreq -ne $rigOldFreq ] || [ "$rigMode" != "$rigOldMode" ]; then + # rig freq or mode changed, update Cloudlog + [[ $DEBUG -eq 1 ]] && printf "%-10d %-6s\n" $rigFreq $rigMode + rigOldFreq=$rigFreq + rigOldMode=$rigMode + + curl --silent --insecure \ + --header "Content-Type: application/json" \ + ${cloudlogHttpAuth:+"--header"} \ + ${cloudlogHttpAuth:+"Authorization: $cloudlogHttpAuth"} \ + --request POST \ + --data "{ + \"key\":\"$cloudlogApiKey\", + \"radio\":\"$cloudlogRadioId\", + \"frequency\":\"$rigFreq\", + \"mode\":\"$rigMode\", + \"timestamp\":\"$(date -u +"%Y/%m/%d %H:%M")\" + }" $cloudlogApiUrl >/dev/null 2>&1 + fi + + sleep $delay +done + diff --git a/bin/date.php b/bin/date.php new file mode 100755 index 0000000..1f8c51b --- /dev/null +++ b/bin/date.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php + + * Last modified: Freitag, 02.11.2018 06:13 + * IRC: #idlorama @ Quakenet (http://www.quakenet.org) + * + */ + + /* + * THIS SCRIPT IS FOR COMMAND LINE (CLI) ONLY!! + * run with "php