Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion bin/nic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,19 @@ sub getHomeDir {
}

sub loadConfig {
open(my $cfh, "<", getHomeDir()."/.nicrc") or return;
my $path;
if (defined $ENV{'XDG_CONFIG_HOME'} &&
-e $ENV{'XDG_CONFIG_HOME'}."/theos/nicrc") {
$path = $ENV{'XDG_CONFIG_HOME'}."/theos/nicrc";
} elsif (-e getHomeDir()."/.config/theos/nicrc") {
$path = getHomeDir()."/.config/theos/nicrc";
} elsif (-e getHomeDir()."/.nicrc") {
$path = getHomeDir()."/.nicrc";
} else {
return
};

open(my $cfh, "<", $path);
while(<$cfh>) {
# Grab config key-value pairs
# Match irrespective of leading whitespace
Expand Down