Skip to content
Snippets Groups Projects
Commit 2cbbc7c1 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Default configuration file

parent b8ea4bd7
No related branches found
No related tags found
No related merge requests found
......@@ -126,9 +126,61 @@ interface ModuleParent
abstract class StatusBar: ModuleParent
{
static public string DefaultConfigText =
@"
refresh = 1
[wireless]
_type=i3status
global_cache = 1
name = wireless _first_
config
format_up = ""W: (%quality %essid) %ip""
format_down = ""W: down""
[ethernet]
_type=i3status
name=ethernet _first_
config
format_up = ""E: %ip (%speed)""
format_down = ""E: down""
[battery]
[load]
_type = i3status
name = load
config = format = ""%1min L""
[memory]
_type = i3status
name = memory
config
format = ""%available""
threshold_degraded = ""1G""
format_degraded = ""MEMORY %available""
[time]
format = yyyy-MM-dd HH:mm:ss
refresh
";
List<Module> modules = new();
protected void parseConfigFile(FileInfo configFile)
protected void parseConfigFile(FileInfo? configFile)
{
if(configFile == null)
{
string configText;
try
{
configText = File.ReadAllText(Environment.GetEnvironmentVariable("HOME")+"/.config/i3/i3csstatus.conf");
}
catch(Exception e) when (e is FileNotFoundException || e is DirectoryNotFoundException)
{
configText = DefaultConfigText;
}
parseConfigString(configText);
}
else
parseConfigString(File.ReadAllText(configFile.ToString()));
}
protected void parseConfigString(string configString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment