diff --git a/Examples/brightness_rofi.sh b/Examples/brightness_rofi.sh new file mode 100755 index 00000000..95c92e5a --- /dev/null +++ b/Examples/brightness_rofi.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +BPATH="/sys/devices/platform/s3c24xx-pwm.0/pwm-backlight.0/backlight/pwm-backlight.0" + +MINB=0 +MAXB=$(cat ${BPATH}/max_brightness) + +CUR=$(cat ${BPATH}/brightness) + +C_STATE=$(((${CUR}*100)/${MAXB})) + +function list_brightness() +{ + for val in 5 10 15 30 50 70 100 + do + if [ ${val} -eq ${C_STATE} ] + then + echo "*${val} %" + else + echo "${val} %" + fi + done +} + +if [ -z "$@" ] +then + list_brightness +else + if [ -n "$@" ] + then + if [[ ${@} =~ ^[0-9]+ ]] + then + VALUE=${@% *} + notify-send "Set brightness to: ${VALUE} %" + NEW_STATE=$((${VALUE}*${MAXB}/100)) + echo ${NEW_STATE} > ${BPATH}/brightness + fi + fi +fi + diff --git a/INSTALL.md b/INSTALL.md index f103f9e8..faf68776 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,6 +1,11 @@ Installation guide: =================== +DEPENDENCY +---------- + +For i3 support, you need at least i3 version 4.5 or up. + Install from a release ---------------------- diff --git a/Makefile.am b/Makefile.am index 5e95f8d2..ca688bd1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,6 +69,8 @@ EXTRA_DIST=\ $(markdown_FILES)\ $(markdown_SC_FILES)\ Examples/i3_switch_workspaces.sh\ + Examples/brightness_rofi.sh\ + Examples/domo_rofi_script.sh\ INSTALL.md ##