added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
25
nyx/homes/notashelf/services/wayland/ags/js/utils/swallow.js
Normal file
25
nyx/homes/notashelf/services/wayland/ags/js/utils/swallow.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { App, Utils } from "../imports.js";
|
||||
const { exec, execAsync } = Utils;
|
||||
|
||||
function genCommand(arg) {
|
||||
return ["sh", "-c", `${App.configDir}/bin/hyprctl_swallow ${arg}`];
|
||||
}
|
||||
|
||||
const swallowQuery = genCommand("query");
|
||||
const swallowToggle = genCommand("toggle");
|
||||
|
||||
export const getSwallowStatus = () => {
|
||||
execAsync(swallowQuery);
|
||||
|
||||
let result = exec("hyprctl -j getoption misc:enable_swallow");
|
||||
return JSON.parse(result).set;
|
||||
};
|
||||
|
||||
export const status = Variable(getSwallowStatus());
|
||||
|
||||
export const toggleSwallowStatus = () => {
|
||||
execAsync(swallowToggle);
|
||||
|
||||
// toggle swallow status
|
||||
status.value = !status.value;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue