User Tools

Site Tools


laptop_hacks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
laptop_hacks [2018/10/25 21:52]
admin [Power Disconnect/Connect events]
laptop_hacks [2020/02/08 23:41] (current)
admin [Laptop Hacks]
Line 1: Line 1:
 =====Laptop Hacks===== =====Laptop Hacks=====
  
-Ho boy, this got difficult really quickly - in 2011 I had everything working on my laptop (Dell XPS-15 L502X) with the LXDE spin of fedora plus fluxbox. After a quick spurt of travel using all the laptoppy things like conserving battery life, suspend/​resume and lid up and downI left it alone, using it like a desktop on AC power but updating through various fedora'​s. Quite unbeknownst to me, ''​systemd''​ came in and the laptoppy stuff got broken - I had to re-discover how to do everything again. Now I know and understand some of it and hopefully recording it here will help me next time.+Ho boy, this got difficult really quickly - in 2011 I had everything working on my laptop (Dell XPS-15 L502X) with the LXDE spin of fedora plus fluxbox. After a quick spurt of travel using all the laptoppy things like conserving battery life, suspend/​resume and lid up and down I left it alone, using it like a desktop on AC power but updating through various fedora'​s. Quite unbeknownst to me, ''​systemd''​ came in and the laptoppy stuff got broken - I had to re-discover how to do everything again. Now I know and understand some of it and hopefully recording it here will help me next time.
  
 Maybe it'll help you too - but you will almost certainly need to some make tweaks for your particular setup. Maybe it'll help you too - but you will almost certainly need to some make tweaks for your particular setup.
Line 238: Line 238:
  
 and run ''​systemctl enable bhepple-resume.service''​ and run ''​systemctl enable bhepple-resume.service''​
 +
 +brightness is this:
 +
 +  #!/bin/bash
 +  ​
 +  # since xbacklight isn't working (nouveau?)
 +  # https://​bbs.archlinux.org/​viewtopic.php?​id=134972 and modified:
 +  ​
 +  # needs to be run as root
 +  ​
 +  NEW_VALUE=${1:​-0}
 +  ​
 +  # base dir for backlight class
 +  basedir="/​sys/​class/​backlight/"​
 +  ​
 +  # get the backlight handler
 +  handler=$basedir$(ls $basedir |head -n 1)"/"​
 +  ​
 +  # get current brightness
 +  old_brightness=$(cat $handler"​brightness"​)
 +  ​
 +  # get max brightness
 +  max_brightness=$(cat $handler"​max_brightness"​)
 +  ​
 +  # get current brightness %
 +  old_brightness_p=$(( 100 * $old_brightness / $max_brightness ))
 +  ​
 +  # calculate new brightness %
 +  if [[ $NEW_VALUE == [+-]* ]]; then
 +      new_brightness_p=$(($old_brightness_p + $NEW_VALUE))
 +  else
 +      new_brightness_p=$NEW_VALUE
 +  fi
 +  ​
 +  # calculate new brightness value
 +  new_brightness=$(( $max_brightness * $new_brightness_p / 100 ))
 +  ​
 +  (( new_brightness <= max_brightness && new_brightness >= 0 )) && {
 +      # set the new brightness value
 +      echo $new_brightness > $handler"​brightness"​
 +  }
 +  ​
 ====Disable nouveau==== ====Disable nouveau====
  
laptop_hacks.1540504329.txt.gz ยท Last modified: 2018/10/25 21:52 by admin