Add Keyboard module

This commit is contained in:
Stephan Raabe
2024-01-01 15:08:52 +01:00
parent 2dd04cba6c
commit ee8a6c6b51
8 changed files with 135 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
name="Keyboard"
order=30

View File

@@ -0,0 +1,2 @@
#!/bin/bash
_getHeader "$name"

View File

@@ -0,0 +1,2 @@
name="Natural Scrolling"
order=1

View File

@@ -0,0 +1,31 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "Enable/Disable the natural scrolling for touchpads."
# Define File
targetFile="$HOME/dotfiles/hypr/conf/keyboard.conf"
settingsFile="$HOME/dotfiles/.settings/keyboard_naturalscroll"
# Define Markers
findMarker="natural_scroll"
# Select Value
customvalue=$(gum choose "Enable" "Disable")
if [ ! -z $customvalue ]; then
if [ "$customvalue" == "Enable" ] ;then
customtext=" natural_scroll = true"
else
customtext=" natural_scroll = false"
fi
_replaceLineInFile "$findMarker" "$customtext" "$targetFile"
_writeSettings "$settingsFile" "$customtext"
echo "Keyboard settings changed."
sleep 2
_goBack
else
echo "ERROR: Define a value."
sleep 2
_goBack
fi