This file contains hidden or 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
#!/bin/bash | |
device_ids=$(xinput -list | grep -i 'pointer' | grep -o id=[0-9]. | grep -o [0-9].) | |
for device_id in ${device_ids[@]} | |
do | |
prop_id=`xinput list-props ${device_id} | grep -i "Natural Scrolling Enabled" | grep -Po '(?<=\().*(?=\))' | head -1` | |
if [ "${prop_id}" ]; then$ | |
xinput set-prop ${device_id} ${prop_id} 1 | |
fi |
This file contains hidden or 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
#!/bin/sh | |
if ! type bclm >//dev/null 2>&1; then | |
echo 'bclm command not found, exiting' >&2 | |
exit 1 | |
fi | |
starting_bclm=$(bclm read) | |
echo "current bclm is $starting_bclm" |
This file contains hidden or 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
#!/bin/bash | |
current_capacity=$(ioreg -l | grep -o '"CurrentCapacity" = [0-9]*' | awk '{print $3}') | |
max_capacity=$(ioreg -l | grep -o '"MaxCapacity" = [0-9]*' | awk '{print $3}') | |
design_capacity=$(ioreg -l | grep -o '"DesignCapacity" = [0-9]*' | awk '{print $3}') | |
if [[ -n "$current_capacity" && -n "$max_capacity" && "$max_capacity" -ne 0 && -n "$design_capacity" && "$design_capacity" -ne 0 ]] | |
then | |
percentage=$(echo "scale=2; ($current_capacity / $max_capacity) * 100" | bc) | |
echo "Battery charge: $percentage%" |
This file contains hidden or 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
SELECT @row := @row + 1 as i FROM | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t2, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t3, | |
(select 0 union all select 1 union all select 3 union all select 4 union all select 5 union all select 6 union all select 6 union all select 7 union all select 8 union all select 9) t4, | |
(SELECT @row:=0) t5; |
This file contains hidden or 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
#!/bin/bash | |
echo "Hello, footpad!" | |
me=`basename "$0"` | |
socket_path=~/"${me}".socket | |
if [ -z "$1" ] || [ "$1" == "open" ] | |
then | |
if [ -f "${socket_path}" ] |
This file contains hidden or 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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
if [ ! -d ~/.vim/bundle/nerdtree ]; then | |
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree | |
fi |