Files
2026-08-13 17:59:03 +02:00

27 lines
727 B
Go

package input
import tea "charm.land/bubbletea/v2"
// applyReset kicks off a `hyprctl reload`, which restores the keyboard
// layout and mouse sensitivity to their hyprland.conf values (along with
// anything else set there); both sections are marked pending since a
// reload touches them together.
func (m *Model) applyReset() tea.Cmd {
m.layoutPending = true
m.mousePending = true
m.layoutFeedback = ""
m.mouseFeedback = ""
return resetCmd()
}
func (m *Model) handleReset(msg resetMsg) tea.Cmd {
m.layoutPending = false
m.mousePending = false
if msg.err != nil {
m.layoutFeedback = msg.err.Error()
m.mouseFeedback = msg.err.Error()
return nil
}
return tea.Batch(fetchLayoutCmd(), fetchSensitivityCmd())
}