feat: Add a ton of hyprland config

This commit is contained in:
2025-04-04 14:47:56 +11:00
parent 958770c548
commit 1cf3d139a5
14 changed files with 417 additions and 100 deletions

BIN
.config/hypr/fireplace.mp4 Normal file

Binary file not shown.

View File

@@ -1,14 +1,34 @@
general {
lock_cmd = notify-send "lock!" # dbus/sysd lock command (loginctl lock-session)
unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = notify-send "Zzz" # command ran before sleep
after_sleep_cmd = notify-send "Awake!" # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
ignore_systemd_inhibit = false # whether to ignore systemd-inhibit --what=idle inhibitors
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 500 # in seconds
on-timeout = notify-send "You are idle!" # command to run when timeout has passed
on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
# listener {
# timeout = 150 # 2.5min.
# on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
# on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
# }
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

View File

@@ -25,7 +25,10 @@ env = HYPRSHOT_DIR,/home/$USER/Pictures/Screenshots
# Set programs that you use
$terminal = alacritty
$fileManager = dolphin
$menu = rofi -show drun
# $menu = rofi -show drun calc -modi calc -terse
$menu = pgrep -x tofi-drun && pkill -x tofi-drun || tofi-drun --drun-launch=true > ~/.logs/tofi-drun.log 2>&1 &
# wofi --show drun
# Some default env vars.
@@ -53,7 +56,7 @@ input {
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_in = 3
gaps_out = 0
border_size = 0
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
@@ -74,12 +77,8 @@ decoration {
enabled = true
size = 3
passes = 1
xray = 0
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
@@ -105,26 +104,41 @@ dwindle {
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
# new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true
workspace_swipe = false
}
cursor {
no_warps = 1
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
disable_hyprland_logo = 1
focus_on_activate = 1
}
plugin {
virtual-desktops {
names = 1:Coding, 2:Internet, 3:3,4:4, 5:Social
cycleworkspaces = 0
rememberlayout = none
notifyinit = 0
verbose_logging = 0
}
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
# device {
# name = epic-mouse-v1
# sensitivity = -0.5
# }
# Example windowrule v1
# windowrule = float, ^(kitty)$
@@ -164,51 +178,66 @@ bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
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 = $mainMod ALT, 1, workspace, 1
bind = $mainMod ALT, 2, workspace, 2
bind = $mainMod ALT, 3, workspace, 3
bind = $mainMod ALT, 4, workspace, 4
bind = $mainMod ALT, 5, workspace, 5
bind = $mainMod ALT, 6, workspace, 6
bind = $mainMod ALT, 7, workspace, 7
bind = $mainMod ALT, 8, workspace, 8
bind = $mainMod ALT, 9, workspace, 9
bind = $mainMod ALT, 0, workspace, 10
bind = $mainMod, 1, vdesk, 1
bind = $mainMod, 2, vdesk, 2
bind = $mainMod, 3, vdesk, 3
bind = $mainMod, 4, vdesk, 4
bind = $mainMod, 5, vdesk, 5
bind = $mainMod, 6, vdesk, 6
bind = $mainMod, 7, vdesk, 7
bind = $mainMod, 8, vdesk, 8
bind = $mainMod, 9, vdesk, 9
bind = $mainMod, 0, vdesk, 10
# Move active window to a workspace with mainMod + SHIFT + [0-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 SHIFT, 0, movetoworkspace, 10
bind = $mainMod SHIFT, 1, movetodesk, 1
bind = $mainMod SHIFT, 2, movetodesk, 2
bind = $mainMod SHIFT, 3, movetodesk, 3
bind = $mainMod SHIFT, 4, movetodesk, 4
bind = $mainMod SHIFT, 5, movetodesk, 5
bind = $mainMod SHIFT, 6, movetodesk, 6
bind = $mainMod SHIFT, 7, movetodesk, 7
bind = $mainMod SHIFT, 8, movetodesk, 8
bind = $mainMod SHIFT, 9, movetodesk, 9
bind = $mainMod SHIFT, 0, movetodesk, 10
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod CTRL, S, movetoworkspace, special:magic
bind = $mainMod SHIFT, S, exec, /home/nathan/.local/bin/hyprshot -m region
bind = $mainMod SHIFT, S, exec, hyprshot -m region
# Scroll through existing workspaces with mainMod + scroll
# bind = $mainMod, mouse_down, workspace, e+1
# bind = $mainMod, mouse_up, workspace, e-1
# Scroll through existing workspaces with mainMod + TAB and SHIFT + TAB
bind = $mainMod, TAB, workspace, e+1
bind = $mainMod SHIFT, TAB, workspace, e-1
bind = ALT, TAB, workspace, e+1
bind = ALT SHIFT, TAB, workspace, e-1
# bind = $mainMod, TAB, workspace, e+1
# bind = $mainMod SHIFT, TAB, workspace, e-1
bind = $mainMod, TAB, overview:toggle
# bindr = SUPER, SUPER_L, exec, $menu
bind = ALT, TAB, exec, ~/.config/hypr/scripts/search-windows.sh
# bind = ALT SHIFT, TAB, workspace, e-1
# bind = ALT, TAB, exec, hyprswitch gui --mod-key alt --key tab --close mod-key-release --reverse-key=key=shift && hyprswitch dispatch
# bind = ALT SHIFT, TAB, exec, hyprswitch gui --mod-key alt --key tab --close mod-key-release --reverse-key=key=shift && hyprswitch dispatch -r
# Media control keys
bindle=, XF86AudioRaiseVolume, exec, vol --up
bindle=, XF86AudioLowerVolume, exec, vol --downxe
bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+
bindle=, XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-
bindle=, XF86MonBrightnessUp, exec, brightnessctl s +5%
bindle=, XF86MonBrightnessDown, exec, brightnessctl s 5%-
bindle=, XF86Search, exec, $menu
@@ -223,3 +252,7 @@ bindl=, XF86AudioPrev, exec, playerctl previous
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Mouse wheel tilt
bind = , mouse_left, exec, ydotool key 56:1 105:1 105:0 56:0
bind = , mouse_right, exec, ydotool key 56:1 106:1 106:0 56:0

View File

@@ -9,7 +9,8 @@ general {
# BACKGROUND
background {
# monitor =
path = $HOME/.config/hypr/hyprlock.png
path = $HOME/.config/backgrounds/background.png
# path = $HOME/.config/hypr/fireplace.mp4
blur_passes = 1
# color = $base
}

View File

@@ -0,0 +1,71 @@
.monitor {
font-size: 20px;
}
.monitor:hover {
background-color: var(--bg-color-hover);
}
.monitor_active {
border: var(--border-size) solid var(--border-color-active);
}
.index {
display: none;
margin: 3px;
padding: 2px 4px;
font-size: 22px;
font-weight: bold;
font-family: monospace;
border-radius: var(--border-radius);
background-color: var(--bg-color);
border: var(--border-size) solid var(--index-border-color);
}
.workspace {
font-size: 24px;
font-weight: bold;
border-radius: var(--border-radius);
background-color: var(--bg-color);
border: var(--border-size) solid var(--border-color);
color: #ffffff;
}
.workspace:hover {
background-color: var(--bg-color-hover);
}
.workspace_special {
border: var(--border-size) solid rgba(0, 255, 0, 0.4);
}
.workspace_active {
border: var(--border-size) solid var(--border-color-active);
}
.client-image {
display: none;
margin-top: 10px;
margin-bottom: 5px;
}
.client {
font-size: 16px;
font-weight: normal;
color: #ffffff;
border-radius: var(--border-radius);
background-color: var(--bg-color);
border: var(--border-size) solid var(--border-color);
}
.client:hover {
background-color: var(--bg-color-hover);
}
.client_active {
border: var(--border-size) solid var(--border-color-active);
}

1
.config/hypr/scripts/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.venv

135
.config/hypr/scripts/desk.py Executable file
View File

@@ -0,0 +1,135 @@
#!/usr/bin/python3
import argparse
import os
import sys
import subprocess
import json
# Check if first arg is colour
waybar = {}
waybar["SELECTED"] = '<span underline="low">'
waybar["DEFAULT"] = '<span foreground="#ffffff">'
waybar["WHITE"]='<span foreground="#ffffff">'
waybar["RED"]='<span foreground="#ff0000">'
waybar["GREEN"]='<span foreground="#60d090">'
waybar["YELLOW"]='<span foreground="#ffff00">'
waybar["BLUE"]='<span foreground="#0000ff">'
waybar["NC"]='</span>'
shell = {}
shell["SELECTED"]='\033[0;32m'
shell["WHITE"]='\033[0;37m'
shell["RED"]='\033[0;31m'
shell["GREEN"]='\033[0;32m'
shell["YELLOW"]='\033[0;33m'
shell["BLUE"]='\033[0;34m'
shell["NC"]='\033[0m'
def get_info():
state = subprocess.run(["hyprctl", "printstate"], capture_output=True, text=True)
state = state.stdout.splitlines()
state.pop(0) # Remove the first line
info = {}
while True:
if len(state) == 0:
break
line = state.pop(0)
if line == "":
continue
if "-" not in line:
break
key, value = line.split(": ")
key = key.strip().removeprefix("-").strip()
value = value.strip()
desk_id = value
info[desk_id] = {"name": key}
for i in range(4):
line = state.pop(0)
if line == "":
break
line = line.split(": ")
if len(line) == 2:
key, value = line
key = key.strip()
value = value.strip()
info[desk_id][key] = value
return info
def get_icon(desk_name, focused=False):
# Get the icon for the desk
icon = ""
desk_name = desk_name.strip().lower()
if desk_name == "coding":
return ""
if desk_name == "web" or desk_name == "internet":
return "󰖟"
if desk_name == "social":
return "󰭻"
return "" if focused else ""
if __name__ == "__main__":
# Check for arguments
parser = argparse.ArgumentParser(description="hyprland desk script")
parser.add_argument("-d", "--desk", type=int, help="Desk number to switch to")
parser.add_argument("-w", "--waybar", action="store_true", help="Waybar mode")
parser.add_argument("-i", "--info", action="store_true", help="Info mode")
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose mode")
args = parser.parse_args()
if args.waybar or args.info:
colours = waybar if args.waybar else shell
# Get info from hyprctl printstate
info = get_info()
output = ""
if args.desk:
desk_num = args.desk
if str(desk_num) not in info:
print(f"Desk {desk_num} does not exist")
sys.exit(1)
desk = info[str(desk_num)]
if args.verbose:
print(desk)
if desk["Populated"] == "false" and desk["Focused"] == "false":
print(f"Desk {desk_num} is empty")
sys.exit(1)
if desk["Focused"] == "true":
output += f"{colours['SELECTED']} {desk_num}: {get_icon(desk['name'],True)} {colours['NC']} "
else:
output += f"{colours["DEFAULT"]} {desk_num}: {get_icon(desk['name'])} {colours['NC']} "
print(output)
sys.exit(0)
for i in range(1, int(max(info.keys()))+1):
if str(i) not in info:
continue
desk = info[str(i)]
if desk["Populated"] == "false" and desk["Focused"] == "false":
continue
if args.verbose:
print(desk)
if desk["Focused"] == "true":
output += f"{colours['SELECTED']} {get_icon(desk['name'],True)} {colours['NC']} "
else:
output += f"{colours["DEFAULT"]} {get_icon(desk['name'])} {colours['NC']} "
print(output)
sys.exit(0)
if args.desk:
# Switch to desk
if args.verbose:
print(f"Switching to desk {args.desk}")
subprocess.run(["hyprctl", "dispatch", "vdesk", str(args.desk)])
sys.exit(0)

View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Check if muted
if wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q "[MUTED]"; then
# If muted, show notification
echo "󰝟"
exit 0
fi
echo "$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}' | sed 's/\.0*$//g')% 󰕾"

View File

View File

@@ -0,0 +1,44 @@
#!/bin/sh
# Check if tofi is running
if pgrep -x "tofi" > /dev/null; then
# Passing as regular tab
ydotool key 15:1 15:0
exit
fi
# Get a list of open windows
WINDOWS=$(hyprctl clients | grep "title: " | sed 's/.*title: //')
# If there are no open windows, exit
[ -z "$WINDOWS" ] && exit
# Use tofi to select a window
SELECTED=$(echo "$WINDOWS" | tofi --num-results 10 --padding-left 20% --padding-top 20% --prompt-text "Select a window: ")
# If a window was selected, focus it
if [ -n "$SELECTED" ]; then
echo "Focusing window: $SELECTED"
# Check if the selected window is on special workspace
# hyprctl clients | grep "$SELECTED" -A 10 | grep workspace
# returns like workspace: -98 (special:magic)
workspace=$(hyprctl clients | grep "$SELECTED" -A 10 | grep workspace)
# if workspace is special, try to focus it
if [[ $workspace == *"special:"* ]]; then
# Get the workspace name (after the colon)
workspace_name=$(echo "$workspace" | sed -E 's/.*:\s*([^)]*).*/\1/')
# Remove number and prefix
echo "Focusing special workspace: $workspace_name"
# Focus the workspace
hyprctl dispatch togglespecialworkspace "$workspace_name"
fi
# Get the window ID
window_id=$(hyprctl clients | grep "$SELECTED" -A 10 | grep pid)
# Get the window ID (after the colon)
window_id=$(echo "$window_id" | sed -E 's/.*:\s*([^)]*).*/\1/')
echo "Window ID: $window_id"
hyprctl dispatch focuswindow pid:"$window_id"
fi

10
.config/hypr/scripts/volume.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
hyprctl dismissnotify
# Check if muted
if wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q "[MUTED]"; then
# If muted, show notification
hyprctl notify -1 5000 0 "Volume muted"
exit 0
fi
hyprctl notify -1 5000 0 "Volume $(wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{print $2 * 100}' | sed 's/\.0*$//g')%"

View File

@@ -1,23 +1,33 @@
exec-once = /usr/lib/x86_64-linux-gnu/libexec/polkit-kde-authentication-agent-1
exec-once = systemctl --user start plasma-kwallet-pam.service plasma-polkit-agent.service
exec-once = /usr/bin/kwalletd6
exec-once = systemctl --user start xdg-desktop-portal-hyprland
exec-once = /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
exec-once = swaync
exec-once = hyprpm reload -n
exec-once = systemctl --user start hyprpolkitagent
exec-once = /usr/bin/kdeconnectd &
exec-once = /usr/bin/swaync &
# Start apps in .autostart
exec-once = /home/$USER/.config/autostart/com.impervious.fingertip.desktop
exec-once = /home/$USER/.config/autostart/Nextcloud.desktop
exec-once = /usr/bin/python3 /usr/bin/solaar --window=hide
exec-once = /home/nathan/AppImages/Fingertip-0.0.4-beta2-linux-X64.AppImage &
exec-once = /home/nathan/AppImages/nextcloud_desktop_sync_client.appimage --background &
# exec-once = /usr/bin/solaar -w hide &
# Start windows
exec-once = alacritty --class alacritty-init
# exec-once = brave-browser # TODO after adding start workspace
exec-once = discord-ptb
exec-once = slack
exec-once = discord --start-minimized
exec-once = slack -U
exec-once = waybar
exec-once = hyprpaper
exec-once = clipse -listen & clipse --listen
exec-once = hypridle
exec-once = clipse -listen
# exec-once = hyprswitch init --show-title --custom-css ~/.config/hypr/hyprswitch.css &
# Proxy
# exec-once = gsettings set org.gnome.system.proxy mode 'auto' && gsettings set org.gnome.system.proxy autoconfig-url 'http://127.0.0.1:9590/proxy.pac'
# exec-once = kwriteconfig6 --file kioslaverc --group 'Proxy Settings' --key 'ProxyType' 2 && kwriteconfig6 --file kioslaverc --group 'Proxy Settings' --key 'AutoProxyURL' "http://127.0.0.1:9590/proxy.pac"
# exec-once = export PROXY_PAC_URL="http://127.0.0.1:9590/proxy.pac"
# exec-once = export http_proxy="http://127.0.0.1:9590"
# exec-once = export https_proxy="$http_proxy"
# exec-once = export no_proxy="localhost,127.0.0.1,::1"

View File

@@ -1,38 +1,20 @@
windowrulev2 = float,class:(clipse)
windowrulev2 = size 622 652,class:(clipse)
windowrulev2 = stayfocused,class:(clipse)
# windowrulev2 = float,class:(clipse)
# windowrulev2 = size 622 652,class:(clipse)
# windowrulev2 = stayfocused,class:(clipse)
windowrulev2 = float,class:(float)
windowrulev2 = float,class:(swayimg)
windowrulev2 = size 80%,class:(swayimg)
windowrule = noblur 1 noanim 1 noshadow 1, class:(^$)
# windowrule = opacity 0.2, class:(^$)
windowrule = float, polkit-kde-authentication-agent-1
windowrule = center,polkit-kde-authentication-agent-1
windowrule = size 800 500,polkit-kde-authentication-agent-1
windowrule = stayfocused,polkit-kde-authentication-agent-1
windowrule = float, io.github.kaii_lb.Overskride
windowrule = center,io.github.kaii_lb.Overskride
windowrule = size 1000 800,io.github.kaii_lb.Overskride
windowrule = float, overskride
windowrule = center,overskride
windowrule = size 700 500,overskride
windowrule = float, iwgtk
windowrule = center,iwgtk
windowrule = size 800 500,iwgtk
windowrule = float, org.kde.gwenview
windowrule = center,org.kde.gwenview
windowrule = size 800 500,org.kde.gwenview
windowrule = float, kdesystemsettings
windowrule = center,kdesystemsettings
windowrule = size 1500 1000,kdesystemsettings
# Start windows
windowrulev2 = workspace 1, class:alacritty-init
# windowrulev2 = workspace 3, class:Brave-browser
windowrulev2 = workspace 5, class:discord
windowrulev2 = workspace 5, class:Slack
# # Start windows
# windowrulev2 = workspace 1, class:alacritty-init
# # windowrulev2 = workspace 3, class:Brave-browser
# windowrulev2 = workspace 5, class:discord
# windowrulev2 = workspace 5, class:org.telegram.desktop
# windowrulev2 = workspace 5, class:Slack
stickyrule = class:discord,5
stickyrule = class:org.telegram.desktop,5
stickyrule = class:Slack,5

3
.zshrc
View File

@@ -158,7 +158,8 @@ alias message='/home/$USER/scripts/message.sh'
alias dockerstart='/home/$USER/scripts/dockerstart.sh'
alias dockerstop='/home/$USER/scripts/dockerstop.sh'
alias domains='/home/$USER/scripts/domains.py'
alias fix_touchpad='/home/$USER/scripts/fix_touchpad.sh'
alias open=xdg-open
# Use gitkraken's cli tool
unalias gk