From 8ae3f9a44fce41360d611e8911e98378d4bb8738 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 29 Jan 2025 14:55:38 -0300 Subject: [PATCH] recover and update hyprland config --- .dotter/global.toml | 11 ++ .dotter/work-laptop.toml | 2 +- config/hypr/executable_gdm-wrapper.sh | 39 +++++ config/hypr/hyprland.conf | 197 ++++++++++++++++++++++++++ config/hypr/hyprpaper.conf | 4 + 5 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 config/hypr/executable_gdm-wrapper.sh create mode 100644 config/hypr/hyprland.conf create mode 100644 config/hypr/hyprpaper.conf diff --git a/.dotter/global.toml b/.dotter/global.toml index 86800d3..16cade7 100644 --- a/.dotter/global.toml +++ b/.dotter/global.toml @@ -71,3 +71,14 @@ cargo.packages = [] [mise.files] "config/mise" = "~/.config/mise" + +[wm.files] +"config/mako" = "~/.config/mako" +"config/swappy" = "~/.config/swappy" +"config/waybar" = "~/.config/waybar/" + +[hyprland] +depends = ["wm"] + +[hyprland.files] +"config/hypr" = "~/.config/hypr" diff --git a/.dotter/work-laptop.toml b/.dotter/work-laptop.toml index d990e6b..200612e 100644 --- a/.dotter/work-laptop.toml +++ b/.dotter/work-laptop.toml @@ -1,5 +1,5 @@ includes = [".dotter/machines/fedora.toml"] -packages = ["cli", "dev", "mise"] +packages = ["cli", "dev", "mise", "hyprland"] [files] diff --git a/config/hypr/executable_gdm-wrapper.sh b/config/hypr/executable_gdm-wrapper.sh new file mode 100644 index 0000000..3b0982d --- /dev/null +++ b/config/hypr/executable_gdm-wrapper.sh @@ -0,0 +1,39 @@ +#!/usr/bin/sh + +if [ "x$XDG_SESSION_TYPE" = "xwayland" ] && + [ "x$XDG_SESSION_CLASS" != "xgreeter" ] && + [ -n "$SHELL" ] && + grep -q "$SHELL" /etc/shells && + ! (echo "$SHELL" | grep -q "false") && + ! (echo "$SHELL" | grep -q "nologin"); then + if [ "$1" != '-l' ]; then + exec bash -c "exec -l '$SHELL' -c '$0 -l $*'" + else + shift + fi +fi + +SETTING=$(G_MESSAGES_DEBUG='' gsettings get org.gnome.system.locale region) +REGION=${SETTING#\'} +REGION=${REGION%\'} + +if [ -n "$REGION" ]; then + unset LC_TIME LC_NUMERIC LC_MONETARY LC_MEASUREMENT LC_PAPER + + if [ "$LANG" != "$REGION" ]; then + # LC_CTYPE + export LC_NUMERIC=$REGION + export LC_TIME=$REGION + # LC_COLLATE + export LC_MONETARY=$REGION + # LC_MESSAGES + export LC_PAPER=$REGION + # LC_NAME + export LC_ADDRESS=$REGION + export LC_TELEPHONE=$REGION + export LC_MEASUREMENT=$REGION + # LC_IDENTIFICATION + fi +fi + +exec Hyprland diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf new file mode 100644 index 0000000..d18fc15 --- /dev/null +++ b/config/hypr/hyprland.conf @@ -0,0 +1,197 @@ + +# ╭────────────────────────────────────────────────────────────────────╮ +# _ _ _ _ +# | | | |_ _ _ __ _ __| | __ _ _ __ __| | +# | |_| | | | | '_ \| '__| |/ _` | '_ \ / _` | +# | _ | |_| | |_) | | | | (_| | | | | (_| | +# |_| |_|\__, | .__/|_| |_|\__,_|_| |_|\__,_| +# |___/|_| +# +# ╰────────────────────────────────────────────────────────────────────╯ + + +# ╭──────────────────────────────────────────────────────────╮ +# │ Autostart apps │ +# ╰──────────────────────────────────────────────────────────╯ + +# Execute your favorite apps at launch +exec-once = waybar & hyprpaper & mako + +# ╭──────────────────────────────────────────────────────────╮ +# │ Config │ +# ╰──────────────────────────────────────────────────────────╯ + +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# ── Monitors ────────────────────────────────────────────────────────── +monitor = , preferred, auto, 1 +monitor = WAYLAND-1, disable # hack for when running manually + +# Some default env vars. +env = XCURSOR_SIZE,24 + +# ── Input devides ───────────────────────────────────────────────────── +input { + kb_layout = latam + kb_variant = + kb_model = + kb_options = caps:escape + kb_rules = + + follow_mouse = 3 + + touchpad { + natural_scroll = true + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +# ── General config ──────────────────────────────────────────────────── +general { + gaps_in = 5 + gaps_out = 10 + border_size = 2 + + # snap { + # enabled = true + # } + + layout = master +} + +decoration { + rounding = 2 + drop_shadow = true + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) +} + +animations { + enabled = true + + animation = windows, 1, 5, default, slide + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 7, default + animation = workspaces, 1, 6, default + animation = specialWorkspace, 1, 8, default, fade +} + +gestures { + workspace_swipe = true + workspace_swipe_invert = false +} + +# ── Layouts ─────────────────────────────────────────────────────────── +master { + new_status = slave + mfact = 0.5 + # slave_count_for_center_master = 4 +} + +# ╭──────────────────────────────────────────────────────────╮ +# │ Windows rules │ +# ╰──────────────────────────────────────────────────────────╯ + + +# ╭──────────────────────────────────────────────────────────╮ +# │ Keybindings │ +# ╰──────────────────────────────────────────────────────────╯ + +$mainMod = SUPER + +$menu = bemenu-run -iw -l 20 -P '>' -p 'Open:' --fn 'JetBrainsMono 13' --ab '##24273add' --af '##f4dbd6' --fb '##24273add' --ff '##8bd5ca' --hb '##24273add' --hf '##a6da95' --nb '##24273add' --nf '##f4dbd6' --nf '##f4dbd6' --tb '##24273add' --tf '##c6a0f6dd' --scb '##24273add' --scf '##c6a0f6' + +# ── Spawn ───────────────────────────────────────────────────────────── +bind = $mainMod SHIFT, E, exit, +bind = $mainMod, return, exec, kitty +bind = $mainMod SHIFT, q, killactive, +bind = $mainMod, D, exec, $menu + +# screenshot current window +bind = $mainMod, Print, exec, grim -g "$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')" - | wl-copy +# screenshot area +bind = $mainMod SHIFT, Print, exec, grim -g "$(slurp -d)" - | wl-copy +# screenshot area and edit it +bind = $mainMod CTRL, Print, exec, grim -g "$(slurp -d)" - | swappy -f - + +bind = $mainMod, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+ +bind = $mainMod, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%- +bind = $mainMod, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bind = $mainMod, XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle +bind = $mainMod, XF86AudioPlay, exec, playerctl play-pause +bind = $mainMod, XF86AudioNext, exec, playerctl next +bind = $mainMod, XF86AudioPrev, exec, playerctl previous +bind = $mainMod, XF86MonBrightnessUp, exec, brightnessctl set +5% +bind = $mainMod, XF86MonBrightnessDown, exec, brightnessctl set 5%- + +# ── Window Options ──────────────────────────────────────────────────── +bind = $mainMod SHIFT, space, togglefloating, +bind = $mainMod, f, fullscreen, 1 # preserve gaps and bar +bind = $mainMod SHIFT, f, fullscreen, 0 # use whole screen + +# ── Focus ───────────────────────────────────────────────────────────── +bind = $mainMod, h, movefocus, l +bind = $mainMod, j, movefocus, d +bind = $mainMod, k, movefocus, u +bind = $mainMod, l, movefocus, r + +bind = $mainMod + SHIFT, h, movewindow, l +bind = $mainMod + SHIFT, j, movewindow, d +bind = $mainMod + SHIFT, k, movewindow, u +bind = $mainMod + SHIFT, l, movewindow, r + +bind = $mainMod, bar, workspace, previous +bind = $mainMod CTRL, bar, focusmonitor, +1 +bind = $mainMod, space, focusurgentorlast +bind = $mainMod, tab, cyclenext, visible +bind = $mainMod SHIFT, tab, cyclenext, visible prev + +# ── Layout ────────────────────────────────────────────────────────────── + +bind = $mainMod, plus, layoutmsg, mfact +0.1 +bind = $mainMod, minus, layoutmsg, mfact -0.1 +bind = $mainMod CTRL, 0, layoutmsg, mfact exact 0.5 +bind = $mainMod, n, layoutmsg, addmaster +bind = $mainMod SHIFT, n, layoutmsg, removemaster +bind = $mainMod, m, layoutmsg, rollprev +bind = $mainMod SHIFT, m, layoutmsg, rollnext +bind = $mainMod, s, layoutmsg, orientationcycle + + +# ── Workspaces ──────────────────────────────────────────────────────── +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 + +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 + +bind = $mainMod, 0, togglespecialworkspace, scratchpad +bind = $mainMod SHIFT, 0, movetoworkspace, special:scratchpad + +# ── Mouse ───────────────────────────────────────────────────────────── +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow + diff --git a/config/hypr/hyprpaper.conf b/config/hypr/hyprpaper.conf new file mode 100644 index 0000000..e71274d --- /dev/null +++ b/config/hypr/hyprpaper.conf @@ -0,0 +1,4 @@ +preload = ~/Pictures/wallpaper.jpg + +#set the default wallpaper(s) seen on inital workspace(s) --depending on the number of monitors used +wallpaper = ,~/Pictures/wallpaper.jpg