- -o -name .undo-tree-history -prune \) -type f 2>/dev/null
-}
-
-# one that comes with distros is too old for newer devices
-fastboot() {
- /a/opt/android-platform-tools/fastboot "$@";
-}
-
-kdecd() { /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd; }
-
-# List of apps to install/update
-# Create from existing manually installed apps by doing
-# fdroidcl update
-# fdroidcl search -i, then manually removing
-# automatically installed/preinstalled apps
-
-#
-# # my attempt at recovering from boot loop:
-# # in that case, boot to recovery (volume up, home button, power, let go of power after samsun logo)
-# # then
-# mount /dev/block/mmcblk0p12 /data
-# cd /data
-# find -iname '*appname*'
-# rm -rf FOUND_DIRS
-# usually good enough to just rm -rf /data/app/APPNAME
-#
-# currently broken:
-# # causes replicant to crash
-# org.quantumbadger.redreader
-# org.kde.kdeconnect_tp
-
-# not broke, but wont work without gps
-#com.zoffcc.applications.zanavi
-# not broke, but not using atm
-#com.nutomic.syncthingandroid
-# # doesn\'t work on replicant
-#net.sourceforge.opencamera
-#
-fdroid_pkgs=(
- de.marmaro.krt.ffupdater
- me.ccrama.redditslide
- org.fedorahosted.freeotp
- at.bitfire.davdroid
- com.alaskalinuxuser.justnotes
- com.artifex.mupdf.viewer.app
- com.danielkim.soundrecorder
- com.fsck.k9
- com.ghostsq.commander
- com.ichi2.anki
- com.jmstudios.redmoon
- com.jmstudios.chibe
- org.kde.kdeconnect_tp
- com.notecryptpro
- com.termux
- cz.martykan.forecastie
- de.danoeh.antennapod
- de.blinkt.openvpn
- de.marmaro.krt.ffupdater
- eu.siacs.conversations
- free.rm.skytube.oss
- im.vector.alpha # riot
- info.papdt.blackblub
- me.tripsit.tripmobile
- net.gaast.giggity
- net.minetest.minetest
- net.osmand.plus
- org.isoron.uhabits
- org.linphone
- org.gnu.icecat
- org.smssecure.smssecure
- org.yaaic
- sh.ftp.rocketninelabs.meditationassistant.opensource
-)
-# https://forum.xda-developers.com/android/software-hacking/wip-selinux-capable-superuser-t3216394
-# for maru,
-#me.phh.superuser
-
-fdup() {
- local -A installed updated
- local p
- fdroidcl update
- if fdroidcl search -u | grep ^org.fdroid.fdroid; then
- fdroidcl upgrade org.fdroid.fdroid
- sleep 5
- fdroidcl update
- fi
- for p in $(fdroidcl search -i| grep -o "^\S\+"); do
- installed[$p]=true
- done
- for p in $(fdroidcl search -u| grep -o "^\S\+"); do
- updated[$p]=false
- done
- for p in ${fdroid_pkgs[@]}; do
- if ! ${installed[$p]:-false}; then
- fdroidcl install $p
- # sleeps are just me being paranoid since replicant has a history of crashing when certain apps are installed
- sleep 5
- fi
- done
- for p in ${!installed[@]}; do
- if ! ${updated[$p]:-true}; then
- fdroidcl upgrade $p
- sleep 5
- fi
- done
-}
-
-firefox-default-profile() {
- key=Default value=1 section=$1
- file=/p/c/subdir_files/.mozilla/firefox/profiles.ini
- sed -ri "/^ *$key/d" "$file"
- sed -ri "/ *\[$section\]/,/^ *\[[^]]+\]/{/^\s*$key[[:space:]=]/d};/ *\[$section\]/a $key=$value" "$file"
-}
-fdhome() { #firefox default home profile
- firefox-default-profile Profile0
-}
-
-fdwork() {
- firefox-default-profile Profile4
-}
-
-ff() {
- if type -P firefox &>/dev/null; then
- firefox "$@"
- else
- iceweasel "$@"
- fi
-}
-
-
-
-fn() {
- firefox -P alt "$@" >/dev/null 2>&1
-}
-
-
-fsdiff () {
- local missing=false
- local dname="${PWD##*/}"
- local m="/a/tmp/$dname-missing"
- local d="/a/tmp/$dname-diff"
- [[ -e $d ]] && rm "$d"
- [[ -e $m ]] && rm "$m"
- local msize=0
- local fsfile
- while read -r line; do
- fsfile="$1${line#.}"
- if [[ -e "$fsfile" ]]; then
- md5diff "$line" "$fsfile" && tee -a "/a/tmp/$dname-diff" <<< "$fsfile $line"
- else
- missing=true
- echo "$line" >> "$m"
- msize=$((msize + 1))
- fi
- done < <(find -type f )
- if $missing; then
- echo "$m"
- (( msize <= 100 )) && cat $m
- fi
-}
-fsdiff-test() {
- # expected output, with different tmp dirs
- # /tmp/tmp.HDPbwMqdC9/c/d ./c/d
- # /a/tmp/tmp.qLDkYxBYPM-missing
- # ./b
- cd $(mktemp -d)
- echo ok > a
- echo nok > b
- mkdir c
- echo ok > c/d
- local x=$(mktemp -d)
- mkdir $x/c
- echo different > $x/c/d
- echo ok > $x/a
- fsdiff $x
-}
-rename-test() {
- # test whether missing files were renamed, generally for use with fsdiff
- # $1 = fsdiff output file, $2 = directory to compare to. pwd = fsdiff dir
- # echos non-renamed files
- local x y found
- unset sums
- for x in "$2"/*; do
- { sums+=( "$(md5sum < "$x")" ) ; } 2>/dev/null
- done
- while read -r line; do
- { missing_sum=$(md5sum < "$line") ; } 2>/dev/null
- renamed=false
- for x in "${sums[@]}"; do
- if [[ $missing_sum == "$x" ]]; then
- renamed=true
- break
- fi
- done
- $renamed || echo "$line"
- done < "$1"
- return 0
-}
-
-feh() {
- # F = fullscren, z = random, Z = auto zoom
- command feh -FzZ "$@"