summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-06-21 20:38:49 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-06-21 20:38:49 +1200
commit6a9f1b77d3a815afa870386d626fb01dceed944f (patch)
treecdeb26bb70aaa0b5782680908df176cff1ec9cfe
parent4f090897faae6c6d8e451281dc862d58bf9f05ba (diff)
parentc4813b0ad3f8e0cc4f55b0f0fda8359eb9729417 (diff)
downloadYATwm-6a9f1b77d3a815afa870386d626fb01dceed944f.tar.gz
YATwm-6a9f1b77d3a815afa870386d626fb01dceed944f.zip
Merge branch 'fullscreen'
Added fullscreen functionality
-rw-r--r--config2
-rw-r--r--config.toml187
-rw-r--r--ewmh.cpp12
-rw-r--r--ewmh.h2
-rw-r--r--main.cpp65
-rw-r--r--notes.org16
-rw-r--r--readme.html82
-rw-r--r--readme.org2
-rw-r--r--structs.h1
9 files changed, 130 insertions, 239 deletions
diff --git a/config b/config
index f97bb04..b154600 100644
--- a/config
+++ b/config
@@ -8,6 +8,7 @@ bind mod+Return spawn alacritty
bind mod+c spawn firefox
bind mod+x spawn loginctl lock-session
bind mod+shift+x bashSpawn loginctl lock-session && systemctl suspend
+bind mod+d bashSpawn "rofi -i -show drun"
gaps 10
outergaps 10
@@ -16,6 +17,7 @@ bind mod+q kill
# Tiling
bind mod+t toggle
+bind mod+f fullscreen
# Focus
bind mod+h focChange left
diff --git a/config.toml b/config.toml
deleted file mode 100644
index be0354f..0000000
--- a/config.toml
+++ /dev/null
@@ -1,187 +0,0 @@
-[Startup]
-startupBash = [
-# "emacs --daemon"
-]
-
-[Main]
-gaps = 3
-outerGaps = 3
-logFile = "/tmp/yatlog.txt"
-
-[Workspaces]
-numWS = 10
-workspaceNames = ["1: ", "2: 拾", "3: ", "4: ", "5: ", "6: ", "7: 拾", "8: ", "9: ", "10: "]
-maxMonitors = 2
-screenPreferences = [[0], [0], [0], [0], [0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]
-
-[Keybinds]
-swapSuperAlt = false
-
-# All the keybinds
-
-#General
-[[Keybinds.key]]
-bind = "mod+e"
-func = "exit"
-[[Keybinds.key]]
-bind = "mod+t"
-func = "toggle"
-[[Keybinds.key]]
-bind = "mod+q"
-func = "kill"
-[[Keybinds.key]]
-bind = "mod+shift+r"
-func = "reload"
-
-#Focus
-[[Keybinds.key]]
-bind = "mod+h"
-func = "focChange"
-args = "Left"
-[[Keybinds.key]]
-bind = "mod+j"
-func = "focChange"
-args = "Down"
-[[Keybinds.key]]
-bind = "mod+k"
-func = "focChange"
-args = "Up"
-[[Keybinds.key]]
-bind = "mod+l"
-func = "focChange"
-args = "Right"
-[[Keybinds.key]]
-bind = "alt+Tab"
-func = "nextMonitor"
-
-#Window moving
-[[Keybinds.key]]
-bind = "mod+shift+h"
-func = "wMove"
-args = "Left"
-[[Keybinds.key]]
-bind = "mod+shift+j"
-func = "wMove"
-args = "Down"
-[[Keybinds.key]]
-bind = "mod+shift+k"
-func = "wMove"
-args = "Up"
-[[Keybinds.key]]
-bind = "mod+shift+l"
-func = "wMove"
-args = "Right"
-
-
-#Spawning
-[[Keybinds.key]]
-bind = "mod+Return"
-func = "spawn"
-args = "alacritty"
-[[Keybinds.key]]
-bind = "mod+d"
-func = "spawn"
-args = "rofi -i -show drun"
-[[Keybinds.key]]
-bind = "mod+c"
-func = "spawn"
-args = "firefox"
-[[Keybinds.key]]
-bind = "mod+x"
-func = "spawn"
-args = "i3lock"
-[[Keybinds.key]]
-bind = "mod+shift+x"
-func = "spawn"
-args = "i3lock"
-[[Keybinds.key]]
-bind = "mod+shift+x"
-func = "spawn"
-args = "systemctl suspend"
-
-#Testing
-[[Keybinds.key]]
-bind = "mod+p"
-func = "wsDump"
-
-# Workspace changing
-[[Keybinds.key]]
-bind = "mod+1"
-func = "changeWS"
-args = 1
-[[Keybinds.key]]
-bind = "mod+1"
-func = "wToWS"
-args = 1
-[[Keybinds.key]]
-bind = "mod+2"
-func = "changeWS"
-args = 2
-[[Keybinds.key]]
-bind = "mod+2"
-func = "wToWS"
-args = 2
-[[Keybinds.key]]
-bind = "mod+3"
-func = "changeWS"
-args = 3
-[[Keybinds.key]]
-bind = "mod+3"
-func = "wToWS"
-args = 3
-[[Keybinds.key]]
-bind = "mod+4"
-func = "changeWS"
-args = 4
-[[Keybinds.key]]
-bind = "mod+4"
-func = "wToWS"
-args = 4
-[[Keybinds.key]]
-bind = "mod+5"
-func = "changeWS"
-args = 5
-[[Keybinds.key]]
-bind = "mod+5"
-func = "wToWS"
-args = 5
-[[Keybinds.key]]
-bind = "mod+6"
-func = "changeWS"
-args = 6
-[[Keybinds.key]]
-bind = "mod+6"
-func = "wToWS"
-args = 6
-[[Keybinds.key]]
-bind = "mod+7"
-func = "changeWS"
-args = 7
-[[Keybinds.key]]
-bind = "mod+7"
-func = "wToWS"
-args = 7
-[[Keybinds.key]]
-bind = "mod+8"
-func = "changeWS"
-args = 8
-[[Keybinds.key]]
-bind = "mod+8"
-func = "wToWS"
-args = 8
-[[Keybinds.key]]
-bind = "mod+9"
-func = "changeWS"
-args = 9
-[[Keybinds.key]]
-bind = "mod+9"
-func = "wToWS"
-args = 9
-[[Keybinds.key]]
-bind = "mod+0"
-func = "changeWS"
-args = 10
-[[Keybinds.key]]
-bind = "mod+0"
-func = "wToWS"
-args = 10
diff --git a/ewmh.cpp b/ewmh.cpp
index 5a7e76c..5878e82 100644
--- a/ewmh.cpp
+++ b/ewmh.cpp
@@ -65,6 +65,18 @@ void setCurrentDesktop(int desktop)
XChangeProperty(*dpy_, *root_, netCurrentDesktop, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&currDesktop, 1);
}
+void setFullscreen(Window w, bool fullscreen)
+{
+ Atom netWMState = XInternAtom(*dpy_, "_NET_WM_STATE", true);
+ Atom netWMStateVal;
+ if(fullscreen)
+ netWMStateVal = XInternAtom(*dpy_, "_NET_WM_STATE_FULLSCREEN", true);
+ else
+ netWMStateVal = XInternAtom(*dpy_, "", true);
+ XChangeProperty(*dpy_, w, netWMState, XA_ATOM, 32, PropModeReplace, (unsigned char*)&netWMStateVal, 1);
+
+}
+
int getProp(Window w, char* propName, Atom* type, unsigned char** data)
{
Atom prop_type = XInternAtom(*dpy_, propName, false);
diff --git a/ewmh.h b/ewmh.h
index 5fbc9a4..e8bae0c 100644
--- a/ewmh.h
+++ b/ewmh.h
@@ -18,4 +18,6 @@ void setWindowDesktop(Window w, int desktop);
void setCurrentDesktop(int desktop);
+void setFullscreen(Window w, bool fullscreen);
+
int getProp(Window w, char* propName, Atom* type, unsigned char** data);
diff --git a/main.cpp b/main.cpp
index d4502dd..72ba368 100644
--- a/main.cpp
+++ b/main.cpp
@@ -75,6 +75,7 @@ int mX, mY;
#define getClient(c) clients.find(c)->second
#define getFrame(f) frames.find(f)->second
+#define getFrameID(w) frameIDS.find(w)->second
Window bar;
@@ -95,9 +96,14 @@ void clientMessage(XClientMessageEvent e);
static int OnXError(Display* display, XErrorEvent* e);
+// Tiling
+// Call this one to tile everything (it does all the fancy stuff trust me just call this one)
void tileRoots();
+// Call this one to until everything (it handles multiple monitors)
void untileRoots();
-void tile(int frameID, int x, int y, int w, int h);
+// This is to be called by tileRoots, it takes in the x, y, w, and h of where it's allowed to tile windows to, and returns the ID of a fullscreen client if one is found, or noID (-1) if none are found
+int tile(int frameID, int x, int y, int w, int h);
+// This is to be called by tileRoots, it takes in a frameID and recursively unmaps all its children
void untile(int frameID);
// Usefull functions
@@ -573,6 +579,18 @@ const void nextMonitor(const CommandArg* argv)
XWarpPointer(dpy, root, root, 0, 0, 0, 0, screens[focusedScreen].x + screens[focusedScreen].w/2, screens[focusedScreen].y + screens[focusedScreen].h/2);
focusRoot(focusedWorkspaces[focusedScreen]);
}
+const void fullscreen(const CommandArg* arg)
+{
+ Window focusedWindow;
+ int focusedRevert;
+ XGetInputFocus(dpy, &focusedWindow, &focusedRevert);
+
+ int fID = getFrameID(focusedWindow);
+ int cID = getFrame(fID).cID;
+ getClient(cID).fullscreen ^= true;
+ tileRoots();
+ setFullscreen(focusedWindow, getClient(cID).fullscreen);
+}
void configureRequest(XConfigureRequestEvent e)
{
@@ -670,7 +688,7 @@ void mapRequest(XMapRequestEvent e)
XSelectInput(dpy, e.window, EnterWindowMask);
//Make client
- Client c = {currClientID, e.window, false};
+ Client c = {currClientID, e.window, false, false};
currClientID++;
//Add to clients map
@@ -845,6 +863,25 @@ void clientMessage(XClientMessageEvent e)
setCurrentDesktop(currWS);
*/
}
+ else if(e.message_type == XInternAtom(dpy, "_NET_WM_STATE", false))
+ {
+ if((Atom)e.data.l[0] == 0)
+ log("\tremove");
+ if((Atom)e.data.l[0] == 1)
+ log("\ttoggle");
+ if((Atom)e.data.l[0] == 2)
+ log("\tadd");
+ char* prop1 = XGetAtomName(dpy, (Atom)e.data.l[1]);
+ if((Atom)e.data.l[1] == XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", false))
+ {
+ int fID = getFrameID(e.window);
+ int cID = getFrame(fID).cID;
+ getClient(cID).fullscreen = (Atom) e.data.l[0] > 0;
+ setFullscreen(e.window, (Atom) e.data.l[0] > 0);
+ tileRoots();
+ }
+ XFree(prop1);
+ }
XFree(name);
}
@@ -861,7 +898,17 @@ void tileRoots()
{
for(int i = 0; i < nscreens; i++)
{
- tile(focusedWorkspaces[i], screens[i].x + cfg.outerGaps, screens[i].y + cfg.outerGaps, screens[i].w - cfg.outerGaps*2, screens[i].h - cfg.outerGaps*2 - bH);
+ int fullscreenClientID = tile(focusedWorkspaces[i], screens[i].x + cfg.outerGaps, screens[i].y + cfg.outerGaps, screens[i].w - cfg.outerGaps*2, screens[i].h - cfg.outerGaps*2 - bH);
+ if(fullscreenClientID!=noID)
+ {
+ untile(focusedWorkspaces[i]);
+ Client c = getClient(fullscreenClientID);
+ XMapWindow(dpy, c.w);
+ XMoveWindow(dpy, c.w,
+ screens[i].x, screens[i].y);
+ XResizeWindow(dpy, c.w,
+ screens[i].w, screens[i].h);
+ }
}
}
void untileRoots()
@@ -871,7 +918,7 @@ void untileRoots()
untile(focusedWorkspaces[i]);
}
}
-void tile(int frameID, int x, int y, int w, int h)
+int tile(int frameID, int x, int y, int w, int h)
{
for(int fID : frames.find(frameID)->second.floatingFrameIDs)
{
@@ -896,20 +943,25 @@ void tile(int frameID, int x, int y, int w, int h)
}
if(!f.isClient)
{
- tile(fID, wX, wY, wW, wH);
+ int fullscreenClientID = tile(fID, wX, wY, wW, wH);
+ if(fullscreenClientID == noID)
+ return fullscreenClientID;
continue;
}
+ Client c = clients.find(f.cID)->second;
+ if(c.fullscreen)
+ return c.ID;
wX += cfg.gaps;
wY += cfg.gaps;
wW -= cfg.gaps * 2;
wH -= cfg.gaps * 2;
- Client c = clients.find(f.cID)->second;
XMapWindow(dpy, c.w);
XMoveWindow(dpy, c.w,
wX, wY);
XResizeWindow(dpy, c.w,
wW, wH);
}
+ return noID;
}
void untile(int frameID)
@@ -966,6 +1018,7 @@ int main(int argc, char** argv)
commandsModule.addCommand("reload", reload, 0, {});
commandsModule.addCommand("wsDump", wsDump, 0, {});
commandsModule.addCommand("nextMonitor", nextMonitor, 0, {});
+ commandsModule.addCommand("fullscreen", fullscreen, 0, {});
//Config
std::vector<Err> cfgErr;
diff --git a/notes.org b/notes.org
index a3b6bf1..ec19667 100644
--- a/notes.org
+++ b/notes.org
@@ -1,5 +1,10 @@
#+TITLE: Features to add
+* Main refactor for the future
+** Make it possible to split up the code into mulitple files easier
+- Header files for some functions such as ~tileRoots~, potentially classes as well
+- Main variables like the list of clients as a stuct, pointer can then be passed for things like EWMH
+
* Remembering focus
Use the variable ~whichChildFocused~ for each non client frame, this is the index of the child that is focused. To then find focused child for a root recurse through all the frames going through the focused child.
** Where it should be updated
@@ -9,18 +14,17 @@ Use the variable ~whichChildFocused~ for each non client frame, this is the inde
** Where it should be used
Whenever I set focus I should use the focused client of whichever workspace is focused
-* Change focus and move between monitors
-Perhaps I can just add something to the ~dirFind~ function
-
-* TOML config
-put in ~/.config/YATwm/config.toml
+* Config
+rewrite it to be a scripting language like i3
* Fullscreen windows
This should be another thing like floating windows except each workspace only gets one
I should check it first when tiling and if it exists then draw it to the size of the screeen then return
* General EWMH things
-I should really figure out what all the client messages mean
+** I should really figure out what all the client messages mean
+- ~_NET_WM_STATE~ is used to change a windows state e.g. moving to fullscreen. It is an ~Atom[]~
* The eventual program to communicate with YATwm
Use a unix socket
+Same protocol as config langauge
diff --git a/readme.html b/readme.html
index 24514ae..1040470 100644
--- a/readme.html
+++ b/readme.html
@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
-<!-- 2023-06-21 Wed 17:18 -->
+<!-- 2023-06-21 Wed 20:26 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>YATwm</title>
@@ -200,36 +200,36 @@
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
-<li><a href="#org286e38a">1. This config is best read in Emacs!</a></li>
-<li><a href="#orgd129d06">2. Disclaimer: This is still very much in beta</a></li>
-<li><a href="#org227444d">3. Usage instructions</a>
+<li><a href="#orge9be048">1. This config is best read in Emacs!</a></li>
+<li><a href="#org90a4bc0">2. Disclaimer: This is still very much in beta</a></li>
+<li><a href="#org5eaba64">3. Usage instructions</a>
<ul>
-<li><a href="#org2311255">3.1. Installation</a>
+<li><a href="#org41321d1">3.1. Installation</a>
<ul>
-<li><a href="#org4917590">3.1.1. Pre reqs</a></li>
-<li><a href="#org69279ee">3.1.2. Installing and removing</a></li>
+<li><a href="#org318ad8e">3.1.1. Pre reqs</a></li>
+<li><a href="#orgf06bf1e">3.1.2. Installing and removing</a></li>
</ul>
</li>
-<li><a href="#org32292f7">3.2. Config</a>
+<li><a href="#org3c09ef5">3.2. Config</a>
<ul>
-<li><a href="#org70b22f3">3.2.1. Syntax</a></li>
-<li><a href="#orgc95e486">3.2.2. General</a></li>
-<li><a href="#org525c2d1">3.2.3. Workspaces</a></li>
-<li><a href="#org657af4b">3.2.4. Keybinds</a></li>
+<li><a href="#org43f17c0">3.2.1. Syntax</a></li>
+<li><a href="#org384a204">3.2.2. General</a></li>
+<li><a href="#orga3a5f0e">3.2.3. Workspaces</a></li>
+<li><a href="#orgee481dd">3.2.4. Keybinds</a></li>
</ul>
</li>
</ul>
</li>
-<li><a href="#org41cf547">4. Credits</a></li>
+<li><a href="#orgd9a91f5">4. Credits</a></li>
</ul>
</div>
</div>
-<div id="outline-container-org286e38a" class="outline-2">
-<h2 id="org286e38a"><span class="section-number-2">1.</span> This config is best read in Emacs!</h2>
+<div id="outline-container-orge9be048" class="outline-2">
+<h2 id="orge9be048"><span class="section-number-2">1.</span> This config is best read in Emacs!</h2>
</div>
-<div id="outline-container-orgd129d06" class="outline-2">
-<h2 id="orgd129d06"><span class="section-number-2">2.</span> Disclaimer: This is still very much in beta</h2>
+<div id="outline-container-org90a4bc0" class="outline-2">
+<h2 id="org90a4bc0"><span class="section-number-2">2.</span> Disclaimer: This is still very much in beta</h2>
<div class="outline-text-2" id="text-2">
<p>
This only just works, multiple monitors aren't supported and floating windows cannot move and there is no resizing. Many features are just hacked together and are likely to break. However, it is just about usable so if you really want to try then go for it! (feel free to make an issue if you have any questions).<br />
@@ -237,16 +237,16 @@ This only just works, multiple monitors aren't supported and floating windows ca
</div>
</div>
-<div id="outline-container-org227444d" class="outline-2">
-<h2 id="org227444d"><span class="section-number-2">3.</span> Usage instructions</h2>
+<div id="outline-container-org5eaba64" class="outline-2">
+<h2 id="org5eaba64"><span class="section-number-2">3.</span> Usage instructions</h2>
<div class="outline-text-2" id="text-3">
</div>
-<div id="outline-container-org2311255" class="outline-3">
-<h3 id="org2311255"><span class="section-number-3">3.1.</span> Installation</h3>
+<div id="outline-container-org41321d1" class="outline-3">
+<h3 id="org41321d1"><span class="section-number-3">3.1.</span> Installation</h3>
<div class="outline-text-3" id="text-3-1">
</div>
-<div id="outline-container-org4917590" class="outline-4">
-<h4 id="org4917590"><span class="section-number-4">3.1.1.</span> Pre reqs</h4>
+<div id="outline-container-org318ad8e" class="outline-4">
+<h4 id="org318ad8e"><span class="section-number-4">3.1.1.</span> Pre reqs</h4>
<div class="outline-text-4" id="text-3-1-1">
<ul class="org-ul">
<li><code>Xlib</code> and <code>g++</code> and <code>libnotify</code> to build the program<br /></li>
@@ -258,8 +258,8 @@ This only just works, multiple monitors aren't supported and floating windows ca
</ul>
</div>
</div>
-<div id="outline-container-org69279ee" class="outline-4">
-<h4 id="org69279ee"><span class="section-number-4">3.1.2.</span> Installing and removing</h4>
+<div id="outline-container-orgf06bf1e" class="outline-4">
+<h4 id="orgf06bf1e"><span class="section-number-4">3.1.2.</span> Installing and removing</h4>
<div class="outline-text-4" id="text-3-1-2">
<ul class="org-ul">
<li><code>make i</code> or <code>make install</code> to install<br /></li>
@@ -269,23 +269,23 @@ This only just works, multiple monitors aren't supported and floating windows ca
</div>
</div>
</div>
-<div id="outline-container-org32292f7" class="outline-3">
-<h3 id="org32292f7"><span class="section-number-3">3.2.</span> Config</h3>
+<div id="outline-container-org3c09ef5" class="outline-3">
+<h3 id="org3c09ef5"><span class="section-number-3">3.2.</span> Config</h3>
<div class="outline-text-3" id="text-3-2">
<p>
You can configure YATwm with the config file in <code>$HOME/.config/YATwm/config</code> or <code>$XDG_CONFIG_HOME/YATwm/config</code> if you have that set. I have provided an example config file in the project dir that has all the variables set to their defaults (this will also be installed to <code>/etc/YATwm/config</code>.<br />
It should alert you with a notification if you have an error, and put the error your log file. If the whole file is missing then it will use the default in <code>/etc/YATwm/config</code>.<br />
</p>
</div>
-<div id="outline-container-org70b22f3" class="outline-4">
-<h4 id="org70b22f3"><span class="section-number-4">3.2.1.</span> Syntax</h4>
+<div id="outline-container-org43f17c0" class="outline-4">
+<h4 id="org43f17c0"><span class="section-number-4">3.2.1.</span> Syntax</h4>
<div class="outline-text-4" id="text-3-2-1">
<p>
The config file is a list of commands. Each command should be on a new line. For example, to set the gaps you would use the <code>gaps</code> command like this <code>gaps 10</code> (make sure this is all there is on that line). This says to call the command <code>gaps</code> with the arguments of <code>10</code>. Commands can have multiple arguments and these should be separated with a space, if you want a space in one of the arguments then wrap the arg in quotes, e.g. <code>addWorkspace "1: A" 1</code>, here the arguments are <code>1: A</code> and <code>1</code>. If you want to have a quote in your argument then make sure that arg is wrapped in quotes or escape it with <code>\</code> (e.g. <code>\'</code>), to insert <code>\</code> then use <code>\\</code>.<br />
</p>
</div>
<ol class="org-ol">
-<li><a id="org10dc20b"></a>Command arg types<br />
+<li><a id="orgd79f7a9"></a>Command arg types<br />
<div class="outline-text-5" id="text-3-2-1-1">
<ul class="org-ul">
<li>String: this is just some text, this can be wrapped in quotes if you want a space in it.<br /></li>
@@ -302,7 +302,7 @@ The config file is a list of commands. Each command should be on a new line. For
</ul>
</div>
</li>
-<li><a id="orgac1b7f4"></a>List of commands<br />
+<li><a id="org948d88f"></a>List of commands<br />
<div class="outline-text-5" id="text-3-2-1-2">
<ul class="org-ul">
<li>exit: shuts down YATwm<br /></li>
@@ -338,6 +338,7 @@ The config file is a list of commands. Each command should be on a new line. For
</ul></li>
<li>reload: Reloads YATwm, this reloads the config file and re runs the monitor detection, and will unmap and remap all windows to refresh them.<br /></li>
<li>nextMonitor: Focuses the next monitor, wraps around.<br /></li>
+<li>fullscreen: Toggles if the current window is fullscreen<br /></li>
<li>gaps: Sets the size of the inner gaps, margins around each window (this ends up looking doubled as each window has it)<br />
<ul class="org-ul">
<li>Number: The size in pixels<br /></li>
@@ -367,8 +368,8 @@ The config file is a list of commands. Each command should be on a new line. For
</li>
</ol>
</div>
-<div id="outline-container-orgc95e486" class="outline-4">
-<h4 id="orgc95e486"><span class="section-number-4">3.2.2.</span> General</h4>
+<div id="outline-container-org384a204" class="outline-4">
+<h4 id="org384a204"><span class="section-number-4">3.2.2.</span> General</h4>
<div class="outline-text-4" id="text-3-2-2">
<p>
You can change either the inner gaps (padding around each window - so double it for space between windows), or the outer gaps (padding around the display - add to inner gaps to get space between window and screen edges).<br />
@@ -378,8 +379,8 @@ YATwm also keeps a log file, the location of this file can be changed with the c
</div>
</div>
-<div id="outline-container-org525c2d1" class="outline-4">
-<h4 id="org525c2d1"><span class="section-number-4">3.2.3.</span> Workspaces</h4>
+<div id="outline-container-orga3a5f0e" class="outline-4">
+<h4 id="orga3a5f0e"><span class="section-number-4">3.2.3.</span> Workspaces</h4>
<div class="outline-text-4" id="text-3-2-3">
<p>
You can add workspace with the command <code>addworkspace</code> in the config file.<br />
@@ -405,8 +406,8 @@ Defaults workspace are listed below (these are the args for the addworkspace com
</ol>
</div>
</div>
-<div id="outline-container-org657af4b" class="outline-4">
-<h4 id="org657af4b"><span class="section-number-4">3.2.4.</span> Keybinds</h4>
+<div id="outline-container-orgee481dd" class="outline-4">
+<h4 id="orgee481dd"><span class="section-number-4">3.2.4.</span> Keybinds</h4>
<div class="outline-text-4" id="text-3-2-4">
<p>
Current keybinds (these can all be edited):<br />
@@ -423,6 +424,7 @@ Current keybinds (these can all be edited):<br />
<li><code>mod + c</code> : firefox<br /></li>
<li><code>mod + x</code> : lock<br /></li>
<li><code>mod + shift + x</code> : lock and sleep<br /></li>
+<li><code>mod + f</code> : toggle fullscreen<br /></li>
<li><code>mod + (num)</code> : switch to workspace (num) - currently only for 1-10 but you can add more<br /></li>
<li><code>mod + shift + (num)</code> : move window to workspace (num) - currently only for 1-10 but you can add more<br /></li>
</ul>
@@ -449,8 +451,8 @@ Commands are executed going down the list and multiple commands with the same ke
</div>
</div>
-<div id="outline-container-org41cf547" class="outline-2">
-<h2 id="org41cf547"><span class="section-number-2">4.</span> Credits</h2>
+<div id="outline-container-orgd9a91f5" class="outline-2">
+<h2 id="orgd9a91f5"><span class="section-number-2">4.</span> Credits</h2>
<div class="outline-text-2" id="text-4">
<p>
Catwm (<a href="https://github.com/pyknite/catwm">https://github.com/pyknite/catwm</a>)<br />
@@ -463,7 +465,7 @@ basic<sub>wm</sub> (<a href="https://github.com/jichu4n/basic_wm">https://github
</div>
</div>
<div id="postamble" class="status">
-<p class="date">Created: 2023-06-21 Wed 17:18</p>
+<p class="date">Created: 2023-06-21 Wed 20:26</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
diff --git a/readme.org b/readme.org
index 4f8afa1..9a41662 100644
--- a/readme.org
+++ b/readme.org
@@ -51,6 +51,7 @@ The config file is a list of commands. Each command should be on a new line. For
- String rest: A string which gets sent to bash
- reload: Reloads YATwm, this reloads the config file and re runs the monitor detection, and will unmap and remap all windows to refresh them.
- nextMonitor: Focuses the next monitor, wraps around.
+- fullscreen: Toggles if the current window is fullscreen
- gaps: Sets the size of the inner gaps, margins around each window (this ends up looking doubled as each window has it)
- Number: The size in pixels
- outergaps: Sets the size of the outer gaps, distance for windows and the edge of the output (add this to the inner gaps to get distance between window and edge of output)
@@ -100,6 +101,7 @@ Current keybinds (these can all be edited):
- ~mod + c~ : firefox
- ~mod + x~ : lock
- ~mod + shift + x~ : lock and sleep
+- ~mod + f~ : toggle fullscreen
- ~mod + (num)~ : switch to workspace (num) - currently only for 1-10 but you can add more
- ~mod + shift + (num)~ : move window to workspace (num) - currently only for 1-10 but you can add more
(mod is super, and the direction keys are h, j, k, l - left, down, up, right respectively like vim)
diff --git a/structs.h b/structs.h
index 0ace524..8215bf5 100644
--- a/structs.h
+++ b/structs.h
@@ -13,6 +13,7 @@ struct Client
int ID;
Window w;
bool floating;
+ bool fullscreen;
};
enum TileDir