Skip to content

Latest commit

 

History

History
213 lines (138 loc) · 5.1 KB

01_ui.md

File metadata and controls

213 lines (138 loc) · 5.1 KB

Introduction

In this part I will present you two options for user interface. Both use Wayland.

YouTube version of this tutorial

I recorded a YT series where I follow all of these instructions. The installation there is performed on a real-life hardware. Check it out if you get stuck.

Secure ArchLinux Installation part 2 - User Interface with Sway

GNOME

Just install gnome. This will get you the usuall, complete desktop expirience.

pacman -S gnome

Then go with all the default options, and enable systemD unit so it autostarts:

systemctl enable gdm.service

Reboot.

Sway

Sway is a tiling window manager. It's like i3 but instead of Xorg it uses Wayland for display server protocol. From my expirience at this moment everything I need works, like screensharing on various platforms ( web google meet, teams, zoom ), and even Steam and GoG games.

For sway we need to install few extra packets:

pacman -S sway polkit swaybg waybar xorg-xwayland xdg-utils fakeroot pulseaudio

This basically gives you a starting base. You can start the UI manually with (but don't do that just yet):

sway

and personally I like to keep it that way. This means you will log via terminal and decide whether you want to jump into the UI or not.

Copy config file to your user's directory so you can enable your own changes:

mkdir .config/sway
cp /etc/sway/config .config/sway/

Keys cheatsheet

https://depau.github.io/sway-cheatsheet/

Terminal

Install your preffered terminal emulator (foot, alacritty, whatever you want), I'm going to use alacritty for this example:

pacman -S alacritty

Then edit your config file and change terminal executable

vim ~/.config/sway/config

# Your preferred terminal emulator
set $term alacritty

Now you can start sway and launch terminal by pressing mod + Enter

Personally I like my terminal windows a bit transparent, so let's do that:

mkdir ~/.config/alacritty/
vim ~/.config/alacritty/alacritty.yml

window:
  opacity: 0.75

Changes should be visible immediately.

Popup command window

Create direcotory for your AUR repos and clone sway launcher there:

mkdir -p ~/repos/AUR/
cd ~/repos/AUR
git clone https://aur.archlinux.org/sway-launcher-desktop.git

Install fzf dependency and font-awesome for icons, then build and install sway launcher:

cd sway-launcher-desktop
pacman -S fzf ttf-font-awesome
makepkg --install

Configure sway to start using that as our launcher:

vim ~/.config/sway/config

set $menu dmenu_path | dmenu | xargs swaymsg exec -- # Comment out this line

# Put those lines below the commented out one
for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10
set $menu exec $term --class=launcher -e /usr/bin/sway-launcher-desktop

Status bar

Lot's of example are presented on the waybar github page https://github.com/Alexays/Waybar/wiki/Examples

The easiest way to start is to just grab an example and modify it to your needs.

Firt, create your waybar config directory:

mkdir ~/.config/waybar

Then, into that directory, download your choosen config and style.css files from the examples page.

We need to tell Sway to start using waybar, so edit your config file:

vim ~/.config/sway/config

# Comment out or delete entire bar section
bar {
  (...)
}

# Put this
bar swaybar_command waybar

Reload Sway with Shift + mod + c to see your new status bar.

Lockscreen

Never leave your station unlocked.

Install required packets:

pacman -S swaylock swayidle

Get yourself some nice lockscreen image and save it on your computer. I'll be reffering to mine as ~/Pictures/lockscreen.jpg

Edit your sway config, the power off/on option will just turn off your display after longer period. Adjust the times (in seconds) as needed. The last option ensures our computer is locked upon entering suspended state.

vim ~/.config/sway/config

exec swayidle -w \
         timeout 300 'swaylock -e -f -i ~/Pictures/lockscreen.jpg' \
         timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
         before-sleep 'swaylock -e -f -i ~/Pictures/lockscreen.jpg'

Add option for manual locking, in my case I'm going for mod + L, same as on Windows:

vim ~/.config/sway/config

### Key bindings
#
# Basics:
#
    # Lock screen
    bindsym $mod+l exec swaylock -e -f -i ~/Pictures/lockscreen.jpg -C ~/.config/swaylock/config

This keystroke collides with another one, so comment them out. Don't worry, you can still change focus with arrow keys:

vim ~/.config/sway/config

# Comment those out:
#bindsym $mod+$left focus left
#bindsym $mod+$down focus down
#bindsym $mod+$up focus up
#bindsym $mod+$right focus right

Background

Same as with lockscreen, get yourself nice wallpaper and save it to ~/Pictures/bg.png

Then change the path in sway's config file:

vim ~/.config/sway/config

### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg ~/Pictures/bg.png fill