summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--README.md11
-rw-r--r--src/sxwm.c27
-rw-r--r--sxwm.110
4 files changed, 40 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8ab40a..70c8cc3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
- **CHANGE**: Renamed `focus_previous` to `focus_prev`
- **CHANGE**: Invalid sample config
- **CHANGE**: Parser `$HOME` searching order. XDG Compliance
+- **CHANGE**: `-b` or `--backup` option for using backup keybinds
- **FIXED**: Improved parsing now supporting commands with `"` and `'`
- **FIXED**: (mouse warping) Switching to master doesn't automatically shift cursor to it
- **FIXED**: `ctrl` and `shift` key works as a modifier
diff --git a/README.md b/README.md
index 37d6b10..4e0a4e5 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@
---
## Table of Contents
+- [Launch Args](#launch-args)
- [Features](#features)
- [Screenshots](#screenshots)
- [Configuration](#configuration)
@@ -33,6 +34,16 @@
---
+## Launch Args
+
+### `-v` or `--version`
+Displays the version of `sxwm`
+
+### `-b` or `--backup`
+Allows user to use backup keybinds with `sxwm`
+
+---
+
## Features
- **Tiling & Floating**: Switch seamlessly between layouts.
diff --git a/src/sxwm.c b/src/sxwm.c
index 149510e..5cc10dd 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -131,6 +131,7 @@ int monsn = 0;
int current_monitor = 0;
Bool global_floating = False;
Bool in_ws_switch = False;
+Bool backup_binds = False;
Bool running = False;
long last_motion_time = 0;
@@ -1279,12 +1280,14 @@ void init_defaults(void)
default_config.new_win_focus = True;
default_config.warp_cursor = True;
- for (unsigned long i = 0; i < LENGTH(binds); i++) {
- default_config.binds[i].mods = binds[i].mods;
- default_config.binds[i].keysym = binds[i].keysym;
- default_config.binds[i].action.cmd = binds[i].action.cmd;
- default_config.binds[i].type = binds[i].type;
- default_config.bindsn++;
+ if (backup_binds) {
+ for (unsigned long i = 0; i < LENGTH(binds); i++) {
+ default_config.binds[i].mods = binds[i].mods;
+ default_config.binds[i].keysym = binds[i].keysym;
+ default_config.binds[i].action.cmd = binds[i].action.cmd;
+ default_config.binds[i].type = binds[i].type;
+ default_config.bindsn++;
+ }
}
user_config = default_config;
@@ -2243,11 +2246,17 @@ int main(int ac, char **av)
{
if (ac > 1) {
if (strcmp(av[1], "-v") == 0 || strcmp(av[1], "--version") == 0) {
- printf("%s\n%s\n%s", SXWM_VERSION, SXWM_AUTHOR, SXWM_LICINFO);
+ printf("%s\n%s\n%s\n", SXWM_VERSION, SXWM_AUTHOR, SXWM_LICINFO);
exit(0);
}
+ else if (strcmp(av[1], "-b") == 0 || strcmp(av[1], "--backup") == 0) {
+ puts("sxwm: using backup keybinds");
+ backup_binds = True;
+ }
else {
- printf("usage:\n[-v || --version]: See the version of sxwm");
+ puts("usege:\n");
+ puts("\t[-v || --version]: See the version of sxwm\n");
+ puts("\t[-b || --backup]: Use backup set of keybinds with sxwm\n");
exit(0);
}
}
@@ -2255,4 +2264,4 @@ int main(int ac, char **av)
printf("sxwm: starting...\n");
run();
return 0;
-}
+} \ No newline at end of file
diff --git a/sxwm.1 b/sxwm.1
index d111c1b..4ab4f25 100644
--- a/sxwm.1
+++ b/sxwm.1
@@ -21,6 +21,16 @@ Extremely lightweight (single C file).
Multi-monitor support via Xinerama.
Works well with external bars such as sxbar.
+.SH LAUNCH ARGUMENTS
+
+.TP
+.B -v || --version
+Displays current sxwm version
+
+.TP
+.B -b || --backup
+Uses default config along side the custom sxwmrc
+
.SH CONFIGURATION
The configuration file is located at
.B ~/.config/sxwmrc