add -ft argument

This commit is contained in:
piotr
2023-07-27 03:27:27 +02:00
parent 2903abd831
commit c0faecdb8b
2 changed files with 14 additions and 0 deletions

View File

@@ -548,6 +548,15 @@ func savePinned() {
}
func launch(command string, terminal bool) {
themeToPrepend := ""
// add "GTK_THEME=<default_gtk_theme>" environment variable
if *forceTheme {
settings, _ := gtk.SettingsGetDefault()
th, err := settings.GetProperty("gtk-theme-name")
if err == nil {
themeToPrepend = th.(string)
}
}
// trim % and everything afterwards
if strings.Contains(command, "%") {
cutAt := strings.Index(command, "%")
@@ -577,6 +586,10 @@ func launch(command string, terminal bool) {
cmdIdx = 0
}
if themeToPrepend != "" {
envVars = append(envVars, fmt.Sprintf("GTK_THEME=%s", themeToPrepend))
}
cmd := exec.Command(elements[cmdIdx], elements[1+cmdIdx:]...)
if terminal {