add scripts

This commit is contained in:
Crispy 2023-12-03 19:55:40 +01:00
parent b91bb6b7c8
commit bc7920537e
4 changed files with 26 additions and 1 deletions

6
scripts/bdays.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
date=$(date "+%-d\\/%-m")
echo $(cat ~/documents/notes/bdays.md \
| sed "/ $date/!d" \
| cut -d "|" -f3)

13
scripts/kb_battery.py Executable file
View file

@ -0,0 +1,13 @@
#!/bin/env python3
import subprocess
all_statuses = subprocess.run(["upower", "-d"], capture_output=True).stdout.decode("utf-8").split("\n\n")
for s in all_statuses:
if "leko pona 1" in s:
for line in s.split("\n"):
if "percentage:" in line:
print(line.split(":")[1].strip())
exit(0)
print("no kb found")

3
scripts/mount_ilo.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
sshfs -o idmap=user -o transform_symlinks ilo:/ ~/ilo

View file

@ -1 +1,4 @@
sed '/# unlikely/q' ~/documents/notes/projects.md | sed 's/#.*//;/^$/d' | shuf -n1 | echo "[$(date +%H:%M)] Work on this for an hour: $(cat -)" sed '/---/q' ~/documents/notes/projects.md \
| sed 's/#.*//;/^$/d' \
| shuf -n1 \
| echo "[$(date +%H:%M)] Work on this for an hour: $(cat -)"