first commit
This commit is contained in:
commit
8e85fe845b
22 changed files with 1449 additions and 0 deletions
10
hypr/autostart.conf
Normal file
10
hypr/autostart.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
exec-once = [workspace 1 silent] $browser
|
||||
exec-once = [workspace 2 silent] thunderbird
|
||||
exec-once = [workspace 2 silent] element-desktop
|
||||
exec-once = [workspace 3 silent] chromium --profile-directory="Default"
|
||||
exec-once = [workspace 4 silent] chromium --profile-directory="Profile 1"
|
||||
exec-once = [workspace 3 silent] chromium --user-data-dir="$HOME/.config/chromium/Default" --new-window
|
||||
exec-once = [workspace 4 silent] chromium --user-data-dir="$HOME/.config/chromium/Profile 1" --new-window
|
||||
|
||||
exec-once = [workspace special:magic silent] $terminal
|
||||
exec-once = [workspace special:magic silent] keepassxc
|
30
hypr/hypridle.conf
Normal file
30
hypr/hypridle.conf
Normal file
|
@ -0,0 +1,30 @@
|
|||
general {
|
||||
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = ~/.config/hypr/scripts/lock.sh # lock before suspend.
|
||||
after_sleep_cmd = hyprctl dispatch dpms on # turn screen on after wake.
|
||||
}
|
||||
|
||||
# Dimming the monitor using ddcutil (DDC/CI brightness)
|
||||
listener {
|
||||
timeout = 150 # 2.5min
|
||||
on-timeout = dim && ~/.config/hypr/scripts/lock.sh # dim monitor (safe for OLED)
|
||||
}
|
||||
|
||||
# Lock screen at 5 minutes
|
||||
listener {
|
||||
timeout = 300
|
||||
on-timeout = ~/.config/hypr/scripts/lock.sh
|
||||
}
|
||||
|
||||
# Turn screen off at 5.5 minutes
|
||||
listener {
|
||||
timeout = 330
|
||||
on-timeout = hyprctl dispatch dpms off && ddcutil setvcp 10 0
|
||||
on-resume = hyprctl dispatch dpms on && ddcutil setvcp 10 100
|
||||
}
|
||||
|
||||
# Suspend after 30 minutes
|
||||
listener {
|
||||
timeout = 1800
|
||||
on-timeout = systemctl suspend
|
||||
}
|
310
hypr/hyprland.conf
Normal file
310
hypr/hyprland.conf
Normal file
|
@ -0,0 +1,310 @@
|
|||
# https://wiki.hyprland.org/Configuring/
|
||||
|
||||
# You can split this configuration into multiple files
|
||||
# Create your files separately and then link them to this file like this:
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
|
||||
#############################
|
||||
### ENVIRONMENT VARIABLES ###
|
||||
#############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||
|
||||
#env = PATH,${HOME}/.local/bin:${PATH}
|
||||
env = XCURSOR_SIZE,24
|
||||
env = HYPRCURSOR_SIZE,24
|
||||
env = GTK_THEME,Adwaita:dark
|
||||
env = QT_QPA_PLATFORMTHEME,qt5ct
|
||||
env = HYPRSHOT_DIR,${HOME}/Screenshots
|
||||
|
||||
################
|
||||
### MONITORS ###
|
||||
################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
# monitor=,preferred,auto,auto
|
||||
monitor=DP-1, 2560x1440@74.97Hz, 0x0, 1
|
||||
|
||||
###################
|
||||
### MY PROGRAMS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
|
||||
# Set programs that you use
|
||||
source = ~/.config/hypr/programs.conf
|
||||
|
||||
#################
|
||||
### AUTOSTART ###
|
||||
#################
|
||||
|
||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
exec-once = hypridle
|
||||
exec-once = waybar
|
||||
exec-once = swaybg -i ~/.config/hypr/wallpapers/Purple.jpg -m fill
|
||||
exec-once = ~/.config/hypr/scripts/dynamic-borders.sh
|
||||
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
|
||||
###################
|
||||
### PERMISSIONS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Permissions/
|
||||
# Please note permission changes here require a Hyprland restart and are not applied on-the-fly
|
||||
# for security reasons
|
||||
|
||||
# ecosystem {
|
||||
# enforce_permissions = 1
|
||||
# }
|
||||
|
||||
# permission = /usr/(bin|local/bin)/grim, screencopy, allow
|
||||
# permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
|
||||
# permission = /usr/(bin|local/bin)/hyprpm, plugin, allow
|
||||
|
||||
|
||||
#####################
|
||||
### LOOK AND FEEL ###
|
||||
#####################
|
||||
|
||||
# Refer to https://wiki.hyprland.org/Configuring/Variables/
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#general
|
||||
general {
|
||||
gaps_in = 5
|
||||
gaps_out = 1,0,0,0
|
||||
|
||||
border_size = 3
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
|
||||
col.active_border = rgba(D55D7Cee) rgba(480023ee) 45deg
|
||||
col.inactive_border = rgba(595959aa)
|
||||
|
||||
# Set to true enable resizing windows by clicking and dragging on borders and gaps
|
||||
resize_on_border = true
|
||||
|
||||
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
|
||||
allow_tearing = false
|
||||
|
||||
layout = dwindle
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#decoration
|
||||
decoration {
|
||||
rounding = 10
|
||||
rounding_power = 2
|
||||
|
||||
# Change transparency of focused and unfocused windows
|
||||
active_opacity = 1.0
|
||||
inactive_opacity = 0.8
|
||||
|
||||
shadow {
|
||||
enabled = true
|
||||
range = 4
|
||||
render_power = 3
|
||||
color = rgba(1a1a1aee)
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#blur
|
||||
blur {
|
||||
enabled = true
|
||||
size = 3
|
||||
passes = 1
|
||||
|
||||
vibrancy = 0.1696
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#animations
|
||||
animations {
|
||||
enabled = yes, please :)
|
||||
|
||||
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = easeOutQuint,0.23,1,0.32,1
|
||||
bezier = easeInOutCubic,0.65,0.05,0.36,1
|
||||
bezier = linear,0,0,1,1
|
||||
bezier = almostLinear,0.5,0.5,0.75,1.0
|
||||
bezier = quick,0.15,0,0.1,1
|
||||
|
||||
animation = global, 1, 10, default
|
||||
animation = border, 1, 5.39, easeOutQuint
|
||||
animation = windows, 1, 4.79, easeOutQuint
|
||||
animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
|
||||
animation = windowsOut, 1, 1.49, linear, popin 87%
|
||||
animation = fadeIn, 1, 1.73, almostLinear
|
||||
animation = fadeOut, 1, 1.46, almostLinear
|
||||
animation = fade, 1, 3.03, quick
|
||||
animation = layers, 1, 3.81, easeOutQuint
|
||||
animation = layersIn, 1, 4, easeOutQuint, fade
|
||||
animation = layersOut, 1, 1.5, linear, fade
|
||||
animation = fadeLayersIn, 1, 1.79, almostLinear
|
||||
animation = fadeLayersOut, 1, 1.39, almostLinear
|
||||
animation = workspaces, 1, 1.94, easeOutQuint, slidefade
|
||||
animation = workspacesIn, 1, 1.21, easeOutQuint, slidefade
|
||||
animation = workspacesOut, 1, 1.94, easeOutQuint, slidefade
|
||||
|
||||
animation = specialWorkspace, 1, 1.21, quick, slidefadevert
|
||||
}
|
||||
|
||||
# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
|
||||
# "Smart gaps" / "No gaps when only"
|
||||
# uncomment all if you wish to use that.
|
||||
# workspace = w[tv1], gapsout:0, gapsin:0
|
||||
# workspace = f[1], gapsout:0, gapsin:0
|
||||
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
|
||||
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
|
||||
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
|
||||
# windowrule = rounding 0, floating:0, onworkspace:f[1]
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
dwindle {
|
||||
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = true # You probably want this
|
||||
}
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
master {
|
||||
new_status = master
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#misc
|
||||
misc {
|
||||
force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
|
||||
disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
|
||||
enable_swallow = true
|
||||
font_family = FontAwesome
|
||||
}
|
||||
|
||||
|
||||
#############
|
||||
### INPUT ###
|
||||
#############
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#input
|
||||
input {
|
||||
kb_layout = us,se,kr
|
||||
kb_variant = dvorak,dvorak,
|
||||
kb_model =
|
||||
kb_options = grp:win_space_toggle,grp:alt_r_toggle
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 0
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
|
||||
natural_scroll = true
|
||||
|
||||
touchpad {
|
||||
natural_scroll = true
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||
gestures {
|
||||
workspace_swipe = false
|
||||
}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
|
||||
###################
|
||||
### KEYBINDINGS ###
|
||||
###################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
source = ~/.config/hypr/keybindings.conf
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
bind = $mainMod, S, togglespecialworkspace, magic
|
||||
bind = $mainMod SHIFT, S, 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 = CTRL ALT, right, workspace, e+1
|
||||
bind = CTRL ALT, left, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
# Swap active window with the one next to it with SUPER + SHIFT + arrow keys
|
||||
bindd = SUPER SHIFT, left, Swap window to the left, swapwindow, l
|
||||
bindd = SUPER SHIFT, right, Swap window to the right, swapwindow, r
|
||||
bindd = SUPER SHIFT, up, Swap window up, swapwindow, u
|
||||
bindd = SUPER SHIFT, down, Swap window down, swapwindow, d
|
||||
|
||||
# Laptop multimedia keys for volume and LCD brightness
|
||||
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+
|
||||
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
||||
bindel = ,XF86MonBrightnessUp, exec, brightnessctl -e4 -n2 set 5%+
|
||||
bindel = ,XF86MonBrightnessDown, exec, brightnessctl -e4 -n2 set 5%-
|
||||
|
||||
# Requires playerctl
|
||||
bindl = , XF86AudioNext, exec, playerctl next
|
||||
bindl = , XF86AudioPause, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||
|
||||
##############################
|
||||
### WINDOWS AND WORKSPACES ###
|
||||
##############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
# Example windowrule
|
||||
# windowrule = float,class:^(kitty)$,title:^(kitty)$
|
||||
# windowrule = float,class:org.keepassxc.KeePassXC
|
||||
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
windowrule = suppressevent maximize, class:.*
|
||||
|
||||
# Fix some dragging issues with XWayland
|
||||
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||
|
||||
source = ~/.config/hypr/windowrule.conf
|
36
hypr/hyprlock.conf
Normal file
36
hypr/hyprlock.conf
Normal file
|
@ -0,0 +1,36 @@
|
|||
background {
|
||||
path = ~/Pictures/Wallpapers/Purple.jpg
|
||||
blur_passes = 2
|
||||
color = rgba(0, 0, 0, 0.2) # slightly darken overlay
|
||||
}
|
||||
|
||||
label {
|
||||
text = $TIME
|
||||
color = rgba(255, 255, 255, 0.5)
|
||||
font_size = 200
|
||||
font_family = Curved Square
|
||||
position = 0, 0
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
input-field {
|
||||
size = 8%, 3%
|
||||
outline_thickness = 0
|
||||
inner_color = rgba(255, 182, 193, 0.3) # transparent background
|
||||
outer_color = rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 1.0) 90deg
|
||||
check_color = rgba(255, 50, 80, 0.9) rgba(255, 0, 100, 0.9) 30deg
|
||||
fail_color = rgba(255, 50, 80, 0.9) rgba(255, 0, 100, 0.9) 30deg
|
||||
|
||||
font_color = rgba(255, 255, 255, 0.9)
|
||||
fade_on_empty = true
|
||||
rounding = 20
|
||||
|
||||
position = 0, 60
|
||||
halign = center
|
||||
valign = bottom
|
||||
|
||||
font_family = Roboto
|
||||
placeholder_text = $LAYOUT
|
||||
}
|
||||
|
20
hypr/keybindings.conf
Normal file
20
hypr/keybindings.conf
Normal file
|
@ -0,0 +1,20 @@
|
|||
bind = $mainMod, T, exec, $terminal
|
||||
bind = $mainMod, B, exec, $browser
|
||||
bind = $mainMod, W, killactive,
|
||||
bind = $mainMod, M, exit,
|
||||
bind = $mainMod, E, exec, $fileManager
|
||||
bind = $mainMod, V, togglefloating,
|
||||
bindr = $mainMod, SUPER_L, exec, $app_menu
|
||||
bindr = $mainMod, SUPER_L, exec, $menu
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, J, togglesplit, # dwindle
|
||||
|
||||
bind = $mainMod, F, fullscreen
|
||||
|
||||
# Screenshot
|
||||
bind = , PRINT, exec, hyprshot -m window
|
||||
bind = shift, PRINT, exec, hyprshot -m region
|
||||
|
||||
# Lock
|
||||
bind = $mainMod, L, exec, ~/.config/hypr/scripts/lock.sh
|
||||
bind = $mainMod SHIFT, L, exec, wlogout --protocol layer-shell
|
2
hypr/menu.list
Normal file
2
hypr/menu.list
Normal file
|
@ -0,0 +1,2 @@
|
|||
Emoji Picker=emoji-picker.py
|
||||
|
5
hypr/programs.conf
Normal file
5
hypr/programs.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
$terminal = kitty -e zsh -c "fastfetch; exec zsh"
|
||||
$fileManager = nautilus
|
||||
$app_menu = ~/.config/hypr/scripts/launch-tofi.sh
|
||||
$menu = ~/.config/hypr/scripts/launch-menu.sh
|
||||
$browser = librewolf
|
120
hypr/scripts/dynamic-borders.sh
Executable file
120
hypr/scripts/dynamic-borders.sh
Executable file
|
@ -0,0 +1,120 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function handle {
|
||||
if [[ ${1:0:10} == "openwindow" ]]
|
||||
then
|
||||
window_id=$(echo $1 | cut --delimiter ">" --fields=3 | cut --delimiter "," --fields=1)
|
||||
workspace_id=$(echo $1 | cut --delimiter ">" --fields=3 | cut --delimiter "," --fields=2)
|
||||
if [[ $workspace_id == "special" ]]
|
||||
then
|
||||
workspace_id=-99
|
||||
fi
|
||||
windows=$(hyprctl workspaces -j | jq ".[] | select(.id == $workspace_id) | .windows")
|
||||
|
||||
if [[ $windows -eq 1 ]]
|
||||
then
|
||||
floating_status=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$window_id\" ) | .floating" )
|
||||
if [[ $floating_status == "false" ]]
|
||||
then
|
||||
hyprctl dispatch setprop address:0x$window_id noborder 1
|
||||
else
|
||||
hyprctl dispatch setprop address:0x$window_id noborder 0
|
||||
return
|
||||
fi
|
||||
|
||||
elif [[ $windows -eq 2 ]]
|
||||
then
|
||||
addresses=$(hyprctl clients -j | jq -r --arg foo "$foo" ".[] | select(.workspace.id == $workspace_id) | .address")
|
||||
for address in $addresses
|
||||
do
|
||||
if [[ "$address" != "$window_id" ]]; then
|
||||
hyprctl dispatch setprop address:$(echo $address | xargs) noborder 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
elif [[ ${1:0:10} == "movewindow" ]]
|
||||
then
|
||||
window_id=$(echo $1 | cut --delimiter ">" --fields=3 | cut --delimiter "," --fields=1)
|
||||
workspace_id=$(echo $1 | cut --delimiter ">" --fields=3 | cut --delimiter "," --fields=2)
|
||||
|
||||
# Sepcial workspaces have an id of -99, they need to be handled separately
|
||||
if [[ $workspace_id == "special" ]]
|
||||
then
|
||||
workspace_id=-99
|
||||
fi
|
||||
|
||||
windows=$(hyprctl workspaces -j | jq ".[] | select(.id == $workspace_id) | .windows")
|
||||
|
||||
if [[ $windows -eq 1 ]]
|
||||
then
|
||||
# Check if the current window is floating and then set the border accordingly
|
||||
floating_status=$(hyprctl clients -j | jq ".[] | select(.address == \"0x$window_id\" ) | .floating" )
|
||||
if [[ $floating_status == "false" ]]
|
||||
then
|
||||
hyprctl dispatch setprop address:0x$window_id noborder 1
|
||||
else
|
||||
hyprctl dispatch setprop address:0x$window_id noborder 0
|
||||
return
|
||||
fi
|
||||
elif [[ $windows -eq 2 ]]
|
||||
then
|
||||
addresses=$(hyprctl clients -j | jq -r --arg foo "$foo" ".[] | select(.workspace.id == $workspace_id) | .address")
|
||||
for address in $addresses
|
||||
do
|
||||
if [[ "$address" != "$window_id" ]]; then
|
||||
hyprctl dispatch setprop address:$(echo $address | xargs) noborder 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Handle all the other workspaces with only one window
|
||||
single_window_workspaces=$(hyprctl workspaces -j | jq '.[] | select(.windows == 1)' | jq ".id")
|
||||
for workspace in $single_window_workspaces
|
||||
do
|
||||
window=$(hyprctl clients -j | jq ".[] | select(.workspace.id == $workspace) | .address")
|
||||
hyprctl dispatch setprop address:$(echo $window | xargs) noborder 1
|
||||
done
|
||||
|
||||
elif [[ ${1:0:11} == "closewindow" ]]
|
||||
then
|
||||
workspace_id=$(hyprctl activewindow -j | jq ".workspace.id")
|
||||
windows=$(hyprctl workspaces -j | jq ".[] | select(.id == $workspace_id) | .windows")
|
||||
|
||||
if [[ $windows -eq 1 ]]
|
||||
then
|
||||
window_id=$(hyprctl activewindow -j | jq -r ".address")
|
||||
floating_status=$(hyprctl activewindow -j | jq ".floating")
|
||||
if [[ $floating_status == "false" ]]
|
||||
then
|
||||
hyprctl dispatch setprop address:$window_id noborder 1
|
||||
else
|
||||
hyprctl dispatch setprop address:$window_id noborder 0
|
||||
return
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
elif [[ ${1:0:18} == "changefloatingmode" ]]
|
||||
then
|
||||
floating_status=$(echo $1 | cut --delimiter ">" --fields 3 | cut --delimiter "," --fields 2)
|
||||
address="0x$(echo $1 | cut --delimiter ">" --fields 3 | cut --delimiter "," --fields 1)"
|
||||
workspace_id=$(hyprctl clients -j | jq --arg address "$address" '.[] | select(.address == $address) | .workspace.id')
|
||||
if [[ $floating_status -eq 1 ]]
|
||||
then
|
||||
hyprctl dispatch setprop address:$address noborder 0
|
||||
else
|
||||
no_windows=$(hyprctl workspaces -j | jq ".[] | select(.id == $workspace_id) | .windows")
|
||||
if [[ $no_windows -eq 1 ]]
|
||||
then
|
||||
hyprctl dispatch setprop address:$address noborder 1
|
||||
else
|
||||
hyprctl dispatch setprop address:$address noborder 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Socket directory has changed in Hyprland v0.40.0
|
||||
# socat - UNIX-CONNECT:/tmp/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/.socket2.sock | while read line; do handle $line; done
|
||||
socat -U - UNIX-CONNECT:$(echo $XDG_RUNTIME_DIR)/hypr/$(echo $HYPRLAND_INSTANCE_SIGNATURE)/.socket2.sock | while read line; do handle $line; done
|
126
hypr/scripts/emoji-picker.py
Executable file
126
hypr/scripts/emoji-picker.py
Executable file
|
@ -0,0 +1,126 @@
|
|||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
# Setup logging
|
||||
logging.basicConfig(
|
||||
level=logging.INFO, # default level
|
||||
format="%(levelname)s: %(message)s"
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Optional: pyperclip fallback
|
||||
try:
|
||||
import pyperclip
|
||||
HAVE_PYPERCLIP = True
|
||||
except ImportError:
|
||||
HAVE_PYPERCLIP = False
|
||||
|
||||
EMOJI_URL = "https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
|
||||
|
||||
class EmojiCache:
|
||||
"""Handles downloading and caching the emoji list in XDG_CACHE_HOME."""
|
||||
def __init__(self):
|
||||
xdg_cache = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))
|
||||
self.cache_dir = xdg_cache / "emoji-picker"
|
||||
self.cache_file = self.cache_dir / "emoji-list.txt"
|
||||
self.cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
logger.debug(f"Cache directory: {self.cache_dir}")
|
||||
|
||||
def fetch(self):
|
||||
"""Download or return cached emoji list."""
|
||||
if not self.cache_file.exists():
|
||||
self.download()
|
||||
else:
|
||||
logger.debug(f"Using cached emoji list at {self.cache_file}")
|
||||
return self.cache_file
|
||||
|
||||
def download(self):
|
||||
try:
|
||||
import requests
|
||||
except ImportError:
|
||||
logger.error("requests module is required to fetch emoji list")
|
||||
sys.exit(1)
|
||||
|
||||
logger.info("Downloading emoji list...")
|
||||
data = requests.get(EMOJI_URL).json()
|
||||
lines = []
|
||||
for e in data:
|
||||
emoji = e.get("emoji", "")
|
||||
description = e.get("description", "")
|
||||
category = e.get("category", "")
|
||||
aliases = e.get("aliases", [])
|
||||
tags = e.get("tags", [])
|
||||
|
||||
line = emoji + " - " + description + " - " + category
|
||||
line = self.add_unique(aliases, line)
|
||||
line = self.add_unique(tags, line)
|
||||
lines.append(line)
|
||||
|
||||
self.cache_file.write_text("\n".join(lines), encoding="utf-8")
|
||||
logger.info(f"Emoji list cached at {self.cache_file}")
|
||||
|
||||
@staticmethod
|
||||
def add_unique(words, line):
|
||||
for word in words:
|
||||
if word.lower() not in line.lower():
|
||||
line += " " + word
|
||||
return line
|
||||
|
||||
class EmojiPicker:
|
||||
"""Shows menu with tofi and copies selected emoji to clipboard."""
|
||||
def __init__(self, emoji_file):
|
||||
self.emoji_file = Path(emoji_file)
|
||||
|
||||
def pick(self):
|
||||
try:
|
||||
with self.emoji_file.open("r", encoding="utf-8") as f:
|
||||
choices = f.read().splitlines()
|
||||
|
||||
result = subprocess.run(
|
||||
[
|
||||
"tofi",
|
||||
"--fuzzy-match", "true",
|
||||
"--require-match", "true",
|
||||
"--history", "true",
|
||||
"--history-file", str(Path.home() / ".cache/emoji-picker/history.txt")
|
||||
],
|
||||
input="\n".join(choices),
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
|
||||
chosen_line = result.stdout.strip()
|
||||
if not chosen_line:
|
||||
logger.debug("No selection made")
|
||||
return
|
||||
|
||||
emoji = chosen_line.split()[0] # just the emoji
|
||||
self.copy_to_clipboard(emoji)
|
||||
logger.info(f"Copied {emoji} to clipboard")
|
||||
|
||||
except FileNotFoundError:
|
||||
logger.error("tofi not found!")
|
||||
|
||||
@staticmethod
|
||||
def copy_to_clipboard(text):
|
||||
if HAVE_PYPERCLIP:
|
||||
pyperclip.copy(text)
|
||||
else:
|
||||
try:
|
||||
subprocess.run(["wl-copy"], input=text.encode(), check=True)
|
||||
except FileNotFoundError:
|
||||
logger.error("wl-copy not found and pyperclip not available")
|
||||
|
||||
def main():
|
||||
cache = EmojiCache()
|
||||
emoji_file = cache.fetch()
|
||||
picker = EmojiPicker(emoji_file)
|
||||
picker.pick()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
13
hypr/scripts/launch-menu.sh
Executable file
13
hypr/scripts/launch-menu.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPTS="$HOME/.config/hypr/menu.list"
|
||||
SCRIPT_PATH="$HOME/.config/hypr/scripts"
|
||||
|
||||
# Kill existing tofi instance if running
|
||||
pkill -x tofi || {
|
||||
chosen=$(cut -d'=' -f1 "$SCRIPTS" | tofi)
|
||||
if [ -n "$chosen" ]; then
|
||||
script=$(awk -F= -v sel="$chosen" '$1==sel {print $2}' "$SCRIPTS")
|
||||
[ -n "$SCRIPT_PATH/$script" ] && eval "$SCRIPT_PATH/$script" &
|
||||
fi
|
||||
}
|
3
hypr/scripts/launch-tofi.sh
Executable file
3
hypr/scripts/launch-tofi.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
pkill tofi-drun || tofi-drun --drun-launch=true
|
3
hypr/scripts/lock.sh
Executable file
3
hypr/scripts/lock.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
hyprctl switchxkblayout all 0
|
||||
loginctl lock-session
|
BIN
hypr/wallpapers/Purple-blurred.jpg
Normal file
BIN
hypr/wallpapers/Purple-blurred.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
BIN
hypr/wallpapers/Purple.jpg
Normal file
BIN
hypr/wallpapers/Purple.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
3
hypr/windowrule.conf
Normal file
3
hypr/windowrule.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Librewolf Picture-in-Picture
|
||||
windowrulev2 = float, class:($browser),title:(Picture-in-Picture)
|
||||
windowrulev2 = pin, class:($browser),title:(Picture-in-Picture)
|
Loading…
Add table
Add a link
Reference in a new issue