Advertisement
Guest User

Untitled

a guest
Jun 9th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2. #by xpander
  3.  
  4. # Define toggle file
  5. TOGGLE=$HOME/.toggle_output
  6.  
  7. # Define output name and target positions
  8. POSITION_1=2560,1440
  9. POSITION_2=2560,0
  10.  
  11. # Check current position using kscreen-doctor
  12. CURRENT_POSITION=$(kscreen-doctor -o | grep "Output:" -A 6 | grep -m1 "Geometry:" | awk '{print $3}')
  13. echo $CURRENT_POSITION
  14. # Toggle position
  15. if [ ! -e $TOGGLE ]; then
  16.     touch $TOGGLE
  17.     # Set to position 2560,1440
  18.     kscreen-doctor output.1.position.$POSITION_1
  19.     echo "Position set to: $POSITION_1"
  20. else
  21.     rm $TOGGLE
  22.    # Set to position 2560,0
  23.     kscreen-doctor output.1.position.$POSITION_2
  24.     echo "Position set to: $POSITION_2"
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement