You've already forked panic-cli
mirror of
https://github.com/Print-and-Panic/panic-cli.git
synced 2026-01-21 10:17:41 -08:00
26 lines
542 B
Go
26 lines
542 B
Go
package kde
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
)
|
|
|
|
type DefaultLookAndFeel struct{}
|
|
|
|
func (d *DefaultLookAndFeel) SetTheme(themeName string) error {
|
|
if themeName == "" {
|
|
return nil
|
|
}
|
|
return exec.Command("plasma-apply-lookandfeel", "-a", themeName).Run()
|
|
}
|
|
|
|
func (d *DefaultLookAndFeel) GetTheme() (string, error) {
|
|
|
|
cmd := exec.Command("kreadconfig5", "--file", "kdeglobals", "--group", "KDE", "--key", "LookAndFeelPackage")
|
|
output, err := cmd.Output()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return strings.TrimSpace(string(output)), nil
|
|
}
|