41 lines
890 B
Markdown
41 lines
890 B
Markdown
|
# Monitor switch (based on XrandR)
|
||
|
|
||
|
Switching occurs only if 2 monitors are connected to the computer!
|
||
|
|
||
|
## dub
|
||
|
|
||
|
- [Introduction](https://dub.pm/package-format-json)
|
||
|
- [General usage](https://dub.pm/commandline.html)
|
||
|
- [Configuring default settings](https://dub.pm/settings)
|
||
|
|
||
|
## How to build
|
||
|
|
||
|
Install `gcc` and `X11` development libraries. Also install `dmd` or `ldc` compiler. Run:
|
||
|
|
||
|
```sh
|
||
|
git clone https://git.zhirov.website/alexander/mswitch.git
|
||
|
cd mswitch
|
||
|
dub
|
||
|
```
|
||
|
|
||
|
or
|
||
|
|
||
|
```sh
|
||
|
dub -- ~/mswitch.log
|
||
|
```
|
||
|
|
||
|
Something similar will be output to the log file `mswitch.log`, and the monitors will be changed:
|
||
|
|
||
|
```sh
|
||
|
[Monitor("eDP-1", true, 1366, 768), Monitor("HDMI-1", false, 1920, 1080)]
|
||
|
-- Switch monitors --
|
||
|
[Monitor("HDMI-1", true, 1920, 1080), Monitor("eDP-1", false, 1366, 768)]
|
||
|
```
|
||
|
|
||
|
where first (or second) line:
|
||
|
|
||
|
- `eDP-1` - output
|
||
|
- `true` - is primary
|
||
|
- `1366` - width
|
||
|
- `768` - height
|