Dag / Arch Linux — Powered by Dag

Created Sun, 29 Aug 2021 15:00:00 +0100 Modified Fri, 04 Oct 2024 12:53:51 +0000
1341 Words

Arch Linux — Powered by Dag

Photo by Isaac Li Shung Tan on Unsplash

What about having a fully working Arch Installation - on your machine? Well, it always has been my dream since the first Arch installation ever.

As I told you here, I installed Arch on a specific computer, so I have carefully chose my packages.

These packages are in addition to the packages I’ve already installed in that guide:

intel-ucode nvidia vlc firefox discord telegram-desktop alsa thunar gcc htop i3 lxappearance ntfs-3g wget picom powertop redshift git xdg-user-dirs xclip maim tree xorg neofetch base-devel

Issues I had once I installed Arch Linux:

  • can’t change background
  • no aur helper
  • no common programs installed
  • no polybar setup
  • audio control not available by keyboard
  • brightness control not available by keyboard
  • no trasparent windows
  • “open containing folder” button doesn’t properly work in Firefox
  • autoconnect to wifi
  • wifi powersaving off
  • Enable lightdm and fix it because it doesn’t work
  • no wakeup after sleep
  • autostart things — redshift in my case
  • screenshot pasted into clipboard
  • multiple keyboard layout: switch between one layout and another one by pressing CTRL+SPACE
  • poweroff commands don’t work
  • no speakers and no microphone
  • cant open zip file and unzip them
  • battery drain

Our reaction after noticing that nothing is working as expected — photo by krakenimages on Unsplash


Can’t change background

This is an easy one, just put this in your console:

nitrogen <wallpaper folder>

It will open a window which will prompt you image picker.

In your i3 config place this line:

exec –no-startup-id nitrogen –restore


No aur helper

sudo git clone [https://aur.archlinux.org/yay-git.git](https://aur.archlinux.org/yay-git.git)
sudo chown -R user:user yay-git
cd yay-git & makepkg -si

No common aur programs installed

In my case they are polybar, vscodium-bin and intellij-idea-ultimate-edition

yay -S polybar vscodium-bin intellij-idea-ultimate-edition p7zip-gui siji

No polybar set up

Comment the lines related to bar in your i3 file and add this line:

exec_always — no-startup-id $HOME/.config/polybar/launch.sh

Create xdg user dirs by giving xdg-user-dirs-update

Now polybar in order to work needs two files: config and launch.sh

cp /usr/share/doc/polybar/config .config/polybar/config

Change your “example” to “bar”.

Create into ./config/polybar/ a file named launch.sh , give:

chmod 755 ./config/polybar/launch.sh

Now it’s time to fill it by copy-pasting this:

#!/bin/bash

# Terminate already running bar instances  
killall -q polybar

# Wait until the processes have been shut down  
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done

# Launch Polybar, using default config location ~/.config/polybar/co>  
polybar bar &

echo “Polybar launched…”

Audio control not available by keyboard

In your i3 config file you need to comment the lines related to bindsym XF86AudioRaiseVolume , bindsym XF86AudioLowerVolume and bindsym XF86AudioMute.

NOTE: I installed sof-firmware that’s why I need to specify the -c 1 option.

It is needed to overwrite them with the ones we are adding:

Audio control

bindsym XF86AudioRaiseVolume exec amixer -q -c 1 sset Master 1+ unmute  
bindsym XF86AudioLowerVolume exec amixer -q -c 1 sset Master 1- unmute  
bindsym XF86AudioMute exec amixer -q -c 1 sset Speaker toggle & amixer -q -c 1 sset Master toggle

Brightness control not available by keyboard

Add this in i3 config file:

Backlight Control — requires brightnessctl and nvidia

bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness


No trasparent windows

After having installed picom, copy the default conf file:

sudo cp /etc/xdg/picom.conf .config/picom.conf

Fix its permissions:

sudo chown user:user .config/picom.conf

Then edit with nano by replacing vsync = true; with vsync = false

vsync = false; in the .config/picom.conf

Add this in i3 config file:

# Window Compositor  
exec_always picom -f

Add this to .config/picom.conf

inactive-opacity = 0.75;  
active-opacity = 1;  
frame-opacity = 1.00;

Open containing folder button doesn’t properly work in Firefox

When you click on Firefox “open containing folder” button after a file it didn’t work

xdg-mime default thunar.desktop inode/directory

Autoconnect to wifi

In the terminal:

cp /etc/netctl/examples/wireless-wpa /etc/netctl/somedescriptivename
  • Edit your new config at /etc/netctl/somedescriptivename to fit your setup.
    Remember to set priority or it won’t work
  • Enable the netctl-auto service for your wireless adapter.
systemctl enable netctl-auto@<device>.service

To list your interfaces (install iw first):

iw dev | awk '$1=="Interface"{print $2}'

Wifi powersaving off:

sudo nano /etc/udev/rules.d/81-wifi-powersave.rules

Inside it:

ACTION==”add”, SUBSYSTEM==”net”, KERNEL==”wl*”, RUN+=”/usr/bin/iw dev wlp0s20f3 set power_save off”

Enable lightdm (and fix it because it will not work)

Uncomment in lightdm greeter-session and replace with

[Seat:*]  
greeter-session=lightdm-gtk-greeter

FIX: Add this to your /etc/lightdm/lightdm.conf in the [LightDM] section:

   logind-check-graphical=true

Then:

systemctl enable lightdm

No wakeup after sleep

sudo nano /etc/systemd/system/suspend@.service

Write this inside:

[Unit]  
Description=User suspend actions  
Before=sleep.target  
  
[Service]  
User=%I  
Type=forking  
Environment=DISPLAY=:0  
ExecStartPre= -/usr/bin/pkill -u %u unison ; /usr/local/bin/music.sh stop  
ExecStart=/usr/bin/sflock  
ExecStartPost=/usr/bin/sleep 1  
  
[Install]  
WantedBy=sleep.target

Now, type

sudo nano /etc/systemd/system/resume@.service

Write this

[Unit]  
Description=User resume actions  
After=suspend.target  
  
[Service]  
User=%I  
Type=simple  
ExecStart=/usr/local/bin/ssh-connect.sh  
  
[Install]  
WantedBy=suspend.target

And finally

systemctl enable suspend@  
systemctl enable resume@

Autostart things with i3

Add them to i3 config file preceded by exec or exec_always.

Useful things I put in mine:

exec redshift -l 41.90:12.49

Screenshot

Add this to i3 config file (requires maim and xclip):

bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/pngbindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/pngbindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png

Multiple key layout (switching from one keyboard to another one with WIN+Space)

Copy-paste this into terminal

localectl set-x11-keymap us,it pc105 qwerty grp:win_space_toggle

Poweroff commands doesn’t work

Become superuser:

sudo su

Override visudo editor:

export EDITOR=nano

Type visudo then add this at the end of the file:

_user_ _hostname_ =NOPASSWD: /usr/bin/systemctl poweroff,/usr/bin/systemctl halt,/usr/bin/systemctl reboot, /usr/bin/systemctl suspend

And in your .bashrc:

alias reboot="sudo systemctl reboot"  
alias poweroff="sudo systemctl poweroff"  
alias halt="sudo systemctl halt"  
alias suspend="sudo systemctl suspend"

No speakers — no microphone

It works for me:

echo "options snd-hda-intel model=generic" >> /etc/modprobe.d/alsa-base.conf  
echo "options snd-hda-intel enable_msi=1" >> /etc/modprobe.d/modprobe.conf

Let’s install sof-firmware:

sudo pacman -S sof-firmware

Can’t open zip files and unzip them

sudo pacman -S p7zip

then from your favorite aur manager:

yay -S p7zip-gui

Battery drain

Install TLP

sudo pacman -S tlp

Let’s autostart this service

sudo systemctl enable tlp.service`

Cool custom theme

Download it first:

wget [https://github.com/Roboron3042/Cyberpunk-Neon/raw/master/gtk/materia-cyberpunk-neon.tar.gz](https://github.com/Roboron3042/Cyberpunk-Neon/raw/master/gtk/materia-cyberpunk-neon.tar.gz) -O materia.tar.gz

Let’s un-tar it:

tar xzf yourfavouritetheme-cyberpunk-neon.tar.gz -C ~/.themes/

Open lxappearance and select it from your theme list


List of installed application (and why):

Photo by Kelly Sikkema on Unsplash

  • intel-ucode, nvidia: microcode for Intel CPU and nvidia drivers
  • vlc firefox discord telegram-desktop git: I refuse to explain you what they are!
  • alsamixer: the standard mixer used to control audio, we will later discuss it
  • thunar: a simple, rich file manager
  • gcc: GNU Compiler Collection
  • htop: an advanced process manager
  • i3: my Window Manager (WM)
  • lxappearance: to change our GTK theme
  • ntfs-3g: allow the os to read NTFS filesystem
  • wget: tool to download stuff from the internet
  • picom: allow trasparency on each window
  • polybar: highly customizable bar
  • powertop: it shows what apps consume our battery
  • redshift: powerful eye-saver
  • xdg-users-dirs: this is useful to create the standard directories of each user
  • xclip: allow to copy-paste images
  • maim: screenshot tool
  • tree: beautifully display our directories in a tree
  • xorg: display server
  • neofetch: just an aesthetic thing for our terminal
  • base-devel: building applications essential tools
  • netctl: it controls our connection
  • lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings: are used to setup a login page
  • ttf-dejavu ttf-liberation noto-fonts: some fonts
  • alacritty: a powerful gpu enhanced terminal, very beautiful
  • dmenu: a menu that could open every app you installed in your system. Is pre-configured with i3
  • ncdu: tool used to check free space
  • brightnessctl: it manages brightness
  • pulseaudio, alsa-tools, alsa-utils: they are useful to manage audio
  • sof-firmware: audio firmware
  • nitrogen: background picker
  • siji: no font in my polybar config

Dotfiles: you can my download my entire configuration here which includes nano syntax highlighting, and many other dot files


Alternatively, you can use my script to download and setup everything as I’ve done on my machine


If you liked this article, why don’t you take a peek at my Medium or check my profile on Github?

You may find interesting even this awesome article on how to install Arch in a few moves