added some bash related scripts
This commit is contained in:
parent
0da5fdf121
commit
4622ef55f9
8
scripts/bash-status-bat
Executable file
8
scripts/bash-status-bat
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
current=$(acpi --battery | sed -e 's/%.*//' | sed 's/.*, //')
|
||||
status="$current%"
|
||||
state=$(acpi --battery | sed -e 's/,.*//' | sed 's/.*: //')
|
||||
|
||||
|
||||
echo "$current% $state"
|
||||
11
scripts/bash-status-git
Executable file
11
scripts/bash-status-git
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
if git status &>/dev/null; then
|
||||
branch=$(git branch --show-current)
|
||||
|
||||
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
|
||||
echo "($branch~)"
|
||||
else
|
||||
echo "($branch*)"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user