Debian Codegraph @

docs/software_usr/cli.rst

raw
1 .. _cli:
2
3 BusKill App: Command-Line Interface
4 =====================================
5
6 This page will describe how to use the BusKill app in CLI mode.
7
8 To control BusKill via the CLI, use the same executable with arguments (executing ``buskill`` without arguments opens it in GUI mode).
9
10 Help
11 ----
12
13 You can print a list of allowable arguments by passing the ``buskill`` app ``-h`` or ``--help``
14
15 ::
16
17 user@disp2781:~/Downloads/dist$ ./buskill.AppImage --help
18 ...
19 usage: buskill [-h] [--version] [--list-triggers] [-v] [-t] [-T] [-a] [-U]
20
21 App for arming and configuring BusKill. For help, see https://docs.buskill.in
22
23 optional arguments:
24 -h, --help show this help message and exit
25 --version print version and exit.
26 --list-triggers List all available triggers.
27 -v, --verbose increase output verbosity
28 -t , --trigger Choose trigger to execute. See --list-triggers for all
29 possible values.
30 -T, --run-trigger Immediately execute the trigger on start
31 -a, --arm Arms BusKill
32 -U, --upgrade Download & upgrade latest version of BusKill
33 user@disp2781:~/Downloads/dist$
34
35 Arming
36 ------
37
38 To arm BusKill, execute it with the ``-a`` or ``--arm`` argument
39
40 ::
41
42 user@disp2781:~/Downloads/dist$ ./buskill.AppImage --arm
43 ...
44 INFO: BusKill is armed. Listening for removal event.
45 INFO: To disarm the CLI, exit with ^C or close this terminal
46 user@disp2781:~/Downloads/dist$
47
48 Trigger Selector
49 ^^^^^^^^^^^^^^^^
50
51 You can use ``-t`` or ``--trigger`` to specify which trigger you would like the BusKill app to execute when your BusKill cable is disconnected. For example, to arm BusKill such that it will shutdown your computer when the BusKill cable is removed, choose the ``soft-shutdown`` trigger
52
53 ::
54
55 user@disp2781:~/Downloads/dist$ ./buskill.AppImage --arm --trigger soft-shutdown
56 ...
57 INFO: BusKill 'trigger' set to 'soft-shutdown'
58 INFO: BusKill is armed. Listening for removal event.
59 INFO: To disarm the CLI, exit with ^C or close this terminal
60
61 You can also list all available triggers with ``--list-triggers``
62
63 ::
64
65 user@disp2781:~/Downloads/dist$ ./buskill.AppImage --list-triggers
66 ...
67 Supported triggers include:
68 lock-screen
69 soft-shutdown
70 user@disp2781:~/Downloads/dist$
71
72 .. note::
73
74 Due to a limitation in the Windows API, executables cannot be switched between ``CONSOLE`` and ``WINDOWS`` at runtime. This effectively means that ``buskill.exe`` *can* be executed from the CLI, but it won't be interactive. For more info, see:
75
76
77 * https://github.com/BusKill/buskill-app/issues/21
78
79 As a simple workaround to launch the BusKill app in CLI mode, simply append ``| more`` to the command. For example, to arm the BusKill app from the CLI in the Windows Command Prompt:
80
81 ::
82
83 C:\Users\user\Desktop\buskill-Windows\buskill>buskill.exe --arm | more
84
85 Disarming
86 ---------
87
88 To disarm BusKill, simply send ``SIGTERM`` by typing ``ctrl+c`` or closing the terminal