diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua index 5ab4bd2..96def15 100644 --- a/config/hypr/hyprland.lua +++ b/config/hypr/hyprland.lua @@ -1,9 +1,52 @@ --- TODO: Laptop vs desktop vs docked config -local swap_escape = false -require("hyprland.core.general") -require("hyprland.core.input")(swap_escape) +-- Determine current platform +local is_docked = false +local laptop_config = false +local read_platform = pcall(function() + io.popen("cat ~/.config/janishutz/platform-laptop") +end) +local read_docked = pcall(function() + io.popen("cat ~/.config/janishutz/docked") +end) +if read_platform then + laptop_config = true +end +if read_docked then + laptop_config = true +end + +-- Core require("colors") +require("hyprland.core.general") +require("hyprland.core.input")(laptop_config) +require("hyprland.core.group") +require("hyprland.core.misc") +require("hyprland.core.style") + +-- Binds +require("hyprland.binds.device")(laptop_config) +require("hyprland.binds.groups") +require("hyprland.binds.launch") +require("hyprland.binds.main") +require("hyprland.binds.notifications") +require("hyprland.binds.screenshot") +require("hyprland.binds.window") +require("hyprland.binds.workspace") + +-- Window rules +require("hyprland.windowrules.floating") +require("hyprland.windowrules.idle") +require("hyprland.windowrules.tags") +require("hyprland.windowrules.workspaces") + +-- Workspace rules +require("hyprland.workspacerules.main") + +-- Monitors +require("hyprland.monitors")(laptop_config, is_docked) + +-- Execs +require("hyprland.execs") hl.device({ name = "pnp0c50:00-093a:0255-touchpad", diff --git a/config/hypr/hyprland/binds/device.lua b/config/hypr/hyprland/binds/device.lua index fad007c..5cdea02 100644 --- a/config/hypr/hyprland/binds/device.lua +++ b/config/hypr/hyprland/binds/device.lua @@ -28,6 +28,21 @@ return function(is_laptop) end) end + hl.bind("Shift + T", function () + hl.device({ + name = "pnp0c50:00-093a:0255-touchpad", + enabled = false + }) + hl.dispatch(hl.dsp.exec_cmd("notify-send 'Disabled Trackpad' --app-name='Hyprctl'")) + end) + hl.bind("T", function () + hl.device({ + name = "pnp0c50:00-093a:0255-touchpad", + enabled = true + }) + hl.dispatch(hl.dsp.exec_cmd("notify-send 'Enabled Trackpad' --app-name='Hyprctl'")) + end) + hl.bind("Escape", function() exit_submap() end) diff --git a/config/hypr/hyprland/binds/main.lua b/config/hypr/hyprland/binds/main.lua new file mode 100644 index 0000000..d01b077 --- /dev/null +++ b/config/hypr/hyprland/binds/main.lua @@ -0,0 +1,9 @@ +hl.bind("Super + X", hl.dsp.submap("launch")) +hl.bind("Super + D", hl.dsp.submap("device")) +hl.bind("Super + C", hl.dsp.submap("notifications")) +hl.bind("Super + G", hl.dsp.submap("groups")) +hl.bind("Super + S", hl.dsp.submap("screenshot")) +hl.bind("Super + W", hl.dsp.submap("window")) +hl.bind("Super + A", hl.dsp.submap("workspace")) +hl.bind("Super + Space", hl.dsp.exec_cmd("hyprlauncher")) +hl.bind("Super + Escape", hl.dsp.exec_cmd("wlogout")) diff --git a/config/hypr/hyprland/core/group.lua b/config/hypr/hyprland/core/group.lua index 7743f03..898d612 100644 --- a/config/hypr/hyprland/core/group.lua +++ b/config/hypr/hyprland/core/group.lua @@ -1,4 +1,3 @@ --- TODO: colours hl.config({ group = { auto_group = false, diff --git a/config/hypr/hyprland/execs.lua b/config/hypr/hyprland/execs.lua index 7941a23..e1d6dc6 100644 --- a/config/hypr/hyprland/execs.lua +++ b/config/hypr/hyprland/execs.lua @@ -4,6 +4,8 @@ hl.on("hyprland.start", function() -- hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") hl.exec_cmd("systemctl --user start hyprpolkitagent") hl.exec_cmd("hypridle") + hl.exec_cmd("hyprpaper") + hl.exec_cmd("hyprlauncher -d") hl.exec_cmd("nm-applet") hl.exec_cmd("nextcloud --background") hl.exec_cmd("quickshell") diff --git a/config/matugen/templates/hyprland/colors.lua b/config/matugen/templates/hyprland/colors.lua index 0175f2d..734047c 100644 --- a/config/matugen/templates/hyprland/colors.lua +++ b/config/matugen/templates/hyprland/colors.lua @@ -1,13 +1,21 @@ hl.config({ general = { col = { - active_border = "rgba({{colors.outline_variant.default.hex_stripped}}77)", + active_border = "rgba({{colors.primary.default.hex_stripped}}cc) rgba({{colors.secondary.default.hex_stripped}}cc) rgba({{colors.tertiary.default.hex_stripped}}cc) 45deg", inactive_border = "rgba({{colors.surface_container_low.default.hex_stripped}}33)", }, }, - misc = { - background_color = "rgba({{colors.surface.dark.hex_stripped}}FF)", + group = { + col = { + active_border = "rgba({{colors.outline_variant.default.hex_stripped}}77)", + inactive_border = "rgba({{colors.surface_container_high.default.hex_stripped}}33)", + }, }, + decoration = { + shadow = { + color = "rgba({{colors.shadow.default.hex_stripped}}20)", + } + } }) hl.window_rule({ diff --git a/config/matugen/templates/wlogout/style.css b/config/matugen/templates/wlogout/style.css new file mode 100644 index 0000000..603c7d9 --- /dev/null +++ b/config/matugen/templates/wlogout/style.css @@ -0,0 +1,66 @@ +/* + * ╭───────────────────────────────────────────────╮ + * │ WLOGOUT │ + * ╰───────────────────────────────────────────────╯ +*/ +window { + font-family: monospace; + font-size: 14pt; + color: {{colors.on_background.default.hex}}; /* text */ + background-color: {{colors.primary.background.hex}}60; +} + +button { + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + border: none; + background-color: transparent; + margin: 5px; + transition: box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out; + border-radius: 40px; +} + +button:hover { + background-color: {{colors.primary.default.hex}}; +} + +button:focus { + background-color: {{colors.primary.default.hex}}80; + color: {{colors.on_primary.default.hex}}; +} + +#lock { + background-image: image(url("./lock.png")); +} +#lock:focus { + background-image: image(url("./lock-hover.png")); +} + +#logout { + background-image: image(url("./logout.png")); +} +#logout:focus { + background-image: image(url("./logout-hover.png")); +} + +#suspend { + background-image: image(url("./sleep.png")); +} +#suspend:focus { + background-image: image(url("./sleep-hover.png")); +} + +#shutdown { + background-image: image(url("./power.png")); +} +#shutdown:focus { + background-image: image(url("./power-hover.png")); +} + +#reboot { + background-image: image(url("./restart.png")); +} +#reboot:focus { + background-image: image(url("./restart-hover.png")); +} diff --git a/config/wlogout/layout b/config/wlogout/layout new file mode 100755 index 0000000..86b2184 --- /dev/null +++ b/config/wlogout/layout @@ -0,0 +1,30 @@ +{ + "label" : "lock", + "action" : "hyprlock", + "text" : "Lock", + "keybind" : "l" +} +{ + "label" : "reboot", + "action" : "systemctl reboot", + "text" : "Reboot", + "keybind" : "r" +} +{ + "label" : "shutdown", + "action" : "systemctl poweroff", + "text" : "Shutdown", + "keybind" : "s" +} +{ + "label" : "logout", + "action" : "hyprctl dispatch exit 0", + "text" : "Logout", + "keybind" : "e" +} +{ + "label" : "suspend", + "action" : "systemctl suspend", + "text" : "Suspend", + "keybind" : "u" +} diff --git a/config/wlogout/lock-hover.png b/config/wlogout/lock-hover.png new file mode 100755 index 0000000..8fb86fe Binary files /dev/null and b/config/wlogout/lock-hover.png differ diff --git a/config/wlogout/lock.png b/config/wlogout/lock.png new file mode 100755 index 0000000..430451c Binary files /dev/null and b/config/wlogout/lock.png differ diff --git a/config/wlogout/logout-hover.png b/config/wlogout/logout-hover.png new file mode 100755 index 0000000..9e570a9 Binary files /dev/null and b/config/wlogout/logout-hover.png differ diff --git a/config/wlogout/logout.png b/config/wlogout/logout.png new file mode 100755 index 0000000..128c995 Binary files /dev/null and b/config/wlogout/logout.png differ diff --git a/config/wlogout/power-hover.png b/config/wlogout/power-hover.png new file mode 100755 index 0000000..122d331 Binary files /dev/null and b/config/wlogout/power-hover.png differ diff --git a/config/wlogout/power.png b/config/wlogout/power.png new file mode 100755 index 0000000..ce56166 Binary files /dev/null and b/config/wlogout/power.png differ diff --git a/config/wlogout/restart-hover.png b/config/wlogout/restart-hover.png new file mode 100755 index 0000000..3e18536 Binary files /dev/null and b/config/wlogout/restart-hover.png differ diff --git a/config/wlogout/restart.png b/config/wlogout/restart.png new file mode 100755 index 0000000..7855d40 Binary files /dev/null and b/config/wlogout/restart.png differ diff --git a/config/wlogout/sleep-hover.png b/config/wlogout/sleep-hover.png new file mode 100755 index 0000000..0fd3bad Binary files /dev/null and b/config/wlogout/sleep-hover.png differ diff --git a/config/wlogout/sleep.png b/config/wlogout/sleep.png new file mode 100755 index 0000000..6a3d607 Binary files /dev/null and b/config/wlogout/sleep.png differ