Cooking with Dag - riced Arch with a side of Apple

I am a proud user of xfce4, it is my favorite DE: clean, highly customizable, and without too much fancy stuff. It does its job.

However, I could save some time by having certain customization (zsh for example), and making it more beautiful looking: having a system which is eye-candy for eyes, at least this work for me, let me be more productive.

Mac-look-a-like

Mac: theming XFCE

Ever dreamed about having a Mac? I like Apple’s look since ever, but I don’t own a modern Apple computer. Despite this, I think their UI elements are clean and highly recognizable, making a system more usable.

Here is what are we going to change:

  • gtk theme: Mojave-gtk-theme
  • icons: McMojave-circle
  • cursor: MacCursor (more precisely, the macOSBigSur variant)
  • top default XFCE4 bar: we can restore a custom configuration
  1. Install MacOSMojave theme
git clone https://github.com/vinceliuice/Mojave-gtk-theme.git  && cd Mojave-gtk-theme
bash install.sh
cd ..
  1. Install MacOSIcons
git clone https://github.com/vinceliuice/McMojave-circle.git && cd McMojave-circle
bash install.sh
cd ..
  1. Install MacCursor
# fetch MacCursor
curl  https://github.com/ful1e5/apple_cursor/releases/download/v1.2.3/macOSBigSur.tar.gz --output macOSBigSur.tar.gz

# extract `macOSMonterey.tar.gz`
tar -xvf macOSBigSur.tar.gz

# For all users
sudo mv macOSBigSur /usr/share/icons/
  1. About the mac top bar, we will restore a config file from xfce4 panel manager:
yay -S xfce4-panel-profiles

The bar will look like this:

top-bar

I haven’t made so much customization, if I need to use a window switcher I will use Plank, but I like much more to switch windows pressing Alt+Tab.

If you use my dotfiles, I will include my config file in my dotfiles repository.

Mac: features

  1. Ulauncher is a nice launcher for your apps and allows you to do other comfortable things, for example, speed-test your connection by typing two characters on the bar or lookout a word on Wikipedia, by not opening your browser.
yay -S ulauncher

It is a spotlight alternative.

Remember to launch ulauncher on login, by toggling a checkbox in its preferences.

  1. Regarding the Mac bottom bar on desktop, Plank is a good bottom bar and its appearance is customizable.
yay -S plank

To customize your plank preferences just give from a new terminal:

plank --preferences

Don’t forget to autostart the application on login! Just create an entry in the autostart tab with plank command on login.

Here is how it looks mine:

bottom-plank-bar

General enhancements

Keyboard shortcuts: xfce4+i3=❤️

A powerful combo productivity could be XFCE4 default keybindings + some of i3 bindings.

For a short period in my life, I have xfce4 and i3 both installed at the same time.

Here’s a list of my shortcuts:

ShortcutAction
Super+SpaceTerminal
Super+[1-4]Change workspace
Ctrl+Spaceulauncher
SuperWhiskerMenu popup
Shift+Ctrl+Printxfce4-screenshooter -r
Super+FToggle fullscreen
Ctrl+Alt+[1-4]Move focused window to desired workspace
Super+[up-down-left-right]Tile window to up/down/left/right

My dotfiles work on xfce4 and xfwm4.

Terminal: zsh and oh-my-zsh

Zsh is a powerful shell, way better than bash.

oh-my-zsh is a helper for zsh which helps your productivity by providing the ability to install themes and plugins.

Install zsh…

pacman -Syu zsh

…and oh-my-zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Now, it’s time to use your new shell!

Setup xfce4-terminal to run zsh by going into Edit > Preferences > Run a custom command instead of my shell > zsh

zsh on steroids

Since you’re now using oh-my-zsh, you can install plugins, themes, and much more.

.zshrc is the .bashrc equivalent, it is your main setup file.

You can customize your shell by installing a custom theme, or some plugins.

I like to use:

git
zsh-autosuggestions
zsh-syntax-highlighting
z
sudo

and also this awesome plugin that needs to be first downloaded by git (it requires dependencies and a short setup).

Also, I like to change my oh-my-zsh home folder, by moving:

# change oh-my-zsh directory
mv "$HOME/.oh-my-zsh" "$HOME/.local/share/oh-my-zsh"

and having this row on my .zshrc file

export ZSH="$HOME/.local/share/oh-my-zsh"

You can install zsh-autosuggestions and zsh-syntax-highlighting by giving:

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions\n
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting\n

Setup aliases

Custom stuff in oh-my-zsh should be done in the zsh folder.

"$HOME/.local/share/oh-my-zsh/custom"

Create a new file named aliases.zsh and write your aliases.

Here’s a list of useful aliases and functions that I like to use (note: as long as you have the required programs, it is suitable for .bashrc too):

# pm aliases
alias reboot="sudo systemctl reboot"
alias poweroff="sudo systemctl poweroff"
alias shutdown='sudo systemctl poweroff'
alias halt="sudo systemctl halt"
alias suspend="sudo systemctl suspend"

# magic-startup-arch-sh
alias inst='sudo pacman -S $1'
alias uninst='sudo pacman -R $1'
alias update='sudo pacman -Syu'
alias instpkg='sudo pacman -U $1'

alias aurupd='yay -Syu'
alias aurinst='yay -S $1'
alias aursearch='yay -Si $1'
alias aurremove='yay -Rns $1'

# lazy aliases
alias q='exit'
alias c='clear'
alias vc='vscodium'
alias n='nano'
alias whatsmyip="curl http://ipecho.net/plain; echo"

# space management
alias diskusage='ncdu'
alias space='sudo du -sh $1'
alias df="df -h"

function freespace {
    echo "Cleaning pacman cache..."
    sudo pacman -Sc
    read $p

    echo "Cleaning unused packages..."
	sudo pacman -Rns $(pacman -Qtdq)

	echo "Cleaning cache..."
	sudo du -sh ~/.cache/
	rm -rf ~/.cache/*

	echo "Cleaning journal files..."
	sudo journalctl --vacuum-size=50M
}

powerlevel10k

The last layer of oh-my-zsh setup is powerlevel10k, a script that helps you to customize your shell appearance by choosing among different looks, to let you customize how information is displayed on screen.

We’re using oh-my-zsh so we can use this snippet:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

If your setting is different (e.g. you’re not using oh-my-zsh), please refer to the official Github installation instructions

From the official Github page:

On the first run, Powerlevel10k configuration wizard will ask you a few questions and configure your prompt. If it doesn’t trigger automatically, type p10k configure. Configuration wizard creates ~/.p10k.zsh based on your preferences. Additional prompt customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options.

This is what my terminal looks like:

terminal

Dotfiles

Finally, you can copy and use my dotfiles.

They contain everything we covered here and all of my settings.

Remember to place dotfiles and folders in your $HOME directory:

git clone github.com/dag7dev/dotfiles.git

TLDR

Everything I said before that includes:

  • mac cursor, gtk-theme, icon, beautiful font, a bottom bar on desktop and “spotlight-like bar”
yay -S mojave-gtk-theme mcmojave-cursors mcmojave-circle-icon-theme-git ttf-roboto xfce4-panel-profiles ulauncher plank-git
  • zsh, oh-my-zsh and powerlevel10k:
# zsh
pacman -Syu zsh

# oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# change oh-my-zsh directory
mv "$HOME/.oh-my-zsh" "$HOME/.local/share/oh-my-zsh"

# add this line to your .zshrc (included in my dotfiles)
export ZSH="$HOME/.local/share/oh-my-zsh"

# install oh-my-zsh plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions\n
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting\n

Use my dotfiles to have a cool look:

git clone -b apple-like-dotfiles github.com/dag7dev/dotfiles.git

Install powerlevel10k:

# powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Setup xfce4-terminal to run zsh by going into Edit > Preferences > Run a custom command instead of my shell > zsh

Finally, add some of my shortcuts. From inside of the dotfiles cloned folder, type:

cp xfce4-keyboard-shortcuts.xml .config/xfce4/xfconf/xfce-perchannel-xml/

Troubleshooting

Q: Plank draws a black line.
A: This happened to me too. Window Manager Tweaks > Compositor > Disable Show shadows under dock windows

Have fun~!