KLV-Spectr Example PLUG File

Kennel Linux Void based


Moderator: Forum moderators

Post Reply
User avatar
rockedge
Site Admin
Posts: 6543
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2749 times
Been thanked: 2624 times
Contact:

KLV-Spectr Example PLUG File

Post by rockedge »

Here is the basic PLUG that will with the Firstrib build script, create a Kennel Linux Void Spectr root file system (rootfs) which has the KLV base and uses the Spectrwm tiling window manager. It is a basic system.

f_00_Void_KLV_spectrwm_no-kernel.plug

Code: Select all

# f_00_Void_KLV_spectrwm_no-kernel.plug
# version="2.0-0"; revision="-rc1"
# Kennel Linux Void outfitted with a spectrwm desktop 
# Creation date 01May2023; Revision date: 19Aug2023
# Copyright Kennel Linux team; License MIT

# build this via terminal commands: build_firstrib_rootfs.sh
# ./build_firstrib_rootfs.sh void default amd64 f_00_Void_KLV_spectrwm_no-kernel.plug
# Architecture i386 will probably successfully build too as an alternative to amd64

# login is:
# user=root; passwd=root
# user=spot; passwd=spot
# user=weedog; passwd=weedog

# All the parameters/commandlines can be appropriately changed:
# Simply comment in or comment out till you have what you desire
# or add new packages to the xbps-install lists.
# You can add as many valid commandlines as you want in here.
#
# base system
xbps-install -y base-minimal ncurses-base bash eudev
xbps-install -y file mc xterm xauth
xbps-install -y shadow wpa_supplicant  # needed for most wifi
xbps-install -y ntfs-3g zstd rsync

# set up passwd system
pwconv
grpconv
printf "root\nroot\n" | passwd >/dev/null 2>&1 # Quietly set default root passwd to "root"

# set root to use /bin/bash
usermod --shell /bin/bash root

# Set locale to en_US.UTF-8 
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/default/libc-locales
xbps-reconfigure -f glibc-locales

# Set Bash as shell
xbps-alternatives --set bash

## --------------------------------------------------------------------------
## Xorg server, spectrwm Desktop configuration

xbps-install -y xorg spectrwm
xbps-install -y dmenu xlockmore tzutils
xbps-install -y gvfs-smb gvfs-mtp gvfs-cdda
xbps-install -y yad gxmessage

# Optional packages
#
xbps-install -y geany gftp rox lxterminal
xbps-install -y e2fsprogs yelp gparted
xbps-install -y dosfstools mtools cpupower
xbps-install -y squashfs-tools wget
xbps-install -y lxterminal htop

# Browser selection
xbps-install -y firefox

# Fix Firefox Fonts 
#
ln -s /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/
xbps-reconfigure -f fontconfig


# Install Audio
#
xbps-install -y pulseaudio pulseaudio-utils alsa-plugins-pulseaudio alsa-utils
ln -s /etc/sv/pulseaudio /etc/runit/runsvdir/default/pulseaudio

# Install Network Manager
#
xbps-install -y NetworkManager network-manager-applet
ln -s /etc/sv/NetworkManager /etc/runit/runsvdir/default/NetworkManager

# Set locale to en_US.UTF-8
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/default/libc-locales
xbps-reconfigure -f glibc-locales

# Set timezone
sed -i 's/#TIMEZONE="Europe/Madrid"/TIMEZONE="America/New_York"/' /etc/rc.conf

# Add ~/Startup directory
#
mkdir -p /root/Startup
cat <<'EOF' >> /usr/local/bin/start-up
#!/bin/bash
sleep 5
user_home=$(eval echo ~${SUDO_USER})
ls $user_home/Startup/* | while read J
do
   "$J" &
done
EOF

chmod +x /usr/local/bin/start-up
 
# Setup autologin on tty1
#
cp -a /etc/X11/xinit/xinitrc /root/.xinitrc
cp -R /etc/sv/agetty-tty1 /etc/sv/agetty-autologin-tty1
sed -i 's/GETTY_ARGS.*/GETTY_ARGS="--autologin root --noclear"/' /etc/sv/agetty-autologin-tty1/conf  # editing for autologin root

# Arrange to startx in user's .bash_profile (per Arch Wiki)
# Remove this section if not wanting boot straight into X
touch ~/.bash_profile
cat <<'AUTOLOGIN' > /etc/profile.d/autologin.sh
# autologin on tty1
if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
startx  # remove the exec if you want back to tty1 on exit X

fi
AUTOLOGIN

# Get and install autologin fix
#
# cd /etc/sv
# wget https://rockedge.org/kernels/data/XBPS_packages/agetty-autologin-tty1.tar.gz
# tar xvfz agetty-autologin-tty1.tar.gz

# Use agetty-autologin-tty1 instead of agetty-tty1 
# rm -f /etc/runit/runsvdir/default/agetty-tty1
# ln -s /etc/sv/agetty-autologin-tty1 /etc/runit/runsvdir/default/agetty-autologin-tty1

# enable dbus service
ln -s /etc/sv/dbus /etc/runit/runsvdir/default/dbus

# Auto-editing .xinitrc to use xfce4 instead of twm
# Because I'm using exec here the script will end there so no xterms started
#
# sed -i 's/twm &/exec xfce4-session/' ~/.xinitrc

 sed -i '51,$d' /root/.xinitrc
 echo "/usr/local/bin/start-up &" >>/root/.xinitrc 
 echo "rox -p default" >>/root/.xinitrc
 echo "spectrwm" >>/root/.xinitrc  # removed exec to allow dropping out of Xorg to console

## USER CONFIGS: Copy main configs to /etc/skel for all normal users later added
#
xbps-install -y sudo
cp -af /root/. /etc/skel
mkdir -p /etc/skel/.config /etc/skel/.cache /etc/skel/.local/share
echo Still some extra to do here re the likes of runit starting pulseaudio
echo among other user needed config bits and pieces,
echo so probably a few user-config issues noted as needing fixed here

# Give wheel group nopasswd sudo rights and create weedog as wheel group member
echo '%wheel ALL=(ALL) NOPASSWD: ALL' | (VISUAL="tee -a" visudo) # wheel group added to sudo no password required
useradd -m -G wheel -s /bin/bash weedog  # weedog in wheel group so has elevated sudo permissions
printf "weedog\nweedog\n" | passwd weedog >/dev/null 2>&1 # Quietly set default weedog passwd to "weedog"

# Give wheel group nopasswd sudo rights and create spot as wheel group member
echo '%wheel ALL=(ALL) NOPASSWD: ALL' | (VISUAL="tee -a" visudo) # wheel group added to sudo no password required
useradd -m -G wheel -s /bin/bash spot  #spot in wheel group so has elevated sudo permissions
printf "spot\nspot\n" | passwd spot >/dev/null 2>&1 # Quietly set default spot

# Create /root directories
#
mkdir -p /root/Desktop
mkdir -p /root/Documents
mkdir -p /root/Downloads
mkdir -p /root/Music
mkdir -p /root/my-applications
mkdir -p /root/Pictures
mkdir -p /root/Public
# mkdir -p /root/Startup
mkdir -p /root/Templates
mkdir -p /root/Videos

# Create /home/spot directories
#
mkdir -p /home/spot/Desktop
mkdir -p /home/spot/Documents
mkdir -p /home/spot/Downloads
mkdir -p /home/spot/Music
mkdir -p /home/spot/my-applications
mkdir -p /home/spot/Pictures
mkdir -p /home/spot/Public
mkdir -p /home/spot/Templates
mkdir -p /home/spot/Videos


# Set permissions
#
chown -R spot:spot /home/spot
chown -R weedog:weedog /home/weedog

# add users to groups and change permissions
#
usermod -a -G audio weedog
usermod -a -G audio spot
usermod -a -G video weedog
usermod -a -G video spot
xhost +
chmod 755 /
chmod 755 /bin
chmod 755 /lib

# add sudo -spot to .desktop files

#-----------------------------------------------------------------------
echo "desktop build process finished"
williwaw
Posts: 1948
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 369 times

Re: KLV-Spectr Example PLUG File

Post by williwaw »

I installed the package xorg and spectrwm and after adding exec /usr/bin/spectrwm to my .xinitrc, the wm starts with errors and
it reports it needs dmenu and xlock

I added dmenu but xbps reports xlock is installed? "up to date"

Is there a way to operate spectrwm without dmenu?

also, have you had any luck bringing up a window manager when logged in as spot?

User avatar
rockedge
Site Admin
Posts: 6543
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2749 times
Been thanked: 2624 times
Contact:

Re: KLV-Spectr Example PLUG File

Post by rockedge »

@williwaw I ran a build using the plug file posted above and then squashed the resulting firstrib_rootfs into 07KLV-spectr-t2_rootfs-gz.sfs

I placed that into a new directory and added in all of the kernel and other system pieces from KLV-Spectr-RT:

Screenshot(32).jpg
Screenshot(32).jpg (26.89 KiB) Viewed 1070 times

This booted to a console login prompt and with user = root password = root, was able to login and it went straight to the spectrwm window manager.

Screenshot(31).jpg
Screenshot(31).jpg (10.83 KiB) Viewed 1070 times

.

So I know the resulting rootf that the above plug makes does work at least on my machines and QEMU tests.

If the Rox pinboard at system start is not desired comment out echo "rox -p default" >>/root/.xinitrc in the PLUG or change it in /root/.xinitrc

williwaw
Posts: 1948
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 369 times

Re: KLV-Spectr Example PLUG File

Post by williwaw »

This booted to a console login prompt and with user = root password = root, was able to login and it went straight to the spectrwm window manager.
I see you have that set up to do that quite well. once logged in as root.

williwaw wrote: Sun Aug 20, 2023 7:08 am

also, have you had any luck bringing up a window manager when logged in as spot?

quess what I was asking above was how to easily get a desktop as another user, in order to run things like chromium "not as root".

so I log in as spot to begin with, but I cannot get X to run....

well there is always run-as -spot, but I have had issues running chromium-ungoogled recently, and there is the portable method to run as spot, but I wonder if in the long run,with the advent of these electron app that seem to want to baulk at running as root, if it might just be easier to have a desktop as user spot or whomever.

User avatar
rockedge
Site Admin
Posts: 6543
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2749 times
Been thanked: 2624 times
Contact:

Re: KLV-Spectr Example PLUG File

Post by rockedge »

@williwaw Good news that you have the system started, but why it's not starting X as spot is a mystery still to me.

On the QEMU VM I am testing the latest build on, will start the X server and spectrwm window manager when logging in a user spot. So far I have not been able to replicate the problem. I will try to boot on an older Dell laptop (14 years old) to see how that goes as user spot.

I run often in KLV's as spot and not root, but it's very handy to be able to run as root normally.

williwaw
Posts: 1948
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 369 times

Re: KLV-Spectr Example PLUG File

Post by williwaw »

hmm,

1. are you using sudo? Edit: I see you are, but do not see where this was added to your plug.. maybe a dep of something else?
2. are you using startx to bring up spots desktop ? you seem to be saying that as son as you supply spots password, the desktop fires up?

can you share your .xinitrc and/or Xsession that you use?

after a little reading I am think that the a user doesnt really aquire its own x session, but x runs as root and lets other users share.

I see you also have jwm installed? perhaps also some session manager

Post Reply

Return to “KLV-Spectr”