tweak: retire CosmicAdaptive.colors for next patch
This commit is contained in:
parent
db763e63a7
commit
68600d2dc1
1 changed files with 20 additions and 12 deletions
|
|
@ -115,10 +115,22 @@ impl Theme {
|
||||||
// tool tips, "What's This" tips, and similar elements
|
// tool tips, "What's This" tips, and similar elements
|
||||||
let tooltip_colors = &window_colors;
|
let tooltip_colors = &window_colors;
|
||||||
|
|
||||||
let general_color_scheme = if self.is_dark { "CosmicDark" } else { "CosmicLight" };
|
let general_color_scheme = if self.is_dark {
|
||||||
let general_name = if self.is_dark { "COSMIC Dark" } else { "COSMIC Light" };
|
"CosmicDark"
|
||||||
|
} else {
|
||||||
|
"CosmicLight"
|
||||||
|
};
|
||||||
|
let general_name = if self.is_dark {
|
||||||
|
"COSMIC Dark"
|
||||||
|
} else {
|
||||||
|
"COSMIC Light"
|
||||||
|
};
|
||||||
// COSMIC icons are stuck in light mode, so use breeze instead
|
// COSMIC icons are stuck in light mode, so use breeze instead
|
||||||
let icons_theme = if self.is_dark { "breeze-dark" } else { "breeze" };
|
let icons_theme = if self.is_dark {
|
||||||
|
"breeze-dark"
|
||||||
|
} else {
|
||||||
|
"breeze"
|
||||||
|
};
|
||||||
|
|
||||||
format!(
|
format!(
|
||||||
r#"# GENERATED BY COSMIC
|
r#"# GENERATED BY COSMIC
|
||||||
|
|
@ -227,10 +239,7 @@ widgetStyle=qt6ct-style
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply the color scheme by:
|
/// Apply the color scheme by symlinking it to `~/.config/kdeglobals`.
|
||||||
/// - symlinking it to `~/.config/kdeglobals`.
|
|
||||||
/// - symlinking it to `~/.local/share/color-schemes/CosmicAdaptive.colors`.
|
|
||||||
/// - TODO: setting color_scheme_path in `~/.config/qt6ct/qt6ct.conf` to CosmicAdaptive.colors
|
|
||||||
///
|
///
|
||||||
/// See the docs: https://develop.kde.org/docs/plasma/#color-scheme
|
/// See the docs: https://develop.kde.org/docs/plasma/#color-scheme
|
||||||
///
|
///
|
||||||
|
|
@ -253,21 +262,20 @@ widgetStyle=qt6ct-style
|
||||||
"CosmicLight.colors"
|
"CosmicLight.colors"
|
||||||
});
|
});
|
||||||
|
|
||||||
let cosmic_adaptive_colors = data_dir.join("CosmicAdaptive.colors");
|
|
||||||
let kdeglobals_file = config_dir.join("kdeglobals");
|
let kdeglobals_file = config_dir.join("kdeglobals");
|
||||||
Self::backup_non_cosmic_kdeglobals(&kdeglobals_file).map_err(OutputError::Io)?;
|
|
||||||
|
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(target_family = "unix")]
|
||||||
for dest_file in &[cosmic_adaptive_colors, kdeglobals_file] {
|
{
|
||||||
use std::os::unix::fs::symlink;
|
use std::os::unix::fs::symlink;
|
||||||
|
Self::backup_non_cosmic_kdeglobals(&kdeglobals_file).map_err(OutputError::Io)?;
|
||||||
|
|
||||||
if dest_file.exists() {
|
if dest_file.exists() {
|
||||||
// Currently we overwrite the file with our symlink.
|
// Currently we overwrite the file with our symlink.
|
||||||
// Maybe in the future we could merge kdeglobals with our color scheme ini?
|
// Maybe in the future we could merge kdeglobals with our color scheme ini?
|
||||||
fs::remove_file(&dest_file).map_err(OutputError::Io)?;
|
fs::remove_file(&kdeglobals_file).map_err(OutputError::Io)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
symlink(&src_file, dest_file).map_err(OutputError::Io)?
|
symlink(&src_file, kdeglobals_file).map_err(OutputError::Io)?
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue