Prevent battery drain during suspend mode on Linux

Published on Author admin

cat /sys/power/mem_sleep will return "s2idle" and "deep" values, value surrounded by square brackets will show which mode is currently activated. Probably when you observer battery drain during suspend, you will see "s2idle" highlighted. To change it do deep sleep mode use command: echo deep > /sys/power/mem_sleep To make change permanent add the following to your… Continue reading Prevent battery drain during suspend mode on Linux

Display Git branch in Bash prompt

Published on Author admin

To display Git branch in Bash prompt append ~/.bashrc file with following content: parse_git_branch() {      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } export PS1="\[\e[92m\]\u@\h \[\e[94m\]\w \[\e[95m\]\$(parse_git_branch)\[\e[00m\]$ "