Advertisement
Guest User

dualscreen_switcher.sh

a guest
Jan 7th, 2019
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. # Script to switch second monitor off or back on again
  2. # sterky was here...
  3.  
  4. # Check if second display (DP-2) is enabled
  5. check=$(nvidia-settings -q dpys | grep DP-2 | grep enabled)
  6.  
  7. # Switch display config
  8. if [ -z "$check" ]; then
  9.     # If disabled - notify and enable second screen
  10.     nvidia-settings --assign CurrentMetaMode="DP-4: 2560x1440_165 +0+0, DP-2: 2560x1440_165 +2560+0"
  11.     notify-send "Dualscreen - enabled" -t 4000 -i messagebox_info
  12. else
  13.     # If enabled - notify and disable second screen
  14.     nvidia-settings --assign CurrentMetaMode="DP-4: 2560x1440_165 +0+0"
  15.     notify-send "Dualscreen - disabled" -t 4000 -i messagebox_info
  16. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement