Software /
code /
clix
Comparison
clix.lua @ 173:9b36119c9900 default tip
clix.lua: There's no need to hide the config file under `$HOME/.config/`.`
author | Trần H. Trung <xmpp:trần.h.trung@trung.fun> |
---|---|
date | Thu, 13 Jul 2023 11:50:30 +0700 |
parent | 171:eb7625161d76 |
comparison
equal
deleted
inserted
replaced
172:becd3aa26e6f | 173:9b36119c9900 |
---|---|
30 local current_account, config_file, err; | 30 local current_account, config_file, err; |
31 | 31 |
32 local home_dir = (os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME")); | 32 local home_dir = (os.getenv("XDG_CONFIG_HOME") or os.getenv("HOME")); |
33 if home_dir then | 33 if home_dir then |
34 local config_path = (home_dir.."/.config"); | 34 local config_path = (home_dir.."/.config"); |
35 config_file, err = io.open(config_path.."/.clixrc") or io.open(config_path.."/.clix"); | 35 config_file, err = io.open(config_path.."/clixrc") or io.open(config_path.."/clix"); |
36 if not config_file then | 36 if not config_file then |
37 print("Unable to open config file... looked for "..config_path.."/.clixrc"); | 37 print("Unable to open config file... looked for "..config_path.."/clixrc"); |
38 if err then print(err); end | 38 if err then print(err); end |
39 os.exit(1); | 39 os.exit(1); |
40 end | 40 end |
41 else | 41 else |
42 config_file, err = io.open("/etc/clixrc") or io.open("/etc/clix"); | 42 config_file, err = io.open("/etc/clixrc") or io.open("/etc/clix"); |