Added and tested script to prepare henrovnix_ok for publishing
This commit is contained in:
@@ -0,0 +1,175 @@
|
||||
##############################################
|
||||
# These files are just for reference.
|
||||
# If you want to change anything, edit the source files in:
|
||||
# ~/YOUR_USERnix/assets/conf
|
||||
#
|
||||
# Temporarily(!) testing can by editing this file, edit the file and reloading hyprshell
|
||||
# After that, run:
|
||||
# cd ~/YOUR_USERnix && emacs README.org --batch -f org-babel-tangle && git add . && git commit -m "Adjusted conf files" && sudo nixos-rebuild switch --flake .#<yourhost>
|
||||
#
|
||||
# If everything still works, you can use the same command but:
|
||||
# - keep "switch"
|
||||
# - and add a reboot:
|
||||
#
|
||||
# cd ~/YOUR_USERnix && sudo nixos-rebuild switch --flake .#<yourhost> && systemctl reboot
|
||||
#
|
||||
# Make sure the lines starting with: cd ~/YOUR_USERnix
|
||||
# are written as ONE single line.
|
||||
###############################################
|
||||
|
||||
|
||||
|
||||
# Keybindings #
|
||||
###############
|
||||
|
||||
$mainMod = SUPER
|
||||
|
||||
# use walker to show exec menu
|
||||
bind = $mainMod, Space , exec, walker
|
||||
bind = $mainMod, P, pseudo
|
||||
bind = $mainMod, T, togglesplit
|
||||
|
||||
# grimblast
|
||||
bind = $mainMod SHIFT, p, exec, grimblast -n -f copysave active
|
||||
bind = $mainMod SHIFT, a, exec, grimblast -n -f copysave area
|
||||
bind = $mainMod ALT, p, exec, grimblast -n -f copysave output
|
||||
bind = $mainMod CTRL, p, exec, grimblast -n -f copysave screen
|
||||
|
||||
# Terminal / launcher / kill / reload
|
||||
bind = $mainMod, E, exec, thunar
|
||||
bind = $mainMod, RETURN, exec, kitty
|
||||
bind = $mainMod, D, exec, wofi --show drun
|
||||
bind = $mainMod, Q, killactive,
|
||||
bind = $mainMod SHIFT, Q, exit,
|
||||
bind = $mainMod SHIFT, R, exec, hyprctl reload
|
||||
|
||||
# Switch windows
|
||||
bind = $mainMod, TAB, hyprexpo:expo, toggle
|
||||
bind = ALT, TAB, cyclenext,
|
||||
# bind = ALT SHIFT, TAB, cyclenext prev
|
||||
|
||||
# Hyprscrolling
|
||||
bind = $mainMod, period, layoutmsg, move +col
|
||||
bind = $mainMod, comma, layoutmsg, swapcol l
|
||||
# Make / break a tab-group (stack)
|
||||
bind = $mainMod, S, togglegroup
|
||||
# Cycle tabs in the group
|
||||
bind = $mainMod, L, changegroupactive, f
|
||||
bind = $mainMod, H, changegroupactive, b
|
||||
bind = $mainMod, T, exec, ~/.config/hypr/scripts/toggle-layout-scrolling-dwindle.sh
|
||||
|
||||
# Focus movement
|
||||
bind = $mainMod, H, movefocus, l
|
||||
bind = $mainMod, L, movefocus, r
|
||||
bind = $mainMod, K, movefocus, u
|
||||
bind = $mainMod, J, movefocus, d
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
|
||||
# Move windows
|
||||
bind = $mainMod SHIFT, H, movewindow, l
|
||||
bind = $mainMod SHIFT, L, movewindow, r
|
||||
bind = $mainMod SHIFT, K, movewindow, u
|
||||
bind = $mainMod SHIFT, J, movewindow, d
|
||||
bind = $mainMod SHIFT, left, movewindow, l
|
||||
bind = $mainMod SHIFT, right, movewindow, r
|
||||
bind = $mainMod SHIFT, up, movewindow, u
|
||||
bind = $mainMod SHIFT, down, movewindow, d
|
||||
|
||||
# Resize windows
|
||||
bind = $mainMod CTRL, H, resizeactive, -30 0
|
||||
bind = $mainMod CTRL, L, resizeactive, 30 0
|
||||
bind = $mainMod CTRL, K, resizeactive, 0 -30
|
||||
bind = $mainMod CTRL, J, resizeactive, 0 30
|
||||
|
||||
# Floating / fullscreen
|
||||
bind = $mainMod, V, togglefloating,
|
||||
bind = $mainMod, F, fullscreen, 0
|
||||
bind = $mainMod SHIFT, F, fullscreen, 1
|
||||
|
||||
# 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 = $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
|
||||
|
||||
# Cycle workspaces
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
bind = $mainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Mouse drag
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
#########################
|
||||
# Screenshots
|
||||
#########################
|
||||
bind = $mainMod SHIFT, s, exec, grim -g "$(slurp)" - | wl-copy
|
||||
bind = , XF86Screenshot, exec, grim - | wl-copy
|
||||
|
||||
#########################
|
||||
# Audio (pamixer)
|
||||
#########################
|
||||
bind = , XF86AudioRaiseVolume, exec, pamixer -i 5
|
||||
bind = , XF86AudioLowerVolume, exec, pamixer -d 5
|
||||
bind = , XF86AudioMute, exec, pamixer -t
|
||||
bind = , XF86AudioMicMute, exec, pamixer --default-source -t
|
||||
|
||||
#########################
|
||||
# Media (playerctl)
|
||||
#########################
|
||||
bind = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bind = , XF86AudioPause, exec, playerctl pause
|
||||
bind = , XF86AudioNext, exec, playerctl next
|
||||
bind = , XF86AudioPrev, exec, playerctl previous
|
||||
bind = , XF86AudioStop, exec, playerctl stop
|
||||
|
||||
#########################
|
||||
# Brightness (brightnessctl)
|
||||
#########################
|
||||
bind = , XF86MonBrightnessUp, exec, brightnessctl set +10%
|
||||
bind = , XF86MonBrightnessDown, exec, brightnessctl set 10%-
|
||||
bind = , XF86KbdBrightnessUp, exec, brightnessctl -d '*kbd_backlight*' set +10%
|
||||
bind = , XF86KbdBrightnessDown, exec, brightnessctl -d '*kbd_backlight*' set 10%-
|
||||
|
||||
#########################
|
||||
# Power / session
|
||||
#########################
|
||||
bind = , XF86Sleep, exec, systemctl suspend
|
||||
bind = , XF86PowerOff, exec, systemctl poweroff
|
||||
bind = , XF86WakeUp, exec, systemctl suspend
|
||||
bind = $mainMod, L, exec, loginctl lock-session
|
||||
bind = $mainMod, X, exec, ~/.config/hypr/scripts/powermenu.sh
|
||||
|
||||
#########################
|
||||
# Laptop lid settings
|
||||
#########################
|
||||
bindl = , switch:on:Lid Switch, exec, ~/.config/hypr/scripts/lid-action.sh
|
||||
bindl = , switch:off:Lid Switch, exec, ~/.config/hypr/scripts/lid-restore.sh
|
||||
|
||||
#########################
|
||||
# Start apps
|
||||
#########################
|
||||
bind = CTRL ALT, B, exec, flatpak run eu.betterbird.Betterbird
|
||||
bind = CTRL ALT, S, exec, spotify
|
||||
bind = CTRL ALT, z, exec, zeditor
|
||||
bind = $mainMod, W, exec, zen --url https://nextcloud.data-pro.nu
|
||||
@@ -0,0 +1,16 @@
|
||||
general {
|
||||
lock_cmd = hyprlock
|
||||
after_sleep_cmd = hyprctl dispatch dpms on
|
||||
ignore_dbus_inhibit = false
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 600
|
||||
on-timeout = hyprlock
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 900
|
||||
on-timeout = hyprctl dispatch dpms off
|
||||
on-resume = hyprctl dispatch dpms on
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
##############################################
|
||||
# These files are just for reference.
|
||||
# If you want to change anything definitive, edit the source files in:
|
||||
# ~/YOUR_USERnix/assets/conf
|
||||
# Temporarily(!) testing can by editing this file, edit the file and reloading hyprshell
|
||||
#
|
||||
# After that, run:
|
||||
# cd ~/YOUR_USERnix && emacs README.org --batch -f org-babel-tangle && git add . && git commit -m "Adjusted conf files" && sudo nixos-rebuild switch --flake .#<yourhost>
|
||||
#
|
||||
# If everything still works, you can use the same command but:
|
||||
# - keep "switch"
|
||||
# - and add a reboot:
|
||||
#
|
||||
# cd ~/YOUR_USERnix && sudo nixos-rebuild switch --flake .#<yourhost> && systemctl reboot
|
||||
#
|
||||
# NOTE:
|
||||
# Make sure the lines starting with: cd ~/YOUR_USERnix
|
||||
# are written as ONE single line.
|
||||
###############################################
|
||||
|
||||
############################
|
||||
# Variables
|
||||
############################
|
||||
|
||||
# Colors (Hyprland "col" values commonly use rgba(aarrggbb)-style hex)
|
||||
# See Hyprland variable / type docs for color formats & bools. :contentReference[oaicite:2]{index=2}
|
||||
$base = rgba(1e1e2eff)
|
||||
$inactive = rgba(595959aa)
|
||||
$blue = rgba(33ccffee)
|
||||
$green = rgba(00ff99ee)
|
||||
|
||||
# Recommended for correct environment in systemd user session / portals. :contentReference[oaicite:4]{index=4}
|
||||
exec-once = dbus-update-activation-environment --systemd --all
|
||||
exec-once = uwsm app -- waybar
|
||||
|
||||
# put these at top-level (recommended), not inside general { }:
|
||||
layerrule = blur on, ignore_alpha 1, match:namespace waybar
|
||||
layerrule = xray 1, match:namespace waybar
|
||||
layerrule = blur on, ignore_alpha 1, match:namespace walker
|
||||
layerrule = xray 1, match:namespace walker
|
||||
layerrule = blur on, ignore_alpha 1, match:namespace swaync-control-center
|
||||
layerrule = blur on, ignore_alpha 1, match:namespace swaync-notification-window
|
||||
|
||||
input {
|
||||
follow_mouse = 1
|
||||
kb_layout = us
|
||||
kb_options = ctrl:nocaps
|
||||
sensitivity = -0.5
|
||||
accel_profile = adaptive
|
||||
scroll_factor = 0.5
|
||||
touchpad {
|
||||
natural_scroll = yes
|
||||
scroll_factor = 0.5
|
||||
}
|
||||
}
|
||||
cursor {
|
||||
no_hardware_cursors = true
|
||||
}
|
||||
general {
|
||||
gaps_in = 2
|
||||
gaps_out = 4
|
||||
border_size = 2
|
||||
# Gradient syntax: color color angle (e.g. 45deg). :contentReference[oaicite:5]{index=5}
|
||||
col.active_border = $blue $green 45deg
|
||||
col.inactive_border = $inactive
|
||||
layout = scrolling
|
||||
resize_on_border = true
|
||||
extend_border_grab_area = 20 # Makes it easier to "grab" the edge
|
||||
}
|
||||
decoration {
|
||||
rounding = 5
|
||||
blur {
|
||||
enabled = yes
|
||||
size = 8
|
||||
passes = 3
|
||||
new_optimizations = on
|
||||
}
|
||||
}
|
||||
animations {
|
||||
enabled = yes
|
||||
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
|
||||
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
|
||||
}
|
||||
dwindle {
|
||||
pseudotile = yes
|
||||
preserve_split = yes
|
||||
}
|
||||
misc {
|
||||
disable_hyprland_logo = false
|
||||
focus_on_activate = true
|
||||
}
|
||||
# Start required session helpers
|
||||
exec-once = hypridle
|
||||
exec-once = hyprpolkitagent
|
||||
# Lid close: lock only if no external monitor is connected
|
||||
bindl = , switch:on:Lid Switch, exec, ~/.config/hypr/scripts/lid-lock.sh
|
||||
# Lid open: turn DPMS back on (does not unlock)
|
||||
bindl = , switch:off:Lid Switch, exec, hyprctl dispatch dpms on
|
||||
|
||||
exec-once = systemd-run --user --scope --unit=elephant elephant
|
||||
exec-once = ~/.config/hypr/scripts/hyprscrolling-listener.sh
|
||||
@@ -0,0 +1,32 @@
|
||||
# ~/.config/hypr/hyprlock.conf
|
||||
|
||||
general {
|
||||
grace = 2
|
||||
ignore_empty_input = true
|
||||
}
|
||||
|
||||
background {
|
||||
path = ~/.config/hypr/lock.png
|
||||
blur_passes = 2
|
||||
blur_size = 6
|
||||
}
|
||||
|
||||
input-field {
|
||||
size = 320, 60
|
||||
outline_thickness = 2
|
||||
dots_size = 0.25
|
||||
dots_spacing = 0.20
|
||||
fade_on_empty = true
|
||||
placeholder_text = "Password"
|
||||
position = 0, -120
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
label {
|
||||
text = $TIME
|
||||
font_size = 72
|
||||
position = 0, 120
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
# --------------------------------------------------
|
||||
# Scrolling layout (Hyprland) – clean, valid config
|
||||
# Managed in repo: assets/conf/desktop/hypr/hyprscrolling.conf
|
||||
#
|
||||
# IMPORTANT:
|
||||
# - "indicators" / "indicator_*" options do NOT exist in the official hyprscrolling plugin
|
||||
# and are not part of the Hyprland scrolling layout config, so they were removed.
|
||||
# - If you still load the hyprscrolling plugin (.so) via Nix, that's fine, but the
|
||||
# behavior is controlled by the "scrolling { }" block below.
|
||||
# --------------------------------------------------
|
||||
|
||||
# If your Nix module already loads the plugin, you can omit this line.
|
||||
# If you keep it, it won't hurt as long as the path exists.
|
||||
plugin = /etc/hypr/plugins/libhyprscrolling.so
|
||||
|
||||
# Make scrolling the default layout
|
||||
general {
|
||||
layout = scrolling
|
||||
}
|
||||
|
||||
# --------------------------------------------------
|
||||
# Scrolling layout configuration (documented on the Hyprland wiki)
|
||||
# --------------------------------------------------
|
||||
|
||||
plugin {
|
||||
hyprscrolling {
|
||||
column_width = 0.5
|
||||
fullscreen_on_one_column = true
|
||||
|
||||
# 0 = center, 1 = fit (per docs/snippets)
|
||||
focus_fit_method = 1
|
||||
|
||||
follow_focus = true
|
||||
follow_min_visible = 0.4
|
||||
|
||||
# optional
|
||||
# explicit_column_widths = 0.333, 0.5, 0.667, 1.0
|
||||
|
||||
direction = right
|
||||
}
|
||||
}
|
||||
|
||||
# --------------------------------------------------
|
||||
# Keybinds (layoutmsg) – these are the commands scrolling uses
|
||||
# Put these here ONLY if this file is included into your main binds config.
|
||||
# --------------------------------------------------
|
||||
|
||||
# Move focus/viewport by column
|
||||
# bind = $mainMod, period, layoutmsg, move +col
|
||||
|
||||
# Put the current window into its own new column
|
||||
# bind = $mainMod, P, layoutmsg, promote
|
||||
|
||||
# Swap whole columns left/right
|
||||
# bind = $mainMod, H, layoutmsg, swapcol l
|
||||
# bind = $mainMod, L, layoutmsg, swapcol r
|
||||
|
||||
# Resize column: set an absolute width, or cycle configured widths
|
||||
# bind = $mainMod, 1, layoutmsg, colresize 0.5
|
||||
# bind = $mainMod, 2, layoutmsg, colresize 0.667
|
||||
# bind = $mainMod, 3, layoutmsg, colresize 1.0
|
||||
# bind = $mainMod, 0, layoutmsg, colresize +conf
|
||||
@@ -0,0 +1,71 @@
|
||||
// Edit with `hyprshell config edit` <-- GUI app, resize!
|
||||
(
|
||||
version: 3,
|
||||
windows: (
|
||||
scale: 8.5,
|
||||
items_per_row: 5 ,
|
||||
overview: (
|
||||
launcher: (
|
||||
default_terminal: None,
|
||||
launch_modifier: "ctrl",
|
||||
width: 800,
|
||||
max_items: 5,
|
||||
show_when_empty: true,
|
||||
plugins: (
|
||||
applications: (
|
||||
run_cache_weeks: 8,
|
||||
show_execs: true,
|
||||
show_actions_submenu: true,
|
||||
),
|
||||
terminal: None,
|
||||
shell: None,
|
||||
websearch: None,
|
||||
calc: (),
|
||||
path: (),
|
||||
actions: (
|
||||
actions: [
|
||||
lock_screen,
|
||||
hibernate,
|
||||
logout,
|
||||
reboot,
|
||||
shutdown,
|
||||
suspend,
|
||||
custom(
|
||||
names: [
|
||||
"Kill",
|
||||
"Stop",
|
||||
],
|
||||
details: "Kill or stop a process by name",
|
||||
command: "pkill \"{}\" && notify-send hyprshell \"stopped {}\"",
|
||||
icon: "remove",
|
||||
),
|
||||
custom(
|
||||
names: [
|
||||
"Reload Hyprshell",
|
||||
],
|
||||
details: "Reload Hyprshell",
|
||||
command: "sleep 1; hyprshell socat \'\"Restart\"\'",
|
||||
icon: "system-restart",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
key: "Super_L",
|
||||
modifier: "super",
|
||||
filter_by: [],
|
||||
hide_filtered: false,
|
||||
exclude_special_workspaces: "",
|
||||
),
|
||||
switch: (
|
||||
modifier: "alt",
|
||||
key: "Tab",
|
||||
filter_by: [
|
||||
current_monitor,
|
||||
],
|
||||
switch_workspaces: false,
|
||||
exclude_special_workspaces: "",
|
||||
),
|
||||
switch_2: None,
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,8 @@
|
||||
window {
|
||||
background: rgba(20, 20, 20, 0.92);
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
* {
|
||||
background-color: unset;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Usage:
|
||||
# Waybar exec: hyprscroll-overflow.sh
|
||||
# Waybar on-click: hyprscroll-overflow.sh --pick
|
||||
#
|
||||
# Env:
|
||||
# COLUMN_WIDTH=0.5
|
||||
# ICON=""
|
||||
# DMENU_CMD="walker --dmenu" (or: "wofi --dmenu", "rofi -dmenu", etc.)
|
||||
|
||||
COLUMN_WIDTH="${COLUMN_WIDTH:-0.5}"
|
||||
ICON="${ICON:-}"
|
||||
DMENU_CMD="${DMENU_CMD:-walker --dmenu}"
|
||||
|
||||
json_escape() {
|
||||
# minimal JSON string escape (quotes, backslashes, newlines, tabs, CR)
|
||||
local s="${1:-}"
|
||||
s="${s//\\/\\\\}"
|
||||
s="${s//\"/\\\"}"
|
||||
s="${s//$'\n'/\\n}"
|
||||
s="${s//$'\r'/\\r}"
|
||||
s="${s//$'\t'/\\t}"
|
||||
printf '%s' "$s"
|
||||
}
|
||||
|
||||
fail_json() {
|
||||
# NOTE: errors SHOULD still show (so you notice), hence JSON output here.
|
||||
local msg="hyprscroll-overflow: ${1:-unknown error}"
|
||||
printf '{"text":"%s !","tooltip":"%s","class":"error"}\n' \
|
||||
"$(json_escape "$ICON")" "$(json_escape "$msg")"
|
||||
exit 0
|
||||
}
|
||||
|
||||
need() { command -v "$1" >/dev/null 2>&1 || fail_json "$1 not in PATH"; }
|
||||
need hyprctl
|
||||
need jq
|
||||
need awk
|
||||
|
||||
read -r focused_mon_id focused_ws_id < <(
|
||||
hyprctl -j monitors 2>/dev/null | jq -r '
|
||||
.[] | select(.focused==true) | "\(.id) \(.activeWorkspace.id)"
|
||||
'
|
||||
) || fail_json "failed to read focused monitor/workspace"
|
||||
|
||||
[[ -n "${focused_mon_id:-}" && -n "${focused_ws_id:-}" ]] || fail_json "no focused monitor/workspace"
|
||||
|
||||
# Current layout (needed for both normal + --pick paths)
|
||||
layout="$(hyprctl getoption general:layout 2>/dev/null | awk '/str:/ {print $2; exit}' || true)"
|
||||
layout="${layout:-}"
|
||||
|
||||
# Collect windows (current ws + current monitor, mapped only)
|
||||
clients_json="$(hyprctl -j clients 2>/dev/null)" || fail_json "failed to read clients"
|
||||
|
||||
# Click action: pick a window and focus it
|
||||
if [[ "${1:-}" == "--pick" ]]; then
|
||||
# Build menu lines: address at end so we can parse it back reliably.
|
||||
menu="$(
|
||||
jq -r --argjson ws "$focused_ws_id" --argjson mid "$focused_mon_id" '
|
||||
[ .[]
|
||||
| select(.mapped == true)
|
||||
| select(.workspace.id == $ws)
|
||||
| select(.monitor == $mid)
|
||||
| {address, class, title}
|
||||
]
|
||||
| map("[\(.class)] \(.title) \(.address)")
|
||||
| .[]
|
||||
' <<<"$clients_json"
|
||||
)" || exit 0
|
||||
|
||||
[[ -n "${menu:-}" ]] || exit 0
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
choice="$(printf '%s\n' "$menu" | eval "$DMENU_CMD" || true)"
|
||||
[[ -n "${choice:-}" ]] || exit 0
|
||||
|
||||
addr="$(awk '{print $NF}' <<<"$choice")"
|
||||
[[ "$addr" =~ ^0x[0-9a-fA-F]+$ ]] || exit 0
|
||||
|
||||
hyprctl dispatch focuswindow "address:${addr}" >/dev/null 2>&1 || exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Tooltip list (multiline)
|
||||
# Include a stable selector: address (hex), plus class + title for humans.
|
||||
tooltip_list="$(
|
||||
jq -r --argjson ws "$focused_ws_id" --argjson mid "$focused_mon_id" '
|
||||
[ .[]
|
||||
| select(.mapped == true)
|
||||
| select(.workspace.id == $ws)
|
||||
| select(.monitor == $mid)
|
||||
| {address, class, title}
|
||||
]
|
||||
| to_entries
|
||||
| map("\(.key+1). [\(.value.class)] \(.value.title) (\(.value.address))")
|
||||
| .[]
|
||||
' <<<"$clients_json"
|
||||
)" || fail_json "failed to build tooltip list"
|
||||
|
||||
win_count="$(
|
||||
jq -r --argjson ws "$focused_ws_id" --argjson mid "$focused_mon_id" '
|
||||
[ .[]
|
||||
| select(.mapped == true)
|
||||
| select(.workspace.id == $ws)
|
||||
| select(.monitor == $mid)
|
||||
] | length
|
||||
' <<<"$clients_json"
|
||||
)" || fail_json "failed to count clients"
|
||||
|
||||
max_visible="$(awk -v w="$COLUMN_WIDTH" 'BEGIN{ if (w<=0) {print 1} else {print int(1.0/w)} }')" \
|
||||
|| fail_json "awk failed"
|
||||
(( max_visible < 1 )) && max_visible=1
|
||||
|
||||
overflow=$(( win_count - max_visible ))
|
||||
|
||||
# IMPORTANT: hide module by outputting NOTHING (no JSON) when not relevant
|
||||
if (( overflow <= 0 )) || [[ "$layout" != "scrolling" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
text="$ICON +$overflow"
|
||||
cls="overflow"
|
||||
|
||||
tooltip="WS ${focused_ws_id} • ${win_count} window(s)\n"
|
||||
tooltip+="Approx ${max_visible} fit (column_width=${COLUMN_WIDTH})\n"
|
||||
tooltip+="------------------------------\n"
|
||||
tooltip+="${tooltip_list:-"(no windows)"}"
|
||||
|
||||
printf '{"text":"%s","tooltip":"%s","class":"%s"}\n' \
|
||||
"$(json_escape "$text")" \
|
||||
"$(json_escape "$tooltip")" \
|
||||
"$(json_escape "$cls")"
|
||||
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# hyprscrolling-per-monitor.sh
|
||||
# Usage:
|
||||
# ./hyprscrolling-per-monitor.sh <MONITOR_NAME>
|
||||
#
|
||||
# Example:
|
||||
# ./hyprscrolling-per-monitor.sh DP-1
|
||||
#
|
||||
# This script reads the current resolution for the given monitor via hyprctl
|
||||
# and sets hyprscrolling column width accordingly.
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: $0 <MONITOR_NAME>"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
MONITOR="$1"
|
||||
|
||||
# Map a resolution (WIDTHxHEIGHT) to a column width value for hyprscrolling.
|
||||
# Tune these values to taste.
|
||||
columnwidth_for_resolution() {
|
||||
local res="$1"
|
||||
case "$res" in
|
||||
# --- Ultra-wide / super-wide ---
|
||||
5120x1440) echo "0.22" ;; # 49" 32:9
|
||||
3840x1080) echo "0.25" ;; # 49" 32:9 (your ultrawide)
|
||||
3440x1440) echo "0.33" ;; # 34" 21:9
|
||||
2560x1080) echo "0.40" ;; # 21:9 budget ultrawide
|
||||
|
||||
# --- QHD / high DPI ---
|
||||
3840x2160) echo "0.40" ;; # 4K
|
||||
3200x1800) echo "0.50" ;;
|
||||
2880x1800) echo "0.50" ;;
|
||||
2560x1600) echo "0.55" ;; # 16:10
|
||||
2560x1440) echo "0.55" ;; # QHD
|
||||
|
||||
# --- FHD / laptop-ish ---
|
||||
1920x1200) echo "0.55" ;; # 16:10
|
||||
1920x1080) echo "0.50" ;; # FHD (your laptop request)
|
||||
|
||||
# --- HD / smaller ---
|
||||
1680x1050) echo "0.65" ;;
|
||||
1600x900) echo "0.70" ;;
|
||||
1366x768) echo "0.80" ;;
|
||||
1280x720) echo "0.85" ;;
|
||||
|
||||
# Unknown / fallback
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get resolution for a named monitor from hyprctl.
|
||||
# Output format should be WIDTHxHEIGHT (e.g. 3840x1080).
|
||||
get_monitor_resolution() {
|
||||
local mon="$1"
|
||||
|
||||
# hyprctl monitors prints lines like:
|
||||
# Monitor DP-1 (ID 0): 3840x1080@119.88 at 0x0 ...
|
||||
# We'll extract the first WIDTHxHEIGHT after the colon.
|
||||
local line
|
||||
if ! line="$(hyprctl monitors 2>/dev/null | grep -F "Monitor ${mon} " -m1 || true)"; then
|
||||
echo ""
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Extract token like 3840x1080@... then strip @...
|
||||
local token
|
||||
token="$(awk -F': ' '{print $2}' <<<"$line" | awk '{print $1}' | cut -d'@' -f1 || true)"
|
||||
echo "$token"
|
||||
}
|
||||
|
||||
resolution="$(get_monitor_resolution "$MONITOR")"
|
||||
if [[ -z "$resolution" ]]; then
|
||||
echo "Could not determine resolution for monitor '$MONITOR'."
|
||||
echo "Tip: check available names with: hyprctl monitors"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
colw="$(columnwidth_for_resolution "$resolution")"
|
||||
if [[ -z "$colw" ]]; then
|
||||
echo "No mapping for resolution '$resolution' on monitor '$MONITOR'."
|
||||
echo "Add it to columnwidth_for_resolution() in this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Apply to hyprscrolling.
|
||||
# Using layoutmsg colresize (as in your snippet).
|
||||
hyprctl dispatch layoutmsg colresize all "$colw"
|
||||
|
||||
echo "hyprscrolling: set column width to $colw for monitor '$MONITOR' ($resolution)"
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
INTERNAL="eDP1"
|
||||
|
||||
has_external() {
|
||||
# Any monitor name that is not INTERNAL counts as external
|
||||
hyprctl monitors -j | grep -q '"name"' && ! hyprctl monitors -j | grep -q "\"name\":\"$INTERNAL\"\""
|
||||
}
|
||||
|
||||
has_external_robust() {
|
||||
# robust without jq: count monitor names; if there's >1 OR there's a name not INTERNAL
|
||||
local names
|
||||
names="$(hyprctl monitors -j | sed -n 's/.*"name":"\([^"]*\)".*/\1/p')"
|
||||
# if any name != INTERNAL then external
|
||||
echo "$names" | grep -vx "$INTERNAL" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
if has_external_robust; then
|
||||
# Clamshell: disable laptop panel, no lock
|
||||
hyprctl keyword monitor "${INTERNAL},disable"
|
||||
else
|
||||
# Laptop only: suspend
|
||||
systemctl suspend
|
||||
fi
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
INTERNAL="eDP1"
|
||||
|
||||
# Restore panel using preferred mode, auto position, scale 1
|
||||
hyprctl keyword monitor "${INTERNAL},preferred,auto,1"
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
OPTIONS=" Lock
|
||||
Logout (Hyprland)
|
||||
Suspend
|
||||
Hibernate
|
||||
Reboot
|
||||
Shutdown
|
||||
Cancel"
|
||||
|
||||
CHOICE=$(printf "%s" "$OPTIONS" | walker --dmenu )
|
||||
|
||||
case "$CHOICE" in
|
||||
"Lock")
|
||||
loginctl lock-session
|
||||
;;
|
||||
"Logout (Hyprland)")
|
||||
hyprctl dispatch exit
|
||||
;;
|
||||
"Suspend")
|
||||
loginctl lock-session && systemctl suspend
|
||||
;;
|
||||
"Hibernate")
|
||||
loginctl lock-session && systemctl hibernate
|
||||
;;
|
||||
"Reboot")
|
||||
systemctl reboot
|
||||
;;
|
||||
"Shutdown")
|
||||
systemctl poweroff
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cur="$(hyprctl getoption general:layout 2>/dev/null | awk '/str:/ {print $2; exit}')"
|
||||
if [[ "$cur" == "scrolling" ]]; then
|
||||
new="dwindle"
|
||||
else
|
||||
new="scrolling"
|
||||
fi
|
||||
hyprctl keyword general:layout "$new" >/dev/null
|
||||
msg="Hyprland layout: $new"
|
||||
echo "$msg"
|
||||
# Show a notification if possible
|
||||
if command -v notify-send >/dev/null 2>&1; then
|
||||
notify-send -a Hyprland "Layout switched" "$msg"
|
||||
fi
|
||||
Reference in New Issue
Block a user