refactor(ags): clean up code
This commit is contained in:
parent
cb7507eedb
commit
5a609dc463
1 changed files with 10 additions and 7 deletions
|
@ -29,15 +29,18 @@ let hidden = 0;
|
||||||
export const WorkspaceDrop = params => EventBox({
|
export const WorkspaceDrop = params => EventBox({
|
||||||
...params,
|
...params,
|
||||||
//tooltipText: `Workspace: ${id}`,
|
//tooltipText: `Workspace: ${id}`,
|
||||||
connections: [['drag-data-received', (eventbox, _w, _c, _x, data) => {
|
connections: [['drag-data-received', (eventbox, _c, _x, _y, data) => {
|
||||||
let id = eventbox.get_parent()._id;
|
let id = eventbox.get_parent()._id;
|
||||||
if (id < -1)
|
|
||||||
id = eventbox.get_parent()._name;
|
|
||||||
else if (id === -1)
|
|
||||||
id = `special:${++hidden}`;
|
|
||||||
else if (id === 1000)
|
|
||||||
id = "empty";
|
|
||||||
|
|
||||||
|
if (id < -1) {
|
||||||
|
id = eventbox.get_parent()._name;
|
||||||
|
}
|
||||||
|
else if (id === -1) {
|
||||||
|
id = `special:${++hidden}`;
|
||||||
|
}
|
||||||
|
else if (id === 1000) {
|
||||||
|
id = "empty";
|
||||||
|
}
|
||||||
execAsync(`hyprctl dispatch movetoworkspacesilent ${id},address:${data.get_text()}`)
|
execAsync(`hyprctl dispatch movetoworkspacesilent ${id},address:${data.get_text()}`)
|
||||||
.catch(print);
|
.catch(print);
|
||||||
}]],
|
}]],
|
||||||
|
|
Loading…
Reference in a new issue