diff --git a/globals/useTheme.ts b/globals/useTheme.ts index 15c2322..83c6123 100644 --- a/globals/useTheme.ts +++ b/globals/useTheme.ts @@ -1,8 +1,10 @@ +import options from 'options'; import Gio from 'gi://Gio'; import { bash, Notify } from 'lib/utils'; import icons from 'lib/icons'; import { filterConfigForThemeOnly, loadJsonFile, saveConfigToFile } from 'widget/settings/shared/FileChooser'; +const { restartCommand } = options.hyprpanel; export const hexColorPattern = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/; globalThis.useTheme = (filePath: string): void => { @@ -39,5 +41,5 @@ globalThis.useTheme = (filePath: string): void => { saveConfigToFile(tmpConfig, `${TMP}/config.json`); saveConfigToFile(optionsConfig, OPTIONS); - bash('pkill ags && ags'); + bash(restartCommand.value); }; diff --git a/widget/settings/pages/config/general/index.ts b/widget/settings/pages/config/general/index.ts index 704dcf7..b155c6c 100644 --- a/widget/settings/pages/config/general/index.ts +++ b/widget/settings/pages/config/general/index.ts @@ -45,7 +45,9 @@ export const BarGeneral = (): Scrollable => { Option({ opt: options.hyprpanel.restartCommand, title: 'Restart Command', - subtitle: 'Command to execute when a restart is initiated.', + subtitle: + 'Command to execute when a restart is initiated. If running ags on a different bus, you\n' + + " can target it by using the '-b busName' flag. Ex: ags -b panel -q; ags -b panel", type: 'string', }), Option({ diff --git a/widget/settings/shared/FileChooser.ts b/widget/settings/shared/FileChooser.ts index b7b5f32..f1a6adf 100644 --- a/widget/settings/shared/FileChooser.ts +++ b/widget/settings/shared/FileChooser.ts @@ -1,3 +1,4 @@ +import options from 'options'; import Gtk from 'gi://Gtk?version=3.0'; import Gio from 'gi://Gio'; import { bash, Notify } from 'lib/utils'; @@ -6,6 +7,7 @@ import { Config } from 'lib/types/filechooser'; import { hexColorPattern } from 'globals/useTheme'; import { isHexColor } from 'globals/variables'; +const { restartCommand } = options.hyprpanel; const whiteListedThemeProp = ['theme.bar.buttons.style']; export const loadJsonFile = (filePath: string): Config | null => { @@ -247,5 +249,5 @@ export const importFiles = (themeOnly: boolean = false): void => { saveConfigToFile(optionsConfig, OPTIONS); } dialog.destroy(); - bash('pkill ags && ags'); + bash(restartCommand.value); };