Add command and script to automatically switch to nvidia drivers when needed

This commit is contained in:
Tanguy Herbron 2021-08-02 17:26:15 +02:00
parent 1af3abe9c7
commit d935345c8a
3 changed files with 17 additions and 0 deletions

View File

@ -620,3 +620,5 @@ exec_always --no-startup-id feh --bg-scale ~/Images/Wallpapers/aerial_waves.jpg
exec_always --no-startup-id xbindkeys --poll-rc exec_always --no-startup-id xbindkeys --poll-rc
exec_always --no-startup-id eww daemon & exec_always --no-startup-id eww daemon &
exec_always --no-startup-id udiskie & exec_always --no-startup-id udiskie &
exec --no-startup-id /home/tanguy/multihead.sh

3
.zshrc
View File

@ -88,6 +88,9 @@ dotfiles config --local status.showUntrackedFiles no
# Switch between nvidia and intel drivers with one command # Switch between nvidia and intel drivers with one command
alias driver='optimus-manager --no-confirm --switch' alias driver='optimus-manager --no-confirm --switch'
# Enable nvidia drivers and trigger the default multi-head configuration
alias multihead='touch /tmp/multihead && driver nvidia'
# Add an alias to the powerpill wrapper for pacman # Add an alias to the powerpill wrapper for pacman
alias pac='sudo pacman -S' alias pac='sudo pacman -S'

12
multihead.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ /tmp/multihead ] ; then
rm /tmp/multihead
# xrandr --auto --output HDMI-0 --right-of eDP-1-1 && xrandr --auto --output DP-1-1 --right-of HDMI-0
xrandr --auto --output DP-1-1 --left-of eDP-1-1 && xrandr --auto --output HDMI-0 --left-of DP-1-1
i3-msg "workspace 3, move workspace to output eDP-1-1"
i3-msg "workspace 1, move workspace to output HDMI-0"
i3-msg "workspace 2, move workspace to output DP-1-1"
~/.config/polybar/launch.sh > /dev/null 2>&1
fi