feat: gamemode, toggle-touchpad and restore-waybar \n fix: albert glitches and bugs in the scripts \n And appearance changes concerning waybar and single windows

This commit is contained in:
Gu://em_ 2025-03-03 09:01:51 +01:00
parent 6e4c3bb974
commit d33ecc32e7
14 changed files with 124 additions and 19 deletions

View file

@ -6,11 +6,14 @@ telemetry=false
[albert]
global_handler_enabled=false
trigger=albert
[applications]
enabled=true
fuzzy=true
terminal=kitty
use_generic_name=false
use_keywords=true
[caffeine]
enabled=false
@ -50,10 +53,13 @@ command_reboot=reboot
enabled=true
trigger=sys
[triggers]
trigger=?
[widgetsboxmodel]
alwaysOnTop=true
clearOnHide=false
clientShadow=true
clientShadow=false
darkTheme=Seventy Eight
displayScrollbar=false
followCursor=true

View file

@ -91,8 +91,11 @@ animations {
animation = fadeLayersOut, 1, 1.39, almostLinear
animation = workspaces, 1, 1.94, almostLinear, fade
animation = workspacesIn, 1, 3, easeOutQuint, slidefade
animation = workspacesOut, 1, 5, easeOutQuint, slidefade
animation = workspacesIn, 1, 3, easeOutQuint, slide
animation = workspacesOut, 1, 3, easeOutQuint, slide
#animation = workspacesIn, 1, 3, easeOutQuint, slidefade
#animation = workspacesOut, 1, 5, easeOutQuint, slidefade
}
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
@ -151,3 +154,13 @@ windowrule=noshadow,^(albert)$
windowrule=float,^(albert)$
windowrule=stayfocused,^(albert)$
windowrule=nodim,^(albert)$
# Prism Launcher
windowrulev2=pseudo, class:(org.prismlauncher.PrismLauncher)
windowrulev2=size 65% 70%, class:(org.prismlauncher.PrismLauncher), title:^(Prism Launcher .*)$
# TODO Automatically fullscreen single apps
# - Seems impossible for now (try mixing with workspace rules)
# Increase gaps for single apps
workspace=w[t1], gapsout:2

View file

@ -17,6 +17,7 @@ input {
touchpad {
natural_scroll = true
disable_while_typing = false
}
}
@ -88,6 +89,14 @@ bind = $mainMod SHIFT, agrave, movetoworkspace, 10
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic
# Minimize function (uses scratchpad)
# For testing, may be removed in future releases
bind = $mainMod, N, togglespecialworkspace, magic
bind = $mainMod, N, movetoworkspace, +0
bind = $mainMod, N, togglespecialworkspace, magic
bind = $mainMod, N, movetoworkspace, special:magic
bind = $mainMod, N, togglespecialworkspace, magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
@ -107,17 +116,29 @@ bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 6%-
bindel = SHIFT, XF86MonBrightnessUp, exec, brightnessctl s 2%+
bindel = SHIFT, XF86MonBrightnessDown, exec, brightnessctl s 2%-
# Requires playerctl
# (Requires playerctl)
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
# Function keys
# Settings
bindel = , XF86Launch1, exec, kitty vim ~/.config/hypr/config
# Screenshot
bind = , Print, exec, ~/.config/hypr/scripts/screenshot.sh
# Touchpad toggle
# (On galaxy books, pressing the disable touchpad key also triggers SUPER and CONTROL keys, this is why there are present here)
bind = SUPER CONTROL, XF86TouchpadToggle, exec, ~/.config/hypr/scripts/toggle-touchpad.sh
# Desktop related shortcuts
# Toggle waybar
bind = $mainMod, B, exec, ~/.config/hypr/scripts/toggle-waybar.sh
# Reload desktop
bind = $mainMod SHIFT, R, exec, ~/.config/hypr/scripts/reload.sh
# Gamemode
bind = $mainMod, F11, exec, ~/.config/hypr/scripts/gamemode.sh

View file

@ -1,2 +1,2 @@
preload = ~/.config/hypr/images/wallpaper.jpg
wallpaper = , ~/.config/hypr/images/wallpaper.jpg
preload = ~/.config/hypr/images/wallpaper.JPG
wallpaper = , ~/.config/hypr/images/wallpaper.JPG

BIN
.config/hypr/images/wallpaper.JPG Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

View file

@ -8,11 +8,4 @@ hyprpaper &
albert &
# mako &
systemctl --user start hyprpolkitagent &
# Launch waybar depending on the last status
waybar_status=~/.config/hypr/status/waybar
if [ "$(cat $waybar_status)" == "on" ]; then
waybar &
elif [ "$(cat $waybar_status)" != "off" ]; then
hyprctl notify 0 3000 0 Failed to retrieve waybar status
fi
~/.config/hypr/scripts/restore-waybar.sh

View file

@ -0,0 +1,22 @@
#!/usr/bin/env sh
# From Hyprland documentation - https://wiki.hyprland.org/0.41.2/Configuring/Uncommon-tips--tricks/#toggle-animationsbluretc-hotkey
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ] ; then
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 1;\
keyword decoration:rounding 0"
killall waybar
hyprctl notify 1 2000 0 "Enabled game mode"
exit
fi
hyprctl reload
~/.config/hypr/scripts/restore-waybar.sh
hyprctl notify 1 2000 0 "Disabled game mode"

View file

@ -0,0 +1,10 @@
#!/bin/sh
# Launch waybar depending on the last status
waybar_status=~/.config/hypr/status/waybar
if [ "$(cat $waybar_status)" == "on" ]; then
killall waybar
waybar &
elif [ "$(cat $waybar_status)" != "off" ]; then
hyprctl notify 0 3000 0 Failed to retrieve waybar status
fi

View file

@ -0,0 +1,34 @@
#!/bin/sh
device=znt0001:00-14e5:650e-touchpad
toggle_variable="device[${device}]:enabled"
hyprctl keyword "${toggle_variable}" true
status_file="$XDG_RUNTIME_DIR/touchpad.status"
enable_touchpad() {
printf "true" > "${status_file}"
hyprctl notify 1 2000 0 "Enabled touchpad"
hyprctl keyword "${toggle_variable}" true
}
disable_touchpad() {
printf "false" > "${status_file}"
hyprctl notify 0 2000 0 "Disabled Touchpad"
hyprctl keyword "${toggle_variable}" false
}
if ! [ -f "${status_file}" ]; then
enable_touchpad
else
if [ $(cat "${status_file}") = "true" ]; then
disable_touchpad
elif [ $(cat "${status_file}") = "false" ]; then
enable_touchpad
fi
fi

View file

@ -1,13 +1,13 @@
{
"layer": "top",
"position": "left",
"margin": "1 2 1 1",
"margin": "1 1 1 1",
"reload_style_on_change": true,
"modules-left": [
//"custom/updates",
"hyprland/workspaces",
"hyprland/submap"
//"group/info"
//"group/info",
//"hyprland/window"
],
"hyprland/workspaces": {

View file

@ -18,9 +18,9 @@ window#waybar {
transition-property: background-color;
transition-duration: 0.5s;
border-radius: 4px;
border: 1px solid alpha(@active, 0.7);
border: 1px solid alpha(@active, 0.3);
background: @background;
background: alpha(@background, 0.8);
background: alpha(@background, 0.7);
color: lighter(@active);
}

7
.zshrc
View file

@ -47,7 +47,9 @@ zinit cdreplay -q # Optimize cache (recommended by the zinit doc)
bindkey -e # Use emacs keybindings
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
bindkey '~' delete-char # Makes the delete key work properly
bindkey '^[[3~' delete-char # Makes the delete key work properly
bindkey '^[[3;5~' kill-word # Makes the delete key work properly
# Missing ctrl+delete
bindkey "^[[1;5C" forward-word # Same with M-arrows
bindkey "^[[1;5D" backward-word
@ -70,6 +72,7 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # Makes completions case
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Makes completions colored
zstyle ':completion:*' menu no # Hide the default completions menu (replaced by fzf)
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
setopt correct # 'Did you mean'
# Environment variables
export PATH=$PATH:~/.local/bin
@ -81,6 +84,8 @@ alias zcfg='vim ~/.zshrc'
alias icat='kitten icat'
alias nv='nvim'
alias cg='cargo'
alias rqr='rust-quick-run.sh'
alias vm='quickemu --vm *.conf'
# Power management
alias pprof='cat /sys/firmware/acpi/platform_profile' # Get current performance profile
alias pprof-list='cat /sys/firmware/acpi/platform_profile_choices' # Lists the available performance profiles