implemented specialWorkspaceMap
This commit is contained in:
parent
93598400a3
commit
0166b32872
5 changed files with 69 additions and 130 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
scripts/clients/build/
|
scripts/clients/build/
|
||||||
|
.vscode/
|
85
.vscode/settings.json
vendored
85
.vscode/settings.json
vendored
|
@ -1,85 +0,0 @@
|
||||||
{
|
|
||||||
"files.associations": {
|
|
||||||
"cctype": "cpp",
|
|
||||||
"clocale": "cpp",
|
|
||||||
"cmath": "cpp",
|
|
||||||
"cstdarg": "cpp",
|
|
||||||
"cstddef": "cpp",
|
|
||||||
"cstdio": "cpp",
|
|
||||||
"cstdlib": "cpp",
|
|
||||||
"cstring": "cpp",
|
|
||||||
"ctime": "cpp",
|
|
||||||
"cwchar": "cpp",
|
|
||||||
"cwctype": "cpp",
|
|
||||||
"any": "cpp",
|
|
||||||
"array": "cpp",
|
|
||||||
"atomic": "cpp",
|
|
||||||
"hash_map": "cpp",
|
|
||||||
"bit": "cpp",
|
|
||||||
"*.tcc": "cpp",
|
|
||||||
"bitset": "cpp",
|
|
||||||
"charconv": "cpp",
|
|
||||||
"chrono": "cpp",
|
|
||||||
"cinttypes": "cpp",
|
|
||||||
"codecvt": "cpp",
|
|
||||||
"compare": "cpp",
|
|
||||||
"complex": "cpp",
|
|
||||||
"concepts": "cpp",
|
|
||||||
"condition_variable": "cpp",
|
|
||||||
"cstdint": "cpp",
|
|
||||||
"deque": "cpp",
|
|
||||||
"forward_list": "cpp",
|
|
||||||
"list": "cpp",
|
|
||||||
"map": "cpp",
|
|
||||||
"set": "cpp",
|
|
||||||
"string": "cpp",
|
|
||||||
"unordered_map": "cpp",
|
|
||||||
"unordered_set": "cpp",
|
|
||||||
"vector": "cpp",
|
|
||||||
"exception": "cpp",
|
|
||||||
"algorithm": "cpp",
|
|
||||||
"functional": "cpp",
|
|
||||||
"iterator": "cpp",
|
|
||||||
"memory": "cpp",
|
|
||||||
"memory_resource": "cpp",
|
|
||||||
"numeric": "cpp",
|
|
||||||
"optional": "cpp",
|
|
||||||
"random": "cpp",
|
|
||||||
"ratio": "cpp",
|
|
||||||
"source_location": "cpp",
|
|
||||||
"string_view": "cpp",
|
|
||||||
"system_error": "cpp",
|
|
||||||
"tuple": "cpp",
|
|
||||||
"type_traits": "cpp",
|
|
||||||
"utility": "cpp",
|
|
||||||
"hash_set": "cpp",
|
|
||||||
"format": "cpp",
|
|
||||||
"fstream": "cpp",
|
|
||||||
"future": "cpp",
|
|
||||||
"initializer_list": "cpp",
|
|
||||||
"iomanip": "cpp",
|
|
||||||
"iosfwd": "cpp",
|
|
||||||
"iostream": "cpp",
|
|
||||||
"istream": "cpp",
|
|
||||||
"limits": "cpp",
|
|
||||||
"mutex": "cpp",
|
|
||||||
"new": "cpp",
|
|
||||||
"numbers": "cpp",
|
|
||||||
"ostream": "cpp",
|
|
||||||
"ranges": "cpp",
|
|
||||||
"semaphore": "cpp",
|
|
||||||
"shared_mutex": "cpp",
|
|
||||||
"span": "cpp",
|
|
||||||
"sstream": "cpp",
|
|
||||||
"stdexcept": "cpp",
|
|
||||||
"stdfloat": "cpp",
|
|
||||||
"stop_token": "cpp",
|
|
||||||
"streambuf": "cpp",
|
|
||||||
"thread": "cpp",
|
|
||||||
"cfenv": "cpp",
|
|
||||||
"typeindex": "cpp",
|
|
||||||
"typeinfo": "cpp",
|
|
||||||
"valarray": "cpp",
|
|
||||||
"variant": "cpp"
|
|
||||||
}
|
|
||||||
}
|
|
0
bar.yuck
0
bar.yuck
20
eww.yuck
20
eww.yuck
|
@ -190,15 +190,27 @@
|
||||||
:id {workspaces[0].special.id}
|
:id {workspaces[0].special.id}
|
||||||
:icon {workspaces[0].special.icon}
|
:icon {workspaces[0].special.icon}
|
||||||
:monitor {monitor})
|
:monitor {monitor})
|
||||||
(seperator)
|
|
||||||
(normalWorkspaces
|
|
||||||
:monitor {monitor})
|
|
||||||
(seperator)
|
|
||||||
(workspace
|
(workspace
|
||||||
:activeOn {workspaces[1].special.activeOn}
|
:activeOn {workspaces[1].special.activeOn}
|
||||||
:occupied {workspaces[1].special.occupied}
|
:occupied {workspaces[1].special.occupied}
|
||||||
:id {workspaces[1].special.id}
|
:id {workspaces[1].special.id}
|
||||||
:icon {workspaces[1].special.icon}
|
:icon {workspaces[1].special.icon}
|
||||||
|
:monitor {monitor})
|
||||||
|
(seperator)
|
||||||
|
(normalWorkspaces
|
||||||
|
:monitor {monitor})
|
||||||
|
(seperator)
|
||||||
|
(workspace
|
||||||
|
:activeOn {workspaces[2].special.activeOn}
|
||||||
|
:occupied {workspaces[2].special.occupied}
|
||||||
|
:id {workspaces[2].special.id}
|
||||||
|
:icon {workspaces[2].special.icon}
|
||||||
|
:monitor {monitor})
|
||||||
|
(workspace
|
||||||
|
:activeOn {workspaces[3].special.activeOn}
|
||||||
|
:occupied {workspaces[3].special.occupied}
|
||||||
|
:id {workspaces[3].special.id}
|
||||||
|
:icon {workspaces[3].special.icon}
|
||||||
:monitor {monitor})))
|
:monitor {monitor})))
|
||||||
|
|
||||||
(defwidget end []
|
(defwidget end []
|
||||||
|
|
|
@ -21,11 +21,11 @@ json workspacesOutput;
|
||||||
std::map<std::string, std::string> iconMap;
|
std::map<std::string, std::string> iconMap;
|
||||||
std::map<int, std::string> monitorMap;
|
std::map<int, std::string> monitorMap;
|
||||||
|
|
||||||
const std::map<std::string, int> specialWorkspaceMap = {
|
std::map<std::string, int> specialWorkspaceMap = {
|
||||||
{"special:super", 0},
|
{"special:ctrl", 0},
|
||||||
{"special:ctrl", 1},
|
{"special:alt", 1},
|
||||||
{"special:alt", 2},
|
{"special:altgr", 2},
|
||||||
{"special:gr", 3}
|
{"special:strg", 3}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ void getAllWorkspaces()
|
||||||
{
|
{
|
||||||
json workspacesInput = json::parse(command("hyprctl workspaces -j"));
|
json workspacesInput = json::parse(command("hyprctl workspaces -j"));
|
||||||
|
|
||||||
int specialIndex = 0;
|
int specialIndex = 4; //next index after specialWorkspaceMap
|
||||||
|
|
||||||
for(const auto& workspace : workspacesInput)
|
for(const auto& workspace : workspacesInput)
|
||||||
{
|
{
|
||||||
|
@ -168,11 +168,22 @@ void getAllWorkspaces()
|
||||||
}
|
}
|
||||||
else if (std::string(workspace["name"]).find("special:") == 0)
|
else if (std::string(workspace["name"]).find("special:") == 0)
|
||||||
{
|
{
|
||||||
workspacesOutput[specialIndex]["special"].clear();
|
std::string name = workspace["name"];
|
||||||
workspacesOutput[specialIndex]["special"] = getWorkspace(workspace);
|
|
||||||
|
|
||||||
|
int currentIndex;
|
||||||
|
|
||||||
|
if (specialWorkspaceMap.contains(name))
|
||||||
|
{
|
||||||
|
currentIndex = specialWorkspaceMap[name];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentIndex = specialIndex;
|
||||||
specialIndex++;
|
specialIndex++;
|
||||||
}
|
}
|
||||||
|
workspacesOutput[currentIndex]["special"].clear();
|
||||||
|
workspacesOutput[currentIndex]["special"] = getWorkspace(workspace);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue