/icewm-personal-tunning

Personal customization of IceWM on mainly, Void Linux.

Primary LanguageRoffGNU General Public License v3.0GPL-3.0

IceWM Personal Tunning (WIP)

Personal customization of IceWM on mainly, Void Linux and Artix Runit. Note that other inits are not supported in this guide.

Index

Overview

IceWM is a lightweight window manager used on distributions like AntiX, but by default its very... W95-like. So I decided to customize at the maximum that I can. This is the result.

Keybindings are processed via sxhkd instead of IceWM built-in one (because I didn't realized that IceWM already has its own script to setup keybindings, but you are free to use it). IceWM's taskbar were replaced by xfce4-panel, but you can also use the IceWM's one. Rofi is used as app launcher. Materia-Manjaro-Dark-B with some modifications is the selected WM theme. lxappearance and Qt5ct are used to customize desktop themes.

I used Nemo as the default file manager, and Sakura is the selected terminal emulator (also I recommend QTerminal and xfce4-terminal). Here we'll use LXDM as a Display Manager.

This guide is focused on Void Linux and Artix Linux. Feel free to add or remove everything as you need and/or want in your setup. This is just a guide.

Special Thanks

- Tuxliban Torvalds for contributing on simplify and optimize automated installation script, enabling services, Xed text editor installation process, and this guide.

To Do

  • Add a Display Manager in order to get Polkit working correctly.
  • Correct some guide content.
  • Replace XFCE tools (for example xfce4-panel by tint2).
  • Make wallpaper to work properly with Nemo Desktop (Artix only).
  • Make automated script to detect signature error on package download and then, abort the installation.
  • Fix Artix script (currently it's broken).
  • Polish automated installation script.
  • Replace some tools in order to keep the setup lightweight.

Automated Install (WIP)

There is a script that will install and configure everything what I explain in this guide. Note that is still in progress, so it may contain a lot of bugs or errors, so be careful.

Void Linux:

sudo xbps-install -S git
git -C "$HOME/github" clone https://github.com/KF-Art/icewm-personal-tunning
cd icewm-personal-tunning
chmod u+x automated_install_void.sh
./automated_install_void.sh

Artix (currently broken, use at your own risk):

sudo pacman -S git
git -C "$HOME/github" clone https://github.com/KF-Art/icewm-personal-tunning
cd icewm-personal-tunning
chmod u+x automated_install_artix.sh
./automated_install_artix.sh

After that, you can start your X session with startx.

DIY Method

Here, you will learn how to configure IceWM and tune it. Also, this is a explanation of the automated script's functioning.

To start, we will create a directory in which the cloned GitHub repositories will be saved.

mkdir "$HOME/github"

Installing Yay and enabling Arch Linux support (Artix Only)

Into Artix, you will need to enable Arch Linux support and install Yay or any AUR helper. The last step will add extra, community and multilib Arch's repositories. If Artix repositories get more populated, this will not be necessary in the future.
#Installing Yay
pacman -S base-devel git
git -C "$HOME/github" clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si

#Enabling Arch Linux support
pacman -S artix-archlinux-support
git -C "$HOME/github" clone https://github.com/KF-Art/icewm-personal-tunning/ && cd icewm-personal-tunning

# Add Arch Linux repos to pacman.conf. Hope that in the future this is not necessary.
cat resources/pacman-arch-support.conf | sudo tee -a /etc/pacman.conf

Installing IceWM and base packages

At this point, I'm assuming that you already have your base system and Xorg installed. These packages are all the base to get all explained in this guide to work properly:

Void Linux:

sudo xbps-install -S icewm rofi network-manager-applet sakura pa-applet brillo nemo qt5ct kvantum unzip zip bsdtar betterlockscreen sxhkd clementine xfce4-panel xfce4-whiskermenu-plugin xfce4-power-manager xfce4-clipman-plugin mate-polkit octoxbps notification-daemon playerctl numlockx picom xscreensaver setxkbmap xautolock blueman NetworkManager pulseaudio firefox pavucontrol git wget gedit eudev timeshift cronie bluez dbus lxdm

Artix:

#Repositories packages.
sudo pacman -S --needed icewm rofi network-manager-applet sakura nemo qt5ct kvantum-qt5 unzip zip bsdtar sxhkd clementine xfce4-panel xfce4-whiskermenu-plugin xfce4-power-manager xfce4-clipman-plugin mate-polkit octopi octopi-notifier-frameworks notification-daemon playerctl numlockx xscreensaver xorg-setxkbmap xautolock blueman networkmanager pulseaudio firefox pavucontrol git wget eudev cronie cronie-runit bluez dbus xed picom lxdm lxdm-runit

#AUR packages.
yay -Sa --needed pa-applet-git timeshift-bin betterlockscreen

Enabling services

Once installed, we have to enable services in order to have an X session, connectivity and Cron management.

Void Linux:

sudo ln -sf /etc/sv/{bluetoothd,NetworkManager,udevd,dbus,crond} /var/service

Artix:

sudo ln -sf /etc/runit/sv/{bluetoothd,NetworkManager,udevd,dbus,cronie} /run/runit/service/

From this point you can start your X session with startx.

Add environment variables

In order to make work XDEB and Qt5ct, you'll need to add some environment variables to your shell configuration file:
QT_QPA_PLATFORMTHEME="qt5ct" #Allows qt5ct to manage Qt settings.

#We'll use this when installing Xed via XDEB.
export PATH="$PATH:$HOME/.local/share/bin"

Install Brillo (Artix only)

For some reason, the AUR package gives an error when compiling. So it's necessary to compile it manually. Also, you can replace it by brightnessctl, for example.
wget https://gitlab.com/cameronnemo/brillo/-/archive/v1.4.9/brillo-v1.4.9.tar.gz
tar -xvf brillo-v1.4.9.tar.gz
cd brillo-v1.4.9
make 
sudo make install install.apparmor install.polkit DESTDIR="/"

Configuring Autostart

For some reason, IceWM ignores ~/.config/autostart and ~/.config/autostart-scripts configurations (at least on Void Linux). Fortunately, IceWM has its own built-in startup manager. We'll create a new file called startup inside ~/.icewm.
touch "$HOME/.icewm/startup"
chmod u+x "$HOME/.icewm/startup"

Once created, we'll setup autostart commands and applications (yeah, I used setxkbmap to set keyboard map, but I recommend you to setup it with Xorg directly):

#!/bin/bash
pulseaudio --start &
sxhkd &
pa-applet &
nm-applet &
picom &
numlockx &
/usr/libexec/polkit-mate-authentication-agent-1 &
xscreensaver -nosplash &
xfce4-panel &
nemo-desktop &
setxkbmap latam
/usr/libexec/notification-daemon &
xautolock -detectsleep -time 5 -locker "betterlockscreen -l blur -w /path/to/your/wallpaper.png" -killtime 10 -killer "loginctl suspend"
blueman-applet &!


# In Void use octoxbps-notifier and in Artix, /usr/bin/octopi-notifier.
octoxbps-notifier &
# /usr/bin/octopi-notifier &

Change /path/to/your/wallpaper.png by the path of your desired background for lockscreen. In this build, a wallpaper is included into resources folder.

Feel free to increase or decrease the -killtime (10 is the minimum) and -time amount.

Configuring Keybindings

As I said before, I used sxhkd to manage keybindings, but this should work similar on ~/.icewm/keys (you need to create it and make it executable). We'll create a new file called sxhkdrc.
touch "$HOME/.config/sxhkd/sxhkdrc"

Now we can configure our keybindings:

#Media buttons
XF86Audio{Prev,Next,Play,Pause}
    playerctl {previous,next,play-pause,play-pause}

#Volume Control
XF86Audio{RaiseVolume,LowerVolume}
    pactl -- set-sink-volume @DEFAULT_SINK@ 0 {+5%,-5%}

#Mute button
XF86AudioMute
    pactl set-sink-mute @DEFAULT_SINK@ toggle

#Brightness control
XF86MonBrightness{Down,Up}
    sudo brillo {-U 20,-A 20}

#Terminal emulator
ctrl + alt + t
    sakura %u

#File manager
ctrl + alt + e
    nemo

#Web browser
ctrl + alt + w
    firefox

#Music player
ctrl + alt + q
    clementine

#Lockscreen
ctrl + alt + l
    betterlockscreen -l blur -w /path/to/your/wallpaper.png

 #Rofi
 ctrl + space
 	$HOME/.config/rofi/launcher.sh

brillo also needs elevated privileges to be able to change brightness, and also we'll add an exception for it. You can make writable the brightness file of your GPU (like as I did), in order to do it without superuser privileges, but I don't know what other consequences it can have.

Configuring IceWM Preferences

Again, we need to create a configuration file:
touch "$HOME/.icewm/preferences"

And now setup the preferences:

TaskBarShowWorkspaces=0
ShowTaskBar=0
RebootCommand="loginctl reboot"
ShutdownCommand="loginctl poweroff"
TerminalCommand=sakura
SuspendCommand="loginctl suspend"

If you don't want to use XFCE's panel, set ShowTaskBar on 1, and remove it from autostart.

Add sudo exceptions

brillo requires root privileges in order to edit the brightness and power status. To be able to use the related keybindings and startup commands, we have to add one exception to sudoers file.
sudo visudo

Now add this line at the end of the file (change yourusername for your user's name):

yourusername ALL= NOPASSWD: /usr/bin/brillo

Alternatively, you can use the automated script method.

echo "$USER $(cat /etc/hostname)= NOPASSWD: /usr/bin/brillo" | sudo EDITOR='tee -a' visudo

After that, logout. Related keybindings now should work.

Installing Xed text editor (Void only)

Xed is my favorite GTK text editor, so I included it into this build. I think that is strange that the Cinnamon's default text editor is not in the repositories of Void, because Cinnamon is one of the officially supported desktop environments. Into Artix this is not necessary, 'cause it's on the repositories.

Automated install (recommended)

The installation of Xed via XDEB is quite tedious, so I created a script to automate the task. First, clone this repo (if not done already):
git -C "$HOME/github" clone https://github.com/KF-Art/icewm-personal-tunning/

Now you can run the installation script. Note that you will need a fully POSIX compatible shell, like oksh or mksh. In this script we'll use dash to avoid installing extra packages.

cd icewm-personal-tunning/scripts/
chmod u+x xed_void_install.sh
./xed_void_install.sh

DIY Method

We'll take the official's Linux Mint package, convert it to XBPS and install it. But first, we need to install XDEB script (into automated script, the selected path is ~/.local/share/bin to avoid errors.
sudo xbps-install -S binutils tar curl xz
git -C "$HOME/github" clone https://github.com/toluschr/xdeb
chmod u+x $HOME/github/xdeb/xdeb
sudo cp $HOME/github/xdeb/xdeb /usr/local/bin

Once installed, we can proceed to package conversion. Install XApps dependency from Void Linux's repository:

sudo xbps-install -S xapps

Download DEB packages from official Linux Mint's repository:

mkdir /tmp/xed && cd /tmp/xed

# These commands will not work on Bash or ZSH, So the dash shell will be used temporarily.
dash -c 'echo "xed_2.8.4+ulyssa_amd64.deb\nxed-common_2.8.4+ulyssa_all.deb\nxed-doc_2.8.4+ulyssa_all.deb"' >> xed_packages
dash -c 'for i in $(cat xed_packages); do curl -O http://packages.linuxmint.com/pool/backport/x/xed/$i; done'

And convert them with XDEB:

dash -c 'for i in $(cat xed_packages); do xdeb -Sde $i; done'

Finally, you can install them:

sudo xbps-install -R binpkgs xed xed-common xed-doc

Xed needs its Glib schemas to be compiled. Otherwise, it will not work.

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

Now Xed should be working properly. If you want, delete the Gedit package. The automated script doesn't remove Gedit, in case Xed fails in the future.

sudo xbps-remove -R gedit

Theming environment

Customize Rofi

We will use a theme based on Aditya Shakya's KDE KRunner one.

# Clone this repo if not done yet.
git -C $HOME/github clone https://github.com/KF-Art/icewm-personal-tunning/

# Copy theme and launcher.
mkdir $HOME/.config/rofi
cp $HOME/github/icewm-personal-tunning/dotfiles/rofi/* $HOME/.config/rofi/

Custom Bash prompt

I made a custom Agnoster-like Bash prompt. With this you don't need Oh My Bash. Add this to your ~/.bashrc:
triangle=$'\uE0B0'

export PS1='\[\e[48;5;237m\] \[\e[0;48;5;237m\]\u\[\e[0;48;5;237m\]@\[\e[0;48;5;237m\]\H\[\e[48;5;237m\] \[\e[0;38;5;237;48;5;29m\]$triangle\[\e[48;5;29m\] \[\e[0;48;5;29m\]\w\[\e[48;5;29m\] \[\e[0;38;5;29;48;5;24m\]$triangle\[\e[48;5;24m\] \[\e[0;48;5;24m\]\!\[\e[48;5;24m\] \[\e[0;38;5;24;48;5;42m\]$triangle\[\e[0;48;5;42m\] \[\e[0;38;5;234;48;5;42m\]\T\[\e[0;48;5;42m\] \[\e[0;38;5;42m\]$triangle \[\e[0m\]'

Edit it as much you want. Also, you can use a prompt generator to modify it, like the one made by Scriptim.

Install San Francisco Pro and JetBrains Mono fonts

We need to clone the font repo, move fonts to /usr/share/fonts/OTF, and update fonts cache and list:
#San Francisco Fonts
git -C "$HOME/github" clone https://github.com/sahibjotsaggu/San-Francisco-Pro-Fonts
sudo mkdir /usr/share/fonts/OTF
sudo mv $HOME/github/San-Francisco-Pro-Fonts/*.otf /usr/share/fonts/OTF

#JetBrains Mono
mkdir /tmp/JetBrains-Mono && cd /tmp/JetBrains-Mono
wget https://github.com/JetBrains/JetBrainsMono/releases/download/v2.242/JetBrainsMono-2.242.zip
unzip JetBrainsMono-2.242.zip
sudo cp -r fonts /usr/share

#Update font cache and list
fc-cache -fv; fc-list

Install and customize Materia Manjaro Dark IceWM theme

Download Materia Manjaro Dark B IceWM theme, and move it to ~/.icewm/themes/. Now we have to edit theme file, specifically Srmx (~/.icewm/themes/Materia-Manjaro-Dark-B/Srmx.theme) to give it a custom fonts and wallpaper. Edit these lines like this:
#Fonts
TitleFontNameXft=                          "SF Pro Display:size=10"
StatusFontNameXft=                         "SF Pro Display:size=10"
MenuFontNameXft=                           "SF Pro Display:size=10"
NormalTaskBarFontNameXft=                  "SF Pro Display:size=10"
ActiveTaskBarFontNameXft=                  "SF Pro Display:size=10"
ListBoxFontNameXft=                        "SF Pro Display:size=10"
ToolTipFontNameXft=                        "SF Pro Display:size=10"
QuickSwitchFontNameXft=                    "SF Pro Display:size=10"
ClockFontNameXft=                          "SF Pro Display:size=10"

#Desktop
DesktopBackgroundImage=                   "/path/to/your/wallpaper.png"

Feel free to edit all the theme as you want (for example, color scheme).

Configure Qt5ct and set GTK & Kvantum themes

In order to use Qt5ct and manage Qt settings, it's necesary to add a environment variable to your .zshrc or .bashrc at the end of the file:
QT_QPA_PLATFORMTHEME="qt5ct"

Alternatively, you can set this variable into /etc/environment to set it at system level. Logout to apply the changes (restart if you're setting it at system level). After that, open Qt5ct, set Kvantum style and configure fonts as you want (I recommend SF Pro Display Light 10).

Download your preferred GTK and Kvantum themes and copy them to /usr/share/themes and ~/.config/Kvantum/, respectively. In this setup, I will use StarLabs-Green (GTK) and KvFlat-Emerald (Kvantum), but you can use any theme you want.

#KvFlat-Emerald installation
git -C "$HOME/github" clone https://github.com/KF-Art/KvFlat-Emerald/
cp "$HOME/github/KvFlat-Emerald/KvFlat-Emerald-Solid" "$HOME/.config/Kvantum"

Now open lxappearance & Kvantum, set themes and configure fonts (lxappearance).

Install Reversal icon theme

You can install any icon theme that you want, as long it includes a void-distributor-logo icon. In this case, I will use Reversal icon theme:
git -C "$HOME/github" clone https://github.com/yeyushengfan258/Reversal-icon-theme
cd "$HOME/github/Reversal-icon-theme"
sudo ./install.sh -green

Now apply the icon theme at lxappearance and Qt5ct.

Prepare Betterlockscreen

Betterlockscreen needs your background to be cached before you can use it:
betterlockscreen -u /path/to/your/wallpaper.png

Customize XFCE panel

I have leave the defaults in general. Delete the default start menu and add Whisker menu instead, change the icon to void-distributor-logo and change the label to "Void Linux". Lastly, add Power Manager and Clipman applets.

DON'T RUN xfce4-power-manager DAEMON, IT WILL DISABLE sxhkd BRIGHTNESS KEYBINDINGS.