Skip to content

user-defaults.lua ​

Path: ~/.config/hypr/UserConfigs/user-defaults.lua

View the source.

This module centralizes application choices and returns them as a Lua table. It replaces the old global variables from 01-UserDefaults.conf.

Current fields ​

lua
local defaults = {
    edit = os.getenv("EDITOR") or "nvim",
    term = "kitty",
    files = "thunar",
    search_engine = "https://www.google.com/search?q={}",
}

return defaults
FieldPurpose
editPreferred editor, using $EDITOR when set
termTerminal command used by user bindings
filesFile-manager command used by user bindings
search_engineSearch URL template reserved by the configuration

search_engine currently has no active consumer in the shipped .config tree. Treat it as a declared default, not as proof that a search binding uses it.

Import the module ​

Other Lua modules access the returned table explicitly:

lua
local defaults = require("UserConfigs.user-defaults")

hl.bind("SUPER + RETURN", hl.dsp.exec_cmd(defaults.term))
hl.bind("SUPER + F", hl.dsp.exec_cmd(defaults.files))

The values are module-scoped. Shell commands such as echo $term cannot read them, and Lua strings do not perform shell variable expansion.

Safe customization ​

Use command names that can be run directly:

lua
local defaults = {
    edit = "nvim",
    term = "foot",
    files = "yazi",
    search_engine = "https://duckduckgo.com/?q={}",
}

The HyprFlux Quick Settings script parses some fields with text tools. Keep the simple name = "value" layout and avoid embedding shell pipelines or commands with complex quoting unless you also update that consumer.

Validate after editing:

bash
luac -p ~/.config/hypr/UserConfigs/user-defaults.lua
Hyprland --config ~/.config/hypr/hyprland.lua --verify-config

Released under the MIT License.