SHARE
TWEET

dualscreen_switcher.sh

a guest Jan 7th, 2019 386 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top