Compare commits

...

3 Commits

Author SHA1 Message Date
7686cf8ada Migrate alacritty 2024-01-06 22:51:38 +01:00
6e78892344 November 11 2023 update 2023-11-11 18:25:46 +01:00
50659b7837 Mar 16 Update 2023-03-16 10:12:44 +01:00
51 changed files with 1684 additions and 1744 deletions

6
.gitmodules vendored
View File

@@ -1,3 +1,9 @@
[submodule "config/awesome/awesome-wm-widgets"]
path = config/awesome/awesome-wm-widgets
url = https://github.com/streetturtle/awesome-wm-widgets
[submodule "config/alacritty/themes"]
path = config/alacritty/themes
url = https://github.com/alacritty/alacritty-theme
[submodule "home/tmux/plugins/tpm"]
path = home/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm

19
config/alacritty.toml Normal file
View File

@@ -0,0 +1,19 @@
# For full documentation of this config format, look man 5 alacritty
import = ["~/.config/alacritty/themes/gruvbox_material_medium_dark.yaml"]
[window]
opacity = 0.9
[window.padding]
x = 3
y = 3
[font]
size = 10.0
[font.normal]
family = "Hack Nerd Font Mono"
[keyboard]
bindings = [
{ key = "Return", mods = "Control|Shift", action = "SpawnNewInstance" },
]

View File

@@ -1,904 +0,0 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
#import:
# - /path/to/alacritty.yml
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
window:
# Window dimensions (changes require restart)
#
# Number of lines/columns (not pixels) in the terminal. The number of columns
# must be at least `2`, while using a value of `0` for columns and lines will
# fall back to the window manager's recommended size.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 3
y: 3
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background and no title bar buttons
#decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark`
# and `light`. Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: Hack
# The `style` can be specified to pick a specific face.
#style: Regular
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
size: 8.0
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter
# spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the
# right, increasing `y` moves the glyph upward.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Hyper)
#colors:
#primary:
#background: '0x000000'
#foreground: '0xffffff'
#cursor:
#text: '0xF81CE5'
#cursor: '0xffffff'
#normal:
#black: '0x000000'
#red: '0xfe0100'
#green: '0x33ff00'
#yellow: '0xfeff00'
#blue: '0x0066ff'
#magenta: '0xcc00ff'
#cyan: '0x00ffff'
#white: '0xd0d0d0'
#bright:
#black: '0x808080'
#red: '0xfe0100'
#green: '0x33ff00'
#yellow: '0xfeff00'
#blue: '0x0066ff'
#magenta: '0xcc00ff'
#cyan: '0x00ffff'
#white: '0xFFFFFF'
# XTerm's default colors
colors:
primary:
background: '0x000000'
foreground: '0xffffff'
normal:
black: '0x000000'
red: '0xcd0000'
green: '0x00cd00'
yellow: '0xcdcd00'
blue: '0x0000ee'
magenta: '0xcd00cd'
cyan: '0x00cdcd'
white: '0xe5e5e5'
bright:
black: '0x7f7f7f'
red: '0xff0000'
green: '0x00ff00'
yellow: '0xffff00'
blue: '0x5c5cff'
magenta: '0xff00ff'
cyan: '0x00ffff'
white: '0xffffff'
# Colors (Tomorrow Night)
#colors:
# Default colors
#primary:
# background: '#1d1f21'
# foreground: '#c5c8c6'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not
# present. If the bright foreground color is not set, or
# `draw_bold_text_with_bright_colors` is `false`, the normal foreground
# color will be used.
#dim_foreground: '#828482'
#bright_foreground: '#eaeaea'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#cursor:
# text: CellBackground
# cursor: CellForeground
# Vi mode cursor colors
#
# Colors for the cursor when the vi mode is active.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#vi_mode_cursor:
# text: CellBackground
# cursor: CellForeground
# Search colors
#
# Colors used for the search bar and match highlighting.
#search:
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: '#ffffff'
# background: '#000000'
#bar:
# background: '#c5c8c6'
# foreground: '#1d1f21'
# Keyboard regex hints
#hints:
# First character in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#start:
# foreground: '#1d1f21'
# background: '#e9ff5e'
# All characters after the first one in the hint label
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#end:
# foreground: '#e9ff5e'
# background: '#1d1f21'
# Line indicator
#
# Color used for the indicator displaying the position in history during
# search and vi mode.
#
# By default, these will use the opposing primary color.
#line_indicator:
# foreground: None
# background: None
# Selection colors
#
# Colors which should be used to draw the selection area.
#
# Allowed values are CellForeground/CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#selection:
# text: CellBackground
# background: CellForeground
# Normal colors
#normal:
# black: '#000000'
# red: '#ff1111'
# green: '#11ff11'
# yellow: '#f0c674'
# blue: '#81a2be'
# magenta: '#b294bb'
# cyan: '#8abeb7'
# white: '#ffffff'
# Bright colors
#bright:
# black: '#666666'
# red: '#d54e53'
# green: '#b9ca4a'
# yellow: '#e7c547'
# blue: '#7aa6da'
# magenta: '#c397d8'
# cyan: '#70c0b1'
# white: '#eaeaea'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#131415'
# red: '#864343'
# green: '#777c44'
# yellow: '#9e824c'
# blue: '#556a7d'
# magenta: '#75617b'
# cyan: '#5b7d78'
# white: '#828482'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
#background_opacity: 1.0
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# Regex hints
#
# Terminal hints can be used to find text in the visible part of the terminal
# and pipe it to other applications.
#hints:
# Keys used for the hint labels.
#alphabet: "jfkdls;ahgurieowpq"
# List with all available hints
#
# Each hint must have a `regex` and either an `action` or a `command` field.
# The fields `mouse`, `binding` and `post_processing` are optional.
#
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
#
# The `mouse.enabled` field controls if the hint should be underlined while
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
#
# If the `post_processing` field is set to `true`, heuristics will be used to
# shorten the match if there are characters likely not to be part of the hint
# (e.g. a trailing `.`). This is most useful for URIs.
#
# Values for `action`:
# - Copy
# Copy the hint's text to the clipboard.
# - Paste
# Paste the hint's text to the terminal or search.
# - Select
# Select the hint's text.
# - MoveViModeCursor
# Move the vi mode cursor to the beginning of the hint.
#enabled:
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
# command: xdg-open
# post_processing: true
# mouse:
# enabled: true
# mods: None
# binding:
# key: U
# mods: Control|Shift
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty
# captures the mouse, the `Shift` modifier is automatically added as a
# requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - ToggleViMode
# - SearchForward
# Start searching toward the right of the search origin.
# - SearchBackward
# Start searching toward the left of the search origin.
# - Copy
# - Paste
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollHalfPageUp
# - ScrollHalfPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# Remove the terminal's scrollback history.
# - Hide
# Hide the Alacritty window.
# - Minimize
# Minimize the Alacritty window.
# - Quit
# Quit Alacritty.
# - ToggleFullscreen
# - SpawnNewInstance
# Spawn a new instance of Alacritty.
# - ClearLogNotice
# Clear Alacritty's UI warning and error notice.
# - ClearSelection
# Remove the active selection.
# - ReceiveChar
# - None
#
# - Vi mode exclusive actions:
#
# - Open
# Perform the action of the first matching hint under the vi mode cursor
# with `mouse.enabled` set to `true`.
# - ToggleNormalSelection
# - ToggleLineSelection
# - ToggleBlockSelection
# - ToggleSemanticSelection
# Toggle semantic selection based on `selection.semantic_escape_chars`.
#
# - Vi mode exclusive cursor motion actions:
#
# - Up
# One line up.
# - Down
# One line down.
# - Left
# One character left.
# - Right
# One character right.
# - First
# First column, or beginning of the line when already at the first column.
# - Last
# Last column, or beginning of the line when already at the last column.
# - FirstOccupied
# First non-empty cell in this terminal row, or first non-empty cell of
# the line when already at the first cell of the row.
# - High
# Top of the screen.
# - Middle
# Center of the screen.
# - Low
# Bottom of the screen.
# - SemanticLeft
# Start of the previous semantically separated word.
# - SemanticRight
# Start of the next semantically separated word.
# - SemanticLeftEnd
# End of the previous semantically separated word.
# - SemanticRightEnd
# End of the next semantically separated word.
# - WordLeft
# Start of the previous whitespace separated word.
# - WordRight
# Start of the next whitespace separated word.
# - WordLeftEnd
# End of the previous whitespace separated word.
# - WordRightEnd
# End of the next whitespace separated word.
# - Bracket
# Character matching the bracket at the cursor's location.
# - SearchNext
# Beginning of the next match.
# - SearchPrevious
# Beginning of the previous match.
# - SearchStart
# Start of the match to the left of the vi mode cursor.
# - SearchEnd
# End of the match to the right of the vi mode cursor.
#
# - Search mode exclusive actions:
# - SearchFocusNext
# Move the focus to the next search match.
# - SearchFocusPrevious
# Move the focus to the previous search match.
# - SearchConfirm
# - SearchCancel
# - SearchClear
# Reset the search regex.
# - SearchDeleteWord
# Delete the last word in the search regex.
# - SearchHistoryPrevious
# Go to the previous regex in the search history.
# - SearchHistoryNext
# Go to the next regex in the search history.
#
# - macOS exclusive actions:
# - ToggleSimpleFullscreen
# Enter fullscreen without occupying another space.
#
# - Linux/BSD exclusive actions:
#
# - CopySelection
# Copy from the selection buffer.
# - PasteSelection
# Paste from the selection buffer.
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Search
# - Alt
# - Vi
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
key_bindings:
- { key: Return, mods: Control|Shift, action: SpawnNewInstance }
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

View File

@@ -0,0 +1,15 @@
colors:
primary:
background: '#282c34'
foreground: '#abb2bf'
bright:
black: '#282c34'
red: '#e06c75'
green: '#98c379'
yellow: '#e5c07b'
blue: '#61afef'
magenta: '#c678dd'
cyan: '#56b6c2'
white: '#abb2bf'
orange: '#d19a66'

View File

@@ -0,0 +1,59 @@
-- {{{ Modules
local awful = require("awful")
local options = require("options")
-- }}}
-- {{{ Variables
-- Applications that will be started
local start_applications = {
"picom",
"flameshot",
"nm-applet",
"lxpolkit",
"unclutter",
"radiotray-ng",
"keepassxc"
}
-- Applications that will be killed on exit/restart
local kill_applications = {
"keepassxc"
}
-- }}}
-- {{{ Functions
local function kill_apps()
for _, cmd in ipairs(kill_applications) do
awful.spawn("pkill " .. cmd)
end
end
local function quit()
kill_apps()
awesome.quit()
end
local function start()
for _, cmd in ipairs(start_applications) do
awful.spawn.single_instance(cmd)
end
end
local function restart()
kill_apps()
awesome.restart()
awful.spawn(options.terminal .. "-e xmodmap ~/.Xmodmap")
end
-- }}}
--- {{{ Script
start()
return {
kill_apps = kill_apps,
restart = restart,
start = start,
quit = quit
}
-- }}}

View File

@@ -0,0 +1,308 @@
-- {{{ Modules
local gears = require("gears")
local awful = require("awful")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
local cmus_widget = require("awesome-wm-widgets.cmus-widget.cmus")
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
local options = require("options")
local modkey = options.modkey
local applications = require("custom.applications")
local macros = require("custom.macros")
-- }}}
-- {{{ Script
-- Menubar configuration
menubar.utils.terminal = options.terminal -- Set the terminal for applications that require it
-- Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end)
))
-- Key bindings
globalkeys = gears.table.join(
awful.key({ }, "Print", function () awful.util.spawn("flameshot gui", false) end),
-- Volume widget
awful.key({ }, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end, {description = "increase volume", group = "custom"}),
awful.key({ }, "XF86AudioLowerVolume", function() volume_widget:dec(5) end, {description = "decrease volume", group = "custom"}),
awful.key({ }, "XF86AudioMute", function() volume_widget:toggle() end, {description = "toggle mute", group = "custom"}),
-- Brightness widget
awful.key({ }, "XF86MonBrightnessUp", function () brightness_widget:inc() end, {description = "increase brightness", group = "custom"}),
awful.key({ }, "XF86MonBrightnessDown", function () brightness_widget:dec() end, {description = "decrease brightness", group = "custom"}),
-- Cmus widget
awful.key({ modkey, "Shift" }, "p", function () cmus_widget:play_pause() end, {description = "toggle track", group = "cmus"}),
awful.key({ }, "XF86AudioPlay", function () cmus_widget:play() end, {description = "play track", group = "cmus"}),
awful.key({ }, "XF86AudioPause", function () cmus_widget:pause() end, {description = "pause track", group = "cmus"}),
awful.key({ }, "XF86AudioNext", function () cmus_widget:next_track() end, {description = "next track", group = "cmus"}),
awful.key({ }, "XF86AudioPrev", function () cmus_widget:prev_track() end, {description = "previous track", group = "cmus"}),
awful.key({ }, "XF86AudioStop", function () cmus_widget:stop() end, {description = "stop track", group = "cmus"}),
-- Lock Screen
awful.key({ }, "XF86HomePage", function() awful.spawn(options.screen_locker) end,
{description = "lock the screen", group = "awesome"}),
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx(1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Standard program
awful.key({ modkey, "Shift" }, "Return", function () awful.spawn(options.terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", menubar.refresh,
{description = "reload launcher", group = "awesome"}),
awful.key({ modkey, "Shift" }, "r", applications.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", applications.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}),
awful.key({ modkey }, "b", function() mywibox.visible = not mywibox.visible end,
{description = "toggle wibox", group = "layout"}),
-- Macros
awful.key({ modkey, "Control" }, "w", macros.work_apps,
{description = "Open applications required for working", group = "macros"}),
-- Macros
awful.key({ modkey, "Control" }, "p", macros.end_work,
{description = "Close applications required for working", group = "macros"})
)
local client_keys = gears.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"})
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 10.
for i = 1, 10 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
local client_buttons = gears.table.join(
awful.button({ }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
end),
awful.button({ modkey }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ modkey }, 3, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.resize(c)
end)
)
-- Define taglist buttons and tasklist buttons
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end)
)
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
c:emit_signal(
"request::activate",
"tasklist",
{raise = true}
)
end
end),
awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
-- Set keys
root.keys(globalkeys)
return {
client_keys = client_keys,
client_buttons = client_buttons,
taglist_buttons = taglist_buttons,
tasklist_buttons = tasklist_buttons
}
-- }}}

View File

@@ -0,0 +1,70 @@
-- {{{ Modules
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local cmus_widget = require("awesome-wm-widgets.cmus-widget.cmus")
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
-- }}}
-- {{{ Variables
local mytextclock = wibox.widget.textclock()
-- }}}
-- {{{ Script
return function(s)
-- Layout box widget
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
return {
layout = wibox.layout.fixed.horizontal,
{
widget = wibox.container.margin,
right = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
wibox.widget.separator{
orientation = "vertical",
forced_width = 5,
visible = false
},
wibox.widget.systray(),
wibox.widget.separator{
orientation = "vertical",
forced_width = 5
}
}
},
{
cmus_widget(),
widget = wibox.container.margin,
right = 10,
left = 7,
space = 5,
draw_empty = false
},
{
widget = wibox.container.margin,
left = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
volume_widget{
widget_type = 'icon_and_text',
with_icon = true,
mute_color = beautiful.bg_urgent
},
mytextclock,
s.mylayoutbox,
}
}
}
end
-- }}}

View File

@@ -0,0 +1,80 @@
-- {{{ Modules
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local cmus_widget = require("awesome-wm-widgets.cmus-widget.cmus")
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
-- }}}
-- {{{ Variables
local mytextclock = wibox.widget.textclock()
-- }}}
-- {{{ Script
return function(s)
-- Layout box widget
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
return {
layout = wibox.layout.fixed.horizontal,
{
widget = wibox.container.margin,
right = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
wibox.widget.separator{
orientation = "vertical",
forced_width = 5,
visible = false
},
wibox.widget.systray(),
wibox.widget.separator{
orientation = "vertical",
forced_width = 5
}
}
},
{
cmus_widget(),
widget = wibox.container.margin,
right = 10,
left = 7,
space = 5,
draw_empty = false
},
{
widget = wibox.container.margin,
left = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
volume_widget{
widget_type = 'icon_and_text',
with_icon = true,
mute_color = beautiful.bg_urgent
},
battery_widget{
enable_battery_warning = true
},
brightness_widget {
type = 'icon_and_text',
program = 'brightnessctl',
percentage = false
},
mytextclock,
s.mylayoutbox,
}
}
}
end
-- }}}

View File

@@ -0,0 +1,46 @@
-- {{{ Modules
local awful = require("awful")
-- }}}
-- {{{ Script
local function instanceExists(class)
local function filter(client)
return awful.rules.match(client, {class = class})
end
-- Return true if any instance is found
return awful.client.iterate(filter)() ~= nil
end
local function spawnIfNoInstance(command, class)
if not instanceExists(class) then
awful.spawn(command)
end
end
local function work_apps()
--spawnIfNoInstance("slack", "Slack")
--spawnIfNoInstance("firefox --class WorkFirefox", "WorkFirefox")
--spawnIfNoInstance("brave", "Brave")
--spawnIfNoInstance("phpstorm", "jetbrains-phpstorm")
--spawnIfNoInstance("sh -c 'alacritty --class WorkAlacritty -e tmux new-session -c ~/repos'", "WorkAlacritty")
--awful.spawn.with_shell("cd ~/repos/rockar-peppermint; make up")
--spawnIfNoInstance("dbeaver", "DBeaver")
end
local function end_work()
--awful.spawn("pkill slack")
--awful.spawn("xdotool search --class jetbrains-phpstorm windowkill")
--awful.spawn("xdotool search --class WorkAlacritty windowquit")
--awful.spawn("xdotool search --class WorkFirefox windowkill")
--awful.spawn.with_shell("cd ~/repos/rockar-peppermint; make stop")
-- Dbeaver requires to be killed twice
--awful.spawn("xdotool search --class DBeaver windowkill")
--awful.spawn("xdotool search --class DBeaver windowkill")
end
return {
work_apps = work_apps,
end_work = end_work
}
-- }}}

View File

@@ -0,0 +1,90 @@
-- {{{ Modules
local awful = require("awful")
local beautiful = require("beautiful")
local bindings = require("custom.bindings")
-- }}}
-- {{{ Script
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = bindings.client_keys,
buttons = bindings.client_buttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"},
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = false }
},
-- Make Work programs spanw at specific tags
{ rule_any = {class = { "Brave" }
}, properties = { tag = "1" }
},
-- { rule_any = {class = { "WorkFirefox" }
-- }, properties = { tag = "1" }
-- },
--
-- { rule_any = {class = { "WorkAlacritty" }
-- }, properties = { tag = "2" }
-- },
--
-- { rule_any = {class = { "jetbrains-phpstorm" }
-- }, properties = { tag = "3" }
-- },
--
-- { rule_any = {class = { "DBeaver" }
-- }, properties = { tag = "9" }
-- },
--
-- { rule_any = {
-- class = { "DBeaver" },
-- }, properties = { tag = "9" }
-- },
--
-- { rule_any = {class = { "Slack" }
-- }, properties = { tag = "0" }
-- },
}
-- }}}

View File

@@ -0,0 +1,58 @@
-- {{{ Modules
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local options = require ("options")
local modkey = options.modkey
local widgets = require("custom." .. options.profile .. ".widgets")
local bindings = require("custom.bindings")
-- }}}
-- {{{ Functions
mywibox = awful.wibar({ position = "top", screen = s })
local function set_wallpaper(s)
awful.spawn.with_shell("nitrogen --restore")
end
-- }}}
-- {{{ Script
-- Update wallpaper when screen size changes
screen.connect_signal("property::geometry", set_wallpaper)
-- Setup each screen
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[2])
-- Tag list
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = bindings.taglist_buttons
}
-- Task list
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = bindings.tasklist_buttons
}
-- Wibox
s.mywibox = mywibox
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
s.mytaglist,
s.mytasklist,
widgets(s)
}
end)
-- }}}

View File

@@ -0,0 +1,68 @@
-- {{{ Modules
local awful = require("awful")
local beautiful = require("beautiful")
-- }}}
-- {{{ Script
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({ }, 1, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}

View File

@@ -0,0 +1,28 @@
-- {{{ Modules
local gears = require("gears")
-- }}}
-- Available profiles: desktop, laptop
local profile = "desktop"
-- Default apps
local terminal = "alacritty"
local editor = os.getenv("EDITOR") or "nvim"
local editor_cmd = terminal .. " -e " .. editor
local screen_locker = "cinnamon-screensaver-command -l"
-- Default modkey
local modkey = "Mod1"
-- Chosen theme
local theme = gears.filesystem.get_configuration_dir() .. "themes/default/theme.lua"
return {
profile = profile,
terminal = terminal,
editor = editor,
editor_cmd = editor_cmd,
screen_locker = screen_locker,
modkey = modkey,
theme = theme
}

View File

@@ -1,32 +1,24 @@
-- {{{ Modules
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
local options = require("options")
-- Load Debian menu entries
local is_deb, debian = pcall(require, "debian.menu")
local has_fdo, freedesktop = pcall(require, "freedesktop")
-- awesome-wm-widgets
local cmus_widget = require("awesome-wm-widgets.cmus-widget.cmus")
local volume_widget = require("awesome-wm-widgets.volume-widget.volume")
local battery_widget = require("awesome-wm-widgets.battery-widget.battery")
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
-- }}}
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
@@ -53,11 +45,12 @@ do
end
-- }}}
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
theme = gears.filesystem.get_configuration_dir() .. "themes/default/theme.lua"
-- {{{ Initialization
-- Run apps on startup
require("custom.applications")
if not beautiful.init(theme) then
-- Initialize theme
if not beautiful.init(options.theme) then
naughty.notify({ preset = naughty.config.presets.critical,
title = string.format("Couldn't load custom theme at %s! Falling back to the default one.", theme),
text = awesome.startup_errors })
@@ -65,29 +58,6 @@ if not beautiful.init(theme) then
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") -- Fallback to default themes
end
-- Default apps
terminal = "alacritty"
editor = os.getenv("EDITOR") or "nvim"
editor_cmd = terminal .. " -e " .. editor
scrlocker = "cinnamon-screensaver-command -l"
-- Default modkey
modkey = "Mod1"
-- Commands
local background_processes = {
"compton",
"flameshot",
"nm-applet",
"lxpolkit",
"unclutter",
"radiotray-ng"
}
local reload_programs = {
"customkeys",
}
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.floating,
@@ -95,12 +65,11 @@ awful.layout.layouts = {
awful.layout.suit.max
}
-- {{{ Menu
-- Create a launcher widget and a main menu
myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile },
{ "manual", options.terminal .. " -e man awesome" },
{ "edit config", options.editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end },
}
@@ -130,556 +99,15 @@ else
})
end
-- Initialize screens
require("custom.screen")
--mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
--menu = mymainmenu })
-- Set keybindings
require("custom.bindings")
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- Load client rules
require("custom.rules")
-- Load client signals
require("custom.signals")
-- }}}
-- Keyboard map indicator and switcher
mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end)
--awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
--awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
c:emit_signal(
"request::activate",
"tasklist",
{raise = true}
)
end
end),
awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } })
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function run_once(cmd_arr)
for _, cmd in ipairs(cmd_arr) do
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
end
end
local function set_wallpaper(s)
awful.spawn.with_shell("nitrogen --restore")
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
local mywibox = awful.wibar({ position = "top", screen = s })
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[2])
-- Create a promptbox for each screen
s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
-- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = taglist_buttons
}
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons
}
-- Create the wibox
s.mywibox = mywibox
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
--mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{
layout = wibox.layout.fixed.horizontal,
{
widget = wibox.container.margin,
right = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
wibox.widget.separator{
orientation = "vertical",
forced_width = 5,
visible = false
},
wibox.widget.systray(),
wibox.widget.separator{
orientation = "vertical",
forced_width = 5
}
}
},
{
cmus_widget(),
widget = wibox.container.margin,
right = 10,
left = 7,
space = 5,
draw_empty = false
},
{
widget = wibox.container.margin,
left = 7,
{
layout = wibox.layout.fixed.horizontal,
spacing = 14,
volume_widget{
widget_type = 'icon_and_text',
with_icon = true,
mute_color = beautiful.bg_urgent
},
battery_widget{
enable_battery_warning = true
},
brightness_widget {
type = 'icon_and_text',
program = 'brightnessctl',
percentage = false
},
mytextclock,
s.mylayoutbox,
}
}
}
}
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end)
--awful.button({ }, 4, awful.tag.viewnext),
--awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ }, "Print", function () awful.util.spawn("flameshot gui", false) end),
-- Volume widget
awful.key({ }, "XF86AudioRaiseVolume", function() volume_widget:inc(5) end, {description = "increase volume", group = "custom"}),
awful.key({ }, "XF86AudioLowerVolume", function() volume_widget:dec(5) end, {description = "decrease volume", group = "custom"}),
awful.key({ }, "XF86AudioMute", function() volume_widget:toggle() end, {description = "toggle mute", group = "custom"}),
-- Brightness widget
awful.key({ }, "XF86MonBrightnessUp", function () brightness_widget:inc() end, {description = "increase brightness", group = "custom"}),
awful.key({ }, "XF86MonBrightnessDown", function () brightness_widget:dec() end, {description = "decrease brightness", group = "custom"}),
-- cmus
awful.key({ modkey, "Shift" }, "p", function () cmus_widget:play_pause() end, {description = "toggle track", group = "cmus"}),
awful.key({ }, "XF86AudioPlay", function () cmus_widget:play() end, {description = "play track", group = "cmus"}),
awful.key({ }, "XF86AudioPause", function () cmus_widget:pause() end, {description = "pause track", group = "cmus"}),
awful.key({ }, "XF86AudioNext", function () cmus_widget:next_track() end, {description = "next track", group = "cmus"}),
awful.key({ }, "XF86AudioPrev", function () cmus_widget:prev_track() end, {description = "previous track", group = "cmus"}),
awful.key({ }, "XF86AudioStop", function () cmus_widget:stop() end, {description = "stop track", group = "cmus"}),
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
awful.key({ modkey, }, "w", function () mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Standard program
awful.key({ modkey, "Shift" }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}),
-- Lock Screen
awful.key({ }, "XF86Display", function() awful.spawn(scrlocker) end,
{description = "lock the screen", group = "custom"}),
awful.key({ modkey }, "b", function() mywibox.visible = not mywibox.visible end,
{description = "toggle wibox", group = "layout"})
)
clientkeys = gears.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"})
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 10 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
clientbuttons = gears.table.join(
awful.button({ }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
end),
awful.button({ modkey }, 1, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ modkey }, 3, function (c)
c:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.resize(c)
end)
)
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
instance = {
"DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class.
"pinentry",
},
class = {
"Arandr",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"xtightvncviewer"},
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
}, properties = { floating = true }},
-- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" }
}, properties = { titlebars_enabled = false }
},
-- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar
local buttons = gears.table.join(
awful.button({ }, 1, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
c:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false})
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}
local function trim(s)
return s:find'^%s*$' and '' or s:match'^%s*(.*%S)'
end
-- Autostart applications
for _, cmd in ipairs(background_processes) do
awful.spawn.single_instance(cmd)
end
for _, cmd in ipairs(reload_programs) do
awful.spawn(cmd)
end

View File

@@ -11,7 +11,7 @@ local themes_path = gfs.get_themes_dir()
local theme = {}
theme.font = "sans 8"
theme.font = "Noto Sans 12"
theme.bg_normal = "#000000"
theme.bg_focus = "#333333"
@@ -128,6 +128,8 @@ theme.awesome_icon = theme_assets.awesome_icon(
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
theme.icon_theme = nil
theme.hotkeys_modifiers_fg = '#fcc100'
return theme
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@@ -1,4 +1,5 @@
[Settings]
gtk-icon-theme-name = Material-Black-Lime-Numix
gtk-theme-name = Material-Black-Lime
gtk-application-prefer-dark-theme = true
gtk-theme-name = Mint-X
gtk-cursor-theme-name = Human
gtk-application-prefer-dark-theme = false

View File

@@ -7,6 +7,7 @@ application/pdf=mupdf.desktop
video/mp4=mpv.desktop
image/png=feh.desktop
image/jpg=feh.desktop
x-scheme-handler/http=brave.desktop
x-scheme-handler/https=brave.desktop
text/html=brave.desktop
x-scheme-handler/http=brave-browser.desktop
x-scheme-handler/https=brave-browser.desktop
application/xhtml+xml=brave-browser.desktop
text/html=brave-browser.desktop

View File

@@ -0,0 +1,10 @@
local wk = require("which-key")
wk.register({
["<leader>gs"] = { vim.cmd.Git, "Open git menu" },
["<leader>gd"] = { vim.cmd.Gdiffsplit, "Compare unstaged changes difference" },
}, {
mode = "n",
silent = true,
noremap = true,
})

View File

@@ -0,0 +1,16 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
local wk = require("which-key")
wk.register({
["<leader>a"] = { mark.add_file, "Add file to harpoon" },
["<C-e>"] = { ui.toggle_quick_menu, "Toggle quick harpoon menu" },
["g1"] = { function() ui.nav_file(1) end, "Navigate to first file in harpoon"},
["g2"] = { function() ui.nav_file(2) end, "Navigate to second file in harpoon"},
["g3"] = { function() ui.nav_file(3) end, "Navigate to third file in harpoon"},
["g4"] = { function() ui.nav_file(4) end, "Navigate to fourth file in harpoon"}
}, {
mode = "n",
silent = true,
noremap = true,
})

View File

@@ -0,0 +1,82 @@
local lsp_zero = require("lsp-zero")
local wk = require("which-key")
wk.register({
["gd"] = { "Go to definitions" },
["K"] = { "Show info" },
["<leader>vws"] = { "View workspace symbol"},
["<leader>vd"] = { "View diagnostics"},
["<leader>vca"] = { "View code action"},
["<leader>vrr"] = { "View references"},
["<leader>vrn"] = { "Rename symbol"},
["[d"] = { "Go to next diagnotics"},
["]d"] = { "Go to previous diagnotics"}
}, {
mode = "n",
silent = true,
noremap = true,
})
wk.register({
["<C-h>"] = { "Signature help"}
}, {
mode = "i",
silent = true,
noremap = true,
})
lsp_zero.on_attach(function(client, bufnr)
local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
require("mason").setup({})
require("mason-lspconfig").setup({
ensure_installed = {
"tsserver",
"rust_analyzer",
"jedi_language_server",
"clangd"
},
handlers = {
lsp_zero.default_setup,
lua_ls = function()
local lua_opts = lsp_zero.nvim_lua_ls()
require("lspconfig").lua_ls.setup(lua_opts)
end,
}
})
local cmp = require("cmp")
local cmp_select = {behavior = cmp.SelectBehavior.Select}
cmp.setup({
sources = {
{name = "path"},
{name = "nvim_lsp"},
{name = "nvim_lua"},
{name = "luasnip"}
},
formatting = lsp_zero.cmp_format(),
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
}),
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
})

View File

@@ -0,0 +1,55 @@
require("lualine").setup {
options = {
icons_enabled = false,
theme = "gruvbox-material",
--component_separators = { left = "", right = ""},
--section_separators = { left = "", right = ""},
component_separators = { left = "|", right = "|"},
section_separators = { left = "", right = ""},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {"mode"},
lualine_b = {"branch", "diff", "diagnostics"},
lualine_c = {"filename"},
lualine_x = {"encoding", "fileformat", "filetype"},
lualine_y = {"progress"},
lualine_z = {"location"}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {"filename"},
lualine_x = {"location"},
lualine_y = {},
lualine_z = {}
},
tabline = {
lualine_a = {
{
"tabs",
mode = 2
}
},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
--lualine_z = {"buffers"}
lualine_z = {}
},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@@ -0,0 +1,7 @@
local null_ls = require('null-ls')
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.eslint,
},
})

View File

@@ -0,0 +1,79 @@
local tree = require("nvim-tree")
local api = require("nvim-tree.api")
local wk = require("which-key")
tree.setup({
view = {
number = true,
relativenumber = true
},
tab = {
sync = {
open = true,
close = true
}
}
})
local tree_smart_toggle = function ()
local currentBuf = vim.api.nvim_get_current_buf()
local currentBufFt = vim.api.nvim_get_option_value("filetype", { buf = currentBuf })
if currentBufFt == "NvimTree" then
api.tree.close()
else
api.tree.focus()
end
end
wk.register({
["<C-n>"] = { tree_smart_toggle, "Toggle file tree"}
}, {
mode = "n",
silent = true,
noremap = true,
})
-- Open tree on startup
--vim.api.nvim_create_autocmd("VimEnter", {
-- callback = function(ev)
-- api.tree.open()
-- vim.cmd.wincmd("l")
-- end
--})
local function tab_win_closed(winnr)
local api = require"nvim-tree.api"
local tabnr = vim.api.nvim_win_get_tabpage(winnr)
local bufnr = vim.api.nvim_win_get_buf(winnr)
local buf_info = vim.fn.getbufinfo(bufnr)[1]
local tab_wins = vim.tbl_filter(function(w) return w~=winnr end, vim.api.nvim_tabpage_list_wins(tabnr))
local tab_bufs = vim.tbl_map(vim.api.nvim_win_get_buf, tab_wins)
if buf_info.name:match(".*NvimTree_%d*$") then -- close buffer was nvim tree
-- Close all nvim tree on :q
if not vim.tbl_isempty(tab_bufs) then -- and was not the last window (not closed automatically by code below)
api.tree.close()
end
else -- else closed buffer was normal buffer
if #tab_bufs == 1 then -- if there is only 1 buffer left in the tab
local last_buf_info = vim.fn.getbufinfo(tab_bufs[1])[1]
if last_buf_info.name:match(".*NvimTree_%d*$") then -- and that buffer is nvim tree
vim.schedule(function ()
if #vim.api.nvim_list_wins() == 1 then -- if its the last buffer in vim
vim.cmd "quit" -- then close all of vim
else -- else there are more tabs open
vim.api.nvim_win_close(tab_wins[1], true) -- then close only the tab
end
end)
end
end
end
end
vim.api.nvim_create_autocmd("WinClosed", {
callback = function ()
local winnr = tonumber(vim.fn.expand("<amatch>"))
vim.schedule_wrap(tab_win_closed(winnr))
end,
nested = true
})

View File

@@ -0,0 +1,9 @@
local wk = require("which-key")
wk.register({
["<C-t>"] = { vim.cmd.TagbarToggle, "Toggle symbols tree browser" },
}, {
mode = "n",
silent = true,
noremap = true,
})

View File

@@ -0,0 +1,18 @@
local builtin = require('telescope.builtin')
local wk = require("which-key")
wk.register({
["<leader>ff"] = { builtin.find_files, "Find files" },
["<C-p>"] = { builtin.git_files, "Find git files" },
["<leader>fs"] = {
function ()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end,
"Grep files"
},
["<leader>fh"] = { builtin.help_tags, "Find documentation" }
}, {
mode = "n",
silent = true,
noremap = true,
})

View File

@@ -0,0 +1,21 @@
require"nvim-treesitter.configs".setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "python", "javascript", "typescript" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally
auto_install = true,
highlight = {
enable = true,
-- 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,
},
}

View File

@@ -0,0 +1,9 @@
local wk = require("which-key")
wk.register({
["<leader>ut"] = { vim.cmd.UndotreeToggle, "Toggle undo history browser" },
}, {
mode = "n",
silent = true,
noremap = true,
})

View File

@@ -0,0 +1,98 @@
local wk = require("which-key")
wk.register({
["<leader>sv"] = {
"Reload Neovim configuration"
},
["<leader>p"] = {
function ()
local file_path = vim.fn.expand("%")
vim.fn.setreg("+", file_path)
print("Copied \"" .. file_path .. "\" to clipboard.")
end,
"Copy relative file path to clipboard"
},
["<C-h>"] = { wk.show, "Show this help message" },
["<C-s>"] = { vim.cmd.w, "Save buffer" },
["<C-w>t"] = { vim.cmd.tabnew, "Open a new tab" },
["<leader>ix"] = {
function ()
vim.o.expandtab = true
end,
"Change identation style to spaces"
},
["<leader>in"] = {
function ()
vim.o.expandtab = false
end,
"Change identation style to tab"
},
['<leader>rw'] = {
function ()
vim.cmd("%s/[ \\t]*$//g")
vim.cmd.noh()
end,
'Remove trailing whitespace'
},
["<leader>e"] = { vim.diagnostic.open_float, "Show diagnostics error details" },
["<leader>n"] = { "Rename symbol under cursor" },
["[d"] = { vim.diagnostic.goto_prev, "Go to previous diagnostics error" },
["]d"] = { vim.diagnostic.goto_next, "Go to next diagnostics error" },
["gD"] = { "Go to declaration" },
["gd"] = { "Go to definition" },
["dL"] = { "0D", "Truncate line" },
["_"] = {
function ()
local line = vim.fn.line(".")
local last_line = vim.fn.line("$")
if line ~= last_line then
vim.cmd.m("+1")
end
end,
"Move line down"
},
["-"] = {
function ()
local line = vim.fn.line(".")
if line ~= 1 then
vim.cmd.m("-2")
end
end,
"Move line up"
},
["H"] = { "0", "Same as 0" },
["L"] = { "$", "Same as $" },
}, {
mode = "n",
silent = true,
noremap = true
})
wk.register({
["<C-w>"] = { "<bs>", "Same as backspace" },
}, {
mode = "i",
silent = true,
noremap = true,
})
wk.register({
["s\""] = { "<esc>`<i\"<esc>`><right>a\"<esc>", "Surround with \"\"" },
["s\'"] = { "<esc>`<i\'<esc>`><right>a\'<esc>", "Surround with \'\'" },
["s "] = { "<esc>`<i <esc>`><right>a <esc>", "Surround with space" },
["s("] = { "<esc>`<i(<esc>`><right>a)<esc>", "Surround with ()" },
["s)"] = { "<esc>`<i(<esc>`><right>a)<esc>", "Surround with ()" },
["s["] = { "<esc>`<i[<esc>`><right>a]<esc>", "Surround with []" },
["s]"] = { "<esc>`<i[<esc>`><right>a]<esc>", "Surround with []" },
["s{"] = { "<esc>`<i{<esc>`><right>a}<esc>", "Surround with {}" },
["s}"] = { "<esc>`<i{<esc>`><right>a}<esc>", "Surround with {}" },
["J"] = { ":m '>+1<CR>gv=gv", "Move lines down" },
["K"] = { ":m '<-2<CR>gv=gv", "Move lines up" },
["<leader>y"] = { "\"+y", "Copy to system clipboard" },
}, {
mode = "v",
silent = true,
noremap = true,
})

1
config/nvim/init.lua Normal file
View File

@@ -0,0 +1 @@
require('augustogunsch')

View File

@@ -1,177 +0,0 @@
syntax on
filetype on
filetype plugin on
set encoding=utf-8
set clipboard=unnamedplus
set nu rnu
set smartindent
set nocp
set bo=all
set mouse=a
colorscheme torte
set list
set listchars=tab:*·,lead,trail:~,extends:>,precedes:<
filetype indent off
hi SignColumn ctermbg=233
hi DiffChange ctermbg=17
hi DiffDelete ctermbg=52 ctermfg=15
hi DiffAdd ctermbg=22
hi DiffText ctermbg=166 ctermfg=15
hi Folded ctermbg=233 ctermfg=247
hi FoldColumn ctermbg=233 ctermfg=247
" matchit builtin plugin
packadd! matchit
let mapleader = " "
let maplocalleader = ","
nnoremap <silent> <F2> <cmd>ToggleDiagOff<cr>:Gdiffsplit<cr>
nnoremap <silent> <F3> <cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F4> <cmd>%s/"/'/g<cr>
nnoremap <silent> <F5> <cmd>ToggleDiag<cr>
nnoremap <silent> <F6> <cmd>%!expand -t4<cr><cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F7> <cmd>%!unexpand -t4<cr><cmd>%!sed 's/[ \t]*$//'<cr>
nnoremap <silent> <F8> <cmd>TagbarToggle<CR>
nnoremap <silent> <F9> <cmd>%s/\([( -]\)0\.\(\d\)/\1.\2/gc<CR>
nnoremap <silent> <F12> <cmd>set et<cr><cmd>set ts=4<cr><cmd>set sw=4<cr>
nnoremap <silent> <F11> <cmd>set noet<cr>
nnoremap <silent> <C-n> <cmd>NERDTreeToggle<cr>
nnoremap <silent> <C-p> <cmd>let @+=expand("%")<cr><cmd>echo "Copied relative file path to clipboard."<cr>
nnoremap <silent> <leader>ev <cmd>tabnew $MYVIMRC<cr>
nnoremap <silent> <leader>sv <cmd>source $MYVIMRC<cr><cmd>AirlineRefresh<cr>
nnoremap <C-s> :%s//gc<left><left><left>
nnoremap <silent> <C-w>t <cmd>tabnew<cr>
nnoremap dL 0D
nnoremap - ddp
nnoremap _ ddkP
" auto quote
vnoremap <leader>" <esc>a"<esc>`<i"<esc>`>
nnoremap H 0
nnoremap L $
augroup python
autocmd FileType python :iabbrev <buffer> frompdb from pdb import set_trace; set_trace()
augroup END
augroup nerdtree
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
augroup END
let g:airline_theme = "powerlineish"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline#extensions#nerdtree_statusline = 1
call plug#begin('~/.config/nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
" LSP config
Plug 'neovim/nvim-lspconfig'
" *auto* completion
Plug 'hrsh7th/nvim-compe'
Plug 'tpope/vim-fugitive'
Plug 'drmingdrmer/xptemplate'
Plug 'WhoIsSethDaniel/toggle-lsp-diagnostics.nvim'
Plug 'preservim/tagbar'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-obsession'
call plug#end()
lua << EOF
--- nvim-compe
require'compe'.setup {
enabled = true;
autocomplete = true;
debug = false;
min_length = 1;
preselect = 'enable';
throttle_time = 80;
source_timeout = 200;
incomplete_delay = 400;
max_abbr_width = 100;
max_kind_width = 100;
max_menu_width = 100;
documentation = true;
source = {
path = true;
nvim_lsp = true;
};
}
--- IMPORTANT
vim.api.nvim_set_keymap('i', '<cr>', 'compe#confirm("<cr>")', { expr = true })
local common_bindings = function(client, bufnr)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local opts = { noremap=true, silent=true }
--Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
buf_set_keymap('n', '<C-[>', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
end
local default_formatting = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local opts = { noremap=true, silent=true }
buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
local default_attach = function(client, bufnr)
common_bindings(client, bufnr)
default_formatting(client, bufnr)
end
local setup = function(lsp, on_attach, settings)
local nvim_lsp = require('lspconfig')
nvim_lsp[lsp].setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
},
settings=settings
}
end
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'clangd', 'rls', 'tsserver', 'jedi_language_server', 'phan'}
for _, lsp in ipairs(servers) do
setup(lsp, default_attach)
end
EOF
" auto close scratch buffer (preview window)
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" xptemplate (snippets) config
let g:xptemplate_vars = "SPcmd=&SParg="

182
config/nvim/init.vim.old Normal file
View File

@@ -0,0 +1,182 @@
call plug#begin('~/.config/nvim/plugged')
" Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Gruvbox theme
Plug 'morhetz/gruvbox'
Plug 'sainnhe/gruvbox-material'
" Tree for searching files
Plug 'scrooloose/nerdtree'
Plug 'PhilRunninger/nerdtree-visual-selection'
" Quick comment/uncomment lines
Plug 'scrooloose/nerdcommenter'
" Auto complete quotes
Plug 'raimondi/delimitmate'
" Changing quotes/tags/parenthesis
" See :help surround
" Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
" Git integration
Plug 'tpope/vim-fugitive'
" File symbols browser
Plug 'preservim/tagbar'
" Fuzzy finder
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Indentation style guesser
Plug 'tpope/vim-sleuth'
" Session manager
Plug 'tpope/vim-obsession'
" Cheat sheet
Plug 'folke/which-key.nvim'
" LSP
Plug 'neovim/nvim-lspconfig'
" nvim-cmp
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
" Snippets
Plug 'L3MON4D3/LuaSnip', {'tag': 'v2.*', 'do': 'make install_jsregexp'}
Plug 'rafamadriz/friendly-snippets'
Plug 'saadparwaiz1/cmp_luasnip'
" Eslint
Plug 'nvim-lua/plenary.nvim'
Plug 'nvimtools/none-ls.nvim'
call plug#end()
augroup nerdtree
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
autocmd VimEnter * NERDTree | wincmd p
augroup END
let g:NERDTreeShowLineNumbers = 1
colorscheme gruvbox
let g:airline_theme = "gruvbox_material"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline#extensions#nerdtree_statusline = 1
" auto close scratch buffer (preview window)
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
lua << EOF
require('luasnip.loaders.from_vscode').lazy_load()
local wk = require('which-key')
wk.register({
['<C-t>'] = { '<cmd>TagbarToggle<cr>', 'Toggle symbols tree browser' },
['<leader>ff'] = { '<cmd>Files<cr>', 'Find a file' },
['<leader>ft'] = { '<cmd>Ag<cr>', 'Find text' },
}, {
mode = 'n',
silent = true,
noremap = true,
})
wk.register({
['<C-l>'] = { '<esc>bEa, ', 'Add , at the end of next WORD' },
}, {
mode = 'i',
silent = true,
noremap = true,
})
local on_attach = function(client, bufnr)
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', '<leader>n', vim.lsp.buf.rename, bufopts)
end
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
})
})
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Clang LSP
require('lspconfig')['clangd'].setup {
on_attach = on_attach,
capabilities = capabilities
}
-- Rust LSP
require('lspconfig')['rls'].setup {
on_attach = on_attach,
capabilities = capabilities
}
-- TypeScript LSP
require('lspconfig')['tsserver'].setup {
on_attach = on_attach,
capabilities = capabilities
}
-- Python LSP
require('lspconfig')['jedi_language_server'].setup {
on_attach = on_attach,
capabilities = capabilities
}
local null_ls = require('null-ls')
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.eslint,
},
})
EOF

View File

@@ -0,0 +1,25 @@
require("augustogunsch.lazy")
require("augustogunsch.options")
--- Reload the entire configuration
function reload_config()
for name,_ in pairs(package.loaded) do
if name:match("^augustogunsch") then
package.loaded[name] = nil
end
end
require("augustogunsch")
-- Reload after/ directory
local glob = vim.fn.stdpath("config") .. "/after/**/*.lua"
local after_lua_filepaths = vim.fn.glob(glob, true, true)
for _, filepath in ipairs(after_lua_filepaths) do
dofile(filepath)
end
vim.notify("Nvim configuration reloaded", vim.log.levels.INFO)
end
vim.keymap.set("n", "<leader>sv", reload_config)

View File

@@ -0,0 +1,87 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local plugins = {
-- gruvbox-material theme
{
"sainnhe/gruvbox-material",
lazy = false,
priority = 1000,
config = function ()
vim.cmd.colorscheme("gruvbox-material")
end,
},
-- keys cheat sheet
{
"folke/which-key.nvim",
lazy = false,
priority = 999
},
-- status and tab lines
"nvim-lualine/lualine.nvim",
-- treesitter
{
"nvim-treesitter/nvim-treesitter",
cmd = "TSUpdate"
},
{
"ThePrimeagen/harpoon",
dependencies = {
"nvim-lua/plenary.nvim",
}
},
{
"nvim-tree/nvim-tree.lua",
enabled = true
},
"raimondi/delimitmate",
"tpope/vim-surround",
"tpope/vim-repeat",
"tpope/vim-fugitive",
"numToStr/Comment.nvim",
-- mason LSP manager
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
-- indentation guesser
"tpope/vim-sleuth",
-- file symbols browser
"preservim/tagbar",
-- undo history browser
"mbbill/undotree",
-- fuzzy finder
"nvim-telescope/telescope.nvim",
-- LSP support
{
"VonHeikemen/lsp-zero.nvim",
branch = "v3.x",
lazy = true,
config = false,
},
"neovim/nvim-lspconfig",
-- autocompletion
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
-- snippets
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"nvim-lua/plenary.nvim",
"nvimtools/none-ls.nvim",
}
require("lazy").setup(plugins)

View File

@@ -0,0 +1,29 @@
-- Disable newtrw
-- required by nvim-tree
vim.opt.guicursor = ""
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.mapleader = " "
vim.opt.termguicolors = true
vim.opt.expandtab = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.list = true
vim.opt.listchars = {
tab = "",
lead = "·",
trail = "~",
extends = ">",
precedes = "<"
}
vim.opt.number = true
vim.opt.relativenumber = true
-- To avoid bad habits
vim.opt.mouse = ""

View File

@@ -70,7 +70,10 @@ shadow-exclude = [
"class_g = 'Cairo-clock'",
# "class_g = 'dwm'",
"class_g = 'dmenu'",
"_GTK_FRAME_EXTENTS@:c"
"_GTK_FRAME_EXTENTS@:c",
"class_g = 'firefox'",
"class_g = 'WorkFirefox'"
"class_g = 'thunderbird'"
];
# Specify a X geometry that describes the region in which shadow should not

View File

@@ -6,5 +6,5 @@
"notification-verbose" : true,
"notifications" : true,
"split-title" : true,
"volume-level" : 34
"volume-level" : 100
}

View File

@@ -1,6 +0,0 @@
#!/bin/sh
set -e
curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim -E -c PlugInstall -c qall

4
configure-tmux.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
set -e
~/.tmux/plugins/tpm/bin/install_plugins

View File

@@ -1 +1,27 @@
keycode 151 = Multi_key Multi_key Multi_key
! Make Caps Lock act as Escape, unless Shift is pressed
clear lock
keycode 66 = Escape Caps_Lock Escape
! Turn AltGr into Mode_switch
keycode 108 = Mode_switch
! Turn Windows key into multi key
keycode 133 = Multi_key Multi_key Multi_key
!
! Turn Tilde, Grave and Circumflex into dead versions
keycode 15 = 6 dead_circumflex 6 dead_circumflex
keycode 49 = dead_grave dead_tilde dead_grave dead_tilde
! Turn Right Control into Dead Acute
clear control
add control = Control_L
keycode 105 = dead_acute dead_acute dead_acute
! Make different letters when Mode_switch is being pressed
! Portuguese:
keycode 54 = c C ccedilla Ccedilla
! Polish:
keycode 26 = e E U0119 U0118
keycode 38 = a A U0105 U0104
keycode 46 = l L U0142 U0141
keycode 52 = z Z U017C U017B

View File

@@ -1 +1 @@
Xft.dpi: 156
Xft.dpi: 96

View File

@@ -1,5 +1,8 @@
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.config/composer/vendor/bin:$PATH"
export EDITOR="/usr/local/bin/nvim"
export PATH="/usr/local/texlive/2023/bin/x86_64-linux:$PATH"
export MANPATH="/usr/local/texlive/2023/texmf-dist/doc/man:$MANPATH"
export INFOPATH="/usr/local/texlive/2023/texmf-dist/doc/info:$INFOPATH"
export EDITOR="/usr/bin/nvim"
# vim
alias vim="nvim"
@@ -44,7 +47,7 @@ alias venv="source venv/bin/activate"
alias grepa="grep -I -n --color=always -r --exclude-dir=venv --exclude-dir=node_modules"
# cat
alias cat="batcat -p --paging=never"
alias cat="bat -p --paging=never --theme=OneHalfLight"
# pipe yd-dlp to mpv
ytmpv() {
@@ -69,6 +72,7 @@ alias nvm="load_nvm; nvm"
alias node="load_nvm; node"
alias npm="load_nvm; npm"
alias npx="load_nvm; npx"
alias yarn="load_nvm; yarn"
alias create-react-app="load_nvm; create-react-app"
export NVM_DIR="$HOME/.nvm"
@@ -80,7 +84,7 @@ load_nvm() {
unalias npm
unalias npx
unalias create-react-app
. "$NVM_DIR/nvm.sh"
. "$NVM_DIR/bash_completion"
. /usr/share/nvm/init-nvm.sh
. /usr/share/nvm/bash_completion
fi
}

View File

@@ -1,3 +1,4 @@
gtk-icon-theme-name = "Material-Black-Lime-Numix"
gtk-theme-name = "Material-Black-Lime"
gtk-application-prefer-dark-theme = "true"
gtk-theme-name = "Mint-X"
gtk-cursor-theme-name = "Human"
gtk-application-prefer-dark-theme = "false"

View File

@@ -1,3 +1,8 @@
Host vps
User root
HostName augustogunsch.com
IdentityFile ~/.ssh/id_rsa_secure
host github
HostName github.com
IdentityFile ~/.ssh/id_rsa_secure

View File

@@ -22,9 +22,16 @@ bind l select-pane -R
bind k select-pane -U
bind j select-pane -D
# move windows
bind-key -n C-S-Left swap-window -d -t -1
bind-key -n C-S-Right swap-window -d -t +1
# don't rename windows automatically
#set-option -g allow-rename off
# renumber windows automatically
set-option -g renumber-windows on
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
@@ -38,7 +45,8 @@ bind-key * kill-pane
######################
# makes promt colorful
set -g default-terminal "screen-256color"
set -g default-terminal "tmux-256color"
set -as terminal-overrides ",alacritty*:Tc"
# loud or quiet?
set -g visual-activity off
@@ -47,43 +55,13 @@ set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour1 bg=colour18 bold'
# panes
set -g pane-border-style 'fg=colour19 bg=colour0'
set -g pane-active-border-style 'bg=colour0 fg=colour9'
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'bg=colour233 fg=colour255'
set -g status-left '#[fg=colour249,bg=colour237]  tmux #[bg=colour233,fg=colour237]'
set -g status-right '#[bg=colour233,fg=colour21]#[fg=colour255,bg=colour21]  %d/%m  %H:%M '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-format '#[fg=colour233,bg=colour21]#[bg=colour21,fg=colour184] #I#[fg=colour255]-#W #[bg=colour233,fg=colour21]'
setw -g window-status-format '#[fg=colour233,bg=colour237]#[bg=colour237,fg=colour184] #I#[fg=colour249]-#W #[bg=colour233,fg=colour237]'
setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
setw -g window-status-separator ''
# messages
set -g message-style 'bg=colour27 fg=white'
# set default shell
set-option -g default-shell $SHELL
# save nvim session
set -g @resurrect-strategy-nvim 'session'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'hasundue/tmux-gruvbox-material'
set -g @gruvbox-material_theme 'dark' # or 'light'
set -g @gruvbox-material_contrast 'medium' # or 'soft' or 'hard'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

1
home/tmux/plugins/tpm Submodule

Submodule home/tmux/plugins/tpm added at 99469c4a9b

View File

@@ -23,9 +23,11 @@ bindkey "^[OB" history-beginning-search-forward-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
autoload -U promptinit
promptinit
export PROMPT='%B%F{63}[%F{68}%n@%m %F{white}%~%F{63}]$%b%f '
export LS_COLORS='di=1;94:ex=4;92:ln=3;96'
export PROMPT="%F{9}[%F{11}%n@%F{11}%m %F{15}%~%F{9}]$%b%f "
export RPROMPT="%T"
# aliases:
source ~/.aliases

View File

@@ -0,0 +1,2 @@
[icon theme]
Inherits=Human

View File

@@ -3,6 +3,9 @@ set -e
cd "$(dirname "$0")"
PWD="$(pwd)"
git submodule init
git submodule update
clone_dir() {
local dir=${1:-home}
local to=${2:-$HOME}

View File

@@ -1,10 +0,0 @@
#!/bin/sh
# Compose key: windows key
setxkbmap -option compose:lwin
# Caps turned into escape
setxkbmap -option caps:escape_shifted_capslock
# dead_greek as control right
xmodmap ~/.Xmodmap

View File

@@ -7,6 +7,6 @@ application/pdf=mupdf.desktop
video/mp4=mpv.desktop
image/png=feh.desktop
image/jpg=feh.desktop
x-scheme-handler/http=qutebrowser.desktop
x-scheme-handler/https=qutebrowser.desktop
text/html=qutebrowser.desktop
x-scheme-handler/http=brave-browser.desktop
x-scheme-handler/https=brave-browser.desktop
text/html=brave-browser.desktop