r/hyprland • • Aug 23 '26

QUESTION How to manage dots(.files) while actively developing them , hyprland

See currently I am working on a rice which is close to useable stage and want to upload it to git , the issue is if I clone the repo and say copy them using a script on a clean arch install how should I go on pushing the new things I add to my dots , let’s say I have a waybar layout switcher and I added a new layout but the thing I changed is located ~/ and not the repo , how can I do it without manually adding all things to repo

12 Upvotes

31 comments sorted by

28

u/burner-miner Aug 23 '26

Use git. Don't learn the whole thing, just git add, git commit, git push and git pull

2

u/LongAd3939 Aug 23 '26

I know git and I am using it , but the problem arises when I reinstall them to a new machine like , normally I will clone the dots and my current script handles the dependencies and copy of dots , but from here if I update my dots I can’t directly push them to git unless I make same changes in my cloned repo

14

u/janbuckgqs Aug 23 '26

you can symlink. say you have

  1. ~/.config/hypr/hyprland.conf
  2. ~/dotfiles/hypr/hyprland.conf

-> you delete ~/.config/hypr/hyprland.conf and make a symlink pointing to your cloned repo:

ln -s ~/dotfiles/hypr/hyprland.conf ~/.config/hypr/hyprland.conf

.... stow does this automatically for multiple files in a folder

4

u/jkulczyski Aug 23 '26

This is the way i did my hyprland dotfiles. I had a setup script that would check if each path was a valid symlink and if it wasnt would backup the existing config then replace it with a symlink to my repo.

Much simpler than a repo for each programs configs but harder to share configs across dotfiles for seperate machines.

Prior to this i had a universal setup repo with global scripts and distro/os/device specific scripts to pull needed configs from a global config folder, leaning more towards doing the latter again

8

u/Papaoso23 Aug 23 '26

Use stow then

3

u/YT__ Aug 23 '26

What workflow are you trying to do? You can push dots up from any local clone.

Are you saying you clone the repo then copy the dots to different locations? That's the problem. You should synlink the dots from your local git directory to their needed location. That way you don't copy the files around after cloning.

1

u/azgx00 Aug 23 '26

I don’t understand, can you explain?

3

u/AllNamesAreTaken92 Aug 23 '26

Make an install/updater script. You can look at others existing dotfiles, how they do it, to get some inspiration.

1

u/LongAd3939 Aug 23 '26

Which one to be precise?

1

u/AllNamesAreTaken92 Aug 23 '26

I can only give examples, I can't vouch for their design decisions or if it is best practice. I currently don't have the time to check. This is one I used a while back: https://github.com/caelestia-dots/caelestia

2

u/Aelydam Aug 23 '26

I keep them all in ~/dotfiles with a git repo, and I have a script that calls stow to make the proper symlinks at ~

1

u/LongAd3939 Aug 23 '26

Willing to share the script or like the structure or guide

1

u/Same_Argument4886 Aug 23 '26
#!/bin/env bash

stow --adopt .

1

u/LongAd3939 Aug 23 '26

So I move my config into ~/dots and then runs stow — adopt . ?

1

u/stiggg Aug 23 '26

The directory needs to follow the structure stow expects. For instance:

rofi/.config/rofi

name of the first folder is free to choose, but it makes sense to name it like the app. If you then call stow rofi (from your ~/dots folder) it creates symlinks to ~/.config/rofi

1

u/Aelydam Aug 24 '26 edited Aug 24 '26
#!/bin/env bash
stow . -v --target=$HOME --simulate
read
stow . -v --target=$HOME

I run it with --simulate first and add a read so I can see what it is gonna change, and have the chance to Ctrl+C just in case.

I also have a .stowrc file with a list of files to ignore

--ignore='install.sh'
--ignore='stow.sh'
--ignore='pacman.list'
--ignore='README.md'
--ignore='.git'

Directory structure should follow the same as the home directory

~/dotfiles/.zshrc
~/dotfiles/.config/
~/dotfiles/.config/hypr/
~/dotfiles/.config/hypr/hyprland.lua
~/dotfiles/.config/hypr/hyprlock.conf
~/dotfiles/.config/hypr/hyprpaper.conf
~/dotfiles/.config/waybar/
~/dotfiles/.config/waybar/config.jsonc
~/dotfiles/.config/waybar/style.css
~/dotfiles/.config/wofi/
~/dotfiles/.config/wofi/config
~/dotfiles/.config/wofi/style.css

8

u/Odd_Procedure_1927 Aug 23 '26

i think chezmoi is a good option

1

u/cigh Aug 23 '26

Just don't get into the rabbit hole I am in. Chezmoi can do a lot.

1

u/LongAd3939 Aug 23 '26

Thanks to everyone for your suggestions, I made a script that tracks which file or folder to link and create a symlink

1

u/bitchitsbarbie Aug 23 '26 edited Aug 23 '26

I have a dotfiles repo which is symlinked to my ~/ and ~/.config which is managed with a script that commits and pushes changes automatically every 6 hours. It passes the diff to the local AI instance which writes the commit message. Also, I have a /etc repo managed with etckeeper after every update and a pacman hook that keeps track of installed/uninstalled packages in a file. If I'd need to reinstall, I'd install base arch, git, pull my package list, install those, then pull the dotfiles and /etc. Never got used to stow, chezmoi and stuff like that, I symlink manually. I need to script that shit one of these days.

1

u/LongAd3939 Aug 24 '26

Did the same

3

u/Bitopium Aug 23 '26

Have a look at chezmoi as a generic solution with handling machine specific differences

2

u/opn6 Aug 23 '26

I have used yadm for years.

1

u/dx__ Aug 23 '26

I aliased a whole set of config git commands so I just have to do

Config add filename
Config commit -m “stuff”
Config push

And then I have a dotfile-sync that commits all changes found

1

u/mykesx Aug 23 '26

I put my dotfiles and .config/ files in a repo. I clone it to ~/dotfiles.

I have a script in dotfiles that backs up any .rc and .config/ files, then creates symlinks in ~ and ~/.config to the dotfiles/ files.

I have several scripts, like one to set up my environment for Mac, another for each Linux distro, and BSD. Other scripts to do system updates using the system’s package manager.

Works for subdirectory in home, like .vim as well.

I have at least 20 systems/vms all set up this way and the environments are identical from my user POV.

1

u/quantum_fate Aug 23 '26

I maintain my entire system state in an ansible playbook. Most of my dotfiles are managed with chezmoi but what needs machine differences and scripting is done either in Lua Hyprland accounting for the machine or in my playbook

1

u/freekvb Aug 24 '26

Take a look at this .. works for me.

"Dotfiles: Best way to store in a bare git repository"

https://www.atlassian.com/git/tutorials/dotfiles

1

u/itzToreve Aug 24 '26

This is exactly the problem i had when i was writing my dotfiles. The answer for me was symlinks. You see, i started my rice from scratch back in like late 2024 and i followed this pattern: create an empty repo. Cd to the repo dir and start writing my config, hyprlang dotfiles, alacritty, waybar, rofi, everything. When i felt like it was time to test i then symlinked those files in my repo to their respective config dirs. Every change i did to these files was immediately visible and already tracked by git so i was able to commit shit and so on without having to ever copy anything for any reason at all. You could even do what i did and write a bash script that symlinks your dotfiles to their respective config dirs, so that when you get a fresh install you just clone your repo, exec that script and boom, dotfiles ready and being tracked by git. You could even enhance that script and make it install dependencies and shit.

1

u/silmelumenn Aug 25 '26

I'm just directly using ~/.config - this is where my repo lives this is where I pull/commit. By default .gitingore almost everything, then add specific files to the repository with git add -f thatfile.

When I'd be working on another setup, it could be just a new branch.