Skip to content

Apply changes to/overwrite existing profile #133

@butzo

Description

@butzo

Sometimes a workstation config changes, i.e. a display is swapped for another or one is missing and thus none of the profiles matches.

Would it be possible to apply changes to/overwrite an existing config instead of creating a new profile?

Loading an existing profile (and using it as a template) would probably be a good idea if only small changes are needed before saving it to a new or existing profile.

Thinking about it is not strictly necessary but would help in keeping the config.toml file and the number of profiles that need to be managed in case something changes small and lean.
Perhaps also a feature that would allow the deletion of profiles without the need to delete the template and changing the config.toml file.
Also a list of available profiles could help.

I originally caught this when I tried to save a change of the config (one of the displays of a workstation i use regularly was missing) by pressing 'a' in the profile pane and the TUI crashed. I fixed it by creating a new profile but was able to reproduce it (see below).

Cheers

> hyprdynamicmonitors tui --debug  --enable-lid-events
Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 55 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
	/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc000494000, {0x7cfc40, 0xc03890})
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:847 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:638 +0xe6
panic({0x7cfc40?, 0xc03890?})
	/opt/hostedtoolcache/go/1.25.0/x64/src/runtime/panic.go:783 +0x132
github.com/fiffeek/hyprdynamicmonitors/internal/tui.(*HDMConfigPane).Update(0xc00041c008, {0x80d360, 0xc0001f2000})
	/home/runner/work/hyprdynamicmonitors/hyprdynamicmonitors/internal/tui/hdm_config_pane.go:125 +0x9f8
github.com/fiffeek/hyprdynamicmonitors/internal/tui.Model.Update({0xc0000ab320, {{{0xc00002a270, 0x1, 0x1}, {{...}, {...}}, 0x0}, {{0xc00002a280, 0x1, 0x1}, ...}, ...}, ...}, ...)
	/home/runner/work/hyprdynamicmonitors/hyprdynamicmonitors/internal/tui/root.go:537 +0x3cba
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc000494000, {0x93c138?, 0xc00048e008?}, 0xc00024c000)
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:494 +0x857
github.com/charmbracelet/bubbletea.(*Program).Run(0xc000494000)
	/home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:716 +0xae7
github.com/fiffeek/hyprdynamicmonitors/internal/app.(*TUI).Run.func7()
	/home/runner/work/hyprdynamicmonitors/hyprdynamicmonitors/internal/app/tui.go:196 +0x27
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:93 +0x50
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
	/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x95
Failed to write to log, write debug.log: file already closed

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions