Add Hyprland config

This commit is contained in:
2024-06-27 15:59:51 +02:00
commit 138d46b2aa
13 changed files with 922 additions and 0 deletions

View File

@ -0,0 +1,163 @@
live_config_reload = true
working_directory = "None"
[env]
TERM = "xterm-256color"
WINIT_X11_SCALE_FACTOR = "1"
[window]
dynamic_padding = true
decorations = "full"
title = "Alacritty"
opacity = 1
decorations_theme_variant = "Dark"
[window.dimensions]
columns = 100
lines = 30
[window.class]
instance = "Alacritty"
general = "Alacritty"
[scrolling]
history = 10000
multiplier = 3
[colors]
draw_bold_text_with_bright_colors = true
[colors.primary]
background = "0x20242c"
foreground = "0xD8DEE9"
[colors.normal]
black = "0x3B4252"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x88C0D0"
white = "0xE5E9F0"
[colors.bright]
black = "0x4C566A"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x8FBCBB"
white = "0xECEFF4"
[font]
size = 12
[font.normal]
family = "monospace"
style = "Regular"
[font.bold]
family = "monospace"
style = "Bold"
[font.italic]
family = "monospace"
style = "Italic"
[font.bold_italic]
family = "monospace"
style = "Bold Italic"
[selection]
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
save_to_clipboard = true
[cursor]
style = "Underline"
vi_mode_style = "None"
unfocused_hollow = true
thickness = 0.15
[mouse]
hide_when_typing = true
[[mouse.bindings]]
mouse = "Middle"
action = "PasteSelection"
[keyboard]
[[keyboard.bindings]]
key = "Paste"
action = "Paste"
[[keyboard.bindings]]
key = "Copy"
action = "Copy"
[[keyboard.bindings]]
key = "L"
mods = "Control"
action = "ClearLogNotice"
[[keyboard.bindings]]
key = "L"
mods = "Control"
mode = "~Vi"
chars = "\f"
[[keyboard.bindings]]
key = "PageUp"
mods = "Shift"
mode = "~Alt"
action = "ScrollPageUp"
[[keyboard.bindings]]
key = "PageDown"
mods = "Shift"
mode = "~Alt"
action = "ScrollPageDown"
[[keyboard.bindings]]
key = "Home"
mods = "Shift"
mode = "~Alt"
action = "ScrollToTop"
[[keyboard.bindings]]
key = "End"
mods = "Shift"
mode = "~Alt"
action = "ScrollToBottom"
[[keyboard.bindings]]
key = "V"
mods = "Control|Shift"
action = "Paste"
[[keyboard.bindings]]
key = "C"
mods = "Control|Shift"
action = "Copy"
[[keyboard.bindings]]
key = "F"
mods = "Control|Shift"
action = "SearchForward"
[[keyboard.bindings]]
key = "B"
mods = "Control|Shift"
action = "SearchBackward"
[[keyboard.bindings]]
key = "C"
mods = "Control|Shift"
mode = "Vi"
action = "ClearSelection"
[[keyboard.bindings]]
key = "Key0"
mods = "Control"
action = "ResetFontSize"

View File

@ -0,0 +1,27 @@
general {
lock_cmd = lockscreen
before_sleep_cmd = lockscreen
after_sleep_cmd = hyprctl dispatch dpms on
}
listener {
timeout = 120
on-timeout = brightnessctl -s set 10
on-resume = brightnessctl -r
}
listener {
timeout = 300
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
listener {
timeout = 330
on-timeout = lockscreen
}
listener {
timeout = 600
on-timeout = systemctl suspend
}

273
.config/hypr/hyprland.conf Normal file
View File

@ -0,0 +1,273 @@
#----------
# Monitors
#----------
monitor = ,preferred,auto,auto
source = ~/.config/hypr/monitors.conf
#------------
# auto start
#------------
# Slow app launch fix
exec-once = systemctl --user import-environment &
exec-once = hash dbus-update-activation-environment 2>/dev/null &
exec-once = dbus-update-activation-environment --systemd &
# Wallpaper
# exec-once = swaybg -o \* -i /mnt/shared/media/wallpaper/mountains.png -m fill
exec-once = hyprpaper
exec-once = hypridle &
exec-once = waybar -c .config/waybar/config-hypr &
exec-once = fcitx5 -d &
exec-once = mako &
exec-once = bash -c "mkfifo /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob && tail -f /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob | wob & disown" &
exec-once = /usr/lib/polkit-kde-authentication-agent-1 &
# exec-once = xdg-desktop-portal-hyprland &
#------------------------
# General configurations
#------------------------
input {
kb_layout = it
kb_variant =
kb_model =
#kb_options = grp:caps_toggle,grp_led:caps,altwin:swap_alt_win,ctrl:rctrl_ralt
kb_options =
kb_rules =
follow_mouse = 1
float_switch_override_focus = 2
touchpad {
natural_scroll = yes
}
sensitivity = 0 # [-1.0 - 1.0]
accel_profile = flat
}
general {
gaps_in = 3
gaps_out = 5
border_size = 3
col.active_border = rgb(26a269)
col.inactive_border = rgb(595959)
layout = dwindle # master|dwindle
apply_sens_to_raw = 0
}
decoration {
active_opacity = 1.0
inactive_opacity = 0.95
fullscreen_opacity = 1.0
rounding = 4
}
animations {
enabled = yes
bezier = overshot, 0.13, 0.99, 0.29, 1.1
animation = windows, 1, 4, overshot, slide
animation = windowsOut, 1, 5, default, popin 80%
animation = border, 1, 5, default
animation = fade, 1, 8, default
animation = workspaces, 1, 6, overshot, slide
}
dwindle {
no_gaps_when_only = false
force_split = 0
special_scale_factor = 0.8
split_width_multiplier = 1.0
use_active_for_splits = true
pseudotile = yes
preserve_split = yes
}
misc {
disable_autoreload = true
disable_hyprland_logo = true
always_follow_on_dnd = true
layers_hog_keyboard_focus = true
animate_manual_resizes = false
enable_swallow = true
swallow_regex =
focus_on_activate = true
vfr = 1
}
gestures {
workspace_swipe = true
workspace_swipe_fingers = 4
workspace_swipe_distance = 250
workspace_swipe_invert = true
workspace_swipe_min_speed_to_force = 15
workspace_swipe_cancel_ratio = 0.5
workspace_swipe_create_new = false
}
# device {
# name = epic-mouse-v1
# sensitivity = -0.5
# }
#----------
# Bindings
#----------
$mainMod = SUPER
# Terminal
bind = $mainMod, RETURN, exec, alacritty
bind = $mainMod, T, exec, alacritty
bind = CTRL ALT, T, exec, alacritty
# Screenshot
bind = , PRINT, exec, grim -g "$(slurp)" - | swappy -f -
# Kill
bind = $mainMod, Q, killactive,
# Floating and fullscreen
bind = $mainMod, F, togglefloating,
bind = $mainMod, P, pin
bind = $mainMod, S, fullscreen
# Wofi
bind = $mainMod, SPACE, exec, wofi
# Volume control
binde = , XF86AudioLowerVolume,exec, pamixer -ud 2 && pamixer --get-volume > /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob
binde = , XF86AudioRaiseVolume,exec, pamixer -ui 2 && pamixer --get-volume > /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob
binde = , XF86AudioMute,exec, amixer sset Master toggle | sed -En '/\[on\]/ s/.*\[([0-9]+)%\].*/\1/ p; /\[off\]/ s/.*/0/p' | head -1 > /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob
# Playback control
bind = , XF86AudioPlay, exec, playerctl play-pause
bind = , XF86AudioNext, exec, playerctl next
bind = , XF86AudioPrev, exec, playerctl previous
# Screen brightness
binde = , XF86MonBrightnessUp, exec, brightnessctl s +5% | brightnessctl -m | awk -F, '{print $4}' | tr -d % > /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob
binde = , XF86MonBrightnessDown, exec, brightnessctl s 5%- | brightnessctl -m | awk -F, '{print $4}' | tr -d % > /tmp/$HYPRLAND_INSTANCE_SIGNATURE.wob
# Lock screen
bind = , XF86PowerOff, exec, lockscreen
# Reload
bind = $mainMod CTRL SHIFT ALT, R, exec, killall -SIGUSR2 waybar && hyprctl reload && notify-send "Waybar and Hyprland reloaded"
# Move focus
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Window movement
bind = $mainMod SHIFT,left, movewindow, l
bind = $mainMod SHIFT,right, movewindow, r
bind = $mainMod SHIFT,up, movewindow, u
bind = $mainMod SHIFT,down, movewindow, d
bind = $mainMod ALT, left, swapwindow, l
bind = $mainMod ALT, right, swapwindow, r
bind = $mainMod ALT, up, swapwindow, u
bind = $mainMod ALT, down, swapwindow, d
bind = $mainMod, D, togglesplit
# Window resize
binde = $mainMod CTRL SHIFT, left, resizeactive,-15 0
binde = $mainMod CTRL SHIFT, right, resizeactive,15 0
binde = $mainMod CTRL SHIFT, up, resizeactive,0 -15
binde = $mainMod CTRL SHIFT, down, resizeactive,0 15
# Windows mouse interaction
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Switch 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, 0, workspace, 10
bind = CTRL ALT, right, workspace, e+1
bind = CTRL ALT, left, workspace, e-1
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Window workspace movement
bind = $mainMod CTRL, 1, movetoworkspace, 1
bind = $mainMod CTRL, 2, movetoworkspace, 2
bind = $mainMod CTRL, 3, movetoworkspace, 3
bind = $mainMod CTRL, 4, movetoworkspace, 4
bind = $mainMod CTRL, 5, movetoworkspace, 5
bind = $mainMod CTRL, 6, movetoworkspace, 6
bind = $mainMod CTRL, 7, movetoworkspace, 7
bind = $mainMod CTRL, 8, movetoworkspace, 8
bind = $mainMod CTRL, 9, movetoworkspace, 9
bind = $mainMod CTRL, 0, movetoworkspace, 10
bind = $mainMod CTRL, left, movetoworkspace, -1
bind = $mainMod CTRL, right, movetoworkspace, +1
# binds {
# workspace_back_and_forth = 1
# allow_workspace_cycles = 1
# }
#---------------
# windows rules
#---------------
windowrule = float, Rofi
windowrule = float, pavucontrol
windowrulev2 = float,class:^()$,title:^(Picture in picture)$
windowrulev2 = float,class:^(blueman-manager)$
windowrulev2 = float,class:^(xdg-desktop-portal-gtk)$
windowrulev2 = float,class:^(xdg-desktop-portal-kde)$
windowrulev2 = float,class:^(xdg-desktop-portal-hyprland)$
windowrulev2 = float,class:^(org.kde.polkit-kde-authentication-agent-1)$
windowrulev2 = float,class:^(CachyOSHello)$
windowrulev2 = float,class:^(zenity)$
windowrulev2 = float,class:^()$,title:^(Steam - Self Updater)$
windowrule = float,title:^(Picture-in-Picture)$
windowrule = size 960 540,title:^(Picture-in-Picture)$
windowrule = move 25%-,title:^(Picture-in-Picture)$
windowrule = float,nemo
windowrule = move 25%-,nemo
windowrule = size 960 540,nemo
windowrule = animation slide right,alacritty

View File

@ -0,0 +1,53 @@
background {
monitor =
path = /mnt/shared/media/wallpaper/mountains.png
blur_passes = 2
}
general {
no_fade_in = false
grace = 0
disable_loading_bar = true
}
input-field {
monitor =
size = 350, 50
outline_thickness = 2
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgba(0, 0, 0, 0.5)
font_color = rgb(200, 200, 200)
fade_on_empty = false
font_family = Monospace
placeholder_text = <span foreground="##cdd6f4">Input Password...</span>
fail_text = <span>Failed ($ATTEMPTS)</span>
hide_input = false
position = 0, -120
halign = center
valign = center
}
label {
monitor =
text = cmd[update:1000] echo "$(date +"%H:%M")"
color = $foreground
font_size = 100
font_family = Monospace
position = 0, -700
halign = center
valign = top
}
label {
monitor =
text = cmd[update:1000] echo "$(date +"%d/%m/%Y")"
color = $foreground
font_size = 32
font_family = Monospace
position = 0, -880
halign = center
valign = top
}

View File

@ -0,0 +1,2 @@
preload = /mnt/shared/media/wallpaper/mountains.png
wallpaper = , /mnt/shared/media/wallpaper/mountains.png

View File

@ -0,0 +1,4 @@
# Generated by nwg-displays on 2024-06-27 at 11:04:46. Do not edit manually.
monitor=eDP-1,3072x1920@60.0,3456x120,2.0
monitor=DP-1,1920x1080@60.0,1536x0,1.0

View File

188
.config/waybar/config-hypr Normal file
View File

@ -0,0 +1,188 @@
{
"layer": "top",
"position": "top",
"margin-left": 3,
"margin-bottom": 0,
"margin-right": 3,
"spacing": 1,
"modules-left": [
"hyprland/workspaces",
"custom/screenshot_t",
"idle_inhibitor"
],
"modules-right": [
"cpu",
"memory",
"network",
"bluetooth",
"pulseaudio",
"battery",
"clock",
// "custom/power",
"tray"
],
// -------------------------------------------------------------------------
// Modules
// -------------------------------------------------------------------------
"custom/screenshot_t": {
"format":" ",
"on-click": "~/.config/waybar/scripts/screenshot_full",
"on-click-right":"~/.config/waybar/scripts/screenshot_area"
},
"cpu": {
"interval": 3,
"format": "<span rise='1000'></span> {usage}%",
"max-length": 7,
"min-length": 7
},
"memory": {
"interval": 3,
"format": "<span rise='1000'></span> {used:0.2f}GB",
"max-length": 12,
"min-length": 12
},
"battery": {
"interval": 5,
"states": {
"good": 95,
"warning": 30,
"critical": 15
},
"format": "<span rise='1000'>{icon}</span> {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-icons": [
"",
"",
"",
"",
""
]
},
"network": {
"format-wifi": " {signalStrength}% <span rise='1000'>|</span> <span rise='1000'></span> {bandwidthUpBytes} <span rise='1000'></span> {bandwidthDownBytes}",
"format-ethernet": "{ifname} <span rise='1000'>|</span> <span rise='1000'></span> {bandwidthUpBytes} <span rise='1000'></span> {bandwidthDownBytes}",
"format-linked": "{ifname} No IP",
"format": "",
"format-disconnected": "¯\\_(ツ)_/¯",
"on-click": "alacritty -e 'nmtui'",
"tooltip-format": "{ifname}\n{ipaddr}/{cidr}",
"tooltip-format-wifi": "{essid} {frequency}MHz\nStrength: {signaldBm}dBm ({signalStrength}%)\nIP: {ipaddr}/{cidr}",
"interval": 3,
"min-length": 32
},
"bluetooth": {
"format-disabled": "<span rise='1200'></span> off",
"format-off": "<span rise='1200'></span> off",
"format-on": "<span rise='1200'></span> on",
"interval": 3,
"on-click": "blueman-manager"
},
"idle_inhibitor": {
"format": "{icon} ",
"format-icons": {
"activated": "",
"deactivated": ""
},
"tooltip": "true"
},
"custom/power": {
"format": "",
"tooltip": false,
"on-click": "wlogout"
},
"clock": {
"format": "<span rise='1500'> </span> {:%e %b %Y <span rise='1000'>|</span> <span rise='800'></span> %H:%M}"
},
"hyprland/workspaces": {
"all-outputs": true,
"format": "{name}",
"format-icons": {
"1": "一",
"2": "二",
"3": "三",
"4": "四",
"5": "五",
"6": "六",
"7": "七",
"8": "八",
"9": "九",
"10": "十"
},
"on-scroll-up": "hyprctl dispatch workspace e+1 1>/dev/null",
"on-scroll-down": "hyprctl dispatch workspace e-1 1>/dev/null",
"sort-by-number": true,
"active-only": false
},
"hyprland/window": {
"max-length": 100,
"separate-outputs": true
},
"pulseaudio": {
"scroll-step": 3, // %, can be a float
"format": "<span rise='1000'>{icon}</span> {volume}% <span rise='1000'>|</span> <span rise='1000'>{format_source}</span>",
"format-bluetooth": "{volume}% {icon} <span rise='1000'>|</span> <span rise='1000'>{format_source}</span>",
"format-bluetooth-muted": " {icon} <span rise='1000'>|</span> <span rise='1000'>{format_source}</span>",
"format-muted": "<span rise='1000'></span> <span rise='1000'>|</span> <span rise='1000'>{format_source}</span>",
//"format-source": "{volume}% ",
//"format-source-muted": "",
"format-source": "",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol",
"on-click-right": "amixer sset Master toggle"
},
"wireplumber": {
"on-click": "pavucontrol",
"on-click-right": "amixer sset Master toggle 1>/dev/null",
//on-click: "${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
//on-scroll-down: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04+";
//on-scroll-up: "${wpctl} set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 0.04-";
"format": "<span foreground='#fab387'>{icon}</span> {volume}%",
"format-muted": " ",
"format-source": "",
"format-source-muted": "",
//"format-muted": "<span foreground='#fab387'> </span>",
//"format-icons": [ "<span foreground='#fab387'></span>" ]
"format-icons": {
"headphone": " ",
"hands-free": " ",
"headset": " ",
"phone": " ",
"portable": " ",
"car": " ",
"default": [" ", " ", " "]
}
},
"tray": {
"icon-size": 15,
"spacing": 5
}
}

View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
grim -g "$(slurp)" - | wl-copy -t image/png
notify-send "Screenshot copied to clipboard"

View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
grimblast copy area || exit
notify-send "Screenshot copied to clipboard"

View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
grimblast copy output || exit
notify-send "Screenshot copied to clipboard"

193
.config/waybar/style.css Normal file
View File

@ -0,0 +1,193 @@
* {
font-family: "Mono";
font-size: 9pt;
font-weight: 600;
padding: 0;
transition-property: background-color;
transition-duration: 0.5s;
border: none;
border-radius: 3px;
min-height: 0;
margin: 0.2em 0.2em 0.2em 0.2em;
}
/* The whole bar */
#waybar {
/*background: @bg;*/
background-color: transparent;
/*color: @light;*/
color: #ffffff;
transition-property: background-color;
transition-duration: 0.5s;
/*border-top: 8px transparent;*/
border-radius: 0px;
margin: 0px 0px;
}
window#waybar.hidden {
opacity: 0.2;
}
#workspaces button {
padding: 0 0px;
color: #7984a4;
background-color: transparent;
box-shadow: inset 0 -3px transparent;
border: none;
border-radius: 0;
}
#workspaces button.focused {
background-color: transparent;
}
#workspace button.hover {
background-color: transparent;
}
#workspaces button.active {
color: #fff;
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
#window {
color: #64727d;
}
/* Each module */
#clock,
#battery,
#cpu,
#memory,
#disk,
#network,
#pulseaudio,
#wireplumber,
#custom-screenshot_t,
#tray,
#mode,
#idle_inhibitor,
#bluetooth,
#custom-hyprPicker,
#custom-power-menu,
#custom-power {
padding: 0px 15px;
color: #e5e5e5;
/* color: #bf616a; */
border-radius: 20px;
background-color: #1e1e1e;
}
#window,
#workspaces {
border-radius: 20px;
padding: 0px 10px;
background-color: #1e1e1e;
}
#cpu {
color: #fb958b;
background-color: #1e1e1e;
}
#memory {
color: #ebcb8b;
background-color: #1e1e1e;
}
#custom-power-menu {
border-radius: 9.5px;
background-color: #1b242b;
border-radius: 7.5px;
padding: 0 0px;
}
#custom-launcher {
background-color: #1b242b;
color: #6a92d7;
border-radius: 7.5px;
padding: 0 0px;
}
/* If workspaces is the leftmost module, omit left margin */
.modules-left > widget:first-child > #workspaces {
margin-left: 0;
}
/* If workspaces is the rightmost module, omit right margin */
.modules-right > widget:last-child > #workspaces {
margin-right: 0;
}
#pulseaudio {
color: #7d9bba;
}
#clock {
color: #c8d2e0;
}
#battery {
color: #c0caf5;
}
#battery.charging,
#battery.full,
#battery.plugged {
color: #26a65b;
}
@keyframes blink {
to {
background-color: rgba(30, 34, 42, 0.5);
color: #abb2bf;
}
}
#battery.critical:not(.charging) {
color: #f53c3c;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#bluetooth {
color: #707d9d;
}
/* #bluetooth.disconnected {
color: #f53c3c;
} */
#network {
color: #b48ead;
}
/* #network.disconnected {
color: #f53c3c;
} */
#tray > .passive {
-gtk-icon-effect: dim;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
background-color: #eb4d4b;
}
/* #idle_inhibitor {
background-color: #2d3436;
} */
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}

10
.config/waybar/waybar.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
# Terminate already running bar instances
killall -q waybar
# Wait until the processes have been shut down
while pgrep -x waybar >/dev/null; do sleep 1; done
# Launch main
waybar