Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
I3csstatus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
I3csstatus
Commits
2cbbc7c1
Commit
2cbbc7c1
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Default configuration file
parent
b8ea4bd7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Program.cs
+54
-2
54 additions, 2 deletions
Program.cs
with
54 additions
and
2 deletions
Program.cs
+
54
−
2
View file @
2cbbc7c1
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment