Script now changes the screen timeout when the screen is locked and restores the values after unlocking from the config-file.
		
			
				
	
	
		
			26 lines
		
	
	
		
			655 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			655 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/bin/sh
 | 
						|
SCREENSAVER_TIMEOUT_DEFAULT=10
 | 
						|
NORMAL_TIMEOUT_DEFAULT=1800
 | 
						|
 | 
						|
case "$1" in
 | 
						|
  "locked")
 | 
						|
    # Read timeout from KDE
 | 
						|
    SCREENSAVER_TIMEOUT=$(kreadconfig5 --file powermanagementprofilesrc --group AC --group DPMSControl --key idleTime_screenSaver)
 | 
						|
    TIMEOUT="${NORMAL_TIMEOUT:-$SCREENSAVER_TIMEOUT_DEFAULT}"
 | 
						|
    ;;
 | 
						|
 | 
						|
  "unlocked")
 | 
						|
    # Read timeout from KDE
 | 
						|
    NORMAL_TIMEOUT=$(kreadconfig5 --file powermanagementprofilesrc --group AC --group DPMSControl --key idleTime)
 | 
						|
    TIMEOUT="${NORMAL_TIMEOUT:-$NORMAL_TIMEOUT_DEFAULT}"
 | 
						|
    ;;
 | 
						|
 | 
						|
  *)
 | 
						|
    echo "$0 <locked|unlocked>"
 | 
						|
    exit 1
 | 
						|
    ;;
 | 
						|
esac
 | 
						|
 | 
						|
# Set timeout-value
 | 
						|
xset s ${TIMEOUT} ${TIMEOUT}
 |