summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-06-21 20:26:52 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-06-21 20:35:10 +1200
commitc4813b0ad3f8e0cc4f55b0f0fda8359eb9729417 (patch)
treecdeb26bb70aaa0b5782680908df176cff1ec9cfe
parent21b1840e0982929c1fa8acc5fadd203dccc94585 (diff)
downloadYATwm-c4813b0ad3f8e0cc4f55b0f0fda8359eb9729417.tar.gz
YATwm-c4813b0ad3f8e0cc4f55b0f0fda8359eb9729417.zip
feat: Fixed fullscreen stuff after rebasing in the config refactor
Also added stuff to the readme for it
-rw-r--r--config2
-rw-r--r--config.toml190
-rw-r--r--main.cpp3
-rw-r--r--readme.html82
-rw-r--r--readme.org2
5 files changed, 48 insertions, 231 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 682cda8..0000000
--- a/config.toml
+++ /dev/null
@@ -1,190 +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"
-[[Keybinds.key]]
-bind = "mod+f"
-func = "fullscreen"
-
-#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/main.cpp b/main.cpp
index af9210b..72ba368 100644
--- a/main.cpp
+++ b/main.cpp
@@ -579,7 +579,7 @@ 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]);
}
-void fullscreen(const KeyArg arg)
+const void fullscreen(const CommandArg* arg)
{
Window focusedWindow;
int focusedRevert;
@@ -1018,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/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)