moji

moji

setting up a minimal linux system

debian based

The system shall be debian based and have dwm as wm.

First install debian without debian desktop environment.

make sure that you add network acces duting installation. this will then be

active even if you do not install a desktop environment. Then you will have net

access, else happy installing :)

Problay no sudoers installed so you needto go in with su. From root install

sudo

˜ apt install sudo

and add a user to it:

˜ sudo adduser usrename sudo

exit root and reboot or log out/in the new sudo user. Then yuo should be able

to

˜ sudo apt install lynx ˜ sudo apt install vim

btw: with alt+FXX you can change to another tty and run lynx inaralles for researching documentations

To install dwm first install folowing libs:

˜ sudo apt install xorg build-essential libx11-dev libxft-dev libxinerama-dev

clone the repos:

install git in case

˜ mkdir ~/src ˜ cd src ˜ git clone https://git.suckless.org/dwm ˜ git clone https://git.suckless.org/dmenu ˜ git clone https://git.suckless.org/st

go into each src and

˜ sudo make clean install

cerate .xinitrc to starts dwm

˜ echo "exec dwm\n" > ~/.xinirrc

try to start dwm with

˜ startx

alpine based

install alpina with

˜ setup-alpine

if not already, setup doas (sudo-like):

˜ su -l root ˜ apk add doas ˜ echo 'permit :wheel' > /etc/doas.d/doas.conf ˜ adduser joe wheel ˜ su -l joe

then use with

˜ doas command

enable community repos

˜ setup-apkrepos -cf ˜ apk update

edit the /etc/apk/repositories by adding comunity or ncommenting, e.g.

˜ http://dl-cdn.alpinelinux.org/alpine/v3.2/main ˜ http://dl-cdn.alpinelinux.org/alpine/v3.2/community

install some tools

˜ doas apk add vim git lynx

install xorg

˜ setup-xorg-base

install build essential

˜ doas apk add alpine-sdk

for x11 dev also add

˜ doas apk add ncurses libx11-dev libxft-dev libxinerama-dev

clone and install the suckless repos:

˜ mkdir ~/src ˜ cd src ˜ git clone https://git.suckless.org/dwm ˜ git clone https://git.suckless.org/dmenu ˜ git clone https://git.suckless.org/st

cerate .xinitrc to start dwm

˜ echo "exec dwm\n" > ~/.xinirrc

if not alreay add your user to video and input groups

check goutps

˜ groups

add to groups

˜ doas adduser joe video ˜ doas adduser joe input

change the kblayout dor xorg

˜ doas apk add setxkbmap ˜ vim ~/.xinitrc

add the setting before starting the wm

˜ setxkbmap ch &

try to start dwm with

˜ startx

ash shell

alpine uses ash shell to cofigure it

˜ vim ~/.profile (curentely not working)

you can also add

˜ alias ll="ls -la" ˜ startx

setup video drivers

˜ doas apk add pciutils

check your vid card

˜ lspci

serach for your card manufacturer driver

˜ doas apk search xf86-video

then if you have an intel card and it finds a driver

˜ doas apk add xf86-video-intel

if you have an intel card

˜ doas apk add mesa-dri-gallium mesa-va-gallium intel-media-driver

install picom

˜ doas apk add picom ˜ cp /etc/xdg/picom.conf.example ~/.picom

tweek conf file as liked and add to .xinitrc after starting the wm

˜ picom --config ~/.picom &

install feh

˜ doas apk add feh

add to .xinitrc

˜ feh --bg-scale /path/to/image.file &

lockscreen

˜ apk add slock

tray battery

˜ apk add cbatticon pm-utils acpi xfce4-power-manager

add them to .xinitrc or .fluxbox/startup

cli battery

install acpi tools if not already done

˜ doas apk add acpi

the you can request the batery satatus form the command line

˜ acpi -b

suspend on lid close

you can suspend the system on lid close by acpid and zzz

˜ doas apk add acpid zzz ˜ doas rc-update add acpid && rc-service acpid start

you can already suspend by

˜ doas zzz

if yo would like to suspend on lid close you need to create a file for busybox

˜ doas mkdir /etc/acpi/LID ˜ doas nano /etc/acpi/LID/00000080

add this to the file

˜ #!/bin/sh ˜ exec zzz

make the file executable and restart acpid

˜ doas chmod +x /etc/acpi/LID/00000080 ˜ doad rc-service acpid start

close the lid and enjoy.

conky

˜ doas apk add conky

edit or create file ~/.config/conky/conky.conf youcna find examples online, e.g.

github

here an example I use

conky.conf

also more information here

variables

settings

automatically startuo conky by addinf to the appropriate file in fluxbox or xinitrc or other

take screenshots

install image magick

˜ doas apk add imagemagic

the that a shot with

˜ import -window root snapshot.png

view it with

˜ display snapshot.png

scale it with

˜ convert in.png -scale 50% out.png

fonts

list the available fonts with

˜ fc-list

selecting fonts can be done with xfont select

˜ apk add xfontsel

shutdown with

˜ su ˜ poweroff

power tools

regulate the cpu frequency

˜ apk add cpufreqd ˜ rc-update add cpufreqd

audio (alsa)

˜ apk add alsa-utils alsaconf ˜ addgroup $USER audio ˜ addgroup root audio

try if you see volume controls wit alsamixer. if no try to switch audiocard with F6

˜ alsamixer

if needed you can set the default audio card in the alsa conf /usr/share/alsa/alsa.conf, i.e.

˜ defaults.ctl.card 1 ˜ defaults.pcm.card 1

finally

˜ rc-service alsa start ˜ rc-update add alsa

audio (pipewire)

you will need a dbus system running

˜ doas add dbus dbus-x11 ˜ rc-update add dbus

then isntall pipwire and tools

˜ doas apk add pipewire wireplumber pipewire-pulse pipewire-jack pipewire-alsa ˜ addgroup [user] audio ˜ doas apk add mpv gst-plugin-pipewire pavucontrol

copy configuratio files

˜ doas cp -a /usr/share/pipewire /etc ˜ doas cp -a /usr/share/wireplumber /etc

start dbus nd pipewire in ./fluxbos/startup

˜ export $(dbus-launch) ˜ /usr/libexec/pipewire-launcher &

install xrandr and acpi for display- and powercontrol

˜ doas apk add xrandr arandr acpi

set backlight brightness

˜ echo 15 > /sys/class/backlight/acpi_video0/brightness

By default, only root can change the brightness by this method. To allow users in the video group to change the brightness, a udev rule such as the following can be used:

˜ vim /etc/udev/rules.d/backlight.rules ˜ ACTION=="add",SUBSYSTEM=="backlight",RUN+="/bin/chgrp video $sys$devpath/brightness",RUN+="/bin/chmod g+w $sys$devpath/brightness"

set the backlight level at boot time

˜ vim /etc/udev/rules.d/81-backlight.rules

set the backlight level to 35

˜ SUBSYSTEM=="backlight",ACTION=="add",KERNEL=="acpi_video0",ATTR{brightness}="35"

aletrnatively you can isntall brillo to set the backlight

˜ doas apk add brillo ˜ brillo -S20 (set to 20) ˜ -G (get) ˜ -O (store current brightness) ˜ -H (help)

for man pages install

˜ doas apk add mandoc man-pages less less-doc

for adding things to dmenu bar

˜ doas apk add xsetroot libxcursor ˜ xsetroot -name "your text" ˜ xsetroot -name "$(acpi -b)"

make a little script to peridically update demnu with stats

˜ #!/bin/ash ˜ # ˜ while true ˜ do ˜ d=$(date +%d.%m.%y) ˜ b=$( acpi -b | awk -F "," '{print $2}') ˜ xsetroot -name "$(echo "\uf455 "$d" \uf004"$b)" ˜ sleep 1m ˜ done

The \uXXX are the unicode nerdfont codes fro heart and calneder.

chmod it and run it in .xinitrc

˜ ~/bin/stat.sh&

install zsh

change shell to zsh

˜ doas apk add zsh shadow

And use chsh

˜ chsh username

Now enter the path for the shell you want to use (e.g /bin/bash) and press Enter to confirm this change. The shell should exist in /etc/shells. Install oh my zhs if you like.

nerdfornts

˜ wget klink to zip file ˜ doas unzip file.zip -d /usr/share/fonts/fontname ˜ doas fc-cache -fv

to check the installed fonts and the font names in the system use

˜ fc-list | grep fontname

to change the font in st dmenu change the respective config.h and recompile.

for st

˜ static char *font = "fontname:pixelsize=14:antialias=true:autohint=true";

for demnu

˜ static const char *fonts[] = { ˜ "fontname:size=10" ˜ };

for dwm

˜ static const char *fonts[] = { "fontname:size=10" }; ˜ static const char dmenufont[] = "fontname:size=10";

install kitty

˜ doas apk add kitty

replace dwm default terminal with kitty and recompile

˜ static const char *termcmd[] = { "kitty", NULL };

configure kitty fonts colors etc. do this in the .config/kitty/kitty.conf file.

to find fonts seen by kitty

˜ kitty +list-fonts

Sometimes its will be necessary to install the noto symbols font to display colorful emojis:

˜ doas apk add font-noto-emoji

get kitty themes

˜ git clone --depth 1 https://github.com/dexpota/kitty-themes.git ~/.config/kitty/kitty-themes

install one of the them

˜ ln -s ./kitty-themes/themes/MonaLisa.conf ./theme.conf

then load it by including the themem in the kitty conf file

˜ inclucde ./theme.conf

install glslviewer

˜ doas apk add cmake glu libxrandr-dev libxcursor-dev libxi-dev freeglut-dev glfw-dev ˜ git clone https://github.com/patriciogonzalezvivo/glslViewer.git ˜ cd glslViewer ˜ git submodule init ˜ git submodule update ˜ mkdir build ˜ cd build ˜ cmake .. ˜ make ˜ doas make inastall

install surf

install surf

˜ git clone https://git.suckless.org/surf ˜ doas apk add gtk+3.0-dev gcr-dev webkit2gtk-dev ˜ doas make clean install

add and additions wlan accesspoint

˜ wpa_passphrase 'ExampleWifiSSID' 'ExampleWifiPassword' > /etc/wpa_supplicant/wpa_supplicant.conf

this will generate an etry with a crypted and a lain text psk. you can

delete the plain test psk

in case you want to reconnect (be sure to kill running wpa_supplicants)

˜ wpa_supplicant -B -i interface -c /etc/wpa_supplicant/wpa_supplicant.conf

see is your are connected:

˜ iw wlan0 link

scann available wlans

˜ iw wlan0 scan

a nice way to get the currentely conectes ssid (i.e. to pipe to dmenu)

˜ iw wlan0 link | grep SSID | awk '{print $2}'

you can also try wpa cli

˜ wpa_cli ˜ scan ˜ add_network ˜ 0 ˜ set_network 0 ssid "MYSSID" ˜ set_network 0 psk "passphrase" ˜ enable_network 0 ˜ save_config ˜ quit ˜ dhcpcd

or add this to the conf file to alloe wpa cli, giving configuration update rights to wpa_cli

˜ ctrl_interface=/run/wpa_supplicant ˜ ctrl_interface_group=wheel ˜ update_config=1

setup bspwm

install binaries

˜ doas apk add bspwm bspwm-doc sxhkd polybar dunst

copy default conif files

˜ mkdir bspwm polybar dunst sxhkd ˜ cp /usr/share/doc/bspwm/examples/bspwmrc bspwm ˜ cp /usr/share/doc/bspwm/examples/sxhkdrc sxhkd ˜ cp /etc/polybar/config.ini polybar ˜ cp /etc/dunst/dunstrc dunst

make a .xinirc containing only (bacup the old one)

˜ exec bspwm

change bspwmrc, removin unwated rules and adding autostarts

˜ setxkbmap ch & ˜ sxhkd & ˜ picom --config filename & ˜ feh --bg-scale filename & ˜ dunst & ˜ polybar &

edit coding od sxhkd as you like. sxhkd is a key-combo mamanger

i.e. the key combo for lauching the terminal and change als the terminal, e.g. kitty

mod the polybar config, i.e. add a batery display module etc. see the github page.

rofi

install binaries

˜ doas apk add rofi ˜ mkdir -p ~/.config/rofi ˜ rofi -dump-config > ~/.config/rofi/config.rasi

now change the sxhkdrc to lauch rofi

fluxbox

˜ apt add fluxbox xterm font terminus ˜ setup-xorg-base

create a .xinitrc and sdd

˜ exec startfluxbox

you may need to dd the ueser to video and input gourps

˜ addgroup [user] input ˜ addgroup [user] video

also you may need to install and add udev dbus:

˜ rc-update add udev ˜ rc-update add dbus

add more fonts

˜ apk add font-terminus-nerd font-inconsolata font-dejavu \ ˜ font-noto font-noto-cjk font-awesome font-noto-extra \ ˜ font-sony-misc font-jis-misc

edit the .luxbox/startup file and add the programs to start such as picom conky etc.

Add themes by copy them into the ./fluxbox/styles folder. They will appear in the fluxmox user styles menu. yu cna find themes here

tenr.de

a nice black theme is carbon. get it here:

carbon.tar

slim

slim is a ligh weight login manager

˜ apk add slim ˜ cp /etc/slim.conf /etc/slim.conf.original

edit teh conf file accordingily, i.e. set thepath to the .xinitrc file. You can then forst test ist with

˜ rc-service slim start

if it woks add it to startup with

˜ rc-update add slim

clipboard

˜ apk add clipboard

nano synthax

˜ git clone https://github.com/scopatz/nanorc.git ˜ cd nanorc ˜ ./install

Add these lines to the ~/.nanorc

˜ include ~/.nano/html.nanorc ˜ include ~/.nano/css.nanorc

etc. also do

˜ set mouse ˜ set softwrap

networkmanager

˜ apk add networkmanager ˜ setup-devd udev ˜ doas apk add networkmanager-wifi networkmanager-cli networkmanager-tui network-manager-applet ˜ rc-service networkmanager start ˜ adduser YourUserName plugdev

edit contents of /etc/NetworkManager/NetworkManager.conf

˜ [main] ˜ dhcp=internal ˜ plugins=ifupdown,keyfile ˜ [ifupdown] ˜ managed=true ˜ [device] ˜ wifi.scan-rand-mac-address=yes ˜ wifi.backend=wpa_supplicant

stop and start services

˜ rc-service wpa_supplicant stop ˜ rc-service networkmanager restart

test if nmtui or nmcli work, if yes remove the services from boot and add networkmanager

˜ rc-update add networkmanager ˜ rc-update del networking boot ˜ rc-update del wpa_supplicant boot

then ou can select the network with nmtui or nmcli. Also you can launch nm-applet at startup fo the WM ar DE. to do it with nomal user add the user to the netdev group

˜ doas adduser [YourUserName] netdev

w3m

install w3m with

˜ doas apk add w3m

you can view images of the websites when using the kitty terminal emulator. to do so open the settings (press o in w3m) and set

˜ use external image viewer -> yes ˜ inline imake display method -> killy (ImageMagick) ˜ external command to display image -> kitty

to save the settings gon on one of the OK and press enter,

to install a reader view (get rig of clutter) you can install rdrview

˜ git clone https://github.com/eafer/rdrview.git

to compile and run you need to install the following

˜ doas apk add gnutls-dev curl-dev libxml2-dev libseccomp-dev mailcap mailcap-doc xdg-utils xdg-utils-doc

the compile

˜ make ˜ doas make install

to switch to reader mode within w3m we need to define a keymap. to do so add the following to ~/.w3m/keymap:

˜ keymap R COMMAND "READ_SHELL 'rdrview $W3M_URL -H 2> /dev/null 1> /tmp/readable.html' ; LOAD /tmp/readable.html"

to change to readermode you can press R (shift r).

mlterm

First you will need to clone the git repro

˜ git clone https://github.com/arakiken/mlterm.git

change into the directory and run the configure script to see wht you have

˜ cd mlterm ˜ ./configure

Depending on the rsuts you can add some more libs, like

˜ doas apk add libssh2-dev fribidi-dev

Dont forgert to rerun cconfigure script! Then make the binary

˜ ./configure ˜ make ˜ doas make intall

mutt

install mutt

˜ doas apk add mutt

crate a rc file in the home directory .muttrc and a directory .mutt which will contain seveal configutation / accout files. Also create additional folder for each account as shown in the example files.

~/
|── .mutt/
| ├── account.com.gmail.foo
| ├── account.com.gmail.bar
| ├── com.gmail.foo/
| └── com.gmail.bar/
└── .muttrc

content of the .muttrc file:

˜ # --- Folder hooks ˜ folder-hook 'account.com.gmail.foo' 'source ~/.mutt/account.com.gmail.foo' ˜ folder-hook 'account.com.gmail.bar' 'source ~/.mutt/account.com.gmail.bar' ˜ # --- Default account ˜ source ~/.mutt/account.com.gmail.foo ˜ # --- Macros for switching accounts ˜ macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account.com.gmail.foo<enter><change-folder>!<enter>' ˜ macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account.com.gmail.bar<enter><change-folder>!<enter>' ˜ # --- Fetch mail shortcut ˜ bind index G imap-fetch-mail

ecample accaout file ~/.mutt/account.com.gmail.foo:

˜ set imap_user = "foo@gmail.com" ˜ set imap_pass = "<PASSWORD>" ˜ set smtp_url = "smtp://foo@smtp.gmail.com:587/" ˜ set smtp_pass = "<PASSWORD>" ˜ set from = "foo@gmail.com" ˜ set realname = "Foo" ˜ set folder = "imaps://imap.gmail.com:993" ˜ set spoolfile = "+INBOX" ˜ set postponed = "+[Gmail]/Drafts" ˜ set header_cache = ~/.mutt/com.gmail.foo/cache/headers ˜ set message_cachedir = ~/.mutt/com.gmail.foo/cache/bodies ˜ set certificate_file = ~/.mutt/com.gmail.foo/certificates

source

next

configure rofi

set up dm

ly

keyboard backlight

colors