feat(hypr): support mice in mk-device-block and add mouse device blocks
Expand mk-device-block.sh to list mice alongside keyboards and emit the pointer-appropriate config block. Add device blocks for the Logitech Pro 2 and G903 mice in input.lua. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>main
parent
572fc00755
commit
b114b7f523
|
|
@ -25,3 +25,19 @@ hl.device({
|
|||
repeat_delay = 500,
|
||||
sensitivity = 0,
|
||||
})
|
||||
hl.device({
|
||||
name = "logitech-pro-2-mouse-1",
|
||||
sensitivity = 0,
|
||||
accel_profile = "",
|
||||
left_handed = false, -- left-handed mode handled on the mouse's onboard memory
|
||||
natural_scroll = false,
|
||||
scroll_points = "",
|
||||
})
|
||||
hl.device({
|
||||
name = "logitech-g903-ls-1",
|
||||
sensitivity = 0,
|
||||
accel_profile = "",
|
||||
left_handed = false,
|
||||
natural_scroll = false,
|
||||
scroll_points = "",
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,27 +1,40 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
keyboards=$(hyprctl devices -j | jq -r '.keyboards[].name')
|
||||
devices=$(hyprctl devices -j)
|
||||
|
||||
if [[ -z "$keyboards" ]]; then
|
||||
echo "No keyboard devices found" >&2
|
||||
# Tag each device with its type so the right block can be emitted on selection.
|
||||
entries=$(jq -r '
|
||||
(.keyboards[]?.name | "keyboard\t" + .),
|
||||
(.mice[]?.name | "mouse\t" + .)
|
||||
' <<<"$devices")
|
||||
|
||||
if [[ -z "$entries" ]]; then
|
||||
echo "No keyboard or mouse devices found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v fzf &>/dev/null; then
|
||||
selected=$(printf '%s\n' $keyboards | fzf --prompt="Select keyboard: " --height=~10)
|
||||
selected=$(printf '%s\n' "$entries" | fzf --prompt="Select device: " --height=~10 --with-nth=2.. --delimiter='\t')
|
||||
else
|
||||
echo "Select a keyboard device:" >&2
|
||||
select selected in $keyboards; do
|
||||
echo "Select a device:" >&2
|
||||
IFS=$'\n'
|
||||
select selected in $entries; do
|
||||
[[ -n "$selected" ]] && break
|
||||
done
|
||||
unset IFS
|
||||
fi
|
||||
|
||||
[[ -z "$selected" ]] && exit 1
|
||||
|
||||
type=${selected%%$'\t'*}
|
||||
name=${selected#*$'\t'}
|
||||
|
||||
case "$type" in
|
||||
keyboard)
|
||||
cat <<EOF
|
||||
hl.device({
|
||||
name = "$selected",
|
||||
name = "$name",
|
||||
kb_layout = "",
|
||||
kb_variant = "",
|
||||
kb_model = "",
|
||||
|
|
@ -32,3 +45,17 @@ hl.device({
|
|||
sensitivity = 0,
|
||||
})
|
||||
EOF
|
||||
;;
|
||||
mouse)
|
||||
cat <<EOF
|
||||
hl.device({
|
||||
name = "$name",
|
||||
sensitivity = 0,
|
||||
accel_profile = "",
|
||||
left_handed = false,
|
||||
natural_scroll = false,
|
||||
scroll_points = "",
|
||||
})
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Reference in New Issue