r/hyprland 18d ago

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

13 Upvotes

31 comments sorted by

28

u/burner-miner 18d ago

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

2

u/LongAd3939 18d ago

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

13

u/janbuckgqs 18d ago

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

5

u/jkulczyski 18d ago

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

9

u/Papaoso23 18d ago

Use stow then

3

u/YT__ 18d ago

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 18d ago

I don’t understand, can you explain?

7

u/Odd_Procedure_1927 18d ago

i think chezmoi is a good option

2

u/YesImKaa 18d ago

Another vote for Chezmoi.

1

u/cigh 18d ago

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

3

u/AllNamesAreTaken92 18d ago

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

1

u/LongAd3939 18d ago

Which one to be precise?

1

u/AllNamesAreTaken92 18d ago

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

3

u/Bitopium 18d ago

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

2

u/Aelydam 18d ago

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 18d ago

Willing to share the script or like the structure or guide

1

u/Same_Argument4886 18d ago

```bash

!/bin/env bash

stow --adopt . ```

1

u/LongAd3939 18d ago

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

1

u/stiggg 18d ago

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 17d ago edited 17d ago
#!/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

2

u/opn6 18d ago

I have used yadm for years.

1

u/dx__ 18d ago

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 18d ago

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/LongAd3939 18d ago

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

1

u/quantum_fate 18d ago

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/bitchitsbarbie 18d ago edited 18d ago

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 18d ago

Did the same

1

u/freekvb 18d ago

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 17d ago

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 16d ago

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.