Connecting Omarchy with MacOS locally
I finally managed to get my 2017 Macbook up and running on Omarchy. (Yippie!)
One of the first things I wanted to get sorted was syncing files quickly between my main Macbook (M1 2020 Macbook) and my Omarchy (the 2017 Macbook)
This article goes through how I did it.
First I needed to allow for external login on my Mac, and figure out the hostname. See my previous article on this.
After you have found out and activated remote access on the mac, it's time to find thje Omarchy hostname. In my case it was "archlinux".
Find out by running hostnamectl
in the terminal and grabbing the "Static hostname" and adding a ".local" afterwards.
So in my case it was like following:
My MacOS host name was: macbookpro.local
My Omarchy host name was: archlinux
To simply connect from the Omarchy to my mac, i could do the following:
ssh eddie@macbookpro.local
where eddie is my username, and typing my password when prompted.
How about the other way? Connecting to my Omarchy from the MacOS?
First I needed to install openssh. I did it via the alt-super-space - «install» - «package» and «openssh».
Start the SSH daemon (immediately)sudo systemctl start sshd
Enable SSH at boot (optional but recommended)sudo systemctl enable sshd
Confirm it’s runningsystemctl status sshd
Then I can connect from the MacOS like this:
ssh eddie@archlinux.local
where eddie is my Omarchy user and typing my password when prompted.
Moving files from the MacOS to Omarchy
First off I install rsync. On Omarchy I do that via the install packages solution again, and on the MacOS I use Homebrew.
Now, as an example I'll mode the folder /Documents/example from my MacOS into my /Documents folder on my Omarchy.
In this case I am in the /home/eddie directory on my Linux - meaning one level above the /Documents folder.
Running the following rsync command syncs the folder from the MacOS to the Linux machine, and now I have the example folder within the Documents folder on my Linux. (tips: run the rsync command with --dry-run as a parameter to test before running it)
rsync -av eddie@macbookpro.local:~/Documents/example Documents
Making it better. ssh-key instead of typing password every time
For this you’ll need an ssh key on each computer.
To create, run: ssh-keygen -t ed25519
continue and add a passphrase if you want (I didnt)
Once created on the Linux machine, add it to the mac like this:
ssh-copy-id eddie@macbookpro.local
Now the Linux ssh-key is inserted to the mac, and allows access without the password.
Test like this:ssh eddie@macbookpro.local
Now it should work without password prompt.
How about the other way? Connecting to the Linux from MacOS?
Same process. Make ssh key and add it the other direction:
I made a new dedicated ssh key for this:ssh-keygen -t ed25519 -f ~/.ssh/ided25519arch -C "mac->arch"
Add a clean SSH config entry
Edit ~/.ssh/config
on the mac and add this:
Host omarchy
HostName archlinux.local
User eddie
Port 22
IdentityFile ~/.ssh/ided25519arch
IdentitiesOnly yes
Copy the key (will ask for your Linux password once)ssh-copy-id -i ~/.ssh/ided25519arch.pub omarchy
After this now I can just type ssh omarchy
and it should work without password prompt.
That same setup from the linux to mac:
edit the ~/.ssh/config
And add:
Host mac
HostName <YourMacName>.local
User <YourMacUsername>
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
After this just type:ssh mac
to connect to the mac from the linux machine.
Adding simple commands for sending back and forth
Now we can create simple bash commands for sending to and from the Desktop on the mac / linux machine (inspired by Derek Sivers)
On my Linux machine, I have now created two files:
1. Create the bin folder (if needed):
mkdir -p ~/bin
2. Create tomac and tolinux scripts:
echo '#!/bin/bash
rsync -av --delete --remove-source-files ~/Desktop/ mac:~/Desktop/ && \
# Delete empty directories on Linux source after rsync completes successfully
find ~/Desktop -type d -empty -delete && \
# Log completion
echo "Sync to Mac finished at $(date)"' > ~/bin/tomac
echo '#!/bin/bash
rsync -av --delete --remove-source-files mac:~/Desktop/ ~/Desktop/ && \
# Delete empty directories on Linux source after rsync completes successfully
ssh mac "find ~/Desktop -type d -empty -delete" && \
# Log completion
echo "Sync to Linux finished at $(date)"' > ~/bin/tolinux
3. Make the scripts executable:
chmod +x ~/bin/tomac ~/bin/tolinux
4. Add ~/bin to your PATH (if it isn’t already):
export PATH="$HOME/bin:$PATH"
Then reload:
source ~/.bashrc # or ~/.zshrc
Now you can just type:
tomac # Send from Linux to Mac
tolinux # Pull from Mac to Linux
Because I both use a mac and a linux, this way it's easy for me to just dump files to the desktop, and transfer over to the other computer as needed.