add ipc handlers for settings
This commit is contained in:
parent
a1fb6d330f
commit
2f6f940b76
7 changed files with 66 additions and 11 deletions
|
|
@ -1,15 +1,37 @@
|
|||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import qs.settings
|
||||
|
||||
IpcHandler {
|
||||
id: ipcHandler
|
||||
target: "util"
|
||||
function refreshWs() {
|
||||
Hyprland.refreshWorkspaces();
|
||||
target: "config"
|
||||
function setFont(newFont: string) {
|
||||
Config.font = newFont;
|
||||
}
|
||||
function refreshMon() {
|
||||
Hyprland.refreshMonitors();
|
||||
Quickshell.reload(false)
|
||||
|
||||
function setFontSize(newSize: int) {
|
||||
Config.fontSize = newSize;
|
||||
}
|
||||
|
||||
function setHeight(newHeight: int) {
|
||||
Config.barHeight = newHeight;
|
||||
}
|
||||
|
||||
function toggleFloating() {
|
||||
Config.floating = !Config.floating;
|
||||
}
|
||||
|
||||
function setRounding(newRounding: int) {
|
||||
Config.rounding = newRounding;
|
||||
}
|
||||
|
||||
function setWall(newWall: string) {
|
||||
if (newWall.startsWith("/")) {
|
||||
Config.wallpaper = "file://" + newWall;
|
||||
return;
|
||||
} else if (newWall.startsWith("~")) {
|
||||
Config.wallpaper = Quickshell.env("HOME") + newWall;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue