diff --git a/home/dot_config/hypr/hyprland.conf b/home/dot_config/hypr/hyprland.conf new file mode 100644 index 00000000..26522135 --- /dev/null +++ b/home/dot_config/hypr/hyprland.conf @@ -0,0 +1,97 @@ +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,preferred,auto,auto + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mod = SUPER +$term = kitty +$e = & hyprctl dispatch submap reset + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox + +# Source a file (multi-file configs) +source = ~/.config/hypr/workspaces.conf +source = ~/.config/hypr/keybinds.conf +source = ~/.config/hypr/windows.conf +source = ~/.config/hypr/start.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 2 + gaps_out = 2 + border_size = 2 + col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + col.inactive_border = rgba(595959aa) + + layout = master + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 2 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + # animations are bloat ;) + enabled = no +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = false + mfact = 0.5 +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = off +} + +misc { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + force_default_wallpaper = 0 # Set to 0 to disable the anime mascot wallpapers +} + +# Example per-device config +# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more +device:epic-mouse-v1 { + sensitivity = -0.5 +} diff --git a/home/dot_config/hypr/keybinds.conf b/home/dot_config/hypr/keybinds.conf new file mode 100644 index 00000000..32f0eafa --- /dev/null +++ b/home/dot_config/hypr/keybinds.conf @@ -0,0 +1,88 @@ +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mod SHIFT, return, exec, $term +bind = $mod, d, killactive, +bind = $mod, t, togglefloating, +bind = $mod, f, fullscreen, + +# Audio +bindl = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +2% +bindl = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -2% +bindl = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle + +# Utility commands +bind = $mod, x, submap, utility +submap = utility +bind = , q, exit, +binde = , h, resizeactive, -50 0 +binde = , j, resizeactive, 0 50 +binde = , k, resizeactive, 0 -50 +binde = , l, resizeactive, 50 0 +bind = , escape, submap, reset +submap = reset + +# Power commands +bind = $mod, p, submap, [r]eboot | [s]hutdown +submap = [r]eboot | [s]hutdown +bind = , s, exec, shutdown now +bind = , r, exec, reboot +bind = , escape, submap, reset +submap = reset + +# Master and stack +bind = $mod, j, layoutmsg, cyclenext +bind = $mod, k, layoutmsg, cycleprev +bind = $mod SHIFT, j, layoutmsg, swapnext +bind = $mod SHIFT, k, layoutmsg, swapprev +bind = $mod, h, focuscurrentorlast +bind = $mod, m, layoutmsg, focusmaster +bind = $mod SHIFT, m, layoutmsg, swapwithmaster +bind = $mod, tab, layoutmsg, orientationcycle +bind = $mod, period, layoutmsg, addmaster +bind = $mod, comma, layoutmsg, removemaster + +# Switch workspaces +bind = $mod, 1, workspace, name:I +bind = $mod, 2, workspace, name:II +bind = $mod, 3, workspace, name:III +bind = $mod, 4, workspace, name:IV +bind = $mod, q, workspace, name:V +bind = $mod, w, workspace, name:VI +bind = $mod, e, workspace, name:VII +bind = $mod, r, workspace, name:VIII +bind = $mod, s, moveworkspacetomonitor,name:X current +bind = $mod, s, workspace, name:X + +# Move active window to a workspace +bind = $mod SHIFT, 1, movetoworkspacesilent, name:I +bind = $mod SHIFT, 2, movetoworkspacesilent, name:II +bind = $mod SHIFT, 3, movetoworkspacesilent, name:III +bind = $mod SHIFT, 4, movetoworkspacesilent, name:IV +bind = $mod SHIFT, q, movetoworkspacesilent, name:V +bind = $mod SHIFT, w, movetoworkspacesilent, name:VI +bind = $mod SHIFT, e, movetoworkspacesilent, name:VII +bind = $mod SHIFT, r, movetoworkspacesilent, name:VIII + +# Scroll through existing workspaces with mod + scroll +bind = $mod, mouse_down, workspace, e+1 +bind = $mod, mouse_up, workspace, e-1 + +# Move/resize windows with mod + LMB/RMB and dragging +bindm = $mod, mouse:272, movewindow +bindm = $mod, mouse:273, resizewindow + +# Open applications +bind = $mod, a, submap, launcher +submap = launcher +bind = , r, exec, $term --title launcher -e ~/bin/linux-app-launcher $e +bind = , escape, submap, reset +submap = reset + +bind = $mod, o, submap, open +submap = open +bind = , b, exec, chromium $e +bind = , o, exec, obsidian $e +bind = , s, exec, steam $e +bind = , d, exec, discord $e +bind = , m, exec, mpv $(wl-paste) $e +bind = , escape, submap, reset +submap = reset diff --git a/home/dot_config/hypr/start.conf b/home/dot_config/hypr/start.conf new file mode 100644 index 00000000..3306616a --- /dev/null +++ b/home/dot_config/hypr/start.conf @@ -0,0 +1,4 @@ +# autostart with hyprland +exec-once = waybar +exec = ~/.config/sway/scripts/idle.sh +exec = swaybg -i ~/media/pictures/wallpapers/random_wallpapers/sulphur-mountain.jpg diff --git a/home/dot_config/hypr/windows.conf b/home/dot_config/hypr/windows.conf new file mode 100644 index 00000000..36b5dcb9 --- /dev/null +++ b/home/dot_config/hypr/windows.conf @@ -0,0 +1 @@ + windowrulev2 = float, size 40% 40%, center, title:^(launcher)$ diff --git a/home/dot_config/hypr/workspaces.conf b/home/dot_config/hypr/workspaces.conf new file mode 100644 index 00000000..2691a961 --- /dev/null +++ b/home/dot_config/hypr/workspaces.conf @@ -0,0 +1,14 @@ +# Monitor definitions +$pri = HDMI-A-1 +$sec = DP-3 + +# Workspace settings +workspace = name:I, default:true, monitor:$pri +workspace = name:II, monitor:$pri +workspace = name:III, monitor:$pri +workspace = name:IV, monitor:$pri +workspace = name:V, default:true, monitor:$sec +workspace = name:VI, monitor:$sec +workspace = name:VII, monitor:$sec +workspace = name:VIII, monitor:$sec +workspace = name:X, default:true, on-created-empty:kitty diff --git a/home/dot_config/waybar/config b/home/dot_config/waybar/config deleted file mode 100644 index 88707f89..00000000 --- a/home/dot_config/waybar/config +++ /dev/null @@ -1,123 +0,0 @@ -// -*- mode: json -*- - -{ - "layer": "top", - "position": "bottom", - - "modules-left": [ - "sway/workspaces", - "custom/right-arrow-dark" - ], - "modules-center": [ - "custom/left-arrow-dark", - "clock#1", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "clock#2", - "custom/right-arrow-dark", - "custom/right-arrow-light", - "clock#3", - "custom/right-arrow-dark" - ], - "modules-right": [ - "custom/left-arrow-dark", - "pulseaudio", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "memory", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "cpu", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "battery", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "disk", - "custom/left-arrow-light", - "custom/left-arrow-dark", - "tray" - ], - - "custom/left-arrow-dark": { - "format": "", - "tooltip": false - }, - "custom/left-arrow-light": { - "format": "", - "tooltip": false - }, - "custom/right-arrow-dark": { - "format": "", - "tooltip": false - }, - "custom/right-arrow-light": { - "format": "", - "tooltip": false - }, - - "sway/workspaces": { - "disable-scroll": true, - "format": "{name}" - }, - - "clock#1": { - "format": "{:%a}", - "tooltip": false - }, - "clock#2": { - "format": "{:%H:%M}", - "tooltip": false - }, - "clock#3": { - "format": "{:%m-%d}", - "tooltip": false - }, - - "pulseaudio": { - "format": "{icon} {volume:2}%", - "format-bluetooth": "{icon} {volume}%", - "format-muted": "MUTE", - "format-icons": { - "headphones": "", - "default": [ - "", - "" - ] - }, - "scroll-step": 5, - "on-click": "pamixer -t", - "on-click-right": "pavucontrol" - }, - "memory": { - "interval": 5, - "format": "Mem {}%" - }, - "cpu": { - "interval": 5, - "format": "CPU {usage:2}%" - }, - "battery": { - "states": { - "good": 95, - "warning": 30, - "critical": 15 - }, - "format": "{icon} {capacity}%", - "format-icons": [ - "", - "", - "", - "", - "" - ] - }, - "disk": { - "interval": 5, - "format": "Disk {percentage_used:2}%", - "path": "/" - }, - "tray": { - "icon-size": 20 - } -} diff --git a/home/dot_config/waybar/config.tmpl b/home/dot_config/waybar/config.tmpl new file mode 100644 index 00000000..14a66f70 --- /dev/null +++ b/home/dot_config/waybar/config.tmpl @@ -0,0 +1,67 @@ +{ + "layer": "top", + + // Choose the order of the modules + "modules-left": ["hyprland/workspaces", "hyprland/submap", "hyprland/window"], + "modules-center": ["clock"], + "modules-right": ["tray", "custom/separator", "network", "custom/separator", "cpu", "custom/separator", "memory", "custom/separator", "pulseaudio", "custom/separator", "custom/disk"], + + "hyprland/workspaces": { + "format": "{icon}", + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1" + }, + "hyprland/window": { + "format": "{}", + "max-length": 50, + }, + "hyprland/submap": { + "format": " {}" + }, + "custom/disk": { + "format": " 󰉉 {}G ", + "interval": 30, + "exec": "df -h --output=avail / | awk 'NR==2 {sub(/.$/, \"\", $1); print $1}'", + }, + "cpu": { + "format": " {usage}%", + "tooltip": false + }, + "memory": { + "format": " {used:0.1f}G" + }, + "network": { + "format-wifi": "({signalStrength}%) ", + "format-ethernet": "{ifname}", + "tooltip-format": "{ifname} via {gwaddr}", + "format-linked": "{ifname} (No IP) ?", + "format-disconnected": "", + "on-click": "nm-connection-editor" + }, + "pulseaudio": { + "format": "{icon} {volume}% {format_source}", + "format-muted": "󰖁 {format_source}", + "format-bluetooth": "{icon}  {volume}% {format_source}", + "format-bluetooth-muted": "󰖁  {format_source}", + + "format-source": "  {volume}%", + "format-source-muted": "", + + "format-icons": { + "default": ["", "", ""] + }, + "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle", + }, + "clock": { + "interval": 1, + "format": " {:%Y-%m-%d  %H:%M:%S}" + }, + "tray": { + "spacing": 10 + }, + "custom/separator": { + "format": " | ", + "interval": "once", + "tooltip": false + }, +} diff --git a/home/dot_config/waybar/scripts/executable_idle.sh b/home/dot_config/waybar/scripts/executable_idle.sh new file mode 100644 index 00000000..2304734b --- /dev/null +++ b/home/dot_config/waybar/scripts/executable_idle.sh @@ -0,0 +1,3 @@ +swayidle -w \ + timeout 300 'hyprctl dispatch dpms off' \ + resume 'hyprctl dispatch dpms on' \ diff --git a/home/dot_config/waybar/style.css b/home/dot_config/waybar/style.css deleted file mode 100644 index 7454ecf8..00000000 --- a/home/dot_config/waybar/style.css +++ /dev/null @@ -1,74 +0,0 @@ -* { - font-size: 20px; - font-family: monospace; -} - -window#waybar { - background: #292b2e; - color: #fdf6e3; -} - -#custom-right-arrow-dark, -#custom-left-arrow-dark { - color: #1a1a1a; -} -#custom-right-arrow-light, -#custom-left-arrow-light { - color: #292b2e; - background: #1a1a1a; -} - -#workspaces, -#clock.1, -#clock.2, -#clock.3, -#pulseaudio, -#memory, -#cpu, -#battery, -#disk, -#tray { - background: #1a1a1a; -} - -#workspaces button { - padding: 0 2px; - color: #fdf6e3; -} -#workspaces button.focused { - color: #268bd2; -} -#workspaces button:hover { - box-shadow: inherit; - text-shadow: inherit; -} -#workspaces button:hover { - background: #1a1a1a; - border: #1a1a1a; - padding: 0 3px; -} - -#pulseaudio { - color: #268bd2; -} -#memory { - color: #2aa198; -} -#cpu { - color: #6c71c4; -} -#battery { - color: #859900; -} -#disk { - color: #b58900; -} - -#clock, -#pulseaudio, -#memory, -#cpu, -#battery, -#disk { - padding: 0 10px; -} diff --git a/home/dot_config/waybar/style.css.tmpl b/home/dot_config/waybar/style.css.tmpl new file mode 100644 index 00000000..1373b2a6 --- /dev/null +++ b/home/dot_config/waybar/style.css.tmpl @@ -0,0 +1,134 @@ +/* Colors */ +@define-color bg {{ .themes.gruvbox.bg0 }}; +@define-color bg2 {{ .themes.gruvbox.bg1 }}; +@define-color bg3 {{ .themes.gruvbox.bg2 }}; +@define-color fg {{ .themes.gruvbox.fg }}; +@define-color red {{ .themes.gruvbox.red }}; +@define-color green {{ .themes.gruvbox.green }}; +@define-color yellow {{ .themes.gruvbox.yellow }}; +@define-color blue0 {{ .themes.gruvbox.blue0 }}; +@define-color blue1 {{ .themes.gruvbox.blue1 }}; +@define-color purple0 {{ .themes.gruvbox.purple0 }}; +@define-color purple1 {{ .themes.gruvbox.purple1 }}; +@define-color cyan {{ .themes.gruvbox.cyan }}; + +* { + font-family: JetBrains Mono, Symbols Nerd Font Mono; + font-size: 12px; + border-radius: 0; + border: none; +} +tooltip { + background: @bg; +} + +window#waybar { + /* background-color: rgba(16, 20, 25,0.5); */ + background-color: @bg; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +#workspaces button { + min-width: 20px; + color: @fg; + padding: 0 5px; +} + +#workspaces button.visible { + background-color: @purple1; +} + +#workspaces button.active { + background-color: @purple0; +} + +#workspaces button.urgent { + background-color: @red; +} + +#submap { + background-color: @blue1; + padding: 0 5px; +} + +#battery, +#cpu, +#memory, +#network, +#pulseaudio, +#pulseaudio#mic, +#custom-swayidle, +#mode { + padding: 0 6px; +} + +#window { + color: @yellow; + padding: 0 10px; +} + + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#clock { + color: @fg; + padding: 0 10px; + border-radius: 0px; +} + +#cpu { + color: @fg; +} + +#custom-disk { + color: @fg; +} + +#memory { + color: @fg; +} + +#network { + color: @fg; +} + +#network.disconnected { + color: @red; +} + +#pulseaudio { + color: @fg; +} + +#pulseaudio.mic { + color: @fg; +} + +#custom-swayidle { + color: @fg; +} + +#tray { + padding: 0 6px; +} + + +#scratchpad { + color: @fg; + padding: 0 10px; +} + +#scratchpad.empty { + background-color: transparent; +} + diff --git a/provision/modules/desktop/sway.nix b/provision/modules/desktop/sway.nix index 22bfe0af..d9a666d3 100644 --- a/provision/modules/desktop/sway.nix +++ b/provision/modules/desktop/sway.nix @@ -59,6 +59,12 @@ in { p7zip pavucontrol borgbackup + waybar + (pkgs.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }) + ) + ] ++ [ ]; @@ -103,5 +109,9 @@ in { enable = true; wrapperFeatures.gtk = true; }; + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; }; } diff --git a/provision/modules/gaming/steam.nix b/provision/modules/gaming/steam.nix index d6f1460a..627202fb 100644 --- a/provision/modules/gaming/steam.nix +++ b/provision/modules/gaming/steam.nix @@ -22,6 +22,8 @@ in { mgba sunshine moonlight-qt + prismlauncher + jdk17 ]; };