From 593b961a513d1eb228cead65d56a8f2253ca1c1c Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Wed, 5 Feb 2025 16:02:49 -0700 Subject: [PATCH 1/8] Cleaned up old, obsolete configs --- .config/sway/config | 4 - ...isplay-arrangement.conf##hostname.normandy | 13 ---- ...splay-arrangement.conf##hostname.rocinante | 7 -- .../display-arrangement.conf##hostname.tycho | 16 ---- ...display-arrangement.conf##hostname.zariman | 9 --- ...space-arrangement.conf##class.dual-monitor | 63 ---------------- ...ace-arrangement.conf##class.single-monitor | 22 ------ ...kspace-arrangement.conf##class.tie-fighter | 38 ---------- ...ace-arrangement.conf##class.triple-monitor | 75 ------------------- 9 files changed, 247 deletions(-) delete mode 100644 .config/sway/display-arrangement.conf##hostname.normandy delete mode 100644 .config/sway/display-arrangement.conf##hostname.rocinante delete mode 100644 .config/sway/display-arrangement.conf##hostname.tycho delete mode 100644 .config/sway/display-arrangement.conf##hostname.zariman delete mode 100644 .config/sway/workspace-arrangement.conf##class.dual-monitor delete mode 100644 .config/sway/workspace-arrangement.conf##class.single-monitor delete mode 100644 .config/sway/workspace-arrangement.conf##class.tie-fighter delete mode 100644 .config/sway/workspace-arrangement.conf##class.triple-monitor diff --git a/.config/sway/config b/.config/sway/config index a3ab5ab..c9c55cc 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -29,10 +29,6 @@ set $colorwallpaper '#1e1e1e' ## Set Background output * bg '#1e1e1e' solid_color -## Include Device-Specific Configs -#include display-arrangement.conf -#include workspace-arrangement.conf - ### ### # Window Management Keybinds # ### ### diff --git a/.config/sway/display-arrangement.conf##hostname.normandy b/.config/sway/display-arrangement.conf##hostname.normandy deleted file mode 100644 index df53929..0000000 --- a/.config/sway/display-arrangement.conf##hostname.normandy +++ /dev/null @@ -1,13 +0,0 @@ -### -*-conf-space-*- ### -# S.S.V. Normandy Display Config # -### ### - -set $leftdisplay 'HDMI-A-1' -set $centerdisplay 'DP-1' -set $rightdisplay 'DP-2' - -output { - $leftdisplay pos 0 220 mode --custom 1920x1080@75Hz - $centerdisplay pos 1920 0 mode 2560x1440@165Hz - $rightdisplay pos 4480 230 mode --custom 1920x1080@75Hz -} diff --git a/.config/sway/display-arrangement.conf##hostname.rocinante b/.config/sway/display-arrangement.conf##hostname.rocinante deleted file mode 100644 index 14a63ed..0000000 --- a/.config/sway/display-arrangement.conf##hostname.rocinante +++ /dev/null @@ -1,7 +0,0 @@ -### -*-conf-space-*- ### -# Rocinante Display Config # -### ### - -set $display eDP-1 - -output $display scale 1 pos 0 1080 diff --git a/.config/sway/display-arrangement.conf##hostname.tycho b/.config/sway/display-arrangement.conf##hostname.tycho deleted file mode 100644 index 5c4a657..0000000 --- a/.config/sway/display-arrangement.conf##hostname.tycho +++ /dev/null @@ -1,16 +0,0 @@ -### -*-conf-space-*- ### -# Tycho Station Display Config # -### ### - -set $leftdisplay "HP Inc. HP Z27n G2 6CM0151FHY" -set $centerdisplay "Hewlett Packard HP S340c CN490508SQ" -set $rightdisplay "HP Inc. HP Z27n G2 6CM0151FD4" - -output { - $leftdisplay pos 0 450 mode 2560x1440@60Hz - $leftdisplay bg ~/Images/Wallpaper.png center - $centerdisplay pos 2560 450 mode 3440x1440 transform 0 - $centerdisplay bg ~/Images/Wallpaper.png center - $rightdisplay pos 6000 0 mode 2560x1440@60Hz transform 90 - $rightdisplay bg ~/Images/Sidepaper.png center -} \ No newline at end of file diff --git a/.config/sway/display-arrangement.conf##hostname.zariman b/.config/sway/display-arrangement.conf##hostname.zariman deleted file mode 100644 index 72c729e..0000000 --- a/.config/sway/display-arrangement.conf##hostname.zariman +++ /dev/null @@ -1,9 +0,0 @@ -### -*-conf-space-*- ### -# Gathering Storm Display Config # -### ### - -set $display eDP-1 - -output $display scale 1 pos 0 1080 -output $display color_profile icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm - diff --git a/.config/sway/workspace-arrangement.conf##class.dual-monitor b/.config/sway/workspace-arrangement.conf##class.dual-monitor deleted file mode 100644 index 9fbcb39..0000000 --- a/.config/sway/workspace-arrangement.conf##class.dual-monitor +++ /dev/null @@ -1,63 +0,0 @@ -### -*-conf-space-*- ### -# Dual-Monitor Workspace Settings # -### ### - -# This file defines the workspaces and creates the keybinds to switch -# between them and move containers around between them. This version -# is for dual-monitor systems. The host-specific display-arrangement.conf -# file should declare the $leftdisplay and $rightdisplay variables used -# here. - -workspace { - # Left monitor workspaces - 1 output $leftdisplay - 2 output $leftdisplay - 3 output $leftdisplay - 4 output $leftdisplay - 5 output $leftdisplay - 6 output $leftdisplay - 7 output $leftdisplay - 8 output $leftdisplay - 9 output $leftdisplay - 10 output $leftdisplay - - # Right monitor workspaces - 11 output $rightdisplay - 12 output $rightdisplay - 13 output $rightdisplay - 14 output $rightdisplay - 15 output $rightdisplay - 16 output $rightdisplay - 17 output $rightdisplay - 18 output $rightdisplay - 19 output $rightdisplay - 20 output $rightdisplay -} - -## Workspace Switching Keybinds -bindsym { - $mod+1 exec swaymsg workspace $(sway-find-workspace 1 ) - $mod+2 exec swaymsg workspace $(sway-find-workspace 2 ) - $mod+3 exec swaymsg workspace $(sway-find-workspace 3 ) - $mod+4 exec swaymsg workspace $(sway-find-workspace 4 ) - $mod+5 exec swaymsg workspace $(sway-find-workspace 5 ) - $mod+6 exec swaymsg workspace $(sway-find-workspace 6 ) - $mod+7 exec swaymsg workspace $(sway-find-workspace 7 ) - $mod+8 exec swaymsg workspace $(sway-find-workspace 8 ) - $mod+9 exec swaymsg workspace $(sway-find-workspace 9 ) - $mod+0 exec swaymsg workspace $(sway-find-workspace 10) -} - -## Window Reassignment Keybinds -bindsym { - $mod+Shift+1 exec swaymsg move container to workspace $(sway-find-workspace 1 ) - $mod+Shift+2 exec swaymsg move container to workspace $(sway-find-workspace 2 ) - $mod+Shift+3 exec swaymsg move container to workspace $(sway-find-workspace 3 ) - $mod+Shift+4 exec swaymsg move container to workspace $(sway-find-workspace 4 ) - $mod+Shift+5 exec swaymsg move container to workspace $(sway-find-workspace 5 ) - $mod+Shift+6 exec swaymsg move container to workspace $(sway-find-workspace 6 ) - $mod+Shift+7 exec swaymsg move container to workspace $(sway-find-workspace 7 ) - $mod+Shift+8 exec swaymsg move container to workspace $(sway-find-workspace 8 ) - $mod+Shift+9 exec swaymsg move container to workspace $(sway-find-workspace 9 ) - $mod+Shift+0 exec swaymsg move container to workspace $(sway-find-workspace 10) -} diff --git a/.config/sway/workspace-arrangement.conf##class.single-monitor b/.config/sway/workspace-arrangement.conf##class.single-monitor deleted file mode 100644 index 163810c..0000000 --- a/.config/sway/workspace-arrangement.conf##class.single-monitor +++ /dev/null @@ -1,22 +0,0 @@ -### -*-conf-space-*- ### -# Single-Monitor Workspace Settings # -### ### - -# This file defines the workspaces and creates the keybinds to switch -# between them and move containers around between them. This version -# is for dual-monitor systems. The host-specific display-arrangement.conf -# file should declare the $display variable used here. - -workspace { - 1 output $display - 2 output $display - 3 output $display - 4 output $display - 5 output $display - 6 output $display - 7 output DP-1 DP-2 DP-3 DP-4 $display - 8 output $display - 9 output $display - 10 output $display -} - diff --git a/.config/sway/workspace-arrangement.conf##class.tie-fighter b/.config/sway/workspace-arrangement.conf##class.tie-fighter deleted file mode 100644 index 3714e9a..0000000 --- a/.config/sway/workspace-arrangement.conf##class.tie-fighter +++ /dev/null @@ -1,38 +0,0 @@ -### -*-conf-space-*- ### -# Tie Fighter Workspace Settings # -### ### - -# This file defines the workspaces and creates the keybinds to switch -# between them and move containers around between them. This version -# is for "tie-fighter" systems (one horizontal central display flanked -# by two vertical displays). The host-specific display-arrangement.conf -# file should declare the $leftdisplay, $centerdisplay, and $rightdisplay -# variables used here. - -workspace { - # Left monitor workspaces - 1 output $leftdisplay - 2 output $leftdisplay - 3 output $leftdisplay - 4 output $leftdisplay - 5 output $leftdisplay - - # Center monitor workspaces - 6 output $centerdisplay - 7 output $centerdisplay - 8 output $centerdisplay - 9 output $centerdisplay - 10 output $centerdisplay - 11 output $centerdisplay - 12 output $centerdisplay - 13 output $centerdisplay - 14 output $centerdisplay - 15 output $centerdisplay - - # Right monitor workspaces - 16 output $rightdisplay - 17 output $rightdisplay - 18 output $rightdisplay - 19 output $rightdisplay - 20 output $rightdisplay -} diff --git a/.config/sway/workspace-arrangement.conf##class.triple-monitor b/.config/sway/workspace-arrangement.conf##class.triple-monitor deleted file mode 100644 index 16baca7..0000000 --- a/.config/sway/workspace-arrangement.conf##class.triple-monitor +++ /dev/null @@ -1,75 +0,0 @@ -### -*-conf-space-*- ### -# Dual-Monitor Workspace Settings # -### ### - -# This file defines the workspaces and creates the keybinds to switch -# between them and move containers around between them. This version -# is for dual-monitor systems. The host-specific display-arrangement.conf -# file should declare the $leftdisplay and $rightdisplay variables used -# here. - -workspace { - # Left monitor workspaces - 1 output $leftdisplay - 2 output $leftdisplay - 3 output $leftdisplay - 4 output $leftdisplay - 5 output $leftdisplay - 6 output $leftdisplay - 7 output $leftdisplay - 8 output $leftdisplay - 9 output $leftdisplay - 10 output $leftdisplay - - # Center monitor workspaces - 11 output $centerdisplay - 12 output $centerdisplay - 13 output $centerdisplay - 14 output $centerdisplay - 15 output $centerdisplay - 16 output $centerdisplay - 17 output $centerdisplay - 18 output $centerdisplay - 19 output $centerdisplay - 20 output $centerdisplay - - # Right monitor workspaces - 21 output $rightdisplay - 22 output $rightdisplay - 23 output $rightdisplay - 24 output $rightdisplay - 25 output $rightdisplay - 26 output $rightdisplay - 27 output $rightdisplay - 28 output $rightdisplay - 29 output $rightdisplay - 30 output $rightdisplay -} - -## Workspace Switching Keybinds -bindsym { - $mod+1 exec swaymsg workspace $(sway-find-workspace 1 ) - $mod+2 exec swaymsg workspace $(sway-find-workspace 2 ) - $mod+3 exec swaymsg workspace $(sway-find-workspace 3 ) - $mod+4 exec swaymsg workspace $(sway-find-workspace 4 ) - $mod+5 exec swaymsg workspace $(sway-find-workspace 5 ) - $mod+6 exec swaymsg workspace $(sway-find-workspace 6 ) - $mod+7 exec swaymsg workspace $(sway-find-workspace 7 ) - $mod+8 exec swaymsg workspace $(sway-find-workspace 8 ) - $mod+9 exec swaymsg workspace $(sway-find-workspace 9 ) - $mod+0 exec swaymsg workspace $(sway-find-workspace 10) -} - -## Window Reassignment Keybinds -bindsym { - $mod+Shift+1 exec swaymsg move container to workspace $(sway-find-workspace 1 ) - $mod+Shift+2 exec swaymsg move container to workspace $(sway-find-workspace 2 ) - $mod+Shift+3 exec swaymsg move container to workspace $(sway-find-workspace 3 ) - $mod+Shift+4 exec swaymsg move container to workspace $(sway-find-workspace 4 ) - $mod+Shift+5 exec swaymsg move container to workspace $(sway-find-workspace 5 ) - $mod+Shift+6 exec swaymsg move container to workspace $(sway-find-workspace 6 ) - $mod+Shift+7 exec swaymsg move container to workspace $(sway-find-workspace 7 ) - $mod+Shift+8 exec swaymsg move container to workspace $(sway-find-workspace 8 ) - $mod+Shift+9 exec swaymsg move container to workspace $(sway-find-workspace 9 ) - $mod+Shift+0 exec swaymsg move container to workspace $(sway-find-workspace 10) -} From bf27d4565e06ebb713da1329c9e9eefd11f0b8c9 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Wed, 5 Feb 2025 18:28:02 -0700 Subject: [PATCH 2/8] add start of outputs file --- .config/sway/outputs.json | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .config/sway/outputs.json diff --git a/.config/sway/outputs.json b/.config/sway/outputs.json new file mode 100644 index 0000000..5d095f4 --- /dev/null +++ b/.config/sway/outputs.json @@ -0,0 +1,42 @@ +{ + "zariman-builtin": { + "names": ["eDP-1"], + "eww_windows": { + "laptopbar": { + "battery": "BAT1" + } + }, + "options": { + "mode": "2560x1600", + "refresh": 165, + "color_profile": "icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm" + } + }, + "work-left": { + "make": "Acer Technologies", + "model": "XV271U M3", + "serial": "1322131231233", + "eww_windows": {}, + "options": { + "mode": "2560x1440", + "refresh": 120 + } + }, + "work-right": { + "make": "Acer Technologies", + "model": "XV271U M3", + "serial": "1431038964205", + "options": { + "mode": "2560x1440", + "refresh": 120 + } + }, + "work-center": { + "make": "Dell Inc.", + "model": "DELL U3818DW", + "serial": "97F8P9350W0L", + "options": { + "mode": "3840x1600" + } + } +} From 098e16e0001efcb7c1f1faf27914ecf1081fe8bb Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Fri, 7 Feb 2025 16:14:45 -0700 Subject: [PATCH 3/8] Add new workspace config files --- .config/voidshell/README.md | 101 ++++++++++++++++++ .config/voidshell/config.yml | 8 ++ .config/voidshell/contexts.yml | 115 ++++++++++++++++++++ .config/voidshell/layouts.yml | 33 ++++++ .config/voidshell/outputs.yml | 69 ++++++++++++ .config/voidshell/workspaces.yml | 177 +++++++++++++++++++++++++++++++ 6 files changed, 503 insertions(+) create mode 100644 .config/voidshell/README.md create mode 100644 .config/voidshell/config.yml create mode 100644 .config/voidshell/contexts.yml create mode 100644 .config/voidshell/layouts.yml create mode 100644 .config/voidshell/outputs.yml create mode 100644 .config/voidshell/workspaces.yml diff --git a/.config/voidshell/README.md b/.config/voidshell/README.md new file mode 100644 index 0000000..8a47092 --- /dev/null +++ b/.config/voidshell/README.md @@ -0,0 +1,101 @@ +# VoidShell Configuration + +VoidShell is configured using a YAML file consisting of multiple top-level objects: + +- `outputs` contains output definitions, which are referenced elsewhere by name +- `workspaces` contains worksapce definitions, which are referenced by ID +- `layouts` contains information about various output layouts that VoidShell will attempt to load when connected outputs change +- `contexts` contains information about a "context", which describes what workspaces should be present on which outputs and in what order, based on the current layout +- `config` contains global configuration variables that can be referenced elsewhere in the config file using Python format string syntax (`{var_name}`). Due to limitations with Python's `format` function, this object must be flat, i.e., contain only primitive values. + +Additionally, there is a top-level `import` directive, which takes a list of file paths to other YAML files, allowing composable configuration. Relative paths are interpreted as being from the location of the *main config file*, not the file in which the `import` directive appears. If a listed file does not exist, it is ignored. + +Imports are processed in a depth-first manner. + +Finally, there is a top-level `default-context` directive, which specifies which context VoidShell should start in. If not specified, the first non-`default` context will be used, unless `default` is the only defined context in which case `default` will be used. + +## Output Section + +The `output` section defines the display outputs known to VoidShell. These are physical monitors, identified by various criteria, but should form a one-to-one mapping from the definition to the monitor. This should generally be accomplished by including make, model, and serial number, but for a laptop, the name `eDP-1` will nearly always refer exclusively to the built-in display, making it useful for those laptop panels which do not report a serial number in their EDIDs. + +It consists of a mapping of internal output name to output definition. + +Multiple output sections are concatenated together. If an output is defined twice, the definitions will be merged, with later appearances overwriting duplicate keys, unless stated otherwise. + +### Structure + +- `criteria`: Match criteria. The following criteria are available, and all must match for the output to be used: + - `name`: The name of the output as reported by the compositor. This changes based on what port the monitor is plugged into, and should therefore not be used for any external displays unless absolutely necessary. Can also be a list of names, in which case will match on any of them (OR filter) + - `hostname`: The hostname of the computer VoidShell is running on. Can also be a list of hostnames, in which case will match on any of them (OR filter) + - `make`: The make of the monitor, reported by EDID + - `model`: The model of the monitor, reported by EDID + - `serial`: The serial "number" of the monitor, reported by EDID + - `modes`: A list of modes which must be available. All modes listed must be available (AND filter). Undefined attributes are ignored (wildcard match). + - `width`: The width in pixels + - `height`: The height in pixels + - `refresh`: The integer refresh rate in millihertz + - `picture_aspect_ratio`: The aspect ratio listed in the EDID (not necessarily equal to `width / height`) +- `eww-windows`: A list of EWW (ElKowar's Wacky Widgets) windows to open when this output is activated, or an object mapping the name of an EWW window to additional variables to pass when opening the window. +- `options`: An object mapping configuration option names to values. When running under Sway, any unrecognized options will simply be added to the configuration command in the form `{option_name} {option_value}`. Duplicate `options` are merged, with later appearances overwriting duplicate keys. All options are optional, with the compositor determining what to do when an option is absent. The following options are understood: + - `resolution`: The resolution to set the output to. Must be a defined mode reported by the monitor EDID. Mutually exclusive with `custom-mode`. + - `refresh`: The refresh rate in millihertz. Added to `resolution` to produce the final mode line. Must be a defined refresh rate for the resolution. Mutually exclusive with `custom-mode`. + - `custom-mode`: The modeline to set the output to. Does not need to be defined by the monitor's EDID. Use with caution. Mutually exclusive with `mode` and `refresh`. + - `scale`: The scaling factor of the output. + +## Workspaces Section + +The `workspaces` section defines the workspaces that VoidShell manages. These are implemented using the underlying compositor's workspace system. + +Workspaces have a concept of a "default application", which is the program that will be executed on this workspace when the default application keybind is pressed. These applications are run in their own cgroups, with logs directed to the user journal unless this is overridden. + +It consists of a mapping of workspace IDs to workspace definitions. The IDs are used to relate the definition to a workspace in the compositor. + +Multiple workspace sections are concatenated together. If a workspace ID is defined multiple times, the last definition is used. + +### Structure + +- `name`: The name of the workspace that is presented to the user +- `application`: The default application of the workspace. The name will have `.desktop` added to the end, and a matching file will be searched for in the standard desktop file locations. Mutually exclusive with `exec`, `args`, and `unit`. +- `exec`: The default application of the workspace. This is assumed to be an executable in VoidShell's PATH. It should contain only the executable name or a path to the executable. Mutually exclusive with `application` and `unit`. +- `args`: The arguments to pass to the command run with `exec`, excluding `argv[0]` (the program name itself). Optional. Mutually exclusive with `application` and `unit`. +- `environ`: A key-value mapping of environment variables and their values to set for the process. Mutually exclusive with `unit`. +- `unit`: A SystemD user unit to start as the default application of the workspace. Mutually exclusive with all other default application options. +- `systemd`: Boolean value indicating whether the default application should be run under SystemD for process control and logging. Defaults to true, and disabling has no effect if the `unit` option is used. +- `log-output`: Boolean value indicating whether the default application should be run with its ouptut (stdout/stderr) connected to the user journal (true), or to `/dev/null` (false). Defaults to true, and disabling has no effect if the `unit` option is used. + +## Layouts Section + +The `layouts` section defines the display layouts that VoidShell will attempt to configure. A scoring system is used to determine the best-fit layout for a given set of connected monitors, and the highest-scoring layout will be activated automatically. However, any compatible layout may be manually selected at any time. + +It consists of a mapping of layout names to layout definitions. + +Multiple layout sections are concatenated together. If a layout name is defined multiple times, the last definition is used. + +### Structure + +A layout object is a key-value mapping specifying the outputs used. The keys provide layout-local generic names for the outputs (e.g. "left" or "right"), which are referenced by contexts to define workspace groups. These objects have the following structure: + +- `required`: Boolean value indicating whether the output must be present to activate the layout. Optional outputs still contribute to score when present, but do not remove the layout from consideration when absent. Defaults to true. +- `score`: The score that this output contributes to the layout when matched. Default is based on how the output was matched, detailed in the *Scoring* section. +- `position`: The position within the framebuffer to place the output, as a tuple of the form `[x, y]`. Values can be integers, in which case they are used directly, or strings, in which case they are processed as follows: + - They are formatted with both the global configuration (set in the `config` section), and an additional value for each previously-defined output equal to its framebuffer resolution (resolution after scaling) in the current dimension. + - This allows to create dynamic output positioning formulae + - Unmatched optional outputs will have their values here set to 0, so they can be safely used. + - They are then evaluated as mathematical expressions, and the result is used as the position. +- `outputs`: A list of outputs that can be used in this layout. If multiple listed outputs are connected, an earlier-listed output will be preferred if it is available. +- `options`: An options mapping as in an output definition. It is merged the same as other duplicate option sets, and overrides any keys set in the definition. Useful for e.g. layout-dependent scaling. + +## Contexts Section + +The `contexts` section defines the "contexts" that VoidShell can be used in (e.g. personal, work, school). These contexts define the mappings of workspaces to outputs based on layout. + +It consists of a mapping of context names to context definitions. + +Multiple context sections are concatenated together. If a context name is defined multiple times, the definitions will be merged, with duplicate groups being overridden in full by later definitions and configs merged. + +The special context name `default` allows for the configuration of fallback workspace assignments in case a group is present in the current layout but not configured in the current context. This context cannot be marked active unless it is the only context defined. + +### Structure + +- `config`: A key-value pairing of configuration values local to this context. Values duplicated from the global config override those in the global config. +- `groups`: A key-value pairing of group names to workspace lists. These are matched against the layout-specific output names of the current layout, with group names not defined in the layout being ignored. The workspaces are identified by their IDs. diff --git a/.config/voidshell/config.yml b/.config/voidshell/config.yml new file mode 100644 index 0000000..c0af6c0 --- /dev/null +++ b/.config/voidshell/config.yml @@ -0,0 +1,8 @@ +config: + battery: BAT1 +import: + - local.yml + - outputs.yml + - layouts.yml + - contexts.yml + - workspaces.yml diff --git a/.config/voidshell/contexts.yml b/.config/voidshell/contexts.yml new file mode 100644 index 0000000..b99be14 --- /dev/null +++ b/.config/voidshell/contexts.yml @@ -0,0 +1,115 @@ +contexts: + work: + groups: + auxiliary: + - media-streaming + primary: + - console-1 + - code-1 + - inet-1 + - proj-1 + - misc-image-editor + - misc-password + - docs-2 + - comms-zoom + - comms-mail + - misc-audio + left-wing: + - console-2 + - code-2 + - docs-1 + - comms-signal + - comms-discord + right-wing: + - console-3 + - code-3 + - inet-3 + - media-music + - comms-slack + builtin: + - console-1 + - code-1 + - inet-1 + - proj-1 + - docs-1 + - comms-zoom + - media-music + - comms-slack + - comms-mail + - misc-audio + entertainment: + groups: + auxiliary: + - media-streaming + primary: + - console-1 + - code-1 + - inet-1 + - gaming-steam + - gaming-minecraft + - gaming-dnd + - gaming-pf + - gaming-other + - media-video + - misc-audio + left-wing: + - console-2 + - gaming-notes-1 + - inet-2 + - media-streaming + - comms-discord + right-wing: + - console-3 + - gaming-notes-2 + - inet-3 + - media-webvideo-1 + - comms-signal + builtin: + - console-1 + - gaming-notes-1 + - gaming-pf + - gaming-steam + - gaming-minecraft + - gaming-dnd + - gaming-other + - comms-discord + - media-video + - misc-audio + personal: + groups: + auxiliary: + - media-streaming + primary: + - console-1 + - code-1 + - inet-1 + - gaming-steam + - misc-image-editor + - misc-password + - media-video + - comms-matrix + - comms-zoom + - misc-audio + left-wing: + - console-2 + - code-2 + - inet-2 + - comms-mail + - comms-discord + right-wing: + - console-3 + - code-3 + - inet-3 + - media-music + - comms-signal + builtin: + - console-1 + - code-1 + - inet-1 + - proj-1 + - comms-signal + - comms-matrix + - media-music + - comms-discord + - comms-mail + - misc-audio diff --git a/.config/voidshell/layouts.yml b/.config/voidshell/layouts.yml new file mode 100644 index 0000000..a6ccd2a --- /dev/null +++ b/.config/voidshell/layouts.yml @@ -0,0 +1,33 @@ +layouts: + battlestation: + auxiliary: + required: false + score: 0 + outputs: + - builtin + options: + scale: 1.5 + position: [0, 600] + left-wing: + outputs: + - work-left-wing + - home-left-wing + position: ['{auxiliary}', 0] + primary: + outputs: + - work-center + - home-center + position: ['{auxiliary} + {left-wing}', 0] + right-wing: + required: false + outputs: + - work-right-wing + - home-right-wing + position: ['{auxiliary} + {left-wing} + {right-wing}', 0] + laptop: + builtin: + outputs: + - builtin + options: + scale: '{scaling-factor}' + position: [0, 0] diff --git a/.config/voidshell/outputs.yml b/.config/voidshell/outputs.yml new file mode 100644 index 0000000..99b5464 --- /dev/null +++ b/.config/voidshell/outputs.yml @@ -0,0 +1,69 @@ +outputs: + work-left-wing: + criteria: + make: Dell Inc. + model: DELL U2722D + serial: DV3MGH3 + eww-windows: + desktop-leftbar: + sidebar: + side: left + options: + resolution: 2560x1440 + refresh: 59951 + work-right-wing: + criteria: + make: Dell Inc. + model: DELL U2722D + serial: 5X3MGH3 + eww-windows: + desktop-rightbar: + sidebar: + side: right + options: + resolution: 2560x1440 + refresh: 59951 + work-center: + criteria: + make: Dell Inc. + model: DELL U3818DW + serial: 97F8P9350W0L + eww-windows: + - desktop-mainbar + options: + resolution: 3840x1600 + refresh: 59994 + home-left-wing: + criteria: + make: ASUSTek COMPUTER INC + model: VG245 + serial: L7LMQS132447 + eww-windows: + desktop-leftbar: + sidebar: + side: left + options: + mode: 1920x1080 + refresh: '75' + home-right-wing: + criteria: + make: ASUSTek COMPUTER INC + model: VG245 + serial: L6LMQS065439 + eww-windows: + desktop-rightbar: + sidebar: + side: right + options: + resolution: 1920x1080 + refresh: '75' + home-center: + criteria: + make: ASUSTek COMPUTER INC + model: VG32AQA1A + serial: S5LMQS033656 + eww-windows: + - desktop-mainbar + options: + resolution: 2560x1440 + refresh: '165' diff --git a/.config/voidshell/workspaces.yml b/.config/voidshell/workspaces.yml new file mode 100644 index 0000000..41aed6a --- /dev/null +++ b/.config/voidshell/workspaces.yml @@ -0,0 +1,177 @@ +workspaces: +### ### +# Console Workspaces # +### ### + console-1: + name: console + exec: console + console-2: + name: console + exec: console + console-3: + name: console + exec: console +### ### +# Code Workspaces # +### ### + code-1: + name: code + exec: emacsclient + args: + - nc + code-2: + name: code + exec: emacsclient + args: + - nc + code-3: + name: code + exec: emacsclient + args: + - nc +### ### +# Internet Workspaces # +### ### + inet-1: + name: internet + exec: firefox + args: + - '--new-window' + inet-2: + name: internet + exec: firefox + args: + - '--new-window' + inet-3: + name: internet + exec: firefox + args: + - '--new-window' +### ### +# Project Workspaces # +### ### + proj-1: + name: project + exec: firefox + args: + - '--new-window' + proj-2: + name: project + exec: firefox + args: + - '--new-window' + proj-3: + name: project + exec: firefox + args: + - '--new-window' +### ### +# Documentation Workspaces # +### ### + doc-1: + name: project + exec: firefox + args: + - '--new-window' + doc-2: + name: project + exec: firefox + args: + - '--new-window' + doc-3: + name: project + exec: firefox + args: + - '--new-window' +### ### +# Comms Workspaces # +### ### + comms-discord: + name: discord comms + exec: discord + comms-slack: + name: slack comms + exec: slack + args: + - '--enable-features=UseOzonePlatform' + - '--ozone-platform=wayland' + - '--enable-gpu-rasterization' + comms-signal: + name: encrypted comms + exec: signal-desktop + comms-matrix: + name: encrypted comms + exec: element-desktop + comms-zoom: + name: video comms + exec: zoom + comms-mail: + name: messages + exec: thunderbird + environ: + MOZ_ENABLE_WAYLAND: 1 +### ### +# Media Workspaces # +### ### + media-music: + name: music + exec: feishin + media-video: + name: video + exec: jellyfinmediaplayer + media-streaming: + name: livestream + exec: firefox + args: + - '--new-window' + media-webvideo-1: + name: web video + exec: firefox + args: + - '--new-window' + media-webvideo-2: + name: web video + exec: firefox + args: + - '--new-window' +### ### +# Gaming Workspaces # +### ### + gaming-steam: + name: steam + exec: steam + gaming-minecraft: + name: minecraft + exec: prismlauncher + gaming-notes-1: + name: notes + exec: obsidian + gaming-notes-2: + name: notes + exec: obsidian + gaming-dnd: + name: 'dungeons & dragons' + exec: firefox + args: + - '--new-window' + - 'https://roll20.net' + gaming-pf: + name: pathfinder + exec: firefox + args: + - '--new-window' + - 'https://mossfinder.ezri.dev' + gaming-other: + name: game +### ### +# Miscellaneous Workspaces # +### ### + misc-audio: + name: audio mixer + exec: pavucontrol + misc-password: + name: password management + exec: bitwarden-desktop + misc-image-editor: + name: image editor + exec: gimp From 65a39a7cd682bb773c34450fd3a77487dfe00d1b Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Thu, 13 Mar 2025 09:33:18 -0600 Subject: [PATCH 4/8] Removed absolute paths for eww network script --- .config/eww/scripts/network.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/eww/scripts/network.py b/.config/eww/scripts/network.py index 99db78e..3ed863f 100755 --- a/.config/eww/scripts/network.py +++ b/.config/eww/scripts/network.py @@ -92,7 +92,7 @@ class Interface: def get_first_hop() -> IPAddress | None: """Get the first network hop.""" # Use ping to get the first hop - cmd = ["/usr/bin/ping", "-c1", "-W0.3", "-t1", "1.1.1.1"] + cmd = ["ping", "-c1", "-W0.3", "-t1", "1.1.1.1"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: ip = IPAddress(result.stdout.decode("utf-8").split("\n")[1].split()[1]) @@ -145,14 +145,14 @@ def interface_status(interface: str, gw): def ping(host: IPAddress) -> bool: - cmd = ["/usr/bin/ping", "-c1", "-w1", str(host)] + cmd = ["ping", "-c1", "-w1", str(host)] result = run(cmd, stdout=DEVNULL, stderr=DEVNULL) return result.returncode == 0 def get_public_ip(): """Get the public IP address.""" - cmd = ["/usr/bin/curl", "-s", "https://ipinfo.io"] + cmd = ["curl", "-s", "https://ipinfo.io"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: data = json.loads(result.stdout.decode("utf-8")) @@ -171,7 +171,7 @@ def get_public_ip(): def get_default_route(): """Get the default route.""" - cmd = ["/usr/bin/ip", "route", "show", "default"] + cmd = ["ip", "route", "show", "default"] result = run(cmd, stdout=PIPE, stderr=PIPE) try: # Get first line (might have multiple gateway routes) From 1127019300aa94f872420b4fdadf3e842d1562b9 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Thu, 13 Mar 2025 09:35:26 -0600 Subject: [PATCH 5/8] Added color profiles to work displays --- ...workspaces.json##hostname.gathering-storm} | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) rename .config/sway/{workspaces.json##hostname.zariman => workspaces.json##hostname.gathering-storm} (93%) diff --git a/.config/sway/workspaces.json##hostname.zariman b/.config/sway/workspaces.json##hostname.gathering-storm similarity index 93% rename from .config/sway/workspaces.json##hostname.zariman rename to .config/sway/workspaces.json##hostname.gathering-storm index c48f495..f365863 100644 --- a/.config/sway/workspaces.json##hostname.zariman +++ b/.config/sway/workspaces.json##hostname.gathering-storm @@ -150,7 +150,10 @@ "index": 22, "name": "encrypted comms", "exec": "signal-desktop", - "program_name": "signal" + "program_name": "signal", + "environ": { + "ELECTRON_OZONE_PLATFORM_HINT": "wayland" + } }, { "index": 23, @@ -175,12 +178,12 @@ "mode": "2560x1600@165Hz scale 1.5 color_profile icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm" }, { - "make": "Acer Technologies", - "model": "XV271U M3", - "serial": "1322131231233", + "make": "Dell Inc.", + "model": "DELL U2722D", + "serial": "DV3MGH3", "group": "left", "position": [1707, 0], - "mode": "2560x1440@120Hz", + "mode": "2560x1440 color_profile icc /usr/share/color/icc/colord/DCI-P3.icd", "eww_windows": { "desktop-leftbar": {}, "sidebar": { @@ -194,16 +197,16 @@ "serial": "97F8P9350W0L", "group": "center", "position": [4267, 0], - "mode": "3840x1600", + "mode": "3840x1600 color_profile icc /usr/share/color/icc/colord/DCI-P3.icd", "eww_windows": ["desktop-mainbar"] }, { - "make": "Acer Technologies", - "model": "XV271U M3", - "serial": "1431038964205", + "make": "Dell Inc.", + "model": "DELL U2722D", + "serial": "5X3MGH3", "group": "right", "position": [8107, 0], - "mode": "2560x1440@120Hz", + "mode": "2560x1440 color_profile icc /usr/share/color/icc/colord/DCI-P3.icd", "eww_windows": { "desktop-rightbar": {}, "sidebar": { From bbc5492534a2c0f3e6625866c16ace427d54d3a8 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Thu, 13 Mar 2025 09:36:06 -0600 Subject: [PATCH 6/8] Removed absolute path from sway context manager service --- .config/systemd/user/sway-context-manager.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/systemd/user/sway-context-manager.service b/.config/systemd/user/sway-context-manager.service index 0e4522d..8a8ab2e 100644 --- a/.config/systemd/user/sway-context-manager.service +++ b/.config/systemd/user/sway-context-manager.service @@ -1,11 +1,11 @@ [Unit] -Description = Sway workspace context manager for dynamic-monitor setups +Description=Sway workspace context manager for dynamic-monitor setups PartOf=sway-session.target [Service] Type=dbus BusName=dev.ezri.sway -ExecStart=/usr/bin/sway_context_manager +ExecStart=sway_context_manager Slice=session.slice Restart=on-abnormal RestartSec=5s From 6a603a5c9b4d1cf0be8707f596c36e591e78d2c6 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Thu, 13 Mar 2025 09:37:20 -0600 Subject: [PATCH 7/8] Updated emacs settings for emacs 30 --- .emacs.d/init.el | 6 +- .emacs.d/settings.org | 251 +++++++++++++++++++++++++++++++----------- 2 files changed, 192 insertions(+), 65 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index ab1de92..ecf6526 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,4 +1,5 @@ ;; Install straight.el +(defvar native-comp-deferred-compilation-deny-list '[]) (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) @@ -6,7 +7,7 @@ (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously - "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) @@ -19,7 +20,8 @@ (use-package straight :custom (straight-use-package-by-default t)) -(straight-use-package 'org) +(use-package org + :ensure t) (require 'org) (org-babel-load-file (expand-file-name "settings.org" diff --git a/.emacs.d/settings.org b/.emacs.d/settings.org index 13f6bd1..c42a7bb 100644 --- a/.emacs.d/settings.org +++ b/.emacs.d/settings.org @@ -5,6 +5,7 @@ Shamelessly stole this from Simponic, made some limited modifications myself. Namely to indent style, theme, and line numbers. Also added Github Copilot. + * Packages ** Melpa #+BEGIN_SRC emacs-lisp @@ -12,15 +13,29 @@ Namely to indent style, theme, and line numbers. Also added Github Copilot. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) #+END_SRC +** Project +#+BEGIN_SRC emacs-lisp + (use-package project + :ensure t) +#+END_SRC +** Configure some packages for internal only +#+BEGIN_SRC emacs-lisp + (use-package eldoc :straight (:type built-in)) + (use-package flymake :straight (:type built-in)) +#+END_SRC * General emacs ** Indentation Indent using tabs, render with tab-width of 2. #+BEGIN_SRC emacs-lisp + (use-package smart-tabs-mode + :ensure t + :init + (smart-tabs-insinuate 'c 'c++ 'java 'javascript 'python) + ) (setq default-tab-width 2) (setq-default tab-width 2) (setq-default indent-tabs-mode t) (setq sh-indentation 2) - (smart-tabs-insinuate 'c 'c++ 'java 'javascript 'python) (add-hook 'conf-mode-hook (lambda () @@ -365,20 +380,22 @@ Indent using tabs, render with tab-width of 2. * Custom Mode Bindings ** SystemD unit files #+BEGIN_SRC emacs-lisp - ;; Base systemd unit files - (add-to-list 'auto-mode-alist '("\\.service\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.timer\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.mount\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.automount\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.target\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.path\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.slice\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.socket\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.device\\'" . conf-unix-mode)) - ;; systemd-networkd - (add-to-list 'auto-mode-alist '("\\.network\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.link\\'" . conf-unix-mode)) - (add-to-list 'auto-mode-alist '("\\.netdev\\'" . conf-unix-mode)) + ;; ;; Base systemd unit files + ;; (add-to-list 'auto-mode-alist '("\\.service\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.timer\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.mount\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.automount\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.target\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.path\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.slice\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.socket\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.device\\'" . conf-unix-mode)) + ;; ;; systemd-networkd + ;; (add-to-list 'auto-mode-alist '("\\.network\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.link\\'" . conf-unix-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.netdev\\'" . conf-unix-mode)) + (use-package systemd + :ensure t) #+END_SRC ** elkowar's wacky widgets @@ -389,8 +406,9 @@ Indent using tabs, render with tab-width of 2. #+BEGIN_SRC emacs-lisp (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode)) #+END_SRC -* Markdown mode -** Auto Text Wrap +* Config & Markup +** Markdown +*** Auto Text Wrap #+BEGIN_SRC emacs-lisp (add-hook 'markdown-mode-hook (lambda () (setq fill-column 85) @@ -398,17 +416,94 @@ Indent using tabs, render with tab-width of 2. (visual-line-mode) (display-fill-column-indicator-mode))) #+END_SRC +** YAML +#+BEGIN_SRC emacs-lisp + (use-package yaml-mode + :ensure t + :mode (("\\.yml\\'" . yaml-mode) + ("\\.yaml\\'" . yaml-mode))) +#+END_SRC * Org mode ** General #+BEGIN_SRC emacs-lisp (setq org-startup-indented t) + (setq org-hide-emphasis-markers t) + (font-lock-add-keywords 'org-mode + '(("^ *\\([-]\\) " + (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) +#+END_SRC + +#+RESULTS: + +** Fonts +#+BEGIN_SRC emacs-lisp + + (custom-theme-set-faces + 'user + '(org-block ((t (:inherit fixed-pitch)))) + '(org-code ((t (:inherit (shadow fixed-pitch))))) + '(org-document-info ((t (:foreground "dark orange")))) + '(org-document-info-keyword ((t (:inherit (shadow fixed-pitch))))) + '(org-indent ((t (:inherit (org-hide fixed-pitch))))) + '(org-link ((t (:foreground "royal blue" :underline t)))) + '(org-meta-line ((t (:inherit (font-lock-comment-face fixed-pitch))))) + '(org-property-value ((t (:inherit fixed-pitch))) t) + '(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch))))) + '(org-table ((t (:inherit fixed-pitch :foreground "#83a598")))) + '(org-tag ((t (:inherit (shadow fixed-pitch) :weight bold :height 0.8)))) + '(org-verbatim ((t (:inherit (shadow fixed-pitch)))))) + + + (defun my-org-font-config (&optional frame) + + (let* ((variable-tuple + (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro")) + ((x-list-fonts "Lucida Grande") '(:font "Lucida Grande")) + ((x-list-fonts "Verdana") '(:font "Verdana")) + ((x-family-fonts "Sans Serif") '(:family "Sans Serif")) + (nil (warn "Cannot find a Sans Serif Font. Install Source Sans Pro.")))) + (headline `(:weight bold))) + + (custom-theme-set-faces + 'user + `(org-level-8 ((t (,@headline ,@variable-tuple)))) + `(org-level-7 ((t (,@headline ,@variable-tuple)))) + `(org-level-6 ((t (,@headline ,@variable-tuple)))) + `(org-level-5 ((t (,@headline ,@variable-tuple)))) + `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1)))) + `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25)))) + `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5)))) + `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75)))) + `(org-document-title ((t (,@headline ,@variable-tuple :height 2.0 :underline nil)))))) + ) + + (add-hook 'after-make-frame-functions 'my-org-font-config) + + (add-hook 'org-mode-hook + (lambda () + (variable-pitch-mode) + (visual-line-mode) + (setq cursor-type '(bar . 2)) + )) +#+END_SRC + +** RPG Stuff +#+BEGIN_SRC emacs-lisp + + (use-package ox-dnd + :straight (ox-dnd :type git :host github :repo "xeals/emacs-org-dnd" :files ("*.el")) + :ensure t + :init + (require 'ox-dnd) + ) + #+END_SRC ** Auto Text Wrap #+BEGIN_SRC emacs-lisp - (add-hook 'org-mode-hook (lambda () - (setq fill-column 85) - (visual-fill-column-mode) - (visual-line-mode))) + ;; (add-hook 'org-mode-hook (lambda () + ;; (setq fill-column 85) + ;; (visual-fill-column-mode) + ;; (visual-line-mode))) #+END_SRC ** Babel *** Elixir @@ -450,15 +545,44 @@ Indent using tabs, render with tab-width of 2. :repo "rlister/org-present")) #+END_SRC +** Links & Backlinks +#+BEGIN_SRC emacs-lisp + + (use-package org-super-links + :straight (org-super-links :type git :host github :repo "toshism/org-super-links" :branch "develop") + :bind (("C-c s s" . org-super-links-link) + ("C-c s l" . org-super-links-store-link) + ("C-c s C-l" . org-super-links-insert-link)) + :config ((require 'org-id) + (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id))) +#+END_SRC + +** Emoji Input +#+BEGIN_SRC emacs-lisp + + (add-hook 'org-mode-hook '(lambda () (set-input-method "emoji"))) + +#+END_SRC + * Development ** Copilot #+BEGIN_SRC emacs-lisp + ;; Ensure dependencies are installed + (use-package editorconfig + :ensure t) + (use-package jsonrpc + :ensure t) ;; Load copilot - (add-to-list 'load-path "/home/ezri/.emacs.d/copilot.el") - (require 'copilot) - - ;; Enable completion - (add-hook 'prog-mode-hook 'copilot-mode) + (use-package copilot + :straight (copilot :type git :host github :repo "copilot-emacs/copilot.el" :files ("*.el")) + :ensure t + :init + (add-hook 'prog-mode-hook 'copilot-mode) + :bind + (:map copilot-completion-map + ("M-" . copilot-accept-completion) + ("M-RET" . copilot-accept-completion)) + ) #+END_SRC ** Tree-Sitter #+BEGIN_SRC emacs-lisp @@ -479,10 +603,6 @@ Indent using tabs, render with tab-width of 2. (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") (yaml "https://github.com/ikatyang/tree-sitter-yaml"))) #+END_SRC -** Git -#+BEGIN_SRC emacs-lisp - (use-package magit :ensure t) -#+END_SRC ** Autocomplete #+BEGIN_SRC emacs-lisp (use-package auto-complete :ensure t) @@ -497,22 +617,22 @@ Indent using tabs, render with tab-width of 2. (setq ac-disable-inline t) ; show menu if have only one candidate (setq ac-candidate-menu-min 0)) - - (define-key copilot-completion-map (kbd "") 'copilot-accept-completion) - (define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion) #+END_SRC ** Company mode #+BEGIN_SRC emacs-lisp (use-package company :ensure t - :init - (global-company-mode t) + :init (global-company-mode t) :bind (:map company-active-map ("C-n" . company-select-next) ("C-p" . company-select-previous)) :config (setq company-idle-delay 0.3)) #+END_SRC + +#+RESULTS: +: company-select-previous + ** LSP #+BEGIN_SRC emacs-lisp (use-package eglot @@ -520,25 +640,41 @@ Indent using tabs, render with tab-width of 2. :defer t :bind (:map eglot-mode-map ("C-c C-e" . eglot-rename) - ("C-." . eglot-code-actions)) + ("C-." . eglot-code-actions) + ("" . eglot-find-declaration)) :hook ((python-mode . eglot-ensure) (python-mode . flyspell-prog-mode) (python-mode . superword-mode) - (python-mode . hs-minor-mode)) + (python-mode . hs-minor-mode) + (typescript-ts-mode . eglot-ensure) + (typescript-ts-mode . flyspell-prog-mode) + (typescript-ts-mode . superword-mode) + (typescript-ts-mode . hs-minor-mode) + (tsx-ts-mode . eglot-ensure) + (tsx-ts-mode . flyspell-prog-mode) + (tsx-ts-mode . superword-mode) + (tsx-ts-mode . hs-minor-mode) + (typescript-mode . eglot-ensure) + (typescript-mode . flyspell-prog-mode) + (typescript-mode . superword-mode) + (typescript-mode . hs-minor-mode)) :config (setq-default eglot-workspace-configuration '((:pylsp . (:configurationSources ["flake8"] :plugins ( - :mccabe (:enabled :json-false) - :pyflakes (:enabled :json-false) - :flake8 (:enabled :json-false - :maxLineLength 88) - :ruff (:enabled t :lineLength 88) - :pydocstyle (:enabled t :convention "numpy") - :yapf (:enabled :json-false) - :autopep8 (:enabled :json-false) - :black (:enabled t :line_length 88 :cache_config t))))))) - + :mccabe (:enabled :json-false) + :pyflakes (:enabled :json-false) + :flake8 (:enabled :json-false + :maxLineLength 88) + :ruff (:enabled t :lineLength 88) + :pydocstyle (:enabled t :convention "numpy") + :yapf (:enabled :json-false) + :autopep8 (:enabled :json-false) + :black (:enabled t :line_length 88 :cache_config t))))))) +#+END_SRC +** Git +#+BEGIN_SRC emacs-lisp + (use-package magit :ensure t) #+END_SRC ** Languages *** Elixir @@ -566,20 +702,13 @@ After installing the ~rust-analyzer~ program, the following can be used: *** Web Stuff **** Typescript #+BEGIN_SRC emacs-lisp - ;; TODO: Update to tree-sitter in Emacs 29 - (setq major-mode-remap-alist - '((typescript-mode . typescript-ts-mode) - (python-mode . python-ts-mode) - (js2-mode . js-ts-mode) - (json-mode . json-ts-mode))) + (use-package typescript-mode + :ensure t + :mode "\\.ts\\'" + :config + (setq typescript-indent-level 2)) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)) - - ;; (add-hook 'tsx-ts-mode-hook #'eglot) - ;; (add-hook 'tsx-ts-mode-hook #'setup-tide-mode) - - ;; (add-hook 'typescript-ts-mode-hook #'eglot) - ;; (add-hook 'typescript-ts-mode-hook #'setup-tide-mode) #+END_SRC **** TIDE #+BEGIN_SRC emacs-lisp @@ -703,7 +832,3 @@ After installing the ~rust-analyzer~ program, the following can be used: ;; ("C-c C-l" . obsidian-insert-wikilink))) #+END_SRC -* TRAMP Customization -#+BEGIN_SRC emacs-lisp - (add-hook 'after-init-hook 'tramp-nspawn-setup) -#+END_SRC From baacfff7c40e503546b40872ab7febc0ec199969 Mon Sep 17 00:00:00 2001 From: Ezri Brimhall Date: Thu, 13 Mar 2025 09:37:39 -0600 Subject: [PATCH 8/8] Updated vpn toggle --- .local/bin/vpn-toggle | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.local/bin/vpn-toggle b/.local/bin/vpn-toggle index 65ae582..d1b9001 100755 --- a/.local/bin/vpn-toggle +++ b/.local/bin/vpn-toggle @@ -1,18 +1,16 @@ #!/usr/bin/env zsh exec >(systemd-cat -t gpclient -p info) 2>&1 - # Toggles the GlobalProtect VPN connection on and off # Get the current state of the VPN connection if pgrep gpclient &>/dev/null; then # VPN is connected, so disconnect echo "Disconnecting from VPN..." - pkexec env TZ=Etc/UTC gpclient disconnect + systemctl stop usu-gpclient else # VPN is disconnected, so connect echo "Connecting to VPN..." - # pkexec doesn't pass the DISPLAY and XAUTHORITY environment variables, so we need to pass them manually - TZ=Etc/UTC sudo /usr/sbin/gpclient --fix-openssl connect gp.usu.edu + systemd-run --unit=usu-gpclient --setenv=SUDO_USER=$(whoami) --setenv=SUDO_UID=$(id -u) --setenv=SUDO_GID=$(id -g) --setenv=SUDO_HOME=$HOME --setenv=DISPLAY=$DISPLAY --setenv=XAUTHORITY=$XAUTHORITY -- /usr/sbin/gpclient --fix-openssl connect gp.usu.edu + sudo nft add element inet router vpn_cgroups \{ '"system.slice/usu-gpclient.service"' \} fi