Update hyprland config

This commit is contained in:
Şahin Akkaya 2024-01-09 00:21:05 +03:00
parent d4ea79d054
commit 5097686b8a
11 changed files with 514 additions and 84 deletions

View File

@ -22,16 +22,18 @@ monitor=HDMI-A-1,preferred,0x0,1.3
# monitor=eDP-1, disable
# monitor=,preferred,auto,1,mirror,HDMI-A-1
# monitor=eDP-1,preferred,auto,1,mirror,HDMI-A-1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
exec-once = dunst
# exec-once = swaync
exec-once = ags
exec-once = /usr/libexec/kf5/polkit-kde-authentication-agent-1
exec-once = swaybg -i "$HOME/Pictures/Wallpapers/minimal.jpg"
# Dim screen after 60 seconds of inactivity
exec-once = swayidle -w timeout 60 'dim-screen &' resume 'undim-screen'
# Lock screen after idle for 120s
@ -48,11 +50,22 @@ exec-once = swayidle -w timeout 20 'if pgrep -x swaylock; then hyprctl dispatch
# Some default env vars.
env = XCURSOR_SIZE,24
#
# env = QT_QPA_PLATFORM,wayland,xcb
# env = GDK_BACKEND,x11
# unscale XWayland
# xwayland {
# force_zero_scaling = false
# }
# toolkit-specific scale
env = GDK_SCALE,1
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = tr
kb_variant = legacy-fix-ansi
kb_layout = tr,us
kb_variant = legacy-fix-ansi,
kb_model =
kb_options =
kb_rules =
@ -68,23 +81,25 @@ input {
}
device:apple-mtp-keyboard {
kb_layout = tr
kb_variant = legacy-fix-iso
kb_layout = tr,us
kb_variant = legacy-fix-iso,
kb_model =
kb_options = ctrl:swapcaps
kb_options = altwin:alt_super_win,shift:both_capslock_cancel,lv3:ralt_switch,caps:ctrl_modifier
kb_rules =
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
gaps_in = 2
gaps_out = 8
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
# col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.active_border = rgba(F9DEA9ee) rgba(F2C294ee) 45deg
# col.active_border = rgba(1affffee) rgba(ff0000ee) 45deg # was my config
col.inactive_border = rgba(595959aa)
layout = dwindle
layout = master
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
@ -105,32 +120,53 @@ decoration {
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
dim_inactive = true
dim_strength = 0.1 # how much inactive windows should be dimmed, 0.0 - 1.0
dim_around = 0.5 # how much the dimaround window rule should dim by. 0.0 - 1.0
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
#
# animation=NAME,ONOFF,SPEED,CURVE,STYLE or
# animation=NAME,ONOFF,SPEED,CURVE
# ONOFF can be either 0 or 1, 0 to disable, 1 to enable. note: if its 0, you can omit further args.
# SPEED is the amount of ds (1ds = 100ms) the animation will take
# CURVE is the bezier curve name, see curves.
# STYLE (optional) is the animation style
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
bezier = overshot,0.05,0.9,0.1,1.1
bezier = easeOutBack, 0.075, 0.82, 0.165, 1
bezier = easeInBack,0.075, 0.82, 0.165, 1
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
animation = windows, 1, 5, default
# animation = windows, 0
animation = windowsIn,1,5,default,slide
animation = windowsOut, 1, 4, easeInBack, slide
animation = border, 1, 10, overshot
animation = borderangle, 1, 10, default, once
animation = fade, 1, 4, default
# animation = fade, 0
animation = workspaces, 1, 4, default, slide
animation = specialWorkspace, 1, 3, easeOutBack, slidefadevert
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
allow_small_split = true
always_center_master = false
}
gestures {
@ -142,6 +178,21 @@ gestures {
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = -1 # Set to 0 to disable the anime mascot wallpapers
# If true, will animate manual window resizes/moves
# animate_manual_resizes = false
# Enable window swallowing
# enable_swallow = false
# swallow_regex = str
# focus_on_activate = false
}
binds {
# If enabled, an attempt to switch to the currently focused workspace will
# instead switch to the previous workspace. Akin to i3s auto_back_and_forth.
workspace_back_and_forth = true
allow_workspace_cycles = true
}
# Example per-device config
@ -157,79 +208,135 @@ device:epic-mouse-v1 {
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = float,class:^(nm-connection-editor)$,
windowrulev2 = float,title:^(Picture-in-Picture)$,
windowrulev2 = pin,title:^(Picture-in-Picture)$,
windowrulev2=dimaround,class:^(pinentry-qt)$,
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
$mod = SUPER
bind = $mainMod, tab, workspace, previous
bind = $mod, tab, workspace, previous
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, return, exec, kitty
bind = $mainMod, q, killactive,
bind = $mainMod control, q, exit,
bind = $mainMod, E, exec, dolphin
bind = $mainMod, V, togglefloating,
bind = $mainMod, semicolon, exec, wofi --show drun --normal-window
bind = $mainMod, p, exec, passmenu
bind = $mainMod, t, pseudo, # dwindle
bind = $mainMod, s, togglesplit, # dwindle
# Move focus with mainMod + arrow keys
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, a, workspace, 1
bind = $mainMod, s, workspace, 2
bind = $mainMod, d, workspace, 3
bind = $mainMod, f, workspace, 4
bind = $mainMod, g, workspace, 5
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
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, a, movetoworkspace, 1
bind = $mainMod SHIFT, s, movetoworkspace, 2
bind = $mainMod SHIFT, d, movetoworkspace, 3
bind = $mainMod SHIFT, f, movetoworkspace, 4
bind = $mainMod SHIFT, g, movetoworkspace, 5
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 = $mod, return, exec, open-kitty-or-focus
# bind = $mod, return, exec, kitty --single-instance
bind = $mod, q, killactive,
bind = $mod, c, exec, smart-exec
bind = $mod control, q, exit,
# Example special workspace (scratchpad)
bind = $mainMod, i, togglespecialworkspace, magic
bind = $mainMod SHIFT, i, movetoworkspace, special:magic
bind = $mod, w, togglespecialworkspace, magic
bind = $mod SHIFT, w, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
bind = $mod control, n, exec, lock-screen
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bind = $mod, e, exec, wofi --show drun --normal-window
# bind = $mod, semicolon, exec, wofi --show drun --normal-window
bind = $mod shift, p, exec, passmenu
bind = $mod, o, togglefloating,
bind = $mod, y, togglefloating
bind = $mod, v, exec, rofi-wireguard --toggle
bind = $mod, y, pin
# bind = $mod, t, exec, smart-tab
bind = $mod, t, togglegroup, # dwindle
# bind = $mod, t, pseudo, # dwindle
bind = $mod, s, togglesplit, # dwindle
bind = $mod, m, fullscreen, 1
### master layout keybindings
bind = $mod, semicolon, layoutmsg,swapwithmaster master
bind = $mod, space, layoutmsg,orientationnext
bind = $mod SHIFT, m, fullscreen, 0
bind = $mod SHIFT, b, fakefullscreen,
bind = $mod shift, n, exec, swaync-client -t -sw
# bindl = $mod SHIFT, L, exec, sleep 1 && hyprctl dispatch dpms off
# focus windows with mod + hjkl
bind = $mod, h, movefocus, l
bind = $mod, l, movefocus, r
bind = $mod, k, movefocus, u
bind = $mod, j, movefocus, d
# Move windows with mod + shift + hjkl
bind = $mod shift, h, swapwindow, l
bind = $mod shift, l, swapwindow, r
bind = $mod shift, k, swapwindow, u
bind = $mod shift, j, swapwindow, d
bind = $mod, left, movewindow, l
bind = $mod, right, movewindow, r
bind = $mod, down, movewindow, d
bind = $mod, up, movewindow, u
# resize windows with mod + control + hjkl
binde = $mod control, h, resizeactive, -20 0
binde = $mod control, l, resizeactive, 20 0
binde = $mod control, k, resizeactive, 0 -20
binde = $mod control, j, resizeactive, 0 20
# Switch workspaces with mod + [0-9]
bind = $mod, p, workspace, e-1
bind = $mod, n, workspace, e+1
bind = $mod, a, workspace, 1
bind = $mod, s, workspace, 2
bind = $mod, d, workspace, 3
bind = $mod, f, workspace, 4
bind = $mod, g, workspace, 5
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
bind = $mod, comma, swapnext, prev
bind = $mod, period, swapnext
# Move active window to a workspace with mod + SHIFT + [0-9]
bind = $mod SHIFT, a, movetoworkspace, 1
bind = $mod SHIFT, s, movetoworkspace, 2
bind = $mod SHIFT, d, movetoworkspace, 3
bind = $mod SHIFT, f, movetoworkspace, 4
bind = $mod SHIFT, g, movetoworkspace, 5
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
# 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
# Scroll through existing workspaces with mod + scroll
# doesn't seem to work with touchpad.
# check and see if this works with mouse
bind = $mod, mouse_down, workspace, e+1
bind = $mod, mouse_up, workspace, e-1
# screen
bindle=,XF86MonBrightnessUp, exec, light -A 3; light -O
bindle=,XF86MonBrightnessDown, exec, light -U 3; light -O
bindle=,XF86MonBrightnessUp, exec, light -A 1; light -O
bindle=,XF86MonBrightnessDown, exec, light -U 1; light -O
# bindle=,XF86KbdBrightnessUp, exec, ags -r 'brightness.kbd++; indicator.kbd()'
# bindle=,XF86KbdBrightnessDown, exec, ags -r 'brightness.kbd--; indicator.kbd()'
#
@ -237,9 +344,79 @@ bindle=,XF86MonBrightnessDown, exec, light -U 3; light -O
bindle=,XF86AudioRaiseVolume, exec, volume up
bindle=,XF86AudioLowerVolume, exec, volume down
bindle=,XF86AudioMute, exec, volume toggle-mute
bind = $mainMod SHIFT, q, exec, lock-screen
# bindl = $mainMod SHIFT, L, exec, sleep 1 && hyprctl dispatch dpms off
# bindle=, XF86KbdBrightnessUp, exec, keyboard_backlight inc
# bindle=, XF86KbdBrightnessDown, exec, keyboard_backlight dec
# check switch name with hyprctl devices
# lock screen when lid is closed or opened
# bindl=,switch:Apple SMC power/lid events,exec,lock-screen
# trigger when the lid is opened
bindl=,switch:off:Apple SMC power/lid events,exec,smart-switch open
# trigger when the lid is closed
bindl=,switch:on:Apple SMC power/lid events,exec,smart-switch close
windowrulev2 = stayfocused,class:(wofi)
windowrulev2 = noborder,class:(wofi)
# # bind = $mod, Return, exec, st -e tmux new-session -A -s st
# bind = $mod SHIFT, q, exec, xkill
# binde = $mod CONTROL, s, exec, toggle-screenkey
# bind = $mod, e, exec, rofimoji
# bind = $mod, b, exec, rofi-bluetooth
# # bind = SUPER, E, exec, [workspace 2 silent;float;noanim] st
# bind = $mod, i, exec, dictionary
# bind = $mod, r, swapnext,
# bind = $mod, semicolon, exec, wofi --show drun
# bind = $mod SHIFT, O, workspaceopt, allpseudo # dwindle
# bind = $mod, space, exec, hypr-toggle-layout
#
#
# bind = $mod SHIFT, Return, togglesplit, # dwindle
#
# # bind = $mod, j, changegroupactive, b
# # bind = $mod, k, changegroupactive, f
#
#
# # to switch between windows in a floating workspace
# bind = SUPER,comma,cyclenext, # change focus to another window
# bind = SUPER,comma,bringactivetotop, # bring it to the top
# bind = SUPER,period,cyclenext, prev # change focus to another window
# bind = SUPER,period,bringactivetotop, # bring it to the top
#
#
#
#
#
#
# # bind=SUPER,mouse_down,workspace,e-1
#
# # bindle=, Print, exec, flameshot gui
# # bindr=SUPER, SUPER_L, exec, pkill wofi || wofi --show drun
#
#
# # will switch to a submap called notifications
# bind = $mod, n, submap, notifications
#
# # will start a submap called "notifications"
# submap=notifications
#
# # sets repeatable binds for resizing the active window
# binde=$mod, n, exec, dunstctl close
# bind=$mod, n, submap, reset
# binde=$mod, k, exec, dunstctl history-pop
# binde=$mod, j, exec, dunstctl close
# binde=$mod, m, exec, dunstctl context
# bind=$mod, m, submap, reset
# binde=$mod, p, exec, toggle-notifications
# bind=$mod, p, submap, reset
#
# # use reset to go back to the global submap
# bind=,escape,submap,reset
#
# # will reset the submap, meaning end the current one and return to the global one
# submap=reset
#
# # keybinds further down will be global again...

View File

@ -0,0 +1,47 @@
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
// 17.00 5600
// 17.30 5300
const float temperature = 2300.0;
const float temperatureStrength = 1.0;
#define WithQuickAndDirtyLuminancePreservation
const float LuminancePreservationFactor = 1.0;
// function from https://www.shadertoy.com/view/4sc3D7
// valid from 1000 to 40000 K (and additionally 0 for pure full white)
vec3 colorTemperatureToRGB(const in float temperature){
// values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693
mat3 m = (temperature <= 6500.0) ? mat3(vec3(0.0, -2902.1955373783176, -8257.7997278925690),
vec3(0.0, 1669.5803561666639, 2575.2827530017594),
vec3(1.0, 1.3302673723350029, 1.8993753891711275)) :
mat3(vec3(1745.0425298314172, 1216.6168361476490, -8257.7997278925690),
vec3(-2666.3474220535695, -2173.1012343082230, 2575.2827530017594),
vec3(0.55995389139931482, 0.70381203140554553, 1.8993753891711275));
return mix(
clamp(vec3(m[0] / (vec3(clamp(temperature, 1000.0, 40000.0)) + m[1]) + m[2]), vec3(0.0), vec3(1.0)),
vec3(1.0),
smoothstep(1000.0, 0.0, temperature)
);
}
void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
// RGB
vec3 color = vec3(pixColor[0], pixColor[1], pixColor[2]);
#ifdef WithQuickAndDirtyLuminancePreservation
color *= mix(1.0,
dot(color, vec3(0.2126, 0.7152, 0.0722)) / max(dot(color, vec3(0.2126, 0.7152, 0.0722)), 1e-5),
LuminancePreservationFactor);
#endif
color = mix(color, color * colorTemperatureToRGB(temperature), temperatureStrength);
vec4 outCol = vec4(color, pixColor[3]);
gl_FragColor = outCol;
}

View File

@ -0,0 +1,20 @@
// vim: set ft=glsl:
// blue light filter shader
// values from https://reshade.me/forum/shader-discussion/3673-blue-light-filter-similar-to-f-lux
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
// green
pixColor[1] *= 0.855;
// blue
pixColor[2] *= 0.725;
gl_FragColor = pixColor;
}

View File

@ -0,0 +1,16 @@
//
// Example blue light filter shader.
//
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
pixColor[2] *= 0.8;
gl_FragColor = pixColor;
}

View File

@ -0,0 +1,18 @@
//
// Example grayscale shader.
//
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
gl_FragColor = vec4(
pixColor[0] * 0.299 + pixColor[1] * 0.587 + pixColor[2] * 0.114,
pixColor[0] * 0.299 + pixColor[1] * 0.587 + pixColor[2] * 0.114,
pixColor[0] * 0.299 + pixColor[1] * 0.587 + pixColor[2] * 0.114,
pixColor[3]
);
}

View File

@ -0,0 +1,40 @@
// vibrance for hyprland
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D tex;
// see https://github.com/CeeJayDK/SweetFX/blob/a792aee788c6203385a858ebdea82a77f81c67f0/Shaders/Vibrance.fx#L20-L30
const vec3 VIB_RGB_BALANCE = vec3(1.0, 1.0, 1.0);
const float VIB_VIBRANCE = 0.15;
const vec3 VIB_coeffVibrance = VIB_RGB_BALANCE * -VIB_VIBRANCE;
void main() {
vec4 pixColor = texture2D(tex, v_texcoord);
// RGB
vec3 color = vec3(pixColor[0], pixColor[1], pixColor[2]);
// vec3 VIB_coefLuma = vec3(0.333333, 0.333334, 0.333333); // was for `if VIB_LUMA == 1`
vec3 VIB_coefLuma = vec3(0.212656, 0.715158, 0.072186); // try both and see which one looks nicer.
float luma = dot(VIB_coefLuma, color);
float max_color = max(color[0], max(color[1], color[2]));
float min_color = min(color[0], min(color[1], color[2]));
float color_saturation = max_color - min_color;
vec3 p_col = vec3(vec3(vec3(vec3(sign(VIB_coeffVibrance) * color_saturation) - 1.0) * VIB_coeffVibrance) + 1.0);
pixColor[0] = mix(luma, color[0], p_col[0]);
pixColor[1] = mix(luma, color[1], p_col[1]);
pixColor[2] = mix(luma, color[2], p_col[2]);
gl_FragColor = pixColor;
}

53
.config/swaylock/config Normal file
View File

@ -0,0 +1,53 @@
ignore-empty-password
#font=Ubuntu Mono Nerd Font
#clock
#timestr=%R
image=~/Pictures/Wallpapers/kill-win.png
# fade-in=0.2
#effect-blur=15x2
#effect-greyscale
#effect-scale=0.1
# show-keyboard-layout
# indicator
indicator-radius=170
indicator-thickness=10
indicator-caps-lock
indicator-x-position=1165
indicator-y-position=625
key-hl-color=880033ff
separator-color=00000000
inside-color=01010133
inside-clear-color=ffd20433
inside-caps-lock-color=009ddc33
inside-ver-color=d9d8d833
inside-wrong-color=ee2e2433
ring-color=231f20D9
ring-clear-color=231f20D9
ring-caps-lock-color=231f20D9
ring-ver-color=231f20D9
ring-wrong-color=231f20D9
line-color=00000000
line-clear-color=ffd204FF
line-caps-lock-color=009ddcFF
line-ver-color=d9d8d8FF
line-wrong-color=ee2e24FF
text-color=dededeff
text-clear-color=ffd204ff
text-ver-color=000000ff
text-wrong-color=ee2e24ff
bs-hl-color=ffd204ff
caps-lock-key-hl-color=ffd204FF
caps-lock-bs-hl-color=dededeFF
text-caps-lock-color=009ddcff

@ -1 +1 @@
Subproject commit 20dfe30e960d98db2c259a355ecef96f43ca6021
Subproject commit fa451e2629328a0cca6fffdc3c46d99f25d544ab

22
scripts/smart-exec Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Get the currently focused workspace
current_workspace=$(hyprctl monitors -j | jq '.[] | .activeWorkspace.id' )
# Define preferred apps based on workspace
case $current_workspace in
1) app="kitty --single-instance";;
2) app="default";;
3) app="thunderbird";;
4) app="firefox";;
5) app="default";;
esac
if [[ "$app" == "default" ]]; then
hyprctl dispatch exec "wofi --show drun --normal-window"
else
notify-send -t 500 "opening $app"
hyprctl dispatch exec "$app"
fi

21
scripts/smart-switch Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
monitors=$(hyprctl monitors -j | jq '.[] | .name')
edp=$(echo "$monitors" | grep eDP)
hdmi=$(echo "$monitors" | grep HDMI)
if [[ "$1" == "close" ]]; then # lid is closing
if [[ -n "$hdmi" ]]; then # -n means if string is not empty
hyprctl keyword monitor "eDP-1, disable"
else
hyprctl dispatch exec lock-screen
fi
else
if [[ -z "$edp" ]]; then # -z means if string is empty
hyprctl keyword monitor eDP-1,preferred,0x1107,2.0
killall ags
ags
fi
fi

16
scripts/smart-tab Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
focusedClient=$(hyprctl clients -j | jq '[.[] | select(.focusHistoryID|contains(0))][0]')
if [[ -n "$focusedClient" ]]; then
clientClass=$(echo "$focusedClient" | jq '.class' )
case "$clientClass" in
kitty) hyprctl pass "" # cannot pass arbitrary keys to applications atm. abort mission
;;
d|D) exit 0
;;
*) exit 1
esac
fi