Skip to content

Commit d188d02

Browse files
authored
Update README.md
1 parent 362eae2 commit d188d02

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,40 @@
22

33
Detects and executes commands when the computer switches to and from tablet mode.
44

5-
## Usage
5+
## Setup
6+
7+
Download the [latest release](https://github.com/yehuthi/linuxflip/releases/latest), and add your user to the `input` group (unless you want to run it as root -- not recommended).
8+
Then you can simply run it or hook it to a desktop session startup script.
9+
10+
> [!TIP]
11+
> <details>
12+
> <summary>⌨ Add yourself to <code>input</code> group</summary>
13+
>
14+
> Open the terminal (press <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> or find it as you would any other program), and enter:
15+
>
16+
> ```sh
17+
> sudo usermod -a input $USER
18+
> ```
19+
> </details>
620
7-
Download the [latest release](https://github.com/yehuthi/linuxflip/releases/latest), and add your user to the `input` group (unless you want to run it as root).
8-
Then you can simply run it or hook it to your system (e.g. in `~/.xinitrc`).
21+
## Usage
922
1023
Run `linuxflip --help` for usage options. The one you're probably interested in is:
1124
```
1225
linuxflip <tablet-cmd> <laptop-cmd>
1326
Runs <tablet-cmd> in a shell when the mode changes to tablet, and <laptop-cmd> when the mode changes to laptop.
1427
```
1528
16-
The commands run in a shell, so shell features are supported. If you'll run as root even through `sudo`, remember to not assume `~` will be substituted for your user's home directory; it's probably going to be `/root`. The commands run asynchronously.
17-
18-
> [!CAUTION]
19-
> Your commands will run with elevated privileges inherited from the program.
29+
- [x] The commands run in a shell, so shell features are supported (such as [tilde expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html)).
30+
- [x] The commands run asynchronously.
2031
21-
### Example
32+
### Examples
2233
2334
#### Scripts
24-
A typical example is running scripts from files. You can place them wherever you want and to run them, the command is simply their path (and as mentioned above, be careful with `~`). Set up those scripts however you want and make sure they're executable (`chmod +x`), then run:
35+
A typical example is running script files. You can place them wherever you want and to run them, the command is simply their path. Set up those scripts however you want and make sure they're executable (`chmod +x`), then run:
2536
2637
```bash
27-
linuxflip "/home/myuser/linuxflip_tablet" "/home/myuser/linuxflip_laptop"
38+
linuxflip "~/.config/linuxflip/tablet" "~/.config/linuxflip/laptop"
2839
```
2940
3041
#### Commands

0 commit comments

Comments
 (0)