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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
I3csstatus
Commits
a4c37500
Commit
a4c37500
authored
2 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Program.cs: Change `namespace ... {CODE}` to `namespace ...;`
parent
f951eda5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Program.cs
+260
-245
260 additions, 245 deletions
Program.cs
with
260 additions
and
245 deletions
Program.cs
+
260
−
245
View file @
a4c37500
...
...
@@ -19,7 +19,8 @@ using Process = System.Diagnostics.Process;
using
Config
;
namespace
i3csstatus
{
namespace
i3csstatus
;
static
class
POSIX
{
[
DllImport
(
"libc"
,
SetLastError
=
true
)]
...
...
@@ -30,6 +31,7 @@ namespace i3csstatus {
public
static
int
EEXIST
=
17
;
public
static
int
ERRNO
{
get
=>
Marshal
.
GetLastPInvokeError
();}
}
static
class
ProcesExtended
{
public
static
int
KillBySignal
(
this
Process
p
,
int
sig
)
...
...
@@ -37,6 +39,7 @@ namespace i3csstatus {
return
POSIX
.
kill
(
p
.
Id
,
sig
);
}
}
static
class
JsonExtended
{
public
static
JsonObject
RemoveNull
(
this
JsonObject
o
)
...
...
@@ -52,6 +55,7 @@ namespace i3csstatus {
return
o
;
}
}
static
class
ColorToHexExtended
{
static
public
string
ToHex
(
this
Color
c
)
...
...
@@ -59,13 +63,15 @@ namespace i3csstatus {
return
$"#
{
c
.
R
:
X2
}{
c
.
G
:
X2
}{
c
.
B
:
X2
}
"
;
}
}
record
Element
(
string
text
,
string
?
short_text
=
null
,
Color
?
color
=
null
);
#
nullable
restore
abstract
class
StatusBar
{
List
<
Module
>
modules
=
new
();
...
...
@@ -111,6 +117,8 @@ namespace i3csstatus {
public
abstract
void
Schedule
(
int
in_ms
);
public
abstract
T
GetGlobal
<
T
>()
where
T
:
GlobalModuleResource
,
new
();
}
class
InnerStatusBar
:
StatusBar
{
StatusBar
parrent
;
...
...
@@ -122,6 +130,8 @@ namespace i3csstatus {
public
override
void
Schedule
(
int
in_ms
)
=>
parrent
.
Schedule
(
in_ms
);
public
override
T
GetGlobal
<
T
>()
=>
parrent
.
GetGlobal
<
T
>();
}
abstract
class
RootStatusBar
:
StatusBar
{
long
nextRun
=
0
;
...
...
@@ -195,6 +205,8 @@ namespace i3csstatus {
return
(
T
)
globalModuleResources
[
typeof
(
T
)];
}
}
class
StatusBarPlainText
:
RootStatusBar
{
public
StatusBarPlainText
(
FileInfo
configFile
):
base
(
configFile
){}
...
...
@@ -211,6 +223,8 @@ namespace i3csstatus {
w
.
WriteLine
(
""
);
}
}
class
StatusBarTerminal
:
RootStatusBar
{
Thread
inputThread
;
...
...
@@ -270,6 +284,8 @@ namespace i3csstatus {
w
.
WriteLine
(
json
.
ToJsonString
(
opt
));
}
}
class
Program
{
#pragma warning disable 1998
...
...
@@ -311,4 +327,3 @@ namespace i3csstatus {
}
#pragma warning restore 1998
}
}
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