nix: Make nix the root
Which means now I'll have to think about real prefixes in commit names.
This commit is contained in:
parent
550eed06e0
commit
ee178b7d57
190 changed files with 5 additions and 6 deletions
39
unprocessed/termux/scripts/autosvc
Executable file
39
unprocessed/termux/scripts/autosvc
Executable file
|
@ -0,0 +1,39 @@
|
|||
#!/data/data/com.termux/files/usr/bin/bash
|
||||
#
|
||||
# Start services based on phone state
|
||||
#
|
||||
|
||||
function act() {
|
||||
# Services that should be always on
|
||||
|
||||
service sshd start
|
||||
service autosvc start
|
||||
|
||||
# Services that should be on depending on battery
|
||||
|
||||
bat="$(termux-battery-status | jq -r '.status')"
|
||||
|
||||
if [[ "$bat" == "FULL" || "$bat" == "CHARGING" ]]
|
||||
then
|
||||
service syncthing start
|
||||
else
|
||||
service syncthing stop
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" == "-d" ]
|
||||
then
|
||||
# Daemon mode
|
||||
while true
|
||||
do
|
||||
echo 29
|
||||
act &>> $HOME/.local/log/autosvc.log
|
||||
echo 31
|
||||
sleep 60
|
||||
done
|
||||
else
|
||||
# One shot mode
|
||||
# TODO Soft-code the log destination & the program arguments
|
||||
act
|
||||
fi
|
||||
|
22
unprocessed/termux/scripts/service
Executable file
22
unprocessed/termux/scripts/service
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/data/data/com.termux/files/usr/bin/bash
|
||||
#
|
||||
# Run & stop Termux services
|
||||
#
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Expected a service name as first argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
service="$1"
|
||||
file="$HOME/.termux/services/$1"
|
||||
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
shift
|
||||
$file "$@"
|
||||
else
|
||||
echo "Service not found: $1"
|
||||
fi
|
||||
|
11
unprocessed/termux/scripts/sudo
Executable file
11
unprocessed/termux/scripts/sudo
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/data/data/com.termux/files/usr/bin/bash
|
||||
#
|
||||
# Substitution for sudo
|
||||
#
|
||||
|
||||
if [ "$(whoami)" != 'root' ]
|
||||
then
|
||||
echo "$@" | tsu
|
||||
else
|
||||
"$@"
|
||||
fi
|
6
unprocessed/termux/scripts/tsu.old
Executable file
6
unprocessed/termux/scripts/tsu.old
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/data/data/com.termux/files/usr/bin/env bash
|
||||
|
||||
# Force the passing of the environment variables on LineageOS where the --preserve-environment
|
||||
# option on the su binary doesn't seem to work well
|
||||
|
||||
/data/data/com.termux/files/usr/bin/tsu -s "$(env | sed "s/^\([^=]\+\)=\(.*\)/\1='\2'/" | tr '\n' ' ') $(which bash)"
|
3
unprocessed/termux/scripts/yt
Executable file
3
unprocessed/termux/scripts/yt
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/data/data/com.termux/files/usr/bin/env bash
|
||||
cd ~/storage/shared/Movies/NewPipe/
|
||||
youtube-dl --all-subs "${@: -1}"
|
Loading…
Add table
Add a link
Reference in a new issue