mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-22 07:13:55 -05:00
hyprland: toggleable switch for tablet mode
This commit is contained in:
parent
bd1b97a191
commit
b8a7477b5b
|
@ -141,11 +141,6 @@
|
|||
(lib.getExe pkgs.gammastep)
|
||||
]
|
||||
else []
|
||||
)
|
||||
++ (
|
||||
if config.alyraffauf.desktop.hyprland.tabletMode.virtKeyboard
|
||||
then [(defaultApps.virtKeyboard)]
|
||||
else []
|
||||
);
|
||||
|
||||
screenshot = rec {
|
||||
|
@ -189,6 +184,19 @@
|
|||
fi
|
||||
'';
|
||||
|
||||
tablet = pkgs.writeShellScript "hyprland-tablet" ''
|
||||
STATE=`${lib.getExe pkgs.dconf} read /org/gnome/desktop/a11y/applications/screen-keyboard-enabled`
|
||||
|
||||
if [ $STATE -z ] || [ $STATE == "false" ]; then
|
||||
if ! [ `pgrep -f ${defaultApps.virtKeyboard}` ]; then
|
||||
${defaultApps.virtKeyboard} &
|
||||
fi
|
||||
${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled true
|
||||
elif [ $STATE == "true" ]; then
|
||||
${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled false
|
||||
fi
|
||||
'';
|
||||
|
||||
# Media/hardware commands
|
||||
brightness = rec {
|
||||
bin = lib.getExe' pkgs.swayosd "swayosd-client";
|
||||
|
@ -242,8 +250,7 @@
|
|||
bindl=,switch:off:Lid Switch,exec,${clamshell} off
|
||||
|
||||
# Enable virtual keyboard in tablet mode
|
||||
bindl=,switch:on:Lenovo Yoga Tablet Mode Control switch,exec,${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled true
|
||||
bindl=,switch:off:Lenovo Yoga Tablet Mode Control switch,exec,${lib.getExe pkgs.dconf} write /org/gnome/desktop/a11y/applications/screen-keyboard-enabled false
|
||||
bindl=,switch:Lenovo Yoga Tablet Mode Control switch,exec,${tablet}
|
||||
|
||||
# unscale XWayland apps
|
||||
xwayland {
|
||||
|
|
Loading…
Reference in a new issue