awesome-www/recipes/xrandr.mdwn

31 lines
1000 B
Plaintext
Raw Permalink Normal View History

2017-08-23 11:34:49 +02:00
# Helper for multiple monitors (based on xrandr)
2017-08-23 11:34:49 +02:00
The [[xrandr.lua|xrandr.lua]] script helps when dealing with multiple monitors.
Using this snippet you can set a keybinding where you swap to all possible
arrangements of monitors.
2017-08-23 11:34:49 +02:00
The process of setting up this script is as follows:
2017-08-23 11:34:49 +02:00
1. Create a file called `xrandr.lua` in your file system (preferably in
awesome's folder) with the [[script|xrandr.lua]] content.
2. Import the script in your `rc.lua`
2017-08-23 11:34:49 +02:00
```lua
local xrandr = require("xrandr")
```
2017-08-23 11:34:49 +02:00
3. Create a keybinding to the script in the `globalkeys` table
2017-08-23 11:34:49 +02:00
Pressing this key binding will open a popup with a possible screen
arrangement.
Pressing the key again will replace this popup with the next possibility,
eventually arriving at "keep the current configuration".
2017-08-23 11:34:49 +02:00
If the key is not pressed again within four seconds, the configuration
described in the current popup is applied.
2017-08-23 11:34:49 +02:00
```lua
awful.key({}, "Some Key", function() xrandr.xrandr() end)
```