Skip to content

Commit

Permalink
hide special workspace by default
Browse files Browse the repository at this point in the history
  • Loading branch information
KZDKM committed Apr 13, 2024
1 parent 9418d84 commit c91364c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Refer to the [Hyprland wiki](https://wiki.hyprland.org/Nix/Hyprland-on-Home-Mana
- `plugin:overview:exitOnSwitch` overview exits when overview is switched by clicking on workspace view or by `switchOnDrop`
- `plugin:overview:showNewWorkspace` add a new empty workspace at the end of workspaces view
- `plugin:overview:showEmptyWorkspace` show empty workspaces that are inbetween non-empty workspaces
- `plugin:overview:showSpecialWorkspace` defaults to false
- `plugin:overview:disableGestures`
- Touchpad gesture behavior follows Hyprland workspace swipe behavior
- `gestures:workspace_swipe_fingers`
Expand Down
1 change: 1 addition & 0 deletions src/Globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace Config {
extern bool exitOnSwitch;
extern bool showNewWorkspace;
extern bool showEmptyWorkspace;
extern bool showSpecialWorkspace;

extern bool disableGestures;

Expand Down
1 change: 1 addition & 0 deletions src/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void CHyprspaceWidget::draw() {
int highestID = 1;
for (auto& ws : g_pCompositor->m_vWorkspaces) {
if (!ws) continue;
if (ws->m_bIsSpecialWorkspace && !Config::showSpecialWorkspace) continue;
if (ws->m_iMonitorID == ownerID) {
workspaces.push_back(ws->m_iID);
if (highestID < ws->m_iID) highestID = ws->m_iID;
Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ bool Config::switchOnDrop = false;
bool Config::exitOnSwitch = false;
bool Config::showNewWorkspace = true;
bool Config::showEmptyWorkspace = true;
bool Config::showSpecialWorkspace = false;

bool Config::disableGestures = false;

Expand Down Expand Up @@ -283,6 +284,7 @@ void reloadConfig() {
Config::exitOnSwitch = std::any_cast<Hyprlang::INT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:exitOnSwitch")->getValue());
Config::showNewWorkspace = std::any_cast<Hyprlang::INT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:showNewWorkspace")->getValue());
Config::showEmptyWorkspace = std::any_cast<Hyprlang::INT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:showEmptyWorkspace")->getValue());
Config::showSpecialWorkspace = std::any_cast<Hyprlang::INT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:showSpecialWorkspace")->getValue());

Config::disableGestures = std::any_cast<Hyprlang::INT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:disableGestures")->getValue());

Expand All @@ -291,6 +293,7 @@ void reloadConfig() {
for (auto& widget : g_overviewWidgets) {
widget->updateConfig();
widget->hide();
widget->endSwipe(0);
}

Config::dragAlpha = std::any_cast<Hyprlang::FLOAT>(HyprlandAPI::getConfigValue(pHandle, "plugin:overview:dragAlpha")->getValue());
Expand Down Expand Up @@ -346,6 +349,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE inHandle) {
HyprlandAPI::addConfigValue(pHandle, "plugin:overview:exitOnSwitch", Hyprlang::INT{0});
HyprlandAPI::addConfigValue(pHandle, "plugin:overview:showNewWorkspace", Hyprlang::INT{1});
HyprlandAPI::addConfigValue(pHandle, "plugin:overview:showEmptyWorkspace", Hyprlang::INT{1});
HyprlandAPI::addConfigValue(pHandle, "plugin:overview:showSpecialWorkspace", Hyprlang::INT{0});

HyprlandAPI::addConfigValue(pHandle, "plugin:overview:disableGestures", Hyprlang::INT{1});

Expand Down

0 comments on commit c91364c

Please sign in to comment.