Add install script

Add Minibook configuration
Re-Add scripts
This commit is contained in:
phil 2023-07-16 12:17:59 +02:00
parent d24cc31b04
commit c1914511ee
7 changed files with 53 additions and 3 deletions

27
install.sh Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env bash
echo "Add tablet group..."
/usr/sbin/groupadd tablet
read -p "Enter your local username: " user
echo "Add user to group..."
usermod -a -G tablet "$user"
echo "Copy files..."
cp -r tabletmode/ /usr/local/lib/python3.11/dist-packages
cp tablet-mode.service /etc/systemd/system
cp laptop-mode.service /etc/systemd/system
cp tablet-mode.json /etc/
cp tablet-mode.desktop /home/"$user"/.local/applications
cp tablet-mode.sudoers /etc/sudoers.d/tablet-mode
cp setsysmode /usr/local/bin
chmod +x /usr/local/bin/setsysmode
cp sysmoded /usr/local/bin
chmod +x /usr/local/bin/sysmoded
echo "Reload systemd..."
systemctl daemon-reload
echo "Install packages..."
apt install evtest -y

View file

@ -3,7 +3,7 @@ Description=Configure system for laptop mode
Conflicts=tablet-mode.service
[Service]
ExecStart=/usr/bin/sysmoded laptop
ExecStart=/usr/local/bin/sysmoded laptop
StandardOutput=null
[Install]

8
setsysmode Normal file
View file

@ -0,0 +1,8 @@
#! /usr/bin/env python3
"""Sets the system mode."""
from tabletmode.cli import main
if __name__ == '__main__':
main()

8
sysmoded Normal file
View file

@ -0,0 +1,8 @@
#! /usr/bin/env python3
"""System mode daemon."""
from tabletmode.daemon import main
if __name__ == '__main__':
main()

View file

@ -2,6 +2,6 @@
Comment=Toggle tablet mode
Terminal=false
Name=Tablet Mode
Exec=/usr/bin/setsysmode toggle
Exec=/usr/local/bin/setsysmode toggle
Type=Application
Icon=pda-symbolic

7
tablet-mode.json Normal file
View file

@ -0,0 +1,7 @@
{
"tablet": [
"/dev/input/by-path/platform-i8042-serio-0-event-kbd",
"/dev/input/by-path/pci-0000:00:14.0-usb-0:9:1.0-event-mouse"
],
"notify": false
}

View file

@ -3,7 +3,7 @@ Description=Configure system for tablet mode
Conflicts=laptop-mode.service
[Service]
ExecStart=/usr/bin/sysmoded tablet
ExecStart=/usr/local/bin/sysmoded tablet
StandardOutput=null
[Install]