Simple script using rofi as GUI to setup multi-monitor environment.
Select outputs and then select action :
Outputs list is dynamically build using python-xlib api. Current primary output is marked with a "*
".
Note : only connected outputs are displayed.
After output is selected, a new menu ask for action.
Actions are :
Disable
: Turn off selected outputAlone
: Keep only selected output on and turn off all othersPrimary
: Set this output as primary outputRight of xxx
: Setup selected output to the right of current primary outputLeft of xxx
: Setup selected output to the left of current primary outputAbove of xxx
: Setup selected output to the above of current primary outputBelow of xxx
: Setup selected output to the below of current primary output
- Python 3 (tested on 3.10.4)
- python-xlib
- rofi
- Nerd Font NotoSansMono for icons
- xrandr to run configuration changes
git clone git@github.com:qboileau/rofi-monitor-selector.git
cd ./rofi-monitor-selector
# Copy rofi themes on ~/.config/rofi
cp ./rofi-theme ~/.config/rofi
# Copy script on i3 configuration directory ~/.i3/scripts
mkdir -p ~/.i3/scripts
cp ./monitor-switcher.py ~/.i3/scripts
Then update i3 configuration to run this script on some binding.
For exemple on Mod + F6
.
~/.i3/config
:
bindsym $mod+F6 exec python ~/.i3/scripts/monitor-switcher.py
Thanks to EndeavourOS i3 team for inspiration and for a neat rofi theme configuration ! ❤️