diff --git a/.config/alacritty/alacritty.toml##default b/.config/alacritty/alacritty.toml##default index c87e543..0df2ef1 100644 --- a/.config/alacritty/alacritty.toml##default +++ b/.config/alacritty/alacritty.toml##default @@ -1,4 +1,3 @@ -working_directory = "/home/ezri" [bell] animation = "EaseOutSine" diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index acd84db..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,92 +0,0 @@ -colors: - # Default colors - primary: - # background: '0x1b191b' - # foreground: '0x9a7c9d' - background: '0x1e1e1e' - foreground: '0x9a7c9d' - - # Normal colors - normal: - black: '0x2d272f' - red: '0xcf6a4c' - green: '0x8f9d6a' - yellow: '0xf9ee98' - blue: '0x7587a6' - magenta: '0x9b859d' - cyan: '0xafc4db' - white: '0xa7a7a7' - - # Bright colors - bright: - black: '0x3f3242' - red: '0xcf6a4c' - green: '0x8f9d6a' - yellow: '0xf9ee98' - blue: '0x7587a6' - magenta: '0x9b859d' - cyan: '0xafc4db' - white: '0xffffff' - - # normal: - # black: '0x453f45' - # red: '0xd27377' - # green: '0x7e9d7c' - # yellow: '0xd2c377' - # blue: '0x7587a6' - # magenta: '0xae96b0' - # cyan: '0xb0c4c2' - # white: '0xd6cad7' - - # bright: - # black: '0x453f45' - # red: '0xd27377' - # green: '0x7e9d7c' - # yellow: '0xd2c377' - # blue: '0x7587a6' - # magenta: '0xae96b0' - # cyan: '0xb0c4c2' - # white: '0xd6cad7' - -cursor: - - style: - blinking: Always - shape: underline - - -font: - size: 9 - - normal: - family: JetBrainsMono Nerd Font - style: Regular - bold: - family: JetBrainsMono Nerd Font - style: Bold - italic: - family: JetBrainsMono Nerd Font - style: Italic - bold_italic: - family: JetBrainsMono Nerd Font - style: Semibold Italic - -window: - title: Terminal - dynamic_title: true - opacity: 0.98 - dynamic_padding: true - -bell: - - animation: EaseOutSine - duration: 200 - color: '0x9a7c9d' - -working_directory: /home/ezri - -draw_bold_text_with_bright_colors: false - -debug: - render_timer: false - highlight_damage: false diff --git a/.config/discord/settings.json b/.config/discord/settings.json new file mode 100644 index 0000000..ec8cf18 --- /dev/null +++ b/.config/discord/settings.json @@ -0,0 +1,16 @@ +{ + "BACKGROUND_COLOR": "#202225", + "IS_MAXIMIZED": true, + "IS_MINIMIZED": false, + "MINIMIZE_TO_TRAY": false, + "OPEN_ON_STARTUP": false, + "WINDOW_BOUNDS": { + "x": 0, + "y": 0, + "width": 1688, + "height": 1022 + }, + "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true, + "SKIP_HOST_UPDATE": true, + "chromiumSwitches": {} +} \ No newline at end of file diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss index f39a56b..cbe9000 100644 --- a/.config/eww/eww.scss +++ b/.config/eww/eww.scss @@ -21,6 +21,7 @@ &.side { margin: 10px; + margin-top: 20px; margin-right: 0px; } @@ -28,6 +29,10 @@ background-color: $bg0; padding: 10px; } + + &.outline { + border: 1px solid $bg1; + } } .nebula { diff --git a/.config/eww/eww.yuck##hostname.gathering-storm b/.config/eww/eww.yuck##hostname.gathering-storm new file mode 100644 index 0000000..94cd9f2 --- /dev/null +++ b/.config/eww/eww.yuck##hostname.gathering-storm @@ -0,0 +1,107 @@ +;; -*-lisp-*- Include modules +(include "./modules/workspaces.yuck") +(include "./modules/clock.yuck") +(include "./modules/system.yuck") +(include "./modules/network.yuck") +(include "./modules/volume.yuck") +(include "./modules/aggietime.yuck") +(include "./modules/timer.yuck") +(include "./modules/mpris.yuck") + +(defvar power--state "normal") + +(include "./windows.yuck") + +(defwindow leftbar + :monitor 1 + :geometry (geometry :width "100%" + :height "36px" + :anchor "top center") + :exclusive true + :focusable false + :stacking "fg" + (centerbox :orientation "h" + :class "bar root" + (tycho-leftbar--left) + (tycho-leftbar--center) + (tycho-leftbar--right))) + +(defwindow centerbar + :monitor 0 + :geometry (geometry :width "100%" + :height "26px" + :anchor "top center") + :exclusive true + :focusable false + :stacking "fg" + (centerbox :orientation "h" + :class "bar root" + (tycho-centerbar--left) + (tycho-centerbar--center) + (tycho-centerbar--right))) + +(defwindow rightbar + :monitor 2 + :geometry (geometry :width "100%" + :height "36px" + :anchor "top center") + :exclusive true + :focusable false + :stacking "fg" + (centerbox :orientation "h" + :class "bar root" + (tycho-rightbar--left) + (tycho-rightbar--center) + (tycho-rightbar--right))) + +(defwindow sidebar + :monitor 1 + :geometry (geometry :width "200px" + :height "100%" + :anchor "left center") + :exclusive true + :focusable false + :stacking "fg" + (tycho-sidebar)) + + + +(defwindow network-status + :monitor 0 + :geometry (geometry :width "200px" + :height "0px" + :x "300px" + :y "0px" + :anchor "top right") + :exclusive false + :focusable false + :stacking "overlay" + (box :orientation "v" + :class "bar root bg outline" + :visible {network--show-details} + (network-detail))) + + +(defwindow builtinbar + :monitor 0 + :geometry (geometry :width "100%" + :height "36px" + :anchor "top center") + :exclusive true + :focusable false + :stacking "fg" + (centerbox :orientation "h" :class "bar root ${power--state == 'critical' ? 'reservepower' : ''}" + (rocinante-builtinbar--left) + (rocinante-builtinbar--center) + (rocinante-builtinbar--right))) + + +(defwindow polkit + :geometry (geometry + :anchor "center") + :focusable true + :exclusive false + :stacking "overlay" + (box :orientation "v" + :class "bar root bg outline" + "testing")) diff --git a/.config/eww/eww.yuck##hostname.normandy b/.config/eww/eww.yuck##hostname.normandy index be1188f..a1d0aa4 100644 --- a/.config/eww/eww.yuck##hostname.normandy +++ b/.config/eww/eww.yuck##hostname.normandy @@ -11,7 +11,7 @@ (include "./windows.yuck") (defwindow leftbar - :monitor 1 + :monitor 2 :geometry (geometry :width "100%" :height "36px" :anchor "top center") @@ -25,7 +25,7 @@ (normandy-leftbar--right))) (defwindow rightbar - :monitor 0 + :monitor 1 :geometry (geometry :width "100%" :height "26px" :anchor "top center") @@ -38,8 +38,22 @@ "" ;;(normandy-rightbar--center) (normandy-rightbar--right))) +(defwindow centerbar + :monitor 0 + :geometry (geometry :width "100%" + :height "26px" + :anchor "top center") + :exclusive true + :focusable false + :stacking "fg" + (centerbox :orientation "h" + :class "bar root" + (normandy-centerbar--left) + (normandy-centerbar--center) + (normandy-centerbar--right))) + (defwindow sidebar - :monitor 1 + :monitor 2 :geometry (geometry :width "210px" :height "1044px" :anchor "left bottom") @@ -48,3 +62,13 @@ :stacking "fg" (normandy-sidebar)) +(defwindow sidebar2 + :monitor 1 + :geometry (geometry :width "210px" + :height "1044px" + :anchor "right bottom") + :exclusive true + :focusable false + :stacking "fg" + (normandy-sidebar)) + diff --git a/.config/eww/eww.yuck##hostname.tycho b/.config/eww/eww.yuck##hostname.tycho index 4e2ae5d..ede8402 100644 --- a/.config/eww/eww.yuck##hostname.tycho +++ b/.config/eww/eww.yuck##hostname.tycho @@ -12,7 +12,7 @@ (defwindow leftbar :monitor 1 - :geometry (geometry :width "1440px" + :geometry (geometry :width "100%" :height "36px" :anchor "top center") :exclusive true @@ -51,20 +51,31 @@ (tycho-rightbar--left) (tycho-rightbar--center) (tycho-rightbar--right))) + +(defwindow sidebar + :monitor 1 + :geometry (geometry :width "200px" + :height "100%" + :anchor "left center") + :exclusive true + :focusable false + :stacking "fg" + (tycho-sidebar)) + (defwindow network-status - :monitor 2 + :monitor 0 :geometry (geometry :width "200px" :height "0px" - :x "407px" + :x "300px" :y "0px" :anchor "top right") :exclusive false :focusable false :stacking "overlay" (box :orientation "v" - :class "bar root bg" + :class "bar root bg outline" :visible {network--show-details} (network-detail))) diff --git a/.config/eww/modules/network.yuck##hostname.gathering-storm b/.config/eww/modules/network.yuck##hostname.gathering-storm new file mode 100644 index 0000000..a92f2cd --- /dev/null +++ b/.config/eww/modules/network.yuck##hostname.gathering-storm @@ -0,0 +1,347 @@ +;; -*-lisp-*- +(deflisten network--data + `~/.config/eww/scripts/network.py`) + +(defvar network--show-details false) + +(defwidget network--interface + [device] + (box :orientation "v" + :halign "center" + :space-evenly false + :spacing 0 + (label :class "offline" + :visible {!device.online} + :text "offline") + (label :visible {device.online} + :class "special" + :text "${device.addresses[0].address}/${device.addresses[0].prefixlen}"))) + +(defwidget network-big--online + [] + (box :orientation "h" + :halign "start" + :valign "center" + :space-evenly false + :spacing 10 + (label :class "medium green nebula" + :visible {network--data.online} + :text "online") + (label :class "medium offline nebula" + :visible {network--data.offline} + :text "offline") + (label :class "medium highlight nebula" + :visible {network--data.configuring} + :text "configuring"))) + +(defwidget network-big--lan + [device] + (label :visible {network--data + [device] + .online} + :class "" + :text "${network--data.interfaces[device].addresses[0].address}/${network--data.interfaces[device].addresses[0].prefixlen}")) + +(defwidget network--wlan + [device] + (box :orientation "h" + :halign "start" + :space-evenly false + :spacing 0 + (label :class "offline" + :visible {network--data + ["network"] + [device] + ["offline"] + } + :text "offline") + (label :visible {network--data + ["network"] + [device] + ["connecting"] + } + :class "highlight" + :text "connecting...") + (label :visible {network--data + ["network"] + [device] + ["online"] + } + :class "special" + :text "${network--data['wifi']['ssid']}"))) + +(defwidget network--lan + [device] + (box :orientation "h" + :halign "start" + :space-evenly false + :spacing 0 + (label :class "offline" + :visible {!device.online} + :text "offline") + (label :visible {device.online} + :class {network--data.last_update.unix < clock--data.unix - 30 ? "highlight" : "special"} + :text "${device.addresses[0].address}/${device.addresses[0].prefixlen}"))) + +(defwidget network--secure + [] + (box :orientation "h" + :halign "start" + :space-evenly false + :spacing 0 + (label :class "highlight" + :text "- insecure" + :visible {! + network--data.secure }) + (label :class "green" + :text "- secured via ${network--data.secure_msg}" + :visible {network--data.secure}))) + +(defwidget vpn-network + [] + (box :orientation "v" + :halign "start" + :space-evenly false + :spacing 0 + :visible {network--data + != + ''} + (label :class "highlight" + :text "offline" + :visible {! + network--data.interfaces.ezrinet.online }) + (label :class "green" + :text "connected" + :visible {network--data.interfaces.ezrinet.online}) + "personal network")) + +(defwidget network + [] + (button :onclick "eww update network--show-details=${!network--show-details}" + (box :orientation "v" + :halign "start" + :space-evenly false + :spacing 0 + :visible {network--data != ''} + (box :orientation "h" + :halign "center" + :space-evenly false + :spacing 10 + (network--lan :device {network--data.default_interface})) + "communications"))) + +(defwidget network--public-ip + [] + (centerbox :orientation "h" + :halign "start" + :width 200 + (box :halign "start" + "public ip:") + "" + (box :halign "end" + :spacing 0 + :space-evenly false + (label :class "highlight" + :text "offline" + :visible {!network--data.online}) + (label :class "highlight" + :text "no response" + :visible {network--data.online && !network--data.have_public_ip}) + (label :class "special" + :text {network--data.public_ip.ip} + :visible {network--data.online && network--data.have_public_ip})))) + +(defwidget network--default-route + [] + (centerbox :orientation "h" + :halign "start" + :width 200 + (box :halign "start" + "route on:") + "" + (box :halign "end" + :spacing 0 + :space-evenly false + (label :class "highlight" + :text "offline" + :visible {!network--data.online}) + (label :class "highlight" + :text "no route" + :visible {network--data.online && !network--data.have_default_route}) + (label :class "special" + :text {network--data.default_route} + :visible {network--data.online && network--data.have_default_route})))) + +(defwidget network--gateway + [] + (centerbox :orientation "h" + :halign "start" + :width 200 + (box :halign "start" + "gateway:") + "" + (box :halign "end" + :spacing 0 + :space-evenly false + (label :class "highlight" + :text "no response" + :visible {!network--data.have_gateway}) + (label :class "special" + :text {network--data.gateway} + :visible {network--data.have_gateway})))) + +(defwidget network--status-summary + [] + (centerbox :orientation "h" + :halign "start" + :width 200 + (box :halign "start" + "status:") + "" + (box :halign "end" + :spacing 0 + :space-evenly false + (label :class "highlight" + :text "offline" + :visible {!network--data.online}) + (label :class "special" + :text "online" + :visible {network--data.online && !network--data.secure}) + (label :class "green" + :text {network--data.secure_msg == "usu" ? "vpn online" : "secure"} + :visible {network--data.online && network--data.secure})))) + + +(defwidget network-detail + [] + (box :orientation "v" + :halign "start" + :space-evenly false + :spacing 0 + (network--status-summary) + (network--public-ip) + (network--default-route) + (network--gateway) + (centerbox :orientation "h" + :halign "start" + :width 200 + (box :halign "start" + "last update:") + "" + (box :halign "end" + :spacing 0 + :space-evenly false + (label :class {network--data.last_update.unix < clock--data.unix - 30 ? "highlight" : "special"} + :text "${network--data.last_update.month}-${network--data.last_update.day} ${network--data.last_update.hour}:${network--data.last_update.minute}:${network--data.last_update.second}"))) + )) + +(defwidget network-sidebar-details [] + (box :orientation "v" + :halign "start" + :class "module" + :space-evenly false + :spacing 5 + :width 200 + (box :orientation "h" + :halign "center" + :class "nebula" + :spacing 10 + :space-evenly false + (label :class "medium special" + :text "Comms")) + (box :orientation "h" + :halign "center" + :class "nebula" + :spacing 10 + :space-evenly false + (label :class "nebula green" + :text "Online" + :visible {network--data.online}) + (label :class "nebula highlight" + :text "Offline" + :visible {!network--data.online})) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Route On:") + "" + (box :halign "end" + (label :text "No Route" + :class "highlight" + :visible {network--data.online && !network--data.have_default_route}) + (label :text "${network--data.default_route}" + :class "special" + :visible {network--data.online && network--data.have_default_route}))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :valign "start" + :class "nebula" + "Address:") + "" + (box :halign "end" + :orientation "v" + (label :text "${network--data.default_interface.addresses[0].address}" + :class "special") + (label :text "/${network--data.default_interface.addresses[0].prefixlen}" + :halign "end" + :class "special"))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Public IP:") + "" + (box :halign "end" + (label :text "Offline" + :class "highlight" + :visible {!network--data.have_public_ip}) + (label :text {network--data.public_ip.ip} + :class "special" + :visible {network--data.have_public_ip}))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Gateway:") + "" + (box :halign "end" + (label :text "Error" + :class "highlight nebula" + :visible {!network--data.have_gateway}) + (label :text {network--data.gateway} + :class "special" + :visible {network--data.have_gateway}))) + (centerbox :orientation "h" + :halign "start" + :class "nebula" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + "VPN:") + "" + (box :halign "end" + (label :text "Offline" + :class "highlight" + :visible {!network--data.interfaces.ezrinet.online}) + (label :text "Online" + :class "green" + :visible {network--data.interfaces.ezrinet.online}))) + + )) + + diff --git a/.config/eww/modules/network.yuck##hostname.tycho b/.config/eww/modules/network.yuck##hostname.tycho index 6fede46..a92f2cd 100644 --- a/.config/eww/modules/network.yuck##hostname.tycho +++ b/.config/eww/modules/network.yuck##hostname.tycho @@ -234,3 +234,114 @@ (label :class {network--data.last_update.unix < clock--data.unix - 30 ? "highlight" : "special"} :text "${network--data.last_update.month}-${network--data.last_update.day} ${network--data.last_update.hour}:${network--data.last_update.minute}:${network--data.last_update.second}"))) )) + +(defwidget network-sidebar-details [] + (box :orientation "v" + :halign "start" + :class "module" + :space-evenly false + :spacing 5 + :width 200 + (box :orientation "h" + :halign "center" + :class "nebula" + :spacing 10 + :space-evenly false + (label :class "medium special" + :text "Comms")) + (box :orientation "h" + :halign "center" + :class "nebula" + :spacing 10 + :space-evenly false + (label :class "nebula green" + :text "Online" + :visible {network--data.online}) + (label :class "nebula highlight" + :text "Offline" + :visible {!network--data.online})) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Route On:") + "" + (box :halign "end" + (label :text "No Route" + :class "highlight" + :visible {network--data.online && !network--data.have_default_route}) + (label :text "${network--data.default_route}" + :class "special" + :visible {network--data.online && network--data.have_default_route}))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :valign "start" + :class "nebula" + "Address:") + "" + (box :halign "end" + :orientation "v" + (label :text "${network--data.default_interface.addresses[0].address}" + :class "special") + (label :text "/${network--data.default_interface.addresses[0].prefixlen}" + :halign "end" + :class "special"))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Public IP:") + "" + (box :halign "end" + (label :text "Offline" + :class "highlight" + :visible {!network--data.have_public_ip}) + (label :text {network--data.public_ip.ip} + :class "special" + :visible {network--data.have_public_ip}))) + (centerbox :orientation "h" + :halign "start" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + :class "nebula" + "Gateway:") + "" + (box :halign "end" + (label :text "Error" + :class "highlight nebula" + :visible {!network--data.have_gateway}) + (label :text {network--data.gateway} + :class "special" + :visible {network--data.have_gateway}))) + (centerbox :orientation "h" + :halign "start" + :class "nebula" + :spacing 10 + :width 200 + :space-evenly false + (box :halign "start" + "VPN:") + "" + (box :halign "end" + (label :text "Offline" + :class "highlight" + :visible {!network--data.interfaces.ezrinet.online}) + (label :text "Online" + :class "green" + :visible {network--data.interfaces.ezrinet.online}))) + + )) + + diff --git a/.config/eww/modules/workspaces.yuck b/.config/eww/modules/workspaces.yuck index ede6b3b..7828d0e 100644 --- a/.config/eww/modules/workspaces.yuck +++ b/.config/eww/modules/workspaces.yuck @@ -1,6 +1,6 @@ ;; -*-lisp-*- (deflisten sway--data :initial '{"mode": "default"}' - `~/.config/eww/scripts/sway.py`) + `sway_listen`) (defvar hypr--data '{}') diff --git a/.config/eww/scripts/mpris.py b/.config/eww/scripts/mpris.py index c27155a..73fd61e 100755 --- a/.config/eww/scripts/mpris.py +++ b/.config/eww/scripts/mpris.py @@ -13,6 +13,10 @@ except: sys.exit(1) from gi.repository import Playerctl, GLib +from gi.events import GLibEventLoopPolicy +import asyncio + +asyncio.set_event_loop_policy(GLibEventLoopPolicy()) title_maxlen = 40 title_end_at = ["(", "-"] @@ -56,8 +60,8 @@ class StatusDisplay: def show(self): self._init_player() - main = GLib.MainLoop() - main.run() + loop = asyncio.get_event_loop() + loop.run_forever() def _get_status(self, playing=None): if self._player: diff --git a/.config/eww/scripts/network.py##hostname.gathering-storm b/.config/eww/scripts/network.py##hostname.gathering-storm new file mode 100755 index 0000000..99db78e --- /dev/null +++ b/.config/eww/scripts/network.py##hostname.gathering-storm @@ -0,0 +1,306 @@ +#!/usr/bin/env python3 + +import trparse +from subprocess import run, PIPE, DEVNULL +import json +import sys +import os +import re +from time import sleep, time as now +from ipaddress import ( + IPv4Address as IPAddress, + IPv4Network as IPNetwork, + IPv4Interface as IPInterface, + AddressValueError, +) +from netifaces import interfaces, ifaddresses, AF_INET, AF_LINK, gateways +import dbus +from datetime import datetime + + +# These are networks that are considered secure. All traffic being routed +# through one of these networks is being encrypted and routed through an +# anonymizing service. +SECURE_FIRSTHOP_NETWORKS = { + "home": IPNetwork("10.242.0.0/16"), # Personal network + "mullvad": IPNetwork("10.64.0.1/32"), # Mullvad VPN + "usu": IPNetwork("129.123.8.126/32"), # USU VPN +} + +# Interfaces that we should check +DEFAULT_INTERFACES_TO_WATCH = ["lan", "ezrinet"] +# Interfaces that we should use when determining if we are online +DEFAULT_INTERFACES_TO_COUNT = ["lan"] +# Overrides for IP addresses to ping to determine if an interface is +# online This is useful for interfaces that don't have or report a +# gateway, but we still want to check if they're online, such as the +# ezrinet interface. +INTERFACE_PING_OVERRIDES = {"ezrinet": IPAddress("10.242.3.1")} + +INTERFACES_TO_WATCH = os.environ.get( + "NETWORK_INTERFACES_TO_WATCH", ",".join(DEFAULT_INTERFACES_TO_WATCH) +).split(",") +INTERFACES_TO_COUNT = os.environ.get( + "NETWORK_INTERFACES_TO_COUNT", ",".join(DEFAULT_INTERFACES_TO_COUNT) +).split(",") + +for key, value in os.environ.items(): + if key[: len("NETWORK_PING_OVERRIDE_")] == "NETWORK_PING_OVERRIDE_": + INTERFACE_PING_OVERRIDES[key[len("NETWORK_PING_OVERRIDE_") :]] = IPAddress( + value + ) + + +class Interface: + name: str + mac: str + addresses: list[IPInterface] + gateway: IPAddress | None + + @property + def online(self): + # If we have no addresses, we're not online + if len(self.addresses) == 0: + return False + # If we have an override, ping that + if self.name in INTERFACE_PING_OVERRIDES: + return ping(INTERFACE_PING_OVERRIDES[self.name]) + # If we have no gateway, this interface is likely not intended + # to route beyond the local network, so we'll assume it's + # online, at least for whatever it's used for. + if self.gateway is None: + return True + return ping(self.gateway) + + def asdict(self): + return { + "name": self.name, + "mac": self.mac, + "addresses": [ + { + "address": str(addr.ip), + "netmask": str(addr.netmask), + "network": str(addr.network), + "prefixlen": addr._prefixlen, + } + for addr in self.addresses + ], + "online": self.online, + } + + +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"] + result = run(cmd, stdout=PIPE, stderr=PIPE) + try: + ip = IPAddress(result.stdout.decode("utf-8").split("\n")[1].split()[1]) + except (IndexError, AddressValueError): + # If we can't parse the output, return None + return None + return ip + + +def validate_first_hop_is_secure(first_hop: IPAddress): + """Check if the first hop is in a secure network.""" + for name, network in SECURE_FIRSTHOP_NETWORKS.items(): + if first_hop in network: + return name + + +def get_gateways(): + """Get gateways on each interface.""" + gw = gateways().get(AF_INET, []) + result = {} + for iface in INTERFACES_TO_WATCH: + for gateway in gw: + if gateway[1] == iface: + result[iface] = gateway[0] + + return result + + +def interface_status(interface: str, gw): + """Get the status of an interface.""" + try: + addrs = ifaddresses(interface) + except: + addrs = {} + result = Interface() + result.name = interface + result.gateway = gw.get(interface, None) + if AF_LINK in addrs: + result.mac = addrs[AF_LINK][0]["addr"] + else: + result.mac = None + if AF_INET in addrs: + result.addresses = [ + IPInterface(f'{addr["addr"]}/{addr["netmask"]}') + for addr in addrs.get(AF_INET, []) + ] + else: + result.addresses = [] + return result + + +def ping(host: IPAddress) -> bool: + cmd = ["/usr/bin/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"] + result = run(cmd, stdout=PIPE, stderr=PIPE) + try: + data = json.loads(result.stdout.decode("utf-8")) + except (IndexError, ValueError): + return None + try: + # If the IP address is invalid, don't return anything + IPAddress(data["ip"]) + except (AddressValueError, KeyError): + if data.get("status", None) == 429: + # We're rate limited, so return something indicating that + return {"rate_limited": True} + return None + return data + + +def get_default_route(): + """Get the default route.""" + cmd = ["/usr/bin/ip", "route", "show", "default"] + result = run(cmd, stdout=PIPE, stderr=PIPE) + try: + # Get first line (might have multiple gateway routes) + line = result.stdout.decode("utf-8").split("\n")[0] + # Get the gateway link (following "dev") + link = re.search(r"dev\s+(\S+)", line).group(1) + # We already know the gateway IP based on our firsthop check earlier, and that's more reliable since it will respect any routing rules + except (IndexError, AttributeError): + return None + return link + + +def format_time(time: datetime) -> dict[str, str | int]: + """Format a datetime object for display.""" + return { + "hour": f"{time.hour:02}", + "minute": f"{time.minute:02}", + "second": f"{time.second:02}", + "year": f"{time.year:04}", + "month": f"{time.month:02}", + "day": f"{time.day:02}", + "unix": int(time.timestamp()), + } + + +# system_bus = dbus.SystemBus() +# networkd = system_bus.get_object( +# "org.freedesktop.network1", "/org/freedesktop/network1" +# ) +# manager = dbus.Interface(networkd, "org.freedesktop.network1.Manager") + + +# def get_dbus_interfaces(): +# for iface in INTERFACES_TO_WATCH: +# dbus_object = system_bus.get_object( +# "org.freedesktop.network1", manager.GetLinkByName(iface) +# ) +# dbus_interface = dbus.Interface(dbus_object, "org.freedesktop.network1.Link") +# yield dbus_interface + +runtime_dir = os.environ.get("XDG_RUNTIME_DIR", "/tmp") + + +def load_last_data(var_name: str): + try: + if os.path.exists(f"{runtime_dir}/{var_name}.json"): + with open(f"{runtime_dir}/{var_name}.json", "r") as f: + return json.load(f), os.path.getmtime(f"{runtime_dir}/{var_name}.json") + + except: + pass + return None, None + + +def store_last_data(var_name: str, data): + with open(f"{runtime_dir}/{var_name}.json", "w") as f: + json.dump(data, f) + + +last_default_route = load_last_data("default_route")[0] +last_ip_data, last_request = load_last_data("ip_data") +try: + last_first_hop = IPAddress(load_last_data("first_hop")[0]) +except: + last_first_hop = None + +while True: + try: + online = ping("1.1.1.1") + except: + online = False + hop = get_first_hop() + gw = get_gateways() + default_route = get_default_route() + # public IP shouldn't change often, so only check every 2 hours or + # if the default route or first hop changes + if ( + default_route != last_default_route + or last_ip_data is None + or last_request is None + or now() - last_request > (2 * 60 * 60) + or (hop != last_first_hop and hop is not None) + ): + print("refreshing public IP", file=sys.stderr, flush=True) + public_ip_data = get_public_ip() + if public_ip_data is None: + print("failed to get public IP", file=sys.stderr, flush=True) + elif public_ip_data.get("rate_limited", False): + last_ip_data = public_ip_data + public_ip_data = None + else: + last_ip_data = public_ip_data + # Write the public IP data to a file + store_last_data("ip_data", public_ip_data) + last_default_route = default_route + store_last_data("default_route", default_route) + last_request = now() + last_first_hop = hop + store_last_data("first_hop", str(hop)) + else: + public_ip_data = last_ip_data + if hop is not None: + secure_msg = validate_first_hop_is_secure(hop) + secure = secure_msg is not None + else: + # If we can't reach the router, assume insecure + secure = False + iface_data = [interface_status(iface, gw) for iface in INTERFACES_TO_WATCH] + iface_dict = {iface.name: iface.asdict() for iface in iface_data} + + default_route_iface_data = interface_status(default_route, gw) + + print( + json.dumps( + { + "online": online, + "secure": secure, + "interfaces": iface_dict, + "public_ip": public_ip_data or {}, + "have_public_ip": public_ip_data is not None and "ip" in public_ip_data, + "default_route": default_route, + "default_interface": default_route_iface_data.asdict(), + "have_default_route": default_route is not None, + "gateway": str(hop), + "have_gateway": hop is not None, + "last_update": format_time(datetime.now()), + } + ), + flush=True, + ) + + sleep(5) diff --git a/.config/eww/scripts/sway.py b/.config/eww/scripts/sway.py index 0e62c3c..7eb13d9 100755 --- a/.config/eww/scripts/sway.py +++ b/.config/eww/scripts/sway.py @@ -48,7 +48,9 @@ class Workspace: self.alerted = False @classmethod - def parse_file(cls: type, filename: str) -> Tuple[WorkspaceTree, WorkspaceList]: + def parse_file( + cls: type, filename: str + ) -> Tuple[WorkspaceTree, WorkspaceList, str]: result = {} initial: dict = None @@ -75,7 +77,9 @@ class Workspace: for context, groups in initial["contexts"].items() } - return result, workspaces + default_context = initial.get("default_context", "personal") + + return result, workspaces, default_context @staticmethod def full_dictify(tree: WorkspaceTree): @@ -99,7 +103,7 @@ class Workspace: } -workspace_tree, workspace_list = Workspace.parse_file( +workspace_tree, workspace_list, default_context = Workspace.parse_file( f"{os.environ['HOME']}/.config/sway/workspaces.json" ) @@ -107,7 +111,7 @@ data = { "ws": {}, "mode": "default", "current": {}, - "context": "work" if gethostname() == "tycho.vpn.ezri.dev" else "personal", + "context": default_context, "visible": {}, } diff --git a/.config/eww/windows.yuck b/.config/eww/windows.yuck index f8ab9bc..75be749 100644 --- a/.config/eww/windows.yuck +++ b/.config/eww/windows.yuck @@ -2,6 +2,9 @@ ;; Top-Level Module Definitions ;; ;;;; ;;;; +;;; ;;; +;; PolKit Auth Window ;; +;;; ;;; ;;; ;;; ;; Bars for Rocinante ;; @@ -84,6 +87,31 @@ (sway-workspace :group "left") (sway-workspaces :group "left"))) +(defwidget normandy-centerbar--left [] + (box :orientation "h" + :halign "start" + :space-evenly false + :spacing 20 + :class "leftbox" + (sway-workspaces :group "center") + (sway-workspace :group "center"))) + +(defwidget normandy-centerbar--center [] + (box :orientation "h" + :halign "end" + :space-evenly false + :spacing 20 + :class "centerbox" + (system-name))) + +(defwidget normandy-centerbar--right [] + (box :orientation "h" + :halign "end" + :space-evenly false + :spacing 20 + :class "rightbox" + (mpris2))) + (defwidget normandy-rightbar--left [] (box :orientation "h" :halign "start" @@ -116,13 +144,23 @@ ;; Bars for Tycho Station ;; ;;; ;;; +(defwidget tycho-sidebar [] + (box :orientation "v" + :valign "start" + :space-evenly false + :spacing 20 + :class "root side" + (sideclock) + (network-sidebar-details) + (system-gauges))) + (defwidget tycho-leftbar--left [] (box :orientation "h" :halign "start" :space-evenly false :spacing 20 :class "leftbox" - (clock) + (system-name) )) (defwidget tycho-leftbar--center [] @@ -131,7 +169,7 @@ :space-evenly false :spacing 20 :class "centerbox" - (system-name) + )) (defwidget tycho-leftbar--right [] @@ -168,8 +206,8 @@ :spacing 20 :class "rightbox" (vpn-network) - (network) (mpris2) + (network) (system-memory) (system-cpu-avg) (clock))) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf new file mode 100644 index 0000000..e159669 --- /dev/null +++ b/.config/hypr/hyprland.conf @@ -0,0 +1,157 @@ + +# +# Please note not all available settings / options are set here. +# For a full list, see the wiki (basic and advanced configuring) +# + + +monitor=,preferred,auto,1 + +input { + kb_file=/home/ezri/.config/hypr/keymap.xkb + kb_layout= + kb_options=compose:caps + + follow_mouse=1 + + touchpad { + natural_scroll=no + } + + sensitivity=0 # -1.0 - 1.0, 0 means no modification. +} + +general { + main_mod=SUPER + + gaps_in=5 + gaps_out=20 + border_size=2 + col.active_border=0xff815986 + col.inactive_border=0xff2d272f + + apply_sens_to_raw=0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) + + damage_tracking=full # leave it on full unless you hate your GPU and want to make it suffer + + layout=dwindle +} + +decoration { + rounding=5 + blur=0 + blur_size=4 # minimum 1 + blur_passes=1 # minimum 1 + blur_new_optimizations=1 +} + +animations { + bezier=overshoot,0.05,0.2,0,1.1 + bezier=overshoot2,0.05,0.3,0,1.3 + enabled=1 + animation=windows,1,3,overshoot2 + animation=windowsIn,1,3,overshoot2 + animation=border,1,3,overshoot + animation=fade,1,3,overshoot + animation=workspaces,1,3,overshoot +} + +gestures { + workspace_swipe=yes +} + +# example window rules +# for windows named/classed as abc and xyz +#windowrule=move 69 420,abc +#windowrule=size 420 69,abc +#windowrule=tile,xyz +#windowrule=float,abc +#windowrule=pseudo,abc +#windowrule=monitor 0,xyz + +# some nice mouse binds +bindm=SUPER,mouse:272,movewindow +bindm=SUPER,mouse:273,resizewindow + +# My binds +bind=SUPER,RETURN,exec,hypr-sensible-launcher +bind=SUPERSHIFT,RETURN,exec,alacritty +bind=SUPERSHIFT,Q,killactive, +bind=SUPERSHIFT,E,exit, +bind=SUPERALT,F,togglefloating, +bind=SUPER,D,exec,wofi --show drun + +bind=SUPER,B,movefocus,l +bind=SUPER,F,movefocus,r +bind=SUPER,P,movefocus,u +bind=SUPER,N,movefocus,d + +bind=SUPERSHIFT,B,movewindow,l +bind=SUPERSHIFT,F,movewindow,r +bind=SUPERSHIFT,P,movewindow,u +bind=SUPERSHIFT,N,movewindow,d + +bind=SUPER,Tab,changegroupactive,f +bind=SUPERSHIFT,Tab,changegroupactive,b +bind=SUPER,T,togglegroup, + +bind=SUPER,1,workspace,1 +bind=SUPER,2,workspace,2 +bind=SUPER,3,workspace,3 +bind=SUPER,4,workspace,4 +bind=SUPER,5,workspace,5 +bind=SUPER,6,workspace,6 +bind=SUPER,7,workspace,7 +bind=SUPER,8,workspace,8 +bind=SUPER,9,workspace,9 +bind=SUPER,0,workspace,10 + +bind=SUPERSHIFT,1,movetoworkspace,1 +bind=SUPERSHIFT,2,movetoworkspace,2 +bind=SUPERSHIFT,3,movetoworkspace,3 +bind=SUPERSHIFT,4,movetoworkspace,4 +bind=SUPERSHIFT,5,movetoworkspace,5 +bind=SUPERSHIFT,6,movetoworkspace,6 +bind=SUPERSHIFT,7,movetoworkspace,7 +bind=SUPERSHIFT,8,movetoworkspace,8 +bind=SUPERSHIFT,9,movetoworkspace,9 +bind=SUPERSHIFT,0,movetoworkspace,10 + +# Audio key bindings +bind=,XF86AudioPlay,exec,playerctl play-pause +bind=,XF86AudioNext,exec,playerctl next +bind=,XF86AudioPrev,exec,playerctl previous + +# Volume key bindings +bind=,XF86AudioRaiseVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ +1% +bind=,XF86AudioLowerVolume,exec,pactl set-sink-volume @DEFAULT_SINK@ -1% +bind=,XF86AudioMute,exec,pactl set-sink-mute @DEFAULT_SINK@ toggle + +# Brightness key bindings +bind=,XF86MonBrightnessUp,exec,light -A 5 +bind=,XF86MonBrightnessDown,exec,light -U 5 + +# Lock screen +bind=SUPER,L,exec,loginctl lock-session + +# Notification dismissal +bind=SUPERCTRL,SPACE,exec,dunstctl close + +# Start daemons +exec-once=systemctl --user import-environment DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP +exec-once=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP +exec=systemctl --user start hypr-session.target + +# Start status bar +exec=eww open hypr-mainbar + +wsbind=1,eDP-1 +wsbind=2,eDP-1 +wsbind=3,eDP-1 +wsbind=4,eDP-1 +wsbind=5,eDP-1 +wsbind=6,eDP-1 +wsbind=7,eDP-1 +wsbind=8,eDP-1 +wsbind=9,eDP-1 +wsbind=10,eDP-1 diff --git a/.config/hypr/keymap.xkb b/.config/hypr/keymap.xkb new file mode 100644 index 0000000..1549f23 --- /dev/null +++ b/.config/hypr/keymap.xkb @@ -0,0 +1,1564 @@ +xkb_keymap { +xkb_keycodes "(unnamed)" { + minimum = 8; + maximum = 255; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 77; + = 78; + = 79; + = 80; + = 81; + = 82; + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 94; + = 95; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + = 102; + = 103; + = 104; + = 105; + = 106; + = 107; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + = 119; + = 120; + = 121; + = 122; + = 123; + = 124; + = 125; + = 126; + = 127; + = 128; + = 129; + = 130; + = 131; + = 132; + = 133; + = 108; + = 135; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + = 147; + = 148; + = 149; + = 150; + = 151; + = 152; + = 153; + = 154; + = 155; + = 156; + = 157; + = 158; + = 159; + = 160; + = 161; + = 162; + = 163; + = 164; + = 165; + = 166; + = 167; + = 168; + = 169; + = 170; + = 171; + = 172; + = 173; + = 174; + = 175; + = 176; + = 177; + = 178; + = 179; + = 180; + = 181; + = 182; + = 183; + = 184; + = 185; + = 186; + = 187; + = 188; + = 189; + = 190; + = 191; + = 192; + = 193; + = 194; + = 195; + = 196; + = 197; + = 198; + = 199; + = 200; + = 201; + = 202; + = 203; + = 204; + = 205; + = 206; + = 207; + = 208; + = 209; + = 210; + = 211; + = 212; + = 213; + = 214; + = 215; + = 216; + = 217; + = 218; + = 219; + = 220; + = 221; + = 222; + = 223; + = 224; + = 225; + = 226; + = 227; + = 228; + = 229; + = 230; + = 231; + = 232; + = 233; + = 234; + = 235; + = 236; + = 237; + = 238; + = 239; + = 240; + = 241; + = 242; + = 243; + = 244; + = 245; + = 246; + = 247; + = 248; + = 249; + = 250; + = 251; + = 252; + = 253; + = 254; + = 255; + indicator 1 = "Charging"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; + indicator 4 = "Compose"; + indicator 5 = "Kana"; + indicator 6 = "Sleep"; + indicator 7 = "Suspend"; + indicator 8 = "Mute"; + indicator 9 = "Misc"; + indicator 10 = "Mail"; + indicator 11 = "Charging"; + indicator 12 = "Shift Lock"; + indicator 13 = "Group 2"; + indicator 14 = "Mouse Keys"; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; +}; + +xkb_types "(unnamed)" { + + virtual_modifiers NumLock,Alt,LevelThree,LevelFive,Meta,Super,Hyper,ScrollLock; + + type "ONE_LEVEL" { + modifiers= none; + level_name[Level1]= "Any"; + }; + type "TWO_LEVEL" { + modifiers= Shift; + map[Shift]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + }; + type "ALPHABETIC" { + modifiers= Shift+Lock; + map[Shift]= Level2; + map[Lock]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Caps"; + }; + type "KEYPAD" { + modifiers= Shift+NumLock; + map[NumLock]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + }; + type "SHIFT+ALT" { + modifiers= Shift+Alt; + map[Shift+Alt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift+Alt"; + }; + type "PC_SUPER_LEVEL2" { + modifiers= Mod4; + map[Mod4]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Super"; + }; + type "PC_CONTROL_LEVEL2" { + modifiers= Control; + map[Control]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Control"; + }; + type "PC_ALT_LEVEL2" { + modifiers= Alt; + map[Alt]= Level2; + level_name[Level1]= "Base"; + level_name[Level2]= "Alt"; + }; + type "CTRL+ALT" { + modifiers= Shift+Control+Alt+LevelThree; + map[Shift]= Level2; + preserve[Shift]= Shift; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + preserve[Shift+LevelThree]= Shift; + map[Control+Alt]= Level5; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "Ctrl+Alt"; + }; + type "LOCAL_EIGHT_LEVEL" { + modifiers= Shift+Lock+Control+LevelThree; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Control]= Level5; + map[Shift+Lock+Control]= Level5; + map[Shift+Control]= Level6; + map[Lock+Control]= Level6; + map[Control+LevelThree]= Level7; + map[Shift+Lock+Control+LevelThree]= Level7; + map[Shift+Control+LevelThree]= Level8; + map[Lock+Control+LevelThree]= Level8; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Level3"; + level_name[Level4]= "Shift Level3"; + level_name[Level5]= "Ctrl"; + level_name[Level6]= "Shift Ctrl"; + level_name[Level7]= "Level3 Ctrl"; + level_name[Level8]= "Shift Level3 Ctrl"; + }; + type "THREE_LEVEL" { + modifiers= Shift+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Level3"; + }; + type "EIGHT_LEVEL" { + modifiers= Shift+LevelThree+LevelFive; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree+LevelFive; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Shift+Lock+LevelThree]= Level3; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[Lock+LevelFive]= Level6; + map[Shift+Lock+LevelFive]= Level5; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[Lock+LevelThree+LevelFive]= Level8; + map[Shift+Lock+LevelThree+LevelFive]= Level7; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_SEMIALPHABETIC" { + modifiers= Shift+Lock+LevelThree+LevelFive; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level4; + preserve[Shift+Lock+LevelThree]= Lock; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + map[Lock+LevelFive]= Level6; + map[Shift+Lock+LevelFive]= Level5; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[Lock+LevelThree+LevelFive]= Level7; + preserve[Lock+LevelThree+LevelFive]= Lock; + map[Shift+Lock+LevelThree+LevelFive]= Level8; + preserve[Shift+Lock+LevelThree+LevelFive]= Lock; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_LEVEL_FIVE_LOCK" { + modifiers= Shift+Lock+NumLock+LevelThree+LevelFive; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + preserve[Shift+LevelFive]= Shift; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[NumLock]= Level5; + map[Shift+NumLock]= Level6; + preserve[Shift+NumLock]= Shift; + map[NumLock+LevelThree]= Level7; + map[Shift+NumLock+LevelThree]= Level8; + map[Shift+NumLock+LevelFive]= Level2; + map[NumLock+LevelThree+LevelFive]= Level3; + map[Shift+NumLock+LevelThree+LevelFive]= Level4; + map[Shift+Lock]= Level2; + map[Lock+LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level4; + map[Lock+LevelFive]= Level5; + map[Shift+Lock+LevelFive]= Level6; + preserve[Shift+Lock+LevelFive]= Shift; + map[Lock+LevelThree+LevelFive]= Level7; + map[Shift+Lock+LevelThree+LevelFive]= Level8; + map[Lock+NumLock]= Level5; + map[Shift+Lock+NumLock]= Level6; + preserve[Shift+Lock+NumLock]= Shift; + map[Lock+NumLock+LevelThree]= Level7; + map[Shift+Lock+NumLock+LevelThree]= Level8; + map[Shift+Lock+NumLock+LevelFive]= Level2; + map[Lock+NumLock+LevelThree+LevelFive]= Level3; + map[Shift+Lock+NumLock+LevelThree+LevelFive]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK" { + modifiers= Shift+Lock+NumLock+LevelThree+LevelFive; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[LevelFive]= Level5; + map[Shift+LevelFive]= Level6; + preserve[Shift+LevelFive]= Shift; + map[LevelThree+LevelFive]= Level7; + map[Shift+LevelThree+LevelFive]= Level8; + map[NumLock]= Level5; + map[Shift+NumLock]= Level6; + preserve[Shift+NumLock]= Shift; + map[NumLock+LevelThree]= Level7; + map[Shift+NumLock+LevelThree]= Level8; + map[Shift+NumLock+LevelFive]= Level2; + map[NumLock+LevelThree+LevelFive]= Level3; + map[Shift+NumLock+LevelThree+LevelFive]= Level4; + map[Lock]= Level2; + map[Lock+LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level4; + map[Lock+LevelFive]= Level5; + map[Shift+Lock+LevelFive]= Level6; + map[Lock+LevelThree+LevelFive]= Level7; + map[Shift+Lock+LevelThree+LevelFive]= Level8; + map[Lock+NumLock]= Level5; + map[Shift+Lock+NumLock]= Level6; + map[Lock+NumLock+LevelThree]= Level7; + map[Shift+Lock+NumLock+LevelThree]= Level8; + map[Lock+NumLock+LevelFive]= Level2; + map[Lock+NumLock+LevelThree+LevelFive]= Level4; + map[Shift+Lock+NumLock+LevelThree+LevelFive]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "X"; + level_name[Level6]= "X Shift"; + level_name[Level7]= "X Alt Base"; + level_name[Level8]= "X Shift Alt"; + }; + type "FOUR_LEVEL" { + modifiers= Shift+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level4; + map[Shift+Lock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level4; + preserve[Shift+Lock+LevelThree]= Lock; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_MIXED_KEYPAD" { + modifiers= Shift+NumLock+LevelThree; + map[NumLock]= Level2; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[NumLock+LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Shift+NumLock+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + }; + type "FOUR_LEVEL_X" { + modifiers= Shift+Control+Alt+LevelThree; + map[LevelThree]= Level2; + map[Shift+LevelThree]= Level3; + map[Control+Alt]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Alt Base"; + level_name[Level3]= "Shift Alt"; + level_name[Level4]= "Ctrl+Alt"; + }; + type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[Lock]= Level4; + preserve[Lock]= Lock; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock+LevelThree]= Level3; + preserve[Lock+LevelThree]= Lock; + map[Shift+Lock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "AltGr Base"; + level_name[Level4]= "Shift AltGr"; + }; + type "FOUR_LEVEL_PLUS_LOCK" { + modifiers= Shift+Lock+LevelThree; + map[Shift]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[Lock]= Level5; + map[Shift+Lock]= Level2; + map[Lock+LevelThree]= Level3; + map[Shift+Lock+LevelThree]= Level4; + level_name[Level1]= "Base"; + level_name[Level2]= "Shift"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Shift Alt"; + level_name[Level5]= "Lock"; + }; + type "FOUR_LEVEL_KEYPAD" { + modifiers= Shift+NumLock+LevelThree; + map[Shift]= Level2; + map[NumLock]= Level2; + map[LevelThree]= Level3; + map[Shift+LevelThree]= Level4; + map[NumLock+LevelThree]= Level4; + map[Shift+NumLock+LevelThree]= Level3; + level_name[Level1]= "Base"; + level_name[Level2]= "Number"; + level_name[Level3]= "Alt Base"; + level_name[Level4]= "Alt Number"; + }; +}; + +xkb_compatibility "(unnamed)" { + + virtual_modifiers NumLock,Alt,LevelThree,LevelFive,Meta,Super,Hyper,ScrollLock; + + interpret.useModMapMods= AnyLevel; + interpret.repeat= False; + interpret.locking= False; + interpret ISO_Level2_Latch+Exactly(Shift) { + useModMapMods=level1; + action= LatchMods(modifiers=Shift,clearLocks,latchToLock); + }; + interpret Shift_Lock+AnyOf(Shift+Lock) { + action= LockMods(modifiers=Shift); + }; + interpret Num_Lock+AnyOf(all) { + virtualModifier= NumLock; + action= LockMods(modifiers=NumLock); + }; + interpret ISO_Level3_Shift+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= SetMods(modifiers=LevelThree,clearLocks); + }; + interpret ISO_Level3_Latch+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); + }; + interpret ISO_Level3_Lock+AnyOf(all) { + virtualModifier= LevelThree; + useModMapMods=level1; + action= LockMods(modifiers=LevelThree); + }; + interpret Alt_L+AnyOf(all) { + virtualModifier= Alt; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Alt_R+AnyOf(all) { + virtualModifier= Alt; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Meta_L+AnyOf(all) { + virtualModifier= Meta; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Meta_R+AnyOf(all) { + virtualModifier= Meta; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Super_L+AnyOf(all) { + virtualModifier= Super; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Super_R+AnyOf(all) { + virtualModifier= Super; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Hyper_L+AnyOf(all) { + virtualModifier= Hyper; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Hyper_R+AnyOf(all) { + virtualModifier= Hyper; + action= SetMods(modifiers=modMapMods,clearLocks); + }; + interpret Scroll_Lock+AnyOf(all) { + virtualModifier= ScrollLock; + action= LockMods(modifiers=modMapMods); + }; + interpret ISO_Level5_Shift+AnyOf(all) { + virtualModifier= LevelFive; + useModMapMods=level1; + action= SetMods(modifiers=LevelFive,clearLocks); + }; + interpret ISO_Level5_Latch+AnyOf(all) { + virtualModifier= LevelFive; + useModMapMods=level1; + action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); + }; + interpret ISO_Level5_Lock+AnyOf(all) { + virtualModifier= LevelFive; + useModMapMods=level1; + action= LockMods(modifiers=LevelFive); + }; + interpret Mode_switch+AnyOfOrNone(all) { + action= SetGroup(group=+1); + }; + interpret ISO_Level3_Shift+AnyOfOrNone(all) { + action= SetMods(modifiers=LevelThree,clearLocks); + }; + interpret ISO_Level3_Latch+AnyOfOrNone(all) { + action= LatchMods(modifiers=LevelThree,clearLocks,latchToLock); + }; + interpret ISO_Level3_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=LevelThree); + }; + interpret ISO_Group_Latch+AnyOfOrNone(all) { + action= LatchGroup(group=2); + }; + interpret ISO_Next_Group+AnyOfOrNone(all) { + action= LockGroup(group=+1); + }; + interpret ISO_Prev_Group+AnyOfOrNone(all) { + action= LockGroup(group=-1); + }; + interpret ISO_First_Group+AnyOfOrNone(all) { + action= LockGroup(group=1); + }; + interpret ISO_Last_Group+AnyOfOrNone(all) { + action= LockGroup(group=2); + }; + interpret KP_1+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret KP_End+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret KP_2+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=+1); + }; + interpret KP_Down+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=+1); + }; + interpret KP_3+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret KP_Next+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret KP_4+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+0); + }; + interpret KP_Left+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+0); + }; + interpret KP_6+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+0); + }; + interpret KP_Right+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+0); + }; + interpret KP_7+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret KP_Home+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret KP_8+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=-1); + }; + interpret KP_Up+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+0,y=-1); + }; + interpret KP_9+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret KP_Prior+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret KP_5+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret KP_Begin+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret KP_F2+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret KP_Divide+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret KP_F3+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret KP_Multiply+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret KP_F4+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=3); + }; + interpret KP_Subtract+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=3); + }; + interpret KP_Separator+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default,count=2); + }; + interpret KP_Add+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default,count=2); + }; + interpret KP_0+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=lock); + }; + interpret KP_Insert+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=lock); + }; + interpret KP_Decimal+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=unlock); + }; + interpret KP_Delete+AnyOfOrNone(all) { + repeat= True; + action= LockPtrBtn(button=default,affect=unlock); + }; + interpret F25+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=1); + }; + interpret F26+AnyOfOrNone(all) { + repeat= True; + action= SetPtrDflt(affect=button,button=2); + }; + interpret F27+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=-1); + }; + interpret F29+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=-1); + }; + interpret F31+AnyOfOrNone(all) { + repeat= True; + action= PtrBtn(button=default); + }; + interpret F33+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=-1,y=+1); + }; + interpret F35+AnyOfOrNone(all) { + repeat= True; + action= MovePtr(x=+1,y=+1); + }; + interpret Pointer_Button_Dflt+AnyOfOrNone(all) { + action= PtrBtn(button=default); + }; + interpret Pointer_Button1+AnyOfOrNone(all) { + action= PtrBtn(button=1); + }; + interpret Pointer_Button2+AnyOfOrNone(all) { + action= PtrBtn(button=2); + }; + interpret Pointer_Button3+AnyOfOrNone(all) { + action= PtrBtn(button=3); + }; + interpret Pointer_DblClick_Dflt+AnyOfOrNone(all) { + action= PtrBtn(button=default,count=2); + }; + interpret Pointer_DblClick1+AnyOfOrNone(all) { + action= PtrBtn(button=1,count=2); + }; + interpret Pointer_DblClick2+AnyOfOrNone(all) { + action= PtrBtn(button=2,count=2); + }; + interpret Pointer_DblClick3+AnyOfOrNone(all) { + action= PtrBtn(button=3,count=2); + }; + interpret Pointer_Drag_Dflt+AnyOfOrNone(all) { + action= LockPtrBtn(button=default,affect=both); + }; + interpret Pointer_Drag1+AnyOfOrNone(all) { + action= LockPtrBtn(button=1,affect=both); + }; + interpret Pointer_Drag2+AnyOfOrNone(all) { + action= LockPtrBtn(button=2,affect=both); + }; + interpret Pointer_Drag3+AnyOfOrNone(all) { + action= LockPtrBtn(button=3,affect=both); + }; + interpret Pointer_EnableKeys+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeys); + }; + interpret Pointer_Accelerate+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeysAccel); + }; + interpret Pointer_DfltBtnNext+AnyOfOrNone(all) { + action= SetPtrDflt(affect=button,button=+1); + }; + interpret Pointer_DfltBtnPrev+AnyOfOrNone(all) { + action= SetPtrDflt(affect=button,button=-1); + }; + interpret AccessX_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AccessXKeys); + }; + interpret AccessX_Feedback_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AccessXFeedback); + }; + interpret RepeatKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=RepeatKeys); + }; + interpret SlowKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=SlowKeys); + }; + interpret BounceKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=BounceKeys); + }; + interpret StickyKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=StickyKeys); + }; + interpret MouseKeys_Enable+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeys); + }; + interpret MouseKeys_Accel_Enable+AnyOfOrNone(all) { + action= LockControls(controls=MouseKeysAccel); + }; + interpret Overlay1_Enable+AnyOfOrNone(all) { + action= LockControls(controls=none); + }; + interpret Overlay2_Enable+AnyOfOrNone(all) { + action= LockControls(controls=none); + }; + interpret AudibleBell_Enable+AnyOfOrNone(all) { + action= LockControls(controls=AudibleBell); + }; + interpret Terminate_Server+AnyOfOrNone(all) { + action= Terminate(); + }; + interpret Alt_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Alt,clearLocks); + }; + interpret Alt_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Alt,clearLocks); + }; + interpret Meta_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Meta,clearLocks); + }; + interpret Meta_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Meta,clearLocks); + }; + interpret Super_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Super,clearLocks); + }; + interpret Super_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Super,clearLocks); + }; + interpret Hyper_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Hyper,clearLocks); + }; + interpret Hyper_R+AnyOfOrNone(all) { + action= SetMods(modifiers=Hyper,clearLocks); + }; + interpret Shift_L+AnyOfOrNone(all) { + action= SetMods(modifiers=Shift,clearLocks); + }; + interpret XF86Switch_VT_1+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=1,!same); + }; + interpret XF86Switch_VT_2+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=2,!same); + }; + interpret XF86Switch_VT_3+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=3,!same); + }; + interpret XF86Switch_VT_4+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=4,!same); + }; + interpret XF86Switch_VT_5+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=5,!same); + }; + interpret XF86Switch_VT_6+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=6,!same); + }; + interpret XF86Switch_VT_7+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=7,!same); + }; + interpret XF86Switch_VT_8+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=8,!same); + }; + interpret XF86Switch_VT_9+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=9,!same); + }; + interpret XF86Switch_VT_10+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=10,!same); + }; + interpret XF86Switch_VT_11+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=11,!same); + }; + interpret XF86Switch_VT_12+AnyOfOrNone(all) { + repeat= True; + action= SwitchScreen(screen=12,!same); + }; + interpret XF86LogGrabInfo+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x47,data[3]=0x72,data[4]=0x62,data[5]=0x73,data[6]=0x00); + }; + interpret XF86LogWindowTree+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x50,data[1]=0x72,data[2]=0x57,data[3]=0x69,data[4]=0x6e,data[5]=0x73,data[6]=0x00); + }; + interpret XF86Next_VMode+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x2b,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); + }; + interpret XF86Prev_VMode+AnyOfOrNone(all) { + repeat= True; + action= Private(type=0x86,data[0]=0x2d,data[1]=0x56,data[2]=0x4d,data[3]=0x6f,data[4]=0x64,data[5]=0x65,data[6]=0x00); + }; + interpret ISO_Level5_Shift+AnyOfOrNone(all) { + action= SetMods(modifiers=LevelFive,clearLocks); + }; + interpret ISO_Level5_Latch+AnyOfOrNone(all) { + action= LatchMods(modifiers=LevelFive,clearLocks,latchToLock); + }; + interpret ISO_Level5_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=LevelFive); + }; + interpret Caps_Lock+AnyOfOrNone(all) { + action= LockMods(modifiers=Lock); + }; + interpret Any+Exactly(Lock) { + action= LockMods(modifiers=Lock); + }; + interpret Any+AnyOf(all) { + action= SetMods(modifiers=modMapMods,clearLocks); + }; + indicator "Caps Lock" { + whichModState= locked; + modifiers= Lock; + }; + indicator "Num Lock" { + whichModState= locked; + modifiers= NumLock; + }; + indicator "Scroll Lock" { + whichModState= locked; + modifiers= ScrollLock; + }; + indicator "Shift Lock" { + whichModState= locked; + modifiers= Shift; + }; + indicator "Group 2" { + groups= 0xfe; + }; + indicator "Mouse Keys" { + controls= mouseKeys; + }; +}; + +xkb_symbols "(unnamed)" { + + name[group1]="English (US)"; + + key { [ Escape ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ BackSpace, BackSpace ] }; + key { [ Tab, ISO_Left_Tab ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ q, Q ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ w, W ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ e, E ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ r, R ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ t, T ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ y, Y ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ u, U ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ i, I ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ o, O ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ p, P ] + }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ Return ] }; + key { [ Control_L ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ a, A ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ s, S ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ d, D ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ f, F ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ g, G ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ h, H ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ j, J ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ k, K ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ l, L ] + }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + key { [ grave, asciitilde ] }; + key { [ Shift_L ] }; + key { [ backslash, bar ] }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ z, Z ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ x, X ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ c, C ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ v, V ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ b, B ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ n, N ] + }; + key { + type= "ALPHABETIC", + symbols[Group1]= [ m, M ] + }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + key { [ Shift_R ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86ClearGrab ] + }; + key { [ Alt_L, Meta_L ] }; + key { [ space, underscore ] }; + key { + type= "TWO_LEVEL", + symbols[Group1]= [ Multi_key, Multi_key ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F1, F1, F1, F1, XF86Switch_VT_1 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F2, F2, F2, F2, XF86Switch_VT_2 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F3, F3, F3, F3, XF86Switch_VT_3 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F4, F4, F4, F4, XF86Switch_VT_4 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F5, F5, F5, F5, XF86Switch_VT_5 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F6, F6, F6, F6, XF86Switch_VT_6 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F7, F7, F7, F7, XF86Switch_VT_7 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F8, F8, F8, F8, XF86Switch_VT_8 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F9, F9, F9, F9, XF86Switch_VT_9 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F10, F10, F10, F10, XF86Switch_VT_10 ] + }; + key { [ Num_Lock ] }; + key { [ Scroll_Lock ] }; + key { [ KP_Home, KP_7 ] }; + key { [ KP_Up, KP_8 ] }; + key { [ KP_Prior, KP_9 ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86Prev_VMode ] + }; + key { [ KP_Left, KP_4 ] }; + key { [ KP_Begin, KP_5 ] }; + key { [ KP_Right, KP_6 ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86Next_VMode ] + }; + key { [ KP_End, KP_1 ] }; + key { [ KP_Down, KP_2 ] }; + key { [ KP_Next, KP_3 ] }; + key { [ KP_Insert, KP_0 ] }; + key { [ KP_Delete, KP_Decimal ] }; + key { [ ISO_Level3_Shift ] }; + key { + type= "FOUR_LEVEL", + symbols[Group1]= [ less, greater, bar, brokenbar ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F11, F11, F11, F11, XF86Switch_VT_11 ] + }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ F12, F12, F12, F12, XF86Switch_VT_12 ] + }; + key { [ Katakana ] }; + key { [ Hiragana ] }; + key { [ Henkan_Mode ] }; + key { [ Hiragana_Katakana ] }; + key { [ Muhenkan ] }; + key { [ KP_Enter ] }; + key { [ Control_R ] }; + key { + type= "CTRL+ALT", + symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86Ungrab ] + }; + key { + type= "PC_ALT_LEVEL2", + symbols[Group1]= [ Print, Sys_Req ] + }; + key { [ Alt_R, Meta_R ] }; + key { [ Linefeed ] }; + key { [ Home ] }; + key { [ Up ] }; + key { [ Prior ] }; + key { [ Left ] }; + key { [ Right ] }; + key { [ End ] }; + key { [ Down ] }; + key { [ Next ] }; + key { [ Insert ] }; + key { [ Delete ] }; + key { [ XF86AudioMute ] }; + key { [ XF86AudioLowerVolume ] }; + key { [ XF86AudioRaiseVolume ] }; + key { [ XF86PowerOff ] }; + key { [ KP_Equal ] }; + key { [ plusminus ] }; + key { + type= "PC_CONTROL_LEVEL2", + symbols[Group1]= [ Pause, Break ] + }; + key { [ XF86LaunchA ] }; + key { [ KP_Decimal, KP_Decimal ] }; + key { [ Hangul ] }; + key { [ Hangul_Hanja ] }; + key { [ Super_L ] }; + key { [ Super_R ] }; + key { [ Menu ] }; + key { [ Cancel ] }; + key { [ Redo ] }; + key { [ SunProps ] }; + key { [ Undo ] }; + key { [ SunFront ] }; + key { [ XF86Copy ] }; + key { [ XF86Open ] }; + key { [ XF86Paste ] }; + key { [ Find ] }; + key { [ XF86Cut ] }; + key { [ Help ] }; + key { [ XF86MenuKB ] }; + key { [ XF86Calculator ] }; + key { [ XF86Sleep ] }; + key { [ XF86WakeUp ] }; + key { [ XF86Explorer ] }; + key { [ XF86Send ] }; + key { [ XF86Xfer ] }; + key { [ XF86Launch1 ] }; + key { [ XF86Launch2 ] }; + key { [ XF86WWW ] }; + key { [ XF86DOS ] }; + key { [ XF86ScreenSaver ] }; + key { [ XF86RotateWindows ] }; + key { [ XF86TaskPane ] }; + key { [ XF86Mail ] }; + key { [ XF86Favorites ] }; + key { [ XF86MyComputer ] }; + key { [ XF86Back ] }; + key { [ XF86Forward ] }; + key { [ XF86Eject ] }; + key { [ XF86Eject ] }; + key { [ XF86AudioNext ] }; + key { [ XF86AudioPlay, XF86AudioPause ] }; + key { [ XF86AudioPrev ] }; + key { [ XF86AudioStop, XF86Eject ] }; + key { [ XF86AudioRecord ] }; + key { [ XF86AudioRewind ] }; + key { [ XF86Phone ] }; + key { [ XF86Tools ] }; + key { [ XF86HomePage ] }; + key { [ XF86Reload ] }; + key { [ XF86Close ] }; + key { [ XF86ScrollUp ] }; + key { [ XF86ScrollDown ] }; + key { [ parenleft ] }; + key { [ parenright ] }; + key { [ XF86New ] }; + key { [ Redo ] }; + key { [ XF86Tools ] }; + key { [ XF86Launch5 ] }; + key { [ XF86Launch6 ] }; + key { [ XF86Launch7 ] }; + key { [ XF86Launch8 ] }; + key { [ XF86Launch9 ] }; + key { [ XF86AudioMicMute ] }; + key { [ XF86TouchpadToggle ] }; + key { [ XF86TouchpadOn ] }; + key { [ XF86TouchpadOff ] }; + key { [ ISO_Level5_Shift ] }; + key { [ NoSymbol, Alt_L ] }; + key { [ NoSymbol, Meta_L ] }; + key { [ NoSymbol, Super_L ] }; + key { [ NoSymbol, Hyper_L ] }; + key { [ XF86AudioPlay ] }; + key { [ XF86AudioPause ] }; + key { [ XF86Launch3 ] }; + key { [ XF86Launch4 ] }; + key { [ XF86LaunchB ] }; + key { [ XF86Suspend ] }; + key { [ XF86Close ] }; + key { [ XF86AudioPlay ] }; + key { [ XF86AudioForward ] }; + key { [ Print ] }; + key { [ XF86WebCam ] }; + key { [ XF86AudioPreset ] }; + key { [ XF86Mail ] }; + key { [ XF86Messenger ] }; + key { [ XF86Search ] }; + key { [ XF86Go ] }; + key { [ XF86Finance ] }; + key { [ XF86Game ] }; + key { [ XF86Shop ] }; + key { [ Cancel ] }; + key { [ XF86MonBrightnessDown ] }; + key { [ XF86MonBrightnessUp ] }; + key { [ XF86AudioMedia ] }; + key { [ XF86Display ] }; + key { [ XF86KbdLightOnOff ] }; + key { [ XF86KbdBrightnessDown ] }; + key { [ XF86KbdBrightnessUp ] }; + key { [ XF86Send ] }; + key { [ XF86Reply ] }; + key { [ XF86MailForward ] }; + key { [ XF86Save ] }; + key { [ XF86Documents ] }; + key { [ XF86Battery ] }; + key { [ XF86Bluetooth ] }; + key { [ XF86WLAN ] }; + key { [ XF86UWB ] }; + key { [ XF86Next_VMode ] }; + key { [ XF86Prev_VMode ] }; + key { [ XF86MonBrightnessCycle ] }; + key { [ XF86BrightnessAuto ] }; + key { [ XF86DisplayOff ] }; + key { [ XF86WWAN ] }; + key { [ XF86RFKill ] }; + modifier_map Control { }; + modifier_map Shift { }; + modifier_map Shift { }; + modifier_map Mod1 { }; + modifier_map Mod2 { }; + modifier_map Mod5 { }; + modifier_map Control { }; + modifier_map Mod1 { }; + modifier_map Mod4 { }; + modifier_map Mod4 { }; + modifier_map Mod3 { }; + modifier_map Mod1 { }; + modifier_map Mod1 { }; + modifier_map Mod4 { }; + modifier_map Mod4 { }; +}; + +}; diff --git a/.config/hypr/workspaces.json##hostname.normandy b/.config/hypr/workspaces.json##hostname.normandy new file mode 100644 index 0000000..937dfd6 --- /dev/null +++ b/.config/hypr/workspaces.json##hostname.normandy @@ -0,0 +1,131 @@ +{ + "default_context": "personal", + "contexts": { + "personal": { + "left": [ + { + "index": 10, + "name": "config", + "exec": "pavucontrol", + "program_name": "pavucontrol" + }, + { + "index": 9, + "name": "email", + "exec": "alacritty", + "program_name": "console" + }, + { + "index": 8, + "name": "discord", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 7, + "name": "music", + "exec": "feishin", + "program_name": "feishin" + }, + { + "index": 6, + "name": "documents", + "exec": "alacritty", + "program_name": "console" + }, + { + "index": 5, + "name": "VM management", + "exec": "virt-manager", + "program_name": "virt-manager" + }, + { + "index": 4, + "name": "project", + "exec": "env MOZ_ENABLE_WAYLAND=0 firefox --new-window", + "program_name": "firefox" + }, + { + "index": 3, + "name": "internet", + "exec": "env MOZ_ENABLE_WAYLAND=0 firefox --new-window", + "program_name": "firefox" + }, + { + "index": 2, + "name": "code", + "exec": "alacritty", + "program_name": "console" + }, + { + "index": 1, + "name": "terminal", + "exec": "alacritty", + "program_name": "console" + } + ], + "right": [ + { + "index": 11, + "name": "terminal", + "exec": "alacritty", + "program_name": "console" + }, + { + "index": 12, + "name": "code", + "exec": "alacritty", + "program_name": "console" + }, + { + "index": 13, + "name": "internet", + "exec": "env MOZ_ENABLE_WAYLAND=0 firefox --new-window", + "program_name": "firefox" + }, + { + "index": 14, + "name": "steam", + "exec": "steam", + "program_name": "steam" + }, + { + "index": 15, + "name": "minecraft", + "exec": "prismlauncher", + "program_name": "prismlauncher" + }, + { + "index": 16, + "name": "images", + "exec": "gimp", + "program_name": "gimp" + }, + { + "index": 17, + "name": "video", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 18, + "name": "slack", + "exec": "slack", + "program_name": "slack" + }, + { + "index": 19, + "name": "zoom", + "exec": "zoom", + "program_name": "zoom" + }, + { + "index": 20, + "name": "config", + "exec": "pavucontrol", + "program_name": "pavucontrol" + } + ] + } + } +} diff --git a/.config/hypr/workspaces.json##hostname.rocinante b/.config/hypr/workspaces.json##hostname.rocinante new file mode 100644 index 0000000..ba2ca28 --- /dev/null +++ b/.config/hypr/workspaces.json##hostname.rocinante @@ -0,0 +1,76 @@ +{ + "default_context": "personal", + "display_ordering": ["builtin"], + "display_layout": { + "builtin": "eDP-1" + }, + "contexts": { + "personal": { + "builtin": [ + { + "index": 1, + "name": "terminal", + "exec": "console", + "program_name": "console" + }, + { + "index": 2, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 3, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 4, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 5, + "name": "servers", + "exec": "virt-manager", + "program_name": "virt-manager" + }, + { + "index": 6, + "name": "steam", + "exec": "steam", + "program_name": "steam" + }, + { + "index": 7, + "name": "media", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 8, + "name": "real-time comms", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 9, + "name": "messages", + "exec": "thunderbird", + "program_name": "thunderbird" + }, + { + "index": 10, + "name": "config", + "exec": "pavucontrol", + "program_name": "pavucontrol" + } + ] + } + } +} diff --git a/.config/hypr/workspaces.json##hostname.tycho b/.config/hypr/workspaces.json##hostname.tycho new file mode 100644 index 0000000..621ad33 --- /dev/null +++ b/.config/hypr/workspaces.json##hostname.tycho @@ -0,0 +1,161 @@ +{ + "default_context": "work", + "display_ordering": ["left", "center", "right"], + "display_layout": { + "left": "DP-5", + "right": "DP-7", + "center": "DP-4" + }, + "contexts": { + "work": { + "left": [ + { + "index": 5, + "name": "discord", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 4, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 3, + "name": "documentation", + "exec": "firefox", + "args": ["--new-window"], + "environ": {}, + "program_name": "firefox" + }, + { + "index": 2, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 1, + "name": "console", + "exec": "console", + "program_name": "console" + } + ], + "center": [ + { + "index": 6, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 7, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 8, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 9, + "name": "project", + "exec": "firefox-developer-edition", + "args": ["-start-debugger-server", "--new-window"], + "program_name": "firefox-developer-edition" + }, + { + "index": 10, + "name": "server management", + "exec": "virt-manager", + "program_name": "virt-manager", + "systemd": false + }, + { + "index": 11, + "name": "password management", + "exec": "bitwarden-desktop", + "program_name": "bitwarden" + }, + { + "index": 12, + "name": "video", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 13, + "name": "edex-ui", + "exec": "edex-ui", + "program_name": "edex-ui" + }, + { + "index": 14, + "name": "mail", + "exec": "thunderbird", + "program_name": "thunderbird", + "environ": { + "MOZ_ENABLE_WAYLAND": "1" + } + }, + { + "index": 15, + "name": "config", + "exec": "console", + "program_name": "console" + } + ], + "right": [ + { + "index": 16, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 17, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 18, + "name": "music", + "exec": "feishin", + "program_name": "feishin" + }, + { + "index": 19, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 20, + "name": "slack", + "exec": "slack", + "program_name": "slack", + "args": [ + "--enable-features=UseOzonePlatform", + "--ozone-platform=wayland", + "--enable-gpu-rasterization" + ], + "memory_profile": { + "high": "800M", + "max": "1.2G" + } + } + ] + } + } +} diff --git a/.config/sway/config b/.config/sway/config index c23cc59..1f90343 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -30,8 +30,8 @@ set $colorwallpaper '#1e1e1e' output * bg '#1e1e1e' solid_color ## Include Device-Specific Configs -include display-arrangement.conf -include workspace-arrangement.conf +#include display-arrangement.conf +#include workspace-arrangement.conf ### ### # Window Management Keybinds # @@ -61,6 +61,34 @@ mode "resize" { } } +## Workspace Switching Keybinds +bindsym { + $mod+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 1 + $mod+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 2 + $mod+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 3 + $mod+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 4 + $mod+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 5 + $mod+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 6 + $mod+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 7 + $mod+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 8 + $mod+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 9 + $mod+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager FocusWorkspace y 10 +} + +## Window Reassignment Keybinds +bindsym { + $mod+Shift+1 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 1 + $mod+Shift+2 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 2 + $mod+Shift+3 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 3 + $mod+Shift+4 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 4 + $mod+Shift+5 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 5 + $mod+Shift+6 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 6 + $mod+Shift+7 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 7 + $mod+Shift+8 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 8 + $mod+Shift+9 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 9 + $mod+Shift+0 exec busctl --user call dev.ezri.sway /ContextManager dev.ezri.sway.ContextManager MoveContainer y 10 +} + bindsym $mod+r mode "resize" ## Moving Windows @@ -91,6 +119,18 @@ bindsym { $mod+f focus right $mod+p focus up $mod+n focus down + + # Arrow key output bindings + $mod+Control+Left focus output left + $mod+Control+Right focus output right + $mod+Control+Up focus output up + $mod+Control+Down focus output down + + # Emacs output bindings + $mod+Control+b focus output left + $mod+Control+f focus output right + $mod+Control+p focus output up + $mod+Control+n focus output down } ## Containers @@ -153,6 +193,15 @@ for_window [app_id="Alacritty"] { client.unfocused $colorbackground $colorwallpaper $colorprimary $colorbackground $colorbackground } +## Floating windows should have titles +for_window [floating] border normal 1 + +## Thunderbird New.* windows should float +for_window [app_id="thunderbird" title="(New|Write)"] floating enable + +## Bitwarden extension windows should float by default +for_window [app_id="firefox" title="Extension: \(Bitwarden Password Manager\)"] floating enable + ### ### # Application Keybinds # ### ### @@ -174,6 +223,10 @@ bindsym --locked { XF86AudioPlay exec playerctl play-pause XF86AudioNext exec playerctl next XF86AudioPrev exec playerctl previous + + XF86AudioRaiseVolume exec pactl set-sink-volume @DEFUALT_SINK@ +5% + XF86AudioLowerVolume exec pactl set-sink-volume @DEFUALT_SINK@ -5% + XF86AudioMute exec pactl set-sink-mute @DEFUALT_SINK@ toggle } ## Screen Locking diff --git a/.config/sway/display-arrangement.conf##hostname.gathering-storm b/.config/sway/display-arrangement.conf##hostname.gathering-storm new file mode 100644 index 0000000..72c729e --- /dev/null +++ b/.config/sway/display-arrangement.conf##hostname.gathering-storm @@ -0,0 +1,9 @@ +### -*-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/display-arrangement.conf##hostname.normandy b/.config/sway/display-arrangement.conf##hostname.normandy index 88871ec..df53929 100644 --- a/.config/sway/display-arrangement.conf##hostname.normandy +++ b/.config/sway/display-arrangement.conf##hostname.normandy @@ -3,9 +3,11 @@ ### ### set $leftdisplay 'HDMI-A-1' +set $centerdisplay 'DP-1' set $rightdisplay 'DP-2' output { - $leftdisplay pos 0 0 mode --custom 1920x1080@75Hz - $rightdisplay pos 1920 0 mode --custom 1920x1080@75Hz + $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.tycho b/.config/sway/display-arrangement.conf##hostname.tycho index 8e31ef1..5c4a657 100644 --- a/.config/sway/display-arrangement.conf##hostname.tycho +++ b/.config/sway/display-arrangement.conf##hostname.tycho @@ -7,10 +7,10 @@ set $centerdisplay "Hewlett Packard HP S340c CN490508SQ" set $rightdisplay "HP Inc. HP Z27n G2 6CM0151FD4" output { - $leftdisplay pos 0 0 mode 2560x1440@60Hz transform 270 - $leftdisplay bg ~/Images/Sidepaper.png center - $centerdisplay pos 1440 450 mode 3440x1440 transform 0 + $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 4880 0 mode 2560x1440@60Hz transform 90 + $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/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces b/.config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces new file mode 100644 index 0000000..9e2e779 --- /dev/null +++ b/.config/sway/local-config.d/50-sidebar-gaps.conf##class.has-sidebar-5-workspaces @@ -0,0 +1,11 @@ +#### -*-conf-space-*- #### +## Sidebar Gaps Config ## +#### #### + +workspace { + # 1 gaps left 260 + # 2 gaps left 260 + # 3 gaps left 260 + # 4 gaps left 260 + # 5 gaps left 260 +} diff --git a/.config/sway/swayidle##class.desktop,hostname.tycho b/.config/sway/swayidle##class.desktop,hostname.tycho index b23c007..15c6e5d 100644 --- a/.config/sway/swayidle##class.desktop,hostname.tycho +++ b/.config/sway/swayidle##class.desktop,hostname.tycho @@ -2,7 +2,7 @@ timeout 10 'pgrep swaylock &> /dev/null && swaymsg "output * power off"' resume 'pgrep swaylock &> /dev/null && swaymsg "output * power on" && gpg-connect-agent UPDATESTARTUPTTY /bye' timeout 15 'pgrep swaylock &> /dev/null && pkill -u 1000 -SIGSTOP electron' resume 'pgrep swaylock &> /dev/null && pkill -u 1000 -SIGCONT electron' -timeout 150 'loginctl lock-session && swaymsg "output * power off"' +timeout 300 'loginctl lock-session && swaymsg "output * power off"' lock ~/.local/bin/screenlock before-sleep 'loginctl lock-session' unlock 'pkill -SIGUSR1 swaylock' diff --git a/.config/sway/workspace-arrangement.conf##class.single-monitor b/.config/sway/workspace-arrangement.conf##class.single-monitor index f8c15d9..163810c 100644 --- a/.config/sway/workspace-arrangement.conf##class.single-monitor +++ b/.config/sway/workspace-arrangement.conf##class.single-monitor @@ -20,30 +20,3 @@ workspace { 10 output $display } -## Workspace Switching Keybinds -bindsym { - $mod+1 exec swaymsg workspace 1 - $mod+2 exec swaymsg workspace 2 - $mod+3 exec swaymsg workspace 3 - $mod+4 exec swaymsg workspace 4 - $mod+5 exec swaymsg workspace 5 - $mod+6 exec swaymsg workspace 6 - $mod+7 exec swaymsg workspace 7 - $mod+8 exec swaymsg workspace 8 - $mod+9 exec swaymsg workspace 9 - $mod+0 exec swaymsg workspace 10 -} - -## Window Reassignment Keybinds -bindsym { - $mod+Shift+1 exec swaymsg move container to workspace 1 - $mod+Shift+2 exec swaymsg move container to workspace 2 - $mod+Shift+3 exec swaymsg move container to workspace 3 - $mod+Shift+4 exec swaymsg move container to workspace 4 - $mod+Shift+5 exec swaymsg move container to workspace 5 - $mod+Shift+6 exec swaymsg move container to workspace 6 - $mod+Shift+7 exec swaymsg move container to workspace 7 - $mod+Shift+8 exec swaymsg move container to workspace 8 - $mod+Shift+9 exec swaymsg move container to workspace 9 - $mod+Shift+0 exec swaymsg move container to workspace 10 -} diff --git a/.config/sway/workspace-arrangement.conf##class.tie-fighter b/.config/sway/workspace-arrangement.conf##class.tie-fighter index 467d0e4..3714e9a 100644 --- a/.config/sway/workspace-arrangement.conf##class.tie-fighter +++ b/.config/sway/workspace-arrangement.conf##class.tie-fighter @@ -36,31 +36,3 @@ workspace { 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.triple-monitor b/.config/sway/workspace-arrangement.conf##class.triple-monitor new file mode 100644 index 0000000..16baca7 --- /dev/null +++ b/.config/sway/workspace-arrangement.conf##class.triple-monitor @@ -0,0 +1,75 @@ +### -*-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) +} diff --git a/.config/sway/workspaces.json##hostname.gathering-storm b/.config/sway/workspaces.json##hostname.gathering-storm new file mode 100644 index 0000000..5237547 --- /dev/null +++ b/.config/sway/workspaces.json##hostname.gathering-storm @@ -0,0 +1,288 @@ +{ + "default_context": "personal-portable", + "workspaces": [ + { + "index": 1, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 2, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 3, + "name": "documentation", + "exec": "firefox", + "args": ["--new-window"], + "environ": {}, + "program_name": "firefox" + }, + { + "index": 4, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 5, + "name": "discord", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 6, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 7, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 8, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 9, + "name": "project", + "exec": "firefox-developer-edition", + "args": ["-start-debugger-server", "--new-window"], + "program_name": "firefox-developer-edition" + }, + { + "index": 10, + "name": "server management", + "exec": "virt-manager", + "program_name": "virt-manager", + "systemd": false + }, + { + "index": 11, + "name": "password management", + "exec": "bitwarden-desktop", + "program_name": "bitwarden" + }, + { + "index": 12, + "name": "video", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 13, + "name": "comms", + "exec": "zoom", + "program_name": "zoom" + }, + { + "index": 14, + "name": "mail", + "exec": "thunderbird", + "program_name": "thunderbird", + "environ": { + "MOZ_ENABLE_WAYLAND": "1" + } + }, + { + "index": 15, + "name": "config", + "exec": "console", + "program_name": "console" + }, + { + "index": 16, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 17, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 18, + "name": "music", + "exec": "feishin", + "program_name": "feishin" + }, + { + "index": 19, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 20, + "name": "slack", + "exec": "slack", + "program_name": "slack", + "args": [ + "--enable-features=UseOzonePlatform", + "--ozone-platform=wayland", + "--enable-gpu-rasterization" + ] + }, + { + "index": 21, + "name": "ferrets", + "exec": "firefox", + "args": ["--new-window", "https://www.twitch.tv/ferretsoftware"], + "program_name": "firefox" + }, + { + "index": 22, + "name": "encrypted comms", + "exec": "signal-desktop", + "program_name": "signal" + }, + { + "index": 23, + "name": "steam", + "exec": "steam", + "program_name": "steam" + } + ], + "contexts": { + "docked": { + "primary": "center", + "outputs": [ + { + "names": ["eDP-1"], + "group": "builtin", + "position": [0, 600], + "eww_windows": ["builtinbar"], + "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", + "group": "left", + "position": [1707, 0], + "mode": "2560x1440@120Hz", + "eww_windows": ["leftbar", "sidebar"] + }, + { + "make": "Dell Inc.", + "model": "DELL U3818DW", + "serial": "97F8P9350W0L", + "group": "center", + "position": [4267, 0], + "mode": "3840x1600", + "eww_windows": ["centerbar"] + }, + { + "make": "Acer Technologies", + "model": "XV271U M3", + "serial": "1431038964205", + "group": "right", + "position": [8107, 0], + "mode": "2560x1440@120Hz", + "eww_windows": ["rightbar"] + } + ], + "groups": { + "builtin": { + "workspaces": [21, 22], + "reverse": false + }, + "left": { + "workspaces": [6, 2, 3, 4, 5], + "reverse": true + }, + "center": { + "workspaces": [1, 7, 8, 9, 10, 11, 12, 13, 14, 15], + "reverse": false + }, + "right": { + "workspaces": [16, 17, 19, 18, 20, 13], + "reverse": false + } + } + }, + "work-portable": { + "primary": "builtin", + "outputs": [ + { + "names": ["eDP-1"], + "group": "builtin", + "position": [0, 0], + "eww_windows": ["builtinbar"], + "mode": "2560x1600@165Hz scale 1.25 color_profile icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm" + } + ], + "groups": { + "builtin": { + "workspaces": [1, 7, 8, 9, 10, 13, 18, 20, 14, 15], + "reverse": false + } + } + }, + "personal-portable": { + "primary": "builtin", + "outputs": [ + { + "names": ["eDP-1"], + "group": "builtin", + "position": [0, 0], + "eww_windows": ["builtinbar"], + "mode": "2560x1600@165Hz scale 1.25 color_profile icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm" + } + ], + "groups": { + "builtin": { + "workspaces": [1, 7, 8, 9, 23, 22, 18, 5, 14, 15], + "reverse": false + } + } + }, + "spawnpoint": { + "primary": "external", + "outputs": [ + { + "names": ["eDP-1"], + "group": "builtin", + "position": [2560, 0], + "eww_windows": ["builtinbar"], + "mode": "2560x1600@165Hz scale 1.5 color_profile icc /usr/share/color/icc/colord/BOE_CQ_______NE160QDM_NZ6.icm" + }, + { + "make": "LG Electronics", + "model": "LG UltraFine", + "serial": "111NTRL2Y030", + "group": "external", + "position": [0, 0], + "eww_windows": ["centerbar"], + "mode": "3840x2160@60Hz scale 1.5" + } + ], + "groups": { + "builtin": { + "workspaces": [6, 2, 3, 18, 5], + "reverse": false + }, + "external": { + "workspaces": [1, 7, 8, 9, 23, 22, 19, 20, 14, 15], + "reverse": false + } + } + } + } +} diff --git a/.config/sway/workspaces.json##hostname.tycho b/.config/sway/workspaces.json##hostname.tycho index f210cd7..45312f2 100644 --- a/.config/sway/workspaces.json##hostname.tycho +++ b/.config/sway/workspaces.json##hostname.tycho @@ -1,158 +1,196 @@ { "default_context": "work", - "display_ordering": ["left", "center", "right"], - "display_layout": { - "left": "DP-5", - "right": "DP-7", - "center": "DP-4" - }, + "workspaces": [ + { + "index": 1, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 2, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 3, + "name": "documentation", + "exec": "firefox", + "args": ["--new-window"], + "environ": {}, + "program_name": "firefox" + }, + { + "index": 4, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 5, + "name": "discord", + "exec": "discord", + "program_name": "discord" + }, + { + "index": 6, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 7, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 8, + "name": "internet", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 9, + "name": "project", + "exec": "firefox-developer-edition", + "args": ["-start-debugger-server", "--new-window"], + "program_name": "firefox-developer-edition" + }, + { + "index": 10, + "name": "server management", + "exec": "virt-manager", + "program_name": "virt-manager", + "systemd": false + }, + { + "index": 11, + "name": "password management", + "exec": "bitwarden-desktop", + "program_name": "bitwarden" + }, + { + "index": 12, + "name": "video", + "exec": "jellyfinmediaplayer", + "program_name": "jellyfinmediaplayer" + }, + { + "index": 13, + "name": "edex-ui", + "exec": "edex-ui", + "program_name": "edex-ui" + }, + { + "index": 14, + "name": "mail", + "exec": "thunderbird", + "program_name": "thunderbird", + "environ": { + "MOZ_ENABLE_WAYLAND": "1" + } + }, + { + "index": 15, + "name": "config", + "exec": "console", + "program_name": "console" + }, + { + "index": 16, + "name": "console", + "exec": "console", + "program_name": "console" + }, + { + "index": 17, + "name": "code", + "exec": "emacsclient", + "args": ["-nc"], + "program_name": "emacsclient" + }, + { + "index": 18, + "name": "music", + "exec": "feishin", + "program_name": "feishin" + }, + { + "index": 19, + "name": "project", + "exec": "firefox", + "args": ["--new-window"], + "program_name": "firefox" + }, + { + "index": 20, + "name": "slack", + "exec": "slack", + "program_name": "slack", + "args": [ + "--enable-features=UseOzonePlatform", + "--ozone-platform=wayland", + "--enable-gpu-rasterization" + ], + "memory_profile": { + "high": "800M", + "max": "1.2G" + } + } + ], "contexts": { "work": { - "left": [ + "primary": "center", + "outputs": [ { - "index": 5, - "name": "discord", - "exec": "discord", - "program_name": "discord" + "make": "HP Inc.", + "model": "HP Z27n G2", + "serial": "6CM0151FHY", + "group": "left", + "position": [0, 450], + "mode": "2560x1440@75Hz", + "eww_windows": ["sidebar", "leftbar"] }, { - "index": 4, - "name": "project", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" + "make": "Hewlett Packard", + "model": "HP S340c", + "serial": "CN490508SQ", + "group": "center", + "position": [2560, 450], + "mode": "3440x1440", + "eww_windows": ["centerbar"] }, { - "index": 3, - "name": "documentation", - "exec": "firefox", - "args": ["--new-window"], - "environ": {}, - "program_name": "firefox" - }, - { - "index": 2, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" - }, - { - "index": 1, - "name": "console", - "exec": "console", - "program_name": "console" + "make": "HP Inc.", + "model": "HP Z27n G2", + "serial": "6CM0151FD4", + "group": "right", + "position": [6000, 0], + "mode": "2560x1440@75Hz", + "transform": 90, + "eww_windows": ["rightbar"] } ], - "center": [ - { - "index": 6, - "name": "console", - "exec": "console", - "program_name": "console" + "groups": { + "left": { + "workspaces": [1, 2, 3, 4, 5], + "reverse": true }, - { - "index": 7, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" + "center": { + "workspaces": [6, 7, 8, 9, 10, 11, 12, 13, 14, 15], + "reverse": false }, - { - "index": 8, - "name": "internet", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" - }, - { - "index": 9, - "name": "project", - "exec": "firefox-developer-edition", - "args": ["-start-debugger-server", "--new-window"], - "program_name": "firefox-developer-edition" - }, - { - "index": 10, - "name": "server management", - "exec": "virt-manager", - "program_name": "virt-manager", - "systemd": false - }, - { - "index": 11, - "name": "password management", - "exec": "bitwarden-desktop", - "program_name": "bitwarden" - }, - { - "index": 12, - "name": "video", - "exec": "jellyfinmediaplayer", - "program_name": "jellyfinmediaplayer" - }, - { - "index": 13, - "name": "edex-ui", - "exec": "edex-ui", - "program_name": "edex-ui" - }, - { - "index": 14, - "name": "mail", - "exec": "thunderbird", - "program_name": "thunderbird" - }, - { - "index": 15, - "name": "config", - "exec": "console", - "program_name": "console" + "right": { + "workspaces": [16, 17, 18, 19, 20], + "reverse": false } - ], - "right": [ - { - "index": 16, - "name": "console", - "exec": "console", - "program_name": "console" - }, - { - "index": 17, - "name": "code", - "exec": "emacsclient", - "args": ["-nc"], - "program_name": "emacsclient" - }, - { - "index": 18, - "name": "music", - "exec": "spotify", - "program_name": "spotify" - }, - { - "index": 19, - "name": "project", - "exec": "firefox", - "args": ["--new-window"], - "program_name": "firefox" - }, - { - "index": 20, - "name": "slack", - "exec": "slack", - "program_name": "slack", - "args": [ - "--enable-features=UseOzonePlatform", - "--ozone-platform=wayland", - "--enable-gpu-rasterization" - ], - "memory_profile": { - "high": "800M", - "max": "1.2G" - } - } - ] + } } } } diff --git a/.config/systemd/user/emacs.service b/.config/systemd/user/emacs.service index da18f78..056cba3 100644 --- a/.config/systemd/user/emacs.service +++ b/.config/systemd/user/emacs.service @@ -13,8 +13,8 @@ Restart=on-failure Slice=session.slice MemoryAccounting=yes # Tide eats memory like crazy, so lets put it on a diet. -MemoryHigh=3G -MemoryMax=5G +MemoryHigh=8G +MemoryMax=10G [Install] WantedBy=graphical-session.target diff --git a/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.rocinante b/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.gathering-storm similarity index 100% rename from .config/systemd/user/eww.service.d/bar-launch.conf##hostname.rocinante rename to .config/systemd/user/eww.service.d/bar-launch.conf##hostname.gathering-storm diff --git a/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.normandy b/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.normandy deleted file mode 100644 index da9fb01..0000000 --- a/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.normandy +++ /dev/null @@ -1,4 +0,0 @@ -# -*-conf-unix-*- - -[Service] -ExecStartPost=eww open-many leftbar rightbar sidebar diff --git a/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.tycho b/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.tycho deleted file mode 100644 index fa0829e..0000000 --- a/.config/systemd/user/eww.service.d/bar-launch.conf##hostname.tycho +++ /dev/null @@ -1,4 +0,0 @@ -# -*-conf-unix-*- - -[Service] -ExecStartPost=eww open-many leftbar centerbar rightbar network-status diff --git a/.config/systemd/user/kdeconnect.service b/.config/systemd/user/kdeconnect.service index e605c68..7decd0c 100644 --- a/.config/systemd/user/kdeconnect.service +++ b/.config/systemd/user/kdeconnect.service @@ -3,7 +3,7 @@ Description=KDE Connect Daemon [Service] Type=simple -ExecStart=/usr/lib/kdeconnectd +ExecStart=/usr/bin/kdeconnectd [Install] -WantedBy=default.target +WantedBy=sway-session.target diff --git a/.config/systemd/user/lxpolkit.service b/.config/systemd/user/lxpolkit.service index 3292d95..ede0b5b 100644 --- a/.config/systemd/user/lxpolkit.service +++ b/.config/systemd/user/lxpolkit.service @@ -4,7 +4,7 @@ BindTo=sway-session.target [Service] Type=simple -ExecStart=/usr/bin/lxpolkit +ExecStart=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 [Install] WantedBy=sway-session.target diff --git a/.config/systemd/user/sway-context-manager.service b/.config/systemd/user/sway-context-manager.service new file mode 100644 index 0000000..0e4522d --- /dev/null +++ b/.config/systemd/user/sway-context-manager.service @@ -0,0 +1,14 @@ +[Unit] +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 +Slice=session.slice +Restart=on-abnormal +RestartSec=5s + +[Install] +WantedBy=sway-session.target diff --git a/.config/yadm/encrypt b/.config/yadm/encrypt index c056182..34662f3 100644 --- a/.config/yadm/encrypt +++ b/.config/yadm/encrypt @@ -1 +1,2 @@ .config/ssh/1*.conf +.config/ssh/3*.conf diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh index 5080219..33f5827 100644 --- a/.config/zsh/alias.zsh +++ b/.config/zsh/alias.zsh @@ -7,7 +7,10 @@ alias userctl="\systemctl --user" alias ujournalctl="\journalctl --user" -alias reconf="source $HOME/.zshrc" +alias reconf="exec $SHELL" + +# Use safeexec to ensure we are using system binaries (required for some AUR packages) +alias paru="safeexec paru" alias cp="cp -i --reflink=auto" alias mv="mv -i" @@ -27,8 +30,10 @@ alias sudo='sudo ' alias sign='gpg --sign-with ezri@ezri.dev --detach-sign' alias verify='gpg --verify' +alias bw-personal='BITWARDENCLI_APPDATA_DIR=~/.config/bw-cli-personal bw' + function didifuckingstutter { - echo $fg[blue]Apologies, right away.$fg[default] + echo $fg[blue]Apologies, milady. Right away.$fg[default] # Run the last command as root last_cmd=$(fc -ln -1) # if last command was emacs, use TRAMP rather than running as root @@ -37,7 +42,7 @@ function didifuckingstutter { echo "> $fg[white]$cmd$fg[default]" $=cmd else - cmd="sudo $(fc -ln -1)" + cmd="sudo zsh -c '$(fc -ln -1)'" echo "> $fg[white]$cmd$fg[default]" sudo -p "$fg[red]I'll need your authorization:$fg[default] " $last_cmd fi diff --git a/.config/zsh/env.zsh b/.config/zsh/env.zsh index 0eccad7..1b6b5a2 100644 --- a/.config/zsh/env.zsh +++ b/.config/zsh/env.zsh @@ -11,7 +11,7 @@ PATH_wincmake=/opt/msvcmake/bin:/opt/msvc/bin/x64 cdpath=(~ ~/src) -export PATH=.:$PATH_asdf:$PATH_node:$PATH_pyenv:$PATH_java:$PATH_user:$PATH_system +export PATH=.:$PATH_node:$PATH_pyenv:$PATH_java:$PATH_user:$PATH_system # Function to run a command with only the "safe" system PATH element function safeexec { diff --git a/.config/zsh/options.zsh b/.config/zsh/options.zsh index 3b68cca..e1d04a8 100644 --- a/.config/zsh/options.zsh +++ b/.config/zsh/options.zsh @@ -2,10 +2,7 @@ setopt auto_cd # Use directory stack setopt auto_pushd -# Always resolve symlinks when changing directory -setopt chase_links # Ignore duplicate commands and commands starting with space setopt hist_ignore_dups setopt hist_ignore_space - diff --git a/.config/zsh/prompt.zsh b/.config/zsh/prompt.zsh index 6e117e3..d7caa8c 100644 --- a/.config/zsh/prompt.zsh +++ b/.config/zsh/prompt.zsh @@ -63,7 +63,7 @@ eval $(awk '{print "PERSONAL_" $0}' ${HOME}/.personal-info 2>/dev/null) if [[ -z ${MACHINE_CHASSIS} ]]; then MACHINE_CHASSIS=$(hostnamectl chassis 2>/dev/null); fi if [[ -z ${MACHINE_CHASSIS} ]]; then MACHINE_CHASSIS="desktop"; fi -if [[ ${MACHINE_CHASSIS} != "container" ]]; then +if [[ ${MACHINE_CHASSIS} != "container" ]] && [[ ${OS_ID} == "arch" ]]; then # Only check if a reboot is necessary if we're not in a container precmd_functions+=(precmd_kernel_info) fi @@ -100,7 +100,7 @@ case $OS_ID in show_os_icon=0 ;; esac -prompt="▶" +prompt_char="%(?.❯.%F{red}❯%f)" host="%F{cyan}[ %F{green}${hostname}%(!.%F{red} as root.) %F{cyan}]%f" localhost="%F{cyan}[ %F{magenta}%B${hostname}%(!.%F{red} as root.)%b %F{cyan}]%f" serial_host="%F{cyan}[ %F{magenta}${hostname}%(!.%F{red} as root.) %F{cyan}] %F{red}%y%f" @@ -108,17 +108,21 @@ container_host="%F{cyan}[ %F{blue}%B${hostname}%(!.%F{red} as root.)%b %F{cyan}] returncode="%(?..%F{red}  %?%f)" prompt_line1='$kernel_info_msg_0_' -prompt_line3=$prompt +prompt_line3=" $prompt_char" # Create conditional prompt line 2 if [[ -v SSH_CLIENT ]]; then prompt_line2='${host}$pyenv_info_msg_0_ ${pwd}' + history_line="${host}" elif [[ ${TTY} =~ "tty" ]]; then prompt_line2='${serial_host}$pyenv_info_msg_0_ ${pwd}' -elif [[ ${MACHINE_CHASSIS} == "container" ]]; then + history_line="${serial_host}" +elif [[ ${MACHINE_CHASSIS} == "container" ]] || [[ ${MACHINE_CHASSIS} == "vm" ]]; then prompt_line2='${container_host}$pyenv_info_msg_0_ ${pwd}' + history_line="${container_host}" else prompt_line2='${localhost}$pyenv_info_msg_0_ ${pwd}' + history_line="${localhost}" fi # Inject icon if available, with ANSI color code stored in $OS_ANSI_COLOR @@ -126,15 +130,36 @@ if [[ ${show_os_icon} -eq 1 ]]; then prompt_line2=$'%{\x1b[${OS_ANSI_COLOR}m${os_icon}\x1b[0m%}'" ${prompt_line2}" fi -if [[ ${TERM} == "dumb" ]]; then - # Dumb terminal needs a dumb prompt, otherwise things like - # emacs TRAMP break - PROMPT='[%~] $ ' -else - PROMPT="${prompt_line1} +set-prompt() { + if [[ ${TERM} == "dumb" ]]; then + # Dumb terminal needs a dumb prompt, otherwise things like + # emacs TRAMP break + PROMPT='[%~] $ ' + PROMPT2='> ' + else + PROMPT="${prompt_line1} ${prompt_line2} ${prompt_line3} " -fi + PROMPT2=" %F{yellow}%_ ❯%f " + fi + +} +set-prompt + +rewrite-prompt-and-accept() { + if [[ ${TERM} == "dumb" ]]; then + return + fi + PROMPT='${history_line} %F{yellow}%T%f ${pwd}$pyenv_info_msg_0_ %F{green}${prompt_char}%f ' + # Clear any suggestions; we've committed to this command + zle autosuggest-clear + zle reset-prompt + set-prompt + zle accept-line +} + +zle -N rewrite-prompt-and-accept +bindkey '^M' rewrite-prompt-and-accept RPROMPT='$vcs_info_msg_0_$returncode' diff --git a/.config/zsh/prompt.zsh##distro.arch b/.config/zsh/prompt.zsh##distro.arch deleted file mode 120000 index 359b920..0000000 --- a/.config/zsh/prompt.zsh##distro.arch +++ /dev/null @@ -1 +0,0 @@ -prompt.zsh##distro.Arch \ No newline at end of file diff --git a/.config/zsh/utils.zsh b/.config/zsh/utils.zsh index b502c99..903a4f4 100644 --- a/.config/zsh/utils.zsh +++ b/.config/zsh/utils.zsh @@ -75,3 +75,62 @@ function lsssh() { echo "$user@$host" done } + +function bwunlock() { + # Unlock Bitwarden vault and export session key + local bwfd + local bwpasswd + local secretstore + local bwcmd + local skipkeyring + + # Use default Bitwarden account + secretstore="bw" + bwcmd="bw" + skipkeyring=0 + + while [[ $# -gt 0 ]]; do + case $1 in + --personal) + # Use personal Bitwarden account + secretstore="bw-personal" + bwcmd="env BITWARDENCLI_APPDATA_DIR=$HOME/.config/bw-cli-personal bw" + ;; + --debug) + # Enable debug output + set -x + ;; + --ask) + # Prompt for Bitwarden password + skipkeyring=1 + ;; + *) + echo "Unknown option: $1" >&2 + ;; + esac + shift + done + + # Attempt to read Bitwarden password from keyring + if ! (( skipkeyring )); then + bwpasswd=$(secret-tool lookup service $secretstore 2>/dev/null) + fi + if [[ -z "${bwpasswd}" ]]; then + # If password is not found in keyring, prompt for it + read -s -p "Enter Bitwarden password: " bwpasswd + echo + # Store Bitwarden password in keyring + if ! (( skipkeyring )); then + secret-tool store --label="Bitwarden" service $secretstore + fi + fi + # Unlock Bitwarden vault and export session key + export BW_SESSION=$(eval $bwcmd unlock --raw "'$bwpasswd'" 2>/dev/tty) + if [[ -z "${BW_SESSION}" ]]; then + echo "Failed to unlock Bitwarden vault" >&2 + return 1 + else + echo "Bitwarden vault unlocked" + fi + +} diff --git a/.config/zsh/zz-asdf.zsh b/.config/zsh/zz-asdf.zsh deleted file mode 100644 index fdba167..0000000 --- a/.config/zsh/zz-asdf.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# source $HOME/.local/lib/asdf/asdf.sh -# source $HOME/.local/lib/asdf/completions/asdf.bash diff --git a/.emacs.d/settings.org b/.emacs.d/settings.org index 66cced0..13f6bd1 100644 --- a/.emacs.d/settings.org +++ b/.emacs.d/settings.org @@ -513,26 +513,31 @@ Indent using tabs, render with tab-width of 2. :config (setq company-idle-delay 0.3)) #+END_SRC -** LSP Mode +** LSP #+BEGIN_SRC emacs-lisp - (use-package lsp-mode + (use-package eglot :ensure t - :init - ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") - (setq lsp-keymap-prefix "C-c l") - :hook ((python-mode . lsp) ;; pip install python-lsp-server pyls-black pyls-isort pyls-mypy - (elixir-mode . lsp) - (rust-mode . lsp) - (java-mode . lsp) - (php-mode . lsp) - (typescript-mode . lsp) ;; npm install -g typescript typescript-language-server - (lsp-mode . lsp-enable-which-key-integration)) - :config (lsp-register-custom-settings - '(("pyls.plugins.pyls_mypy.enabled" t t) - ("pyls.plugins.pyls_mypy.live_mode" nil t) - ("pyls.plugins.pyls_black.enabled" t t) - ("pyls.plugins.pyls_isort.enabled" t t))) - :commands lsp) + :defer t + :bind (:map eglot-mode-map + ("C-c C-e" . eglot-rename) + ("C-." . eglot-code-actions)) + :hook ((python-mode . eglot-ensure) + (python-mode . flyspell-prog-mode) + (python-mode . superword-mode) + (python-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))))))) #+END_SRC ** Languages @@ -570,11 +575,11 @@ After installing the ~rust-analyzer~ program, the following can be used: (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)) - (add-hook 'tsx-ts-mode-hook #'lsp) - (add-hook 'tsx-ts-mode-hook #'setup-tide-mode) + ;; (add-hook 'tsx-ts-mode-hook #'eglot) + ;; (add-hook 'tsx-ts-mode-hook #'setup-tide-mode) - (add-hook 'typescript-ts-mode-hook #'lsp) - (add-hook 'typescript-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 @@ -659,7 +664,7 @@ After installing the ~rust-analyzer~ program, the following can be used: #+RESULTS: -** Format All The Buffers +* Format All The Buffers #+BEGIN_SRC emacs-lisp (use-package format-all :ensure t) diff --git a/.local/bin/default-application-launcher b/.local/bin/default-application-launcher index f4109ff..65e0304 100755 --- a/.local/bin/default-application-launcher +++ b/.local/bin/default-application-launcher @@ -4,11 +4,10 @@ exec >(systemd-cat -t i3-sensible-launcher -p info) exec 2> >(systemd-cat -t i3-sensible-launcher -p err) -pyenv shell system +export PATH=$HOME/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin -current_workspace=$(swaymsg -t get_workspaces | jq '.[] | select(.focused==true).name' -r) - -ws_data=$(jq <$HOME/.config/sway/workspaces.json ".contexts | [.[] | values[]] | flatten(1) | .[] | select(.index==${current_workspace})" -c) +ws_data=$(sway_get_focused_workspace) +current_workspace=$(echo $ws_data | jq -r '.index') program=$(echo $ws_data | jq -r '.exec') program_name=$(echo $ws_data | jq -r '.program_name') diff --git a/.local/bin/sway-find-workspace b/.local/bin/sway-find-workspace index 69be005..8f6ddba 100755 --- a/.local/bin/sway-find-workspace +++ b/.local/bin/sway-find-workspace @@ -10,10 +10,16 @@ done echo "Output sets: $output_sets" >&2 +if [[ -f $XDG_RUNTIME_DIR/wm_context ]]; then + wm_context=$(<$XDG_RUNTIME_DIR/wm_context) +else + wm_context=$(jq <~/.config/sway/workspaces.json '.default_context' -r) +fi + workspace_counts=() total_workspaces=0 for output in {1..${#output_sets[@]}}; do - workspace_counts+=$(jq <~/.config/sway/workspaces.json ".contexts[.default_context] | [values[]][$((output - 1))] | length" -r) + workspace_counts+=$(jq <~/.config/sway/workspaces.json ".contexts.${wm_context} | [values[]][$((output - 1))] | length" -r) ((total_workspaces += workspace_counts[output])) done diff --git a/.local/bin/vpn-toggle b/.local/bin/vpn-toggle index ccedc64..65ae582 100755 --- a/.local/bin/vpn-toggle +++ b/.local/bin/vpn-toggle @@ -1,15 +1,18 @@ #!/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 gpclient disconnect + pkexec env TZ=Etc/UTC gpclient disconnect 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 - pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gpclient connect gp.usu.edu + TZ=Etc/UTC sudo /usr/sbin/gpclient --fix-openssl connect gp.usu.edu fi diff --git a/.local/share/yadm/archive b/.local/share/yadm/archive index cee847a..d1590ea 100644 Binary files a/.local/share/yadm/archive and b/.local/share/yadm/archive differ diff --git a/.zshrc b/.zshrc index b743d91..bf28d25 100644 --- a/.zshrc +++ b/.zshrc @@ -12,3 +12,4 @@ fi setopt INC_APPEND_HISTORY_TIME +