Fix: Known issues from the dotfiles documentation pass #8
@@ -151,9 +151,6 @@ hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) --
|
|||||||
-- Laptop specific keybinds
|
-- Laptop specific keybinds
|
||||||
--------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- for disabling Touchpad. hyprctl devices to get device name.
|
|
||||||
local touchpadDevice = "asue1209:00-04f3:319f-touchpad"
|
|
||||||
|
|
||||||
hl.bind("XF86KbdBrightnessDown", hl.dsp.exec_cmd(scriptsDir .. "/BrightnessKbd.sh --dec"), { repeating = true }) -- decrease keyboard brightness
|
hl.bind("XF86KbdBrightnessDown", hl.dsp.exec_cmd(scriptsDir .. "/BrightnessKbd.sh --dec"), { repeating = true }) -- decrease keyboard brightness
|
||||||
hl.bind("XF86KbdBrightnessUp", hl.dsp.exec_cmd(scriptsDir .. "/BrightnessKbd.sh --inc"), { repeating = true }) -- increase keyboard brightness
|
hl.bind("XF86KbdBrightnessUp", hl.dsp.exec_cmd(scriptsDir .. "/BrightnessKbd.sh --inc"), { repeating = true }) -- increase keyboard brightness
|
||||||
hl.bind("XF86Launch1", hl.dsp.exec_cmd("rog-control-center")) -- ASUS Armory crate button
|
hl.bind("XF86Launch1", hl.dsp.exec_cmd("rog-control-center")) -- ASUS Armory crate button
|
||||||
@@ -161,7 +158,7 @@ hl.bind("XF86Launch3", hl.dsp.exec_cmd("asusctl led-mode -n")) -- FN+F4 Switch k
|
|||||||
hl.bind("XF86Launch4", hl.dsp.exec_cmd("asusctl profile -n")) -- FN+F5 change of fan profiles (Quiet, Balance, Performance)
|
hl.bind("XF86Launch4", hl.dsp.exec_cmd("asusctl profile -n")) -- FN+F5 change of fan profiles (Quiet, Balance, Performance)
|
||||||
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd(scriptsDir .. "/Brightness.sh --dec"), { repeating = true }) -- decrease monitor brightness
|
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd(scriptsDir .. "/Brightness.sh --dec"), { repeating = true }) -- decrease monitor brightness
|
||||||
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(scriptsDir .. "/Brightness.sh --inc"), { repeating = true }) -- increase monitor brightness
|
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(scriptsDir .. "/Brightness.sh --inc"), { repeating = true }) -- increase monitor brightness
|
||||||
hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd(scriptsDir .. "/TouchPad.sh")) -- disable touchpad
|
hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd(scriptsDir .. "/TouchPad.sh")) -- toggle touchpad (finds the device itself)
|
||||||
|
|
||||||
-- Screenshot keybindings using F6 (no PrintSrc button)
|
-- Screenshot keybindings using F6 (no PrintSrc button)
|
||||||
-- hl.bind(mainMod .. " + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --now")) -- screenshot
|
-- hl.bind(mainMod .. " + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --now")) -- screenshot
|
||||||
@@ -169,8 +166,3 @@ hl.bind("XF86TouchpadToggle", hl.dsp.exec_cmd(scriptsDir .. "/TouchPad.sh")) --
|
|||||||
-- hl.bind(mainMod .. " + CTRL + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --in5")) -- screenshot (5 secs delay)
|
-- hl.bind(mainMod .. " + CTRL + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --in5")) -- screenshot (5 secs delay)
|
||||||
-- hl.bind(mainMod .. " + ALT + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --in10")) -- screenshot (10 secs delay)
|
-- hl.bind(mainMod .. " + ALT + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --in10")) -- screenshot (10 secs delay)
|
||||||
-- hl.bind("ALT + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --active")) -- screenshot (active window only)
|
-- hl.bind("ALT + F6", hl.dsp.exec_cmd(scriptsDir .. "/ScreenShot.sh --active")) -- screenshot (active window only)
|
||||||
|
|
||||||
hl.device({
|
|
||||||
name = touchpadDevice,
|
|
||||||
enabled = true,
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -1,32 +1,30 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# HyprFlux — https://github.com/ahmad9059/HyprFlux
|
# Toggles the laptop touchpad (XF86TouchpadToggle).
|
||||||
# For disabling touchpad.
|
# Finds the touchpad by name in `hyprctl devices`, so it works on any laptop
|
||||||
# Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system
|
# without hard-coding the device. The Lua config rejects `hyprctl keyword`,
|
||||||
# use hyprctl devices to get your system touchpad device name
|
# so the device is switched with hl.device() through `hyprctl eval`.
|
||||||
# source https://github.com/hyprwm/Hyprland/discussions/4283?sort=new#discussioncomment-8648109
|
|
||||||
|
|
||||||
notif="$HOME/.config/swaync/images/ja.png"
|
notif="$HOME/.config/swaync/images/note.png"
|
||||||
|
STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
|
||||||
|
|
||||||
export STATUS_FILE="$XDG_RUNTIME_DIR/touchpad.status"
|
device=$(hyprctl devices -j | jq -r '[.mice[].name | select(test("touchpad"; "i"))][0] // empty')
|
||||||
|
if [ -z "$device" ]; then
|
||||||
enable_touchpad() {
|
notify-send -u low -i "$notif" "Touchpad" "No touchpad found"
|
||||||
printf "true" >"$STATUS_FILE"
|
exit 1
|
||||||
notify-send -u low -i $notif " Enabling" " touchpad"
|
fi
|
||||||
hyprctl keyword '$TOUCHPAD_ENABLED' "true" -r
|
|
||||||
}
|
set_touchpad() {
|
||||||
|
printf '%s' "$1" >"$STATUS_FILE"
|
||||||
disable_touchpad() {
|
hyprctl eval "hl.device({ name = \"$device\", enabled = $1 })" >/dev/null
|
||||||
printf "false" >"$STATUS_FILE"
|
if [ "$1" = true ]; then
|
||||||
notify-send -u low -i $notif " Disabling" " touchpad"
|
notify-send -u low -i "$notif" " Enabling" " touchpad"
|
||||||
hyprctl keyword '$TOUCHPAD_ENABLED' "false" -r
|
else
|
||||||
}
|
notify-send -u low -i "$notif" " Disabling" " touchpad"
|
||||||
|
fi
|
||||||
if ! [ -f "$STATUS_FILE" ]; then
|
}
|
||||||
enable_touchpad
|
|
||||||
else
|
if [ "$(cat "$STATUS_FILE" 2>/dev/null)" = "false" ]; then
|
||||||
if [ $(cat "$STATUS_FILE") = "true" ]; then
|
set_touchpad true
|
||||||
disable_touchpad
|
else
|
||||||
elif [ $(cat "$STATUS_FILE") = "false" ]; then
|
set_touchpad false
|
||||||
enable_touchpad
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user