Compare commits

..

64 Commits

Author SHA1 Message Date
Storm Dragon
1658a53081 Hopefully use connected screen to display video if available, fall back to dummy driver if not found. 2024-12-01 19:38:10 -05:00
Storm Dragon
9cc539a6e4 Updated disk size check to 7G. 2024-11-03 02:18:59 -05:00
Storm Dragon
46faab708b Updated default image size to 6G because some packages failed to install. 2024-11-03 02:17:03 -05:00
Storm Dragon
e620f80b0e Minor update for comments. 2024-06-01 22:15:37 -04:00
Storm Dragon
134d25682b Offer a way to sync time at boot in the first boot version of configure-stormux. 2024-05-24 15:51:40 -04:00
Storm Dragon
88d7d12c69 timedatectl seems to be working now with time sync. 2024-05-21 02:06:30 -04:00
Storm Dragon
83b7867da4 Hopefully final touches on getting time and date sync working. 2024-03-21 14:30:48 -04:00
Storm Dragon
af1642b138 Build install openntpd during image build. 2024-03-21 14:29:20 -04:00
Storm Dragon
51a0fd0883 Try to make sure time and date is syncing with the internet. 2024-03-21 11:25:13 -04:00
Storm Dragon
b22785ab3e Make sure systemd-networkd and Networkmanager aren't both trying to get control of the network. 2024-03-21 11:21:51 -04:00
Storm Dragon
ef015add0a Remove dbus-broker from packages b ecause it's now the default. 2024-03-21 02:40:02 -04:00
Storm Dragon
81d60bb1b3 Added message reminding the user to go back to cursor mode after setting up internet connection. 2024-03-12 17:20:11 -04:00
Storm Dragon
50d9099231 Add a message for if inital configure-stormux gets interrupted. 2024-03-12 17:14:32 -04:00
Storm Dragon
aa4ec62c47 Added timezone to configure-stormux stub. 2024-03-12 17:04:11 -04:00
Storm Dragon
7fb1ba5283 Added alias pi-ip. 2024-03-09 04:59:47 -05:00
Storm Dragon
386cb3230e Code restructure on configure-stormux stub. 2024-03-08 16:35:52 -05:00
Storm Dragon
0b10dc426b Added partition size here so it runs on first boot. 2024-03-08 16:27:55 -05:00
Storm Dragon
40fd173777 Make sure audible sudo prompts are available throughout configure-stormux and the start up process. 2024-03-08 01:29:45 -05:00
Storm Dragon
1e24598316 Removed unneeded message from configure-stormux stub. 2024-03-07 17:29:16 -05:00
Storm Dragon
901d5cdb7a Updated first boot script. 2024-03-07 17:28:29 -05:00
Storm Dragon
16ae09c86d Fixed bug with configure-stormux stub. 2024-03-05 19:18:01 -05:00
Storm Dragon
b593494374 Moved pi3 stuff to its own branch because it's archived now. 2024-03-05 18:22:21 -05:00
Storm Dragon
f6a2a43906 Default etc/environment file added. 2024-03-05 18:13:18 -05:00
Storm Dragon
9f8355514f Updated configure-stormux stub. 2024-03-03 14:38:44 -05:00
Storm Dragon
563362985f Fix removal part of first boot script. 2024-03-03 14:24:24 -05:00
Storm Dragon
51f8c1b3d4 Updated the .bash_aliases file. 2024-02-26 00:25:23 -05:00
Storm Dragon
cdfd1d31a2 Make sure the greeting for configure stormux only appears on the tty where it spawns. 2024-02-16 02:54:54 -05:00
Storm Dragon
2af9365e22 Updated the first boot script. 2024-02-16 01:36:59 -05:00
Storm Dragon
3a37c33a64 New attempt at getting configure-stormux to run on first boot. 2024-02-16 01:35:39 -05:00
Storm Dragon
2144432ec5 Added package raspberrypi-utils 2024-02-16 01:14:10 -05:00
Storm Dragon
3dbf1f97fb Updated firmware package name. 2023-12-29 11:44:19 -05:00
Storm Dragon
4f7dbb4f82 Updated configure-stormus stub file. Because it is ran initially as root, no need for the sudo calls. Also handle removal of the cron job that causes it to run on the first boot of the image. 2023-09-24 15:47:42 -04:00
Storm Dragon
7ed27d5c65 Changed firstrun script to not delete itself. This will be handled in configure-stormux past a certain point. This way if something goes wrong, the script will stil run if the Pi had to be powered down without completing setup. 2023-09-24 15:35:31 -04:00
Storm Dragon
4c23704b2a Use cron to run configure-stormux on first boot. 2023-09-24 15:31:14 -04:00
Storm Dragon
7d15478e18 Updated the p3 build script. 2023-08-19 19:51:59 -04:00
Storm Dragon
110e7d9253 Added screen to installed packages. 2023-08-19 18:04:24 -04:00
Storm Dragon
2dc2f72e22 Missed a couple spots for audible prompt. 2023-08-19 12:48:51 -04:00
Storm Dragon
cea6ad9988 Update the configure-stormux stub to use the audible prompt. 2023-08-19 10:37:02 -04:00
Storm Dragon
340ebb5861 Put the skel stuff in the wrong place... More cofrfee please. 2023-08-19 09:03:30 -04:00
Storm Dragon
89ab28a79c New files from skel moved into place. 2023-08-19 08:42:51 -04:00
Storm Dragon
44cc2024fc Added skel with some default files to improve convenience. 2023-08-19 08:35:35 -04:00
Storm Dragon
5bae083148 Update the audibleprompt script to use the arguments from sudo. This should keep locales. 2023-08-17 16:33:57 -04:00
Storm Dragon
800d6ca71b Working toward audible sudo prompts for some operations. 2023-08-17 15:28:03 -04:00
Storm Dragon
d5c86ab680 Added donation leader board to motd file. 2023-07-01 10:20:35 -04:00
Storm Dragon
6e6f02df1e Added arch-install-scripts to package checks. 2023-06-25 22:27:43 -04:00
stormdragon2976
0796f3fe65 Work around to get armv7h builds for the Pi4. 2023-01-21 01:31:45 -05:00
stormdragon2976
1e32dac8da The configure-stormux stub should now set the clock before updating so that there will not be certificate is not yet valid errors. 2023-01-19 01:00:33 -05:00
stormdragon2976
83ceeda6f3 Added package raspberrypi-firmware to the build scripts. 2023-01-18 19:27:31 -05:00
stormdragon2976
46113cc659 Started updates for the Pi3 build script. 2023-01-18 00:31:23 -05:00
stormdragon2976
1357d2ef04 Fixed aur package building. 2023-01-17 19:41:17 -05:00
stormdragon2976
e721b7ef60 Updated package names for qemu. 2023-01-01 14:55:07 -05:00
stormdragon2976
354c79cc5b Update initial configure-stormux script to use new repository. 2023-01-01 14:47:44 -05:00
Storm Dragon
8101bf6907 Add user to realtime group to help with hdmi sound. 2022-04-21 00:29:30 -04:00
Storm Dragon
f8987fca58 Add user to realtime group to help with hdmi sound. 2022-04-21 00:25:25 -04:00
Storm Dragon
2fe6cc1cb4 Clear the screen when applying laptop layout so when Fenrir restarts it is less spammy. 2022-04-04 03:10:22 -04:00
Storm Dragon
02913ad280 Pi3 support coming back. 2022-04-02 22:29:36 -04:00
Storm Dragon
25bbd9f3c6 Finall.y remembered to enable wireplumber. 2022-04-02 20:31:26 -04:00
Storm Dragon
00ccf36543 Switch to dbus-broker. 2022-04-02 16:47:27 -04:00
Storm Dragon
824b68b90a Another shot at speeding up time sync. 2022-04-01 00:35:18 -04:00
Storm Dragon
3642af9128 Make the git clone process quiet. 2022-04-01 00:27:05 -04:00
Storm Dragon
0182d40087 Hopefully make time sync at boot faster. Update the configure-stormux starter script. 2022-03-31 23:41:41 -04:00
Storm Dragon
efe1f75e08 Add noconfirm to the removal and installation of kernels. 2022-03-30 04:56:10 -04:00
Storm Dragon
dc356e52ae forgot to comment out the sed statement which is not needed for linux-rpi. 2022-03-30 04:38:47 -04:00
Storm Dragon
c156bddb94 Moving toward 64 bit. Hopefully everything is ready, needs testing. 2022-03-30 04:37:45 -04:00
26 changed files with 391 additions and 67 deletions

View File

@ -1,20 +0,0 @@
Section "Monitor"
Identifier "dummy_monitor"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection
Section "Device"
Identifier "dummy_card"
VideoRam 256000
Driver "dummy"
EndSection
Section "Screen"
Identifier "dummy_screen"
Device "dummy_card"
Monitor "dummy_monitor"
SubSection "Display"
EndSubSection
EndSection

View File

@ -1,12 +0,0 @@
#!/bin/bash
trap 'popd &> /dev/null' EXIT
if [[ ! -d /opt/configure-stormux ]]; then
echo "Installing configure-stormux..."
sudo git -C /opt clone https://gitlab.com/stormux/configure-stormux.git || exit 1
fi
pushd /opt/configure-stormux
./configure-stormux.sh
exit 0

View File

@ -1,6 +1,6 @@
#! /bin/bash #! /bin/bash
# #
# Copyright 2020, Stormux, <storm_dragon@linux-a11y.org> # Copyright 2020, Stormux, <storm_dragon@stormux.org>
# #
# This is free software; you can redistribute it and/or modify it under the # This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free # terms of the GNU General Public License as published by the Free
@ -50,9 +50,9 @@ help() {
declare -A command=( declare -A command=(
[h]="This help screen." [h]="This help screen."
[l:]="Language default is en_US." [l:]="Language default is en_US."
[n:]="Image name, default is stormux-pi<3|4>-<yyyy-mm-dd>.img" [n:]="Image name, default is stormux-pi<32|64>-<yyyy-mm-dd>.img"
[s:]="image size in GB, default is 4." [s:]="image size in GB, default is 4."
[v:]="Version of the Raspberry Pi for which you are building. (3|4 default)" [v:]="Version of the Raspberry Pi for which you are building. (32|64) default is 64."
) )
# Convert the keys of the associative array to a format usable by getopts # Convert the keys of the associative array to a format usable by getopts
@ -76,10 +76,10 @@ while getopts "${args}" i ; do
fi fi
;; ;;
v) v)
if [[ "${OPTARG}" =~ ^[34]$ ]]; then if [[ "${OPTARG}" =~ ^32|64$ ]]; then
imageVersion="${OPTARG}" imageVersion="${OPTARG}"
else else
echo "Image version must be 3 for the Raspberry Pi 3, or 4 for the Raspberry Pi 4 (default)." echo "Image version must be 32 for 32 bit (armv7h), or 64 for 64 bit (aarch64 default)."
exit 1 exit 1
fi fi
;; ;;
@ -90,9 +90,12 @@ while getopts "${args}" i ; do
done done
# make sure variables are set, or use defaults. # make sure variables are set, or use defaults.
export imageVersion="${imageVersion:-4}" export imageVersion="${imageVersion:-64}"
export imageSize="${imageSize:-4G}" export imageSize="${imageSize:-6G}"
export imageName="${imageName:-stormux-pi${imageVersion}-$(date '+%Y-%m-%d').img}" imageName="${imageName:-stormux-pi4-${imageVersion}-$(date '+%Y-%m-%d').img}"
imageName="${imageName/-64-/-aarch64-}"
imageName="${imageName/-32-/-armv7h-}"
export imageName
export imageLanguage="${imageLanguage:-en_US.UTF-8}" export imageLanguage="${imageLanguage:-en_US.UTF-8}"
# Make sure the image file doesn't exist. # Make sure the image file doesn't exist.
@ -110,15 +113,15 @@ fi
# make sure the needed tools are installed # make sure the needed tools are installed
if [[ "$(uname -m)" == "x86_64" ]]; then if [[ "$(uname -m)" == "x86_64" ]]; then
if ! pacman -Q qemu-user-static &> /dev/null ; then if ! pacman -Q qemu-user-static &> /dev/null ; then
echo "Please install qemu-user-static and binfmt-qemu-static before continuing." echo "Please install qemu-user-static and qemu-user-static-binfmt before continuing."
exit 1 exit 1
fi fi
if ! pacman -Q binfmt-qemu-static &> /dev/null ; then if ! pacman -Q qemu-user-static-binfmt &> /dev/null ; then
echo "Please install qemu-user-static and binfmt-qemu-static before continuing." echo "Please install qemu-user-static and qemu-user-static-binfmt before continuing."
exit 1 exit 1
fi fi
fi fi
for i in dosfstools parted wget ; do for i in arch-install-scripts dosfstools parted wget ; do
if ! pacman -Q $i &> /dev/null ; then if ! pacman -Q $i &> /dev/null ; then
echo "Please install $i before continuing." echo "Please install $i before continuing."
exit 1 exit 1
@ -127,14 +130,12 @@ done
# Url for the image to be downloaded. # Url for the image to be downloaded.
#url[3]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz" url[32]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz"
url[3]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz" url[64]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
#url[4]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
url[4]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz"
fallocate -l "$imageSize" "$imageName" fallocate -l "$imageSize" "$imageName"
loopdev="$(losetup --find --show "${imageName}")" loopdev="$(losetup --find --show "${imageName}")"
parted --script "${loopdev}" mklabel msdos mkpart primary fat32 0% 100M mkpart primary ext4 100M 100% parted --script "${loopdev}" mklabel msdos mkpart primary fat32 0% 200M mkpart primary ext4 200M 100%
mkfs.vfat -F32 "${loopdev}p1" mkfs.vfat -F32 "${loopdev}p1"
mkfs.ext4 -F "${loopdev}p2" mkfs.ext4 -F "${loopdev}p2"
mount "${loopdev}p2" /mnt mount "${loopdev}p2" /mnt
@ -144,12 +145,26 @@ mount "${loopdev}p1" /mnt/boot
mounted=0 mounted=0
imageFileName=$(mktemp) imageFileName=$(mktemp)
wget "${url[$imageVersion]}" -O "${imageFileName}" wget "${url[$imageVersion]}" -O "${imageFileName}"
if [[ $imageVersion -eq 32 ]]; then
# Workaround for bsdtar errors when extracting 32 bit image.
set +e
fi
bsdtar -xpf "${imageFileName}" -C /mnt bsdtar -xpf "${imageFileName}" -C /mnt
# Set -e in case it got unset for 32 bit image
set -e
arch-chroot /mnt << EOF arch-chroot /mnt << EOF
# set up pacman # set up pacman
pacman-key --init pacman-key --init
pacman-key --populate archlinuxarm pacman-key --populate archlinuxarm
pacman -Syyu --needed --noconfirm \ pacman -Syy
# Change kernels for aarch64
if [[ "$imageVersion" == "64" ]]; then
pacman -R --noconfirm linux-aarch64 uboot-raspberrypi
pacman -S --noconfirm linux-rpi
fi
# Install packages
pacman -Su --needed --noconfirm \
alsa-firmware \ alsa-firmware \
alsa-utils \ alsa-utils \
base \ base \
@ -158,21 +173,33 @@ pacman -Syyu --needed --noconfirm \
bluez \ bluez \
bluez-utils \ bluez-utils \
brltty \ brltty \
cloud-utils \
cronie \ cronie \
espeak-ng \ espeak-ng \
fake-hwclock \
firmware-raspberrypi \
git \ git \
go \
magic-wormhole \ magic-wormhole \
man \ man \
man-pages \ man-pages \
networkmanager \ networkmanager \
ntp \
pipewire \ pipewire \
pipewire-alsa \ pipewire-alsa \
pipewire-jack \ pipewire-jack \
pipewire-pulse \ pipewire-pulse \
poppler \
python-pyudev \
python-daemonize \
python-evdev \
python-dbus \
python-pyte \
raspberrypi-utils \
realtime-privileges \
rhvoice-voice-bdl \ rhvoice-voice-bdl \
rng-tools \ rng-tools \
rsync \ rsync \
screen \
sox \ sox \
w3m \ w3m \
wget \ wget \
@ -192,7 +219,7 @@ systemctl enable rngd.service
echo 'Stormux \r (\l)' > /etc/issue echo 'Stormux \r (\l)' > /etc/issue
echo >> /etc/issue echo >> /etc/issue
# Change the alarm user to be stormux # Change the alarm user to be stormux
usermod -a -g users -G wheel,audio,video,network,brlapi -m -d /home/stormux -l stormux alarm usermod -a -g users -G wheel,realtime,audio,video,network,brlapi -m -d /home/stormux -l stormux alarm
# Grant sudo privileges to the stormux user for package installation. # Grant sudo privileges to the stormux user for package installation.
echo 'stormux ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/wheel echo 'stormux ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/wheel
# Set the password for the root user # Set the password for the root user
@ -203,30 +230,44 @@ echo -e "stormux\nstormux" | passwd "stormux"
sudo -iu stormux sudo -iu stormux
# Create desktop, downloads, music, and other directories. # Create desktop, downloads, music, and other directories.
xdg-user-dirs-update xdg-user-dirs-update
# Install the yay package manager # Build AUR packages
git clone https://aur.archlinux.org/yay.git export aurPackages=(fenrir-git \
cd yay growpartfs \
makepkg -si --noconfirm log2ram \
cd ~ yay)
rm -rf yay export PKGDEST=~/packages
yay -S --noconfirm fenrir-git growpartfs log2ram for p in "\${aurPackages[@]}" ; do
rm -rf .cache/yay git clone https://aur.archlinux.org/\${p}.git
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh cd ~/\${p}
makepkg -A
cd ~
rm -rf \${p}
done
exit exit
# Install built packages
for p in /home/stormux/packages/* ; do
pacman -U --noconfirm \${p}
done
rm -rf /home/stormux/packages/
# Enable linger so that hopefully sound will start at login. # Enable linger so that hopefully sound will start at login.
mkdir -p /var/lib/systemd/linger mkdir -p /var/lib/systemd/linger
touch /var/lib/systemd/linger/stormux touch /var/lib/systemd/linger/stormux
systemctl --global enable pipewire.service pipewire-pulse.service systemctl --global enable pipewire.service pipewire-pulse.service
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
sudo -u stormux /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
# Configure sudo for group wheel, remove nopasswd for the stormux user # Configure sudo for group wheel, remove nopasswd for the stormux user
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel
# Set the hostname # Set the hostname
echo stormux > /etc/hostname echo stormux > /etc/hostname
# Enable services # Configure services
systemctl enable brltty.path cronie.service fenrirscreenreader.service log2ram.service NetworkManager.service ntpd.service systemctl disable systemd-networkd.service systemd-networkd.socket
systemctl enable brltty.path cronie.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service
# Cleanup packages
pacman -Sc --noconfirm
pacman -R --noconfirm go
# Update fstab for Raspberry Pi 4. # Update fstab for Raspberry Pi 4. Not needed until linux-aarch64 works.
#[[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab # [[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab
EOF EOF
# Copy override files into place. # Copy override files into place.
@ -234,6 +275,7 @@ cp -rv ../files/boot/* /mnt/boot
cp -rv ../files/etc/* /mnt/etc cp -rv ../files/etc/* /mnt/etc
cp -rv ../files/var/* /mnt/var cp -rv ../files/var/* /mnt/var
cp -rv ../files/usr/* /mnt/usr cp -rv ../files/usr/* /mnt/usr
find ../files/etc/skel/ -mindepth 1 -exec cp -rv "{}" /mnt/home/stormux/ \;
# Exiting calls the cleanup function to unmount. # Exiting calls the cleanup function to unmount.
exit 0 exit 0

View File

@ -0,0 +1,32 @@
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
EndSection
Section "Monitor"
Identifier "Monitor0"
Option "DPMS" "true"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection
Section "Device"
Identifier "Card0"
# Try standard driver
Driver "modesetting"
# Fallback to dummy
Option "FallbackDriver" "dummy"
VideoRam 256000
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection

7
pi4/files/etc/audibleprompt.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t &
read -rsp "$*"$'\n' password
echo "$password"
exit 0

12
pi4/files/etc/environment Normal file
View File

@ -0,0 +1,12 @@
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
# Accessibility variables
export ACCESSIBILITY_ENABLED=1
export GTK_MODULES=gail:atk-bridge
export GNOME_ACCESSIBILITY=1
export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
export SAL_USE_VCLPLUGIN=gtk3

View File

@ -3,6 +3,8 @@ Welcome to Stormux, powered by Arch Linux ARM
Stormux Website: https://stormux.org Stormux Website: https://stormux.org
Arch Linux ARM Forum: https://archlinuxarm.org/forum Arch Linux ARM Forum: https://archlinuxarm.org/forum
Stormux IRC: #stormux on irc.libera.chat Stormux IRC: #stormux on irc.stormux.org
Arch Linux ARM IRC: #archlinuxarm on irc.libera.chat Arch Linux ARM IRC: #archlinuxarm on irc.libera.chat
Thank you Stormux supporters! https://ko-fi.com/stormux/leaderboard

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
if [[ "$(tty)" != "/dev/tty1" ]]; then
return
fi
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
return
fi
if ! [[ -x /usr/local/bin/configure-stormux ]]; then
return
fi
# For audible sudo prompts:
unset sudoFlags
if [[ -x /etc/audibleprompt.sh ]]; then
export SUDO_ASKPASS=/etc/audibleprompt.sh
export sudoFlags=("-A")
fi
cat << "EOF"
Hello, and welcome to Stormux!
Let's get you set up. After you press enter, you will be prompted for the sudo password.
When that happens, type the word stormux and press enter.
You will not receive any speech feedback for this process.
That is completely normal, and speech will return after you have typed the password.
Once again, the password is stormux in all lower case letters.
Please press enter to continue.
EOF
read -r
sudo "${sudoFlags[@]}" configure-stormux

View File

@ -0,0 +1,4 @@
# Raspberry Pi Information
alias pi-temp='/usr/bin/vcgencmd measure_temp'
alias pi-version='cat /sys/firmware/devicetree/base/model;echo'
alias pi-ip='ip a | grep -v "127.0.0.1" | grep -E -o "([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}"'

View File

@ -0,0 +1,21 @@
memuse() {
ps axo rss,comm,pid \
| awk '{ proc_list[$2] += $1; } END \
{ for (proc in proc_list) { printf("%d\t%s\n", proc_list[proc],proc); }}' \
| sort -n | tail -n 10 | sort -rn \
| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}'
}
pdf()
{
if [[ $# -ne 1 ]]; then
echo 'Usage: pdf <file>' >&2
else
local dir=$(mktemp -d -p /tmp pdf_conversion.XXXXXX)
local outFile="${1##*/}"
local outFile="${outFile%.*}"
pdftohtml -noframes -i -s "$1" "${dir}/${outFile}.html"
w3m -s "${dir}/${outFile}.html"
fi
}

View File

@ -0,0 +1,24 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#Change directories without using cd
shopt -s autocd
# Keep bash history in screen
export HISTFILE="${HISTFILE}${WINDOW:+.${WINDOW}}"
# load Aliases and functions
[[ -f ".bash_aliases" ]] && source .bash_aliases
[[ -f ".bash_functions" ]] && source .bash_functions
#Invironment variables
PS1='[\u@\h \W] \$ '
export DIALOGOPTS='--no-lines --visit-items'
GPG_TTY=$(tty)
export GPG_TTY
# Don't put commands prefixed with space, or duplicate commands in history
export HISTCONTROL=ignoreboth

View File

@ -0,0 +1,6 @@
# Reload changes with control+x followed by control+r
set echo-control-characters off
# History searching with up and down arrows.
"\e[A": history-search-backward
"\e[B": history-search-forward

View File

@ -0,0 +1,18 @@
vbell off
bell_msg ""
hardstatus off
startup_message off
defscrollback 4096
bind ! select 10
bind @ select 11
bind \# select 12
bind $ select 13
bind % select 14
bind ^ select 15
bind & select 16
bind * select 17
bind ( select 18
bind ) select 19
bind b eval "writebuf" 'exec !!! xclip -selection "clipboard" -i /tmp/screen-exchange'
#termcapinfo xterm|xterms|xs|rxvt ti@:te@
termcapinfo xterm* ti@:te@

View File

@ -0,0 +1,11 @@
[Unit]
Description=Update system time from worldtimeapi.org
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/sync_time.sh
[Install]
WantedBy=multi-user.target

View File

@ -6,7 +6,7 @@ Conflicts=systemd-timesyncd.service
[Service] [Service]
Type=forking Type=forking
PrivateTmp=true PrivateTmp=true
ExecStartPre=/usr/bin/ntpd -gq ExecStartPre=/usr/bin/ntpd -Ggq
ExecStart=/usr/bin/ntpd -g -u ntp:ntp ExecStart=/usr/bin/ntpd -g -u ntp:ntp
Restart=always Restart=always

View File

@ -0,0 +1,139 @@
#!/usr/bin/env bash
# For audible sudo prompts:
unset sudoFlags
if [[ -x /etc/audibleprompt.sh ]]; then
export SUDO_ASKPASS=/etc/audibleprompt.sh
export sudoFlags=("-A")
fi
trap cleanup EXIT
cleanup() {
popd &> /dev/null
if ! [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
echo "Initial setup is not complete."
echo "To continue setup, please run:"
echo "sudo configure-stormux"
fi
}
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
pushd /opt/configure-stormux
./configure-stormux.sh
exit 0
fi
export DIALOGOPTS='--insecure --no-lines --visit-items'
set_timezone() {
# Get the list of timezones
mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 | sort -u)
# Use the same text twice here and just hide the tag field.
region=$(dialog --backtitle "Please select your Region" \
--no-tags \
--menu "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection." 0 0 0 \
$(for i in ${regions[@]} ; do echo "$i";echo "$i";done) --stdout)
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
# Use the same text twice here and just hide the tag field.
city=$(dialog --backtitle "Please select a city near you" \
--no-tags \
--menu "Use up and down arrow or page-up and page-down to navigate the list." 0 0 10 \
$(for i in ${cities[@]} ; do echo "$i";echo "$i";done) --stdout)
# Set the timezone
if [[ -f /etc/localtime ]]; then
rm /etc/localtime
fi
ln -sf /usr/share/zoneinfo/${region}/${city} /etc/localtime
timedatectl set-ntp true
}
# Offer to switch fenrir layout.
echo "Would you like to switch Fenrir to laptop layout?"
echo "Press y for yes or n for no followed by enter."
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
clear
systemctl restart fenrirscreenreader.service
fi
# Check for possible resize
diskSource="$(df --output='source' / | tail -1)"
diskSize="$(df -h --output='size' / | tail -1 | tr -cd '[:digit:].')"
diskSize=${diskSize%.*}
if [[ $diskSize -le 7 ]]; then
echo "$diskSource is only $diskSize gigs, which means it probably needs to be resized. Would you like to do this now?"
echo "Press y for yes or n for no followed by enter."
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sudo "${sudoFlags[@]}" growpartfs $diskSource
fi
fi
if ! ping -c1 stormux.org &> /dev/null ; then
echo "No internet connection detected. Press enter to open NetworkManager."
echo "Note, it is best to put Fenrir into highlight mode while using NetworkManager."
echo "In desktop layout this is done by pressing Fenrir+numpad asterisk."
echo "That is the key just above numpad 9."
echo "In laptop mode, press Fenrir+y."
echo "In desktop mode the Fenrir key is numpad insert."
echo "In laptop mode the Fenrir key is the Super key, sometimes called the Windows key."
echo "After connecting to the internet, remember to go back to cursor mode."
echo "It is the same key used to switch to highlight mode."
echo "Press enter to continue."
read -r continue
nmtui-connect
fi
# Check for internet connectivity
if ping -qc1 -W 1 stormux.org &> /dev/null; then
echo "Updating the clock to prevent certificate errors..."
# Get current date and time
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
echo "Current date and time: $date_time"
# set date and time
date -s "$date_time"
echo "If your Pi does not have a CMOS battery and is powered off regularly, it may take a while for the time to be set correctly after boot."
echo "Stormux provides a service to sync the time after internet connection is established."
read -rp "Would you like the time to sync as soon as the Pi connects to the internet? " answer
answer="${answer:0:1}"
if [[ "${answer,,}" == "y" ]]; then
systemctl enable time_sync_at_boot.service
else
echo "Time sync at boot skipped."
echo "If you change your mind later, simply type:"
echo "sudo systemctl enable time_sync_at_boot.service"
fi
set_timezone
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
fi
echo "Installing configure-stormux..."
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
echo
echo "Initial setup is complete."
echo
echo "The default passwords are stormux for the stormux user"
echo "and root for the root user. It is highly recommended to change them."
echo "To change the password for stormux, run:"
echo "passwd"
echo "To change the password for root, run:"
echo "sudo passwd"
echo
echo "For more configuration options, run configure-stormux,"
echo "or you may configure your system manually."
echo
echo "Thank you for choosing Stormux."
exit 0

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
date -s "$date_time"