Compare commits

..

No commits in common. "bf1c36b03baa894320aa0104fb313d160161a990" and "6f970a2b1a328b261e0ffbf370a6bf1cd7a00275" have entirely different histories.

16 changed files with 79 additions and 196 deletions

4
.gitmodules vendored
View File

@ -8,5 +8,5 @@
branch = master
[submodule "submodules/shell-things"]
path = submodules/shell-things
url = https://codeberg.org/Aminda/shell-things.git
branch = cxefa
url = https://gitea.blesmrt.net/Mikaela/shell-things.git
branch = master

View File

@ -10,6 +10,8 @@ ci:
default_language_version:
node: "lts"
# Remember .python-version and pyproject.toml !
python: "3.13"
ruby: ".ruby-version"
repos:

1
.python-version Normal file
View File

@ -0,0 +1 @@
system

View File

@ -8,10 +8,7 @@
set -x
if ! hash adb 2> /dev/null; then
echo "Error: adb not found in $PATH" 1>&2
exit 1
fi
# TODO: if adb is not installed or in $PATH, exit?
# Remember,
echo "In case of trouble check Android System Settings, Connected devices, USB mode. It should be data transfer for adb USB debugging to take effect."
@ -45,21 +42,16 @@ adb "$@" shell pm grant com.github.cvzi.darkmodewallpaper android.permission.REA
(adb "$@" shell pm uninstall com.google.android.safetycore &)
#(adb "$@" shell pm disable com.google.android.safetycore &)
# Enable DNS-over-TLS
(adb "$@" shell settings put global private_dns_mode hostname &)
# If dns.google or cloudflare-dns.com, it will be updated to DoH3
#(adb "$@" shell settings put global private_dns_specifier dns.google &)
# TODO: Revisit this after DNS4EU launch. Regardless of potential issues,
# I am tempted by non-commercial ad filtering DNS.
(adb "$@" shell settings put global private_dns_specifier dns.adguard-dns.com &)
# I thought maybe setting the above to DoH3 and this would together allow
# arbitary DoH3 server, but no
# Should tell whether the DoH3 module exists
(adb "$@" shell pm list package | grep com.android.resolv &)
# If 1, DoH3 is supported. How about trying to make it 1?
(adb "$@" shell cmd device_config get netd_native doh &)
(adb "$@" shell cmd device_config put netd_native doh 1 &)
# Wait a bit and then reboot the device
sleep 5
#adb "$@" reboot
printf "Consider: adb $@ shell settings put global private_dns_specifier dns.adguard-dns.com\n"
printf "Performance issues? adb $@ shell top -b | head\n"
printf "Performance issues? adb shell top -b | head\n"
set +x

View File

@ -80,12 +80,6 @@ else
printf "Either linuxbrew is not installed or running as root, skipping linuxbrew...\n"
fi
if hash pipx 2> /dev/null; then
if [[ $(id -u) != 0 ]]; then
pipx upgrade-all
fi
fi
if hash rpmconf 2> /dev/null; then
# Tests if there are rpmsave/rpmnew files, hopefully is non-interactive
rpmconf -a -t
@ -156,5 +150,17 @@ if [ -f /root/fixgrub.bash ]; then
. /root/fixgrub.bash
fi
# Lumina & Sedric have been having kernel update issues, let's see if this
# script could detect and suggest action for that.
# if [ -f /root/fix-kernel-install.bash ]; then
# . /root/fix-kernel-install.bash
# fi
# TODO: This seems to have been entirely on wrong track. Remove it?
#if hash kernel-install 2> /dev/null; then
# sleep 3
# kernel-install add-all -v
# sleep 5
#fi
# Hide commands being executed again
set +x

41
bash/fix-kernel-install.bash Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env bash
#set -x
export LC_ALL=en_DK.UTF-8
# Check for existence of /etc/machine-id/
if [ -f /etc/machine-id ]; then
# How about we just store the machine-id instead of fetching it
# constantly?
MACHINEID="$(cat /etc/machine-id)"
#echo "Our machine-id is $MACHINEID"
# Check for existence of the /boot/<machine-id> directory
if [ -d /boot/efi/"$MACHINEID" ]; then
# Store the latest installed kernel to $EXPECTEDKERNEL
EXPECTEDKERNEL="$(find /lib/modules -maxdepth 1 -printf '%P\n' | sort | tail -n -1)"
# And actual kernel in the boot/efi directory
ACTUALKERNEL="$(find /boot/efi/"$MACHINEID"/ -maxdepth 1 -printf '%P\n' | sort | tail -n -1)"
# Are they the same? Everything OK!
if [ "$EXPECTEDKERNEL" == "$ACTUALKERNEL" ]; then
echo "The kernel situation seems OK."
else
printf "\nWARNING! Kernels mismatch! Suggested actions:\n"
printf "\tsudo mkdir /boot/%b/%b\n" "$MACHINEID" "$EXPECTEDKERNEL"
printf "\tsudo kernel-install -v add %b /lib/modules/%b/vmlinuz\n" "$EXPECTEDKERNEL" "$EXPECTEDKERNEL"
#printf "\tsudo dnf reinstall kernel-core-%b -y\n" "$EXPECTEDKERNEL"
printf "Please note that Lumina and Sedric have moved to UKI.\n"
fi
fi
fi
echo "New kernel? Just in case, try sudo kernel-install -v add $(uname -r) # although using the actual new kernel version"
echo "Alternatively sudo kernel-install -v add-all"
#set +x

View File

@ -1,89 +0,0 @@
#!/usr/bin/env bash
set -x
# I am not a fan of Snap in general due to issues such as one allowed
# repository allowed at a time, closed source server, issues when running
# without a desktop environment, but with web browsers it beats flatpak for
# respecting browser policies, thus this script which is kind of
# snap-workarounds.bash
# WARNING: No KDE Desktop Integration for snap users. And obviously this
# script isn't going to install snap duplicates of browsers that are already
# installed, Ubuntu users are trusted to know firefox/chromium are wrappers
# for snaps.
# If snap isn't installed, exit
if ! hash snap 2> /dev/null; then
echo "This script is useless without snap installed."
exit 1
fi
# Require root or exit
if [ "$(id -u)" != "0" ]; then
echo "This script requires root." 1>&2
exit 1
fi
# Ensure classic snap support is enabled
if [ ! -d "/snap" ]; then
ln -nsv /var/lib/snapd/snap /snap
fi
# Init policy directories or quit if the script isn't available
if [ -f "../submodules/shell-things/etc/init-browser-policies.bash" ]; then
# TODO: That script has comments that might be more at home here!
../submodules/shell-things/etc/init-browser-policies.bash
else
echo "Missing submodule shell-things, initializing submodules"
git submodule update --init
echo "Please run the script again!"
exit 1
fi
# If Firefox is already installed, switch to the ESR channel for distrust
# towards Mozilla and search engine policy support. Otherwise install Firefox
# This is officially supported/published by Mozilla.
if [[ ! -f "/usr/bin/firefox" ]] && [[ ! -f "/usr/bin/firefox-esr" ]]; then
if [ -f "/snap/bin/firefox" ]; then
snap refresh firefox --channel=esr/stable
else
snap install firefox --channel=esr/stable
fi
else
echo "If on Ubuntu: sudo snap refresh firefox --channel=esr/stable"
fi
# Difficult to test Chromium policies without Chromium. And for testing edge is fine.
# Published/supported by Canonical.
if [[ ! -f "/usr/bin/chromium" ]] && [[ ! -f "/usr/bin/chromium-browser" ]]; then
if [ -f "/snap/bin/chromium" ]; then
snap refresh chromium --channel=edge
else
snap install chromium --edge
fi
else
echo "If on Ubuntu: sudo snap refresh chromium --channel=edge"
fi
# European/Norwegian freeware browser that I prefer to keep installed as an option.
# Official snap.
if [[ ! -f "/usr/bin/vivaldi" ]] && [[ ! -f "/usr/bin/vivaldi-snapshot" ]]; then
if [ -f "/snap/bin/vivaldi.vivaldi-stable" ]; then
snap refresh vivaldi
else
snap install vivaldi
fi
fi
# TODO: Revisit when they change CEO.
# - 2008: https://en.wikipedia.org/wiki/Brendan_Eich#Appointment_to_CEO_and_resignation
# - 2025: https://news.ycombinator.com/item?id=43251203
#
#if [[ ! -f "/usr/bin/brave-browser-stable" ]] && [[ ! -f "/usr/bin/brave-browser-beta" ]] && [[ ! -f "/usr/bin/brave-browser-nightly" ]]; then
# if [ -f "/snap/bin/brave" ]; then
# snap refresh brave
# else
# snap install brave
# fi
#fi
set +x

View File

@ -1,12 +1,9 @@
#!/usr/bin/env bash
set -x
set -x
if [[ -d "$HOME/.config/BraveSoftware/Brave-Browser-Nightly" && -d "$HOME/.cache/BraveSoftware/Brave-Browser-Nightly" ]]; then
/usr/bin/brave-browser-nightly --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
elif [ -f /usr/bin/brave-browser-stable ]; then
else
/usr/bin/brave-browser-stable --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
elif [ -f /snap/bin/brave ]; then
snap run brave --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable "$@"
fi
set +x

View File

@ -1,8 +1,4 @@
#!/usr/bin/env bash
set -x
if [ -f /usr/bin/chromium-browser ]; then
/usr/bin/chromium-browser --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
else
snap run chromium --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable "$@"
fi
/usr/bin/chromium-browser --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
set +x

View File

@ -4,9 +4,5 @@
set -x
# --start-in-tray - would be nice, but then I cannot open it from there, thus --use-tray-icon
(flatpak run org.signal.Signal --use-tray-icon --ozone-platform=wayland --enable-features=WaylandWindowDecorations "$@" &)
if [ -f /snap/bin/signal-desktop ]; then
#snap set signal-desktop tray-icon=true
(snap run signal-desktop --use-tray-icon --ozone-platform=wayland --enable-features=WaylandWindowDecorations "$@" &)
fi
flatpak run org.signal.Signal --use-tray-icon --ozone-platform=wayland --enable-features=WaylandWindowDecorations "$@"
set +x

View File

@ -2,9 +2,7 @@
set -x
if [[ -d "$HOME/.config/vivaldi-snapshot" && -d "$HOME/.cache/vivaldi-snapshot" ]]; then
/usr/bin/vivaldi-snapshot --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
elif [ -f /usr/bin/vivaldi ]; then
else
/usr/bin/vivaldi --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable-features=WaylandWindowDecorations "$@"
elif [ -f /snap/bin/vivaldi.vivaldi-stable ]; then
snap run vivaldi.vivaldi-stable --ozone-platform=wayland --disk-cache-dir='/dev/null' --enable "$@"
fi
set +x

View File

@ -1,14 +1,13 @@
{
"devDependencies": {
"@aminda/global-prettier-config": "2025.13.0",
"@aminda/global-prettier-config": "2025.10.0",
"@prettier/plugin-ruby": "4.0.4",
"@prettier/plugin-xml": "3.4.1",
"corepack": "latest",
"prettier": "3.5.3",
"prettier-plugin-nginx": "1.0.3",
"prettier-plugin-sh": "0.15.0",
"prettier-plugin-toml": "2.0.2"
},
"packageManager": "pnpm@10.6.5+sha512.cdf928fca20832cd59ec53826492b7dc25dc524d4370b6b4adbf65803d32efaa6c1c88147c0ae4e8d579a6c9eec715757b50d4fa35eea179d868eada4ed043af",
"packageManager": "pnpm@10.6.0+sha512.df0136e797db0cfa7ec1084e77f3bdf81bacbae9066832fbf95cba4c2140ad05e64f316cde51ce3f99ea00a91ffc702d6aedd3c0f450f895e3e7c052fe573cd8",
"prettier": "@aminda/global-prettier-config"
}

24
pnpm-lock.yaml generated vendored
View File

@ -8,17 +8,14 @@ importers:
.:
devDependencies:
"@aminda/global-prettier-config":
specifier: 2025.13.0
version: 2025.13.0
specifier: 2025.10.0
version: 2025.10.0
"@prettier/plugin-ruby":
specifier: 4.0.4
version: 4.0.4(prettier@3.5.3)
"@prettier/plugin-xml":
specifier: 3.4.1
version: 3.4.1(prettier@3.5.3)
corepack:
specifier: latest
version: 0.32.0
prettier:
specifier: 3.5.3
version: 3.5.3
@ -33,10 +30,10 @@ importers:
version: 2.0.2(prettier@3.5.3)
packages:
"@aminda/global-prettier-config@2025.13.0":
"@aminda/global-prettier-config@2025.10.0":
resolution:
{
integrity: sha512-1yRmlX7lrBu41eu7dcAF17fTYdbnTYp6o1zRKGUVku6ddz9rp0cjCw4QK1oNrUq7KU0GAAlxQtDfw0WlOzJw+A==,
integrity: sha512-7M2TWWTZDU6rU0AkcNeFSILuvh8lT3Mr0TAl/ZVctYWgWuzOzyRVZySwStl4o3Oj2QMCEEEky5wzJO8540rq1Q==,
}
"@prettier/plugin-ruby@4.0.4":
@ -79,14 +76,6 @@ packages:
integrity: sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==,
}
corepack@0.32.0:
resolution:
{
integrity: sha512-KhahVUFy7xL8OTty/ToY646hXMQhih8rnvUkA9/qnk/u4QUF2+SbQneX/zZnDxG1NiABFm5ojZCWnIv93oyhhQ==,
}
engines: { node: ^18.17.1 || ^20.10.0 || >=22.11.0 }
hasBin: true
mvdan-sh@0.10.1:
resolution:
{
@ -145,11 +134,10 @@ packages:
}
snapshots:
"@aminda/global-prettier-config@2025.13.0":
"@aminda/global-prettier-config@2025.10.0":
dependencies:
"@prettier/plugin-ruby": 4.0.4(prettier@3.5.3)
"@prettier/plugin-xml": 3.4.1(prettier@3.5.3)
corepack: 0.32.0
prettier: 3.5.3
prettier-plugin-nginx: 1.0.3
prettier-plugin-sh: 0.15.0(prettier@3.5.3)
@ -178,8 +166,6 @@ snapshots:
dependencies:
regexp-to-ast: 0.5.0
corepack@0.32.0: {}
mvdan-sh@0.10.1: {}
prettier-plugin-nginx@1.0.3: {}

View File

@ -1,42 +0,0 @@
#!/usr/bin/env python3
"""
A family member wanted to know what dates are on weeks 26 and 31 and instead of
the answer received this script. I thought I would try to improve it for fun,
since it doesn't pass pylint or anything.
"""
import datetime
# Current year
# TODO: ask the user or if no answer, assume the actual current year?
CURRENT_YEAR = 2025
# TODO: ask for the week
# Calculate dates for weeks 26-31
def get_dates_for_week(week_number, year):
"""
This function gets the dates for the week in question.
"""
# Find the first day of the year
first_day_of_year = datetime.date(year, 1, 1)
# Find the first day of the desired week (ISO format week numbering)
start_of_week = first_day_of_year + datetime.timedelta(
weeks=week_number - 1
)
# Return the start and end date of the week
start_of_week = start_of_week - datetime.timedelta(
days=start_of_week.weekday()
) # Adjust to Monday
end_of_week = start_of_week + datetime.timedelta(days=6) # Sunday
return (start_of_week, end_of_week)
# TODO: ansewr in a more human format
# Get the dates for weeks 26-31
weeks = {
week: get_dates_for_week(week, CURRENT_YEAR) for week in range(26, 32)
}
print(weeks)

@ -1 +1 @@
Subproject commit bc3750b65f76149edd6c7fc673c8ef3f0b8e20f6
Subproject commit 47d6a0b0cc0e241149303547e7819ef34ea91502

@ -1 +1 @@
Subproject commit a6bba46ab55b195363248ffff9b22228db11609a
Subproject commit 9cdd99fdb18bd01dd4fc1a5d5320a981bb207698