1) Brightness.sh
Allows you to set up brightness of your monitor using terminal.
Following command is used to set brightness level.
sudo sh -c 'echo <brightness> > /sys/class/backlight/<device>/brightness'
Here <brightness> is brightness level, and takes integer values starting from 0. Higher the value, higher the brightness.
2) Volume.sh
Allows you to mute or unmute speakers.
Mute
pactl set-sink-mute 0 1
Enable speakers
pactl set-sink-mute 0 0
Here pactl stands for 'Pulse Audio Control'
3) Startup.sh
This script will run every bash script from given directory.
I use this script for switching profiles.
For example if I store brightness.sh and volume.sh in startup_scripts directory and run startup.sh then this startup.sh will run both brightness.sh and volume.sh for me.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Welcome !!" | |
echo $USER | |
echo "This will run startup scripts." | |
echo "Please authenticate. You need to be a sudoer." | |
echo "*********************************************" | |
echo "Adjusting Brightness to level 1." | |
# sudo sh -c 'echo <brightness> > /sys/class/backlight/<device>/brightness' | |
# for <device> | |
# cd /sys/class/backlight/ | |
# ls | |
sudo sh -c 'echo 1 > /sys/class/backlight/acpi_video0/brightness' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Welcome " $USER | |
echo "Settings up profile" | |
cd ../startup_scripts | |
# loop over all shell(*.sh) files in directory. | |
for f in *.sh | |
do | |
# Note that you need to change permissions of this file to make it executable. | |
./$f | |
done | |
echo "END of script" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "killing audio" | |
pactl set-sink-mute 0 1 |
No comments:
Post a Comment