mirror of
https://github.com/eza-community/eza
synced 2024-10-14 20:03:50 +00:00
feat(ui): Add EXA_COLOR bindings for un-themed items
This commit is contained in:
parent
7e60ba16b7
commit
35b29aea2d
|
@ -79,6 +79,9 @@ LIST OF CODES
|
|||
|
||||
`EXA_COLORS` can use many more:
|
||||
|
||||
`oc`
|
||||
: the permissions displayed as octal
|
||||
|
||||
`ur`
|
||||
: the user-read permission bit
|
||||
|
||||
|
@ -196,6 +199,9 @@ LIST OF CODES
|
|||
`gi`
|
||||
: an ignored flag in Git
|
||||
|
||||
`gc`
|
||||
: a conflicted flag in Git
|
||||
|
||||
`xx`
|
||||
: “punctuation”, including many background UI elements
|
||||
|
||||
|
@ -220,6 +226,9 @@ LIST OF CODES
|
|||
`bO`
|
||||
: the overlay style for broken symlink paths
|
||||
|
||||
`sp`
|
||||
: special (not file, dir, mount, exec, pipe, socket, block device, char device, or link)
|
||||
|
||||
`mp`
|
||||
: a mount point
|
||||
|
||||
|
@ -253,6 +262,21 @@ LIST OF CODES
|
|||
`bu`
|
||||
: a regular file that is used to build a project (ex: Makefile)
|
||||
|
||||
`Sn`
|
||||
: No security context on a file
|
||||
|
||||
`Su`
|
||||
: SELinux user
|
||||
|
||||
`Sr`
|
||||
: SELinux role
|
||||
|
||||
`St`
|
||||
: SELinux type
|
||||
|
||||
`Sl`
|
||||
: SELinux level
|
||||
|
||||
Values in `EXA_COLORS` override those given in `LS_COLORS`, so you don’t need to re-write an existing `LS_COLORS` variable with proprietary extensions.
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ pub struct UiStyles {
|
|||
pub inode: Style, // in
|
||||
pub blocks: Style, // bl
|
||||
pub header: Style, // hd
|
||||
pub octal: Style,
|
||||
pub octal: Style, // oc
|
||||
|
||||
pub symlink_path: Style, // lp
|
||||
pub control_char: Style, // cc
|
||||
|
@ -38,7 +38,7 @@ pub struct FileKinds {
|
|||
pub block_device: Style, // bd
|
||||
pub char_device: Style, // cd
|
||||
pub socket: Style, // so
|
||||
pub special: Style,
|
||||
pub special: Style, // sp
|
||||
pub executable: Style, // ex
|
||||
pub mount_point: Style, // mp
|
||||
}
|
||||
|
@ -104,21 +104,21 @@ pub struct Git {
|
|||
pub renamed: Style, // gv
|
||||
pub typechange: Style, // gt
|
||||
pub ignored: Style, // gi
|
||||
pub conflicted: Style,
|
||||
pub conflicted: Style, // gc
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
pub struct SELinuxContext {
|
||||
pub colon: Style,
|
||||
pub user: Style,
|
||||
pub role: Style,
|
||||
pub typ: Style,
|
||||
pub range: Style,
|
||||
pub user: Style, // Su
|
||||
pub role: Style, // Sr
|
||||
pub typ: Style, // St
|
||||
pub range: Style, // Sl
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
pub struct SecurityContext {
|
||||
pub none: Style,
|
||||
pub none: Style, // Sn
|
||||
pub selinux: SELinuxContext,
|
||||
}
|
||||
|
||||
|
@ -217,17 +217,20 @@ impl UiStyles {
|
|||
"gv" => self.git.renamed = pair.to_style(),
|
||||
"gt" => self.git.typechange = pair.to_style(),
|
||||
"gi" => self.git.ignored = pair.to_style(),
|
||||
"gc" => self.git.conflicted = pair.to_style(),
|
||||
|
||||
"xx" => self.punctuation = pair.to_style(),
|
||||
"da" => self.date = pair.to_style(),
|
||||
"in" => self.inode = pair.to_style(),
|
||||
"bl" => self.blocks = pair.to_style(),
|
||||
"hd" => self.header = pair.to_style(),
|
||||
"oc" => self.octal = pair.to_style(),
|
||||
"lp" => self.symlink_path = pair.to_style(),
|
||||
"cc" => self.control_char = pair.to_style(),
|
||||
"bO" => self.broken_path_overlay = pair.to_style(),
|
||||
|
||||
"mp" => self.filekinds.mount_point = pair.to_style(),
|
||||
"sp" => self.filekinds.special = pair.to_style(), // Catch-all for unrecognized file kind
|
||||
|
||||
"im" => self.file_type.image = pair.to_style(),
|
||||
"vi" => self.file_type.video = pair.to_style(),
|
||||
|
@ -240,6 +243,12 @@ impl UiStyles {
|
|||
"cm" => self.file_type.compiled = pair.to_style(),
|
||||
"bu" => self.file_type.build = pair.to_style(),
|
||||
|
||||
"Sn" => self.security_context.none = pair.to_style(),
|
||||
"Su" => self.security_context.selinux.user = pair.to_style(),
|
||||
"Sr" => self.security_context.selinux.role = pair.to_style(),
|
||||
"St" => self.security_context.selinux.typ = pair.to_style(),
|
||||
"Sl" => self.security_context.selinux.range = pair.to_style(),
|
||||
|
||||
_ => return false,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue