Commit graph

474 commits

Author SHA1 Message Date
S. Christoffer Eliesen af31a3f04a commands: Learn 'move workspace to output <direction|name>'. 2015-11-03 22:38:53 +01:00
S. Christoffer Eliesen 9c8394022e commands: Learn 'move <container|window> to output <direction|name>'. 2015-11-03 22:38:53 +01:00
S. Christoffer Eliesen 78ca619769 commands: Learn mouse_warping.
Place mouse at center of focused view when changing to a workspace on a
different output, if option is enabled. (This replicates existing i3
option.)

This can be triggered in multiple ways:
A) via `workspace <name>` which changes output
B) via `focus <direction>` which changes output
C) via `focus output <name>` which (obviously) changes output
2015-10-29 17:41:33 +01:00
S. Christoffer Eliesen 5fa8f91655 commands: Learn 'focus output <direction|name>' 2015-10-28 20:06:48 +01:00
S. Christoffer Eliesen 9f02b0bf16 commands: Learn 'debuglog'.
Replicates i3 option. Verbosity level given as command line argument
becomes default log level, and using 'debuglog toggle' switches back and
forth between default and debug (or L_ERROR and debug if default is also
L_DEBUG).
2015-10-27 14:37:44 +01:00
S. Christoffer Eliesen c49e5340db commands: cmd_move: Fix "move container to workspace _number_ n"
This is an undocumented feature (the word "number" is just ignored
anyway), but it exists to be compatible with i3 config syntax.

Plus some code cleanup at the same time.
2015-10-25 13:19:48 +01:00
S. Christoffer Eliesen 362413bd50 commands: cmd_results->input is duplicated/freed. 2015-10-23 13:03:14 +02:00
S. Christoffer Eliesen 88a2ddbe83 commands: Code formatting. 2015-10-23 12:55:48 +02:00
S. Christoffer Eliesen 187f0ab1c4 commands: Allow 'floating_modifier' & 'focus_follows_mouse' at runtime. 2015-10-23 12:45:46 +02:00
S. Christoffer Eliesen af30a1b67c ipc,commands,config: Replace cmd_status enum with cmd_results struct.
In i3 the ipc reply will contain a human readable error message, and
this patch replicates that behaviour.

However, that error message is also useful for logging, which this
patch takes advantage of.

E.g. instead of logging errors directly in commands.c/checkargs, it is
fed back to the caller which eventually ends up logging everything with
maximum context available (config.c/read_config).

So instead of logging e.g. "Error on line 'exit'" it will now log:
"Error on line 'exit': Can't execute from config."
2015-10-22 23:36:24 +02:00
S. Christoffer Eliesen edf33aad29 config: Add "seamless_mouse" to decide if pointer crosses output edges. 2015-10-22 01:39:12 +02:00
S. Christoffer Eliesen 9b271573a9 commands: Allow changing resolution outside config load. 2015-10-22 00:16:10 +02:00
S. Christoffer Eliesen ca862a5bd4 config: Apply output config also during config reload. 2015-10-21 23:24:06 +02:00
S. Christoffer Eliesen 6eb8da0e14 commands,container: Tweak debug output to better reflect reality. 2015-10-21 22:22:01 +02:00
S. Christoffer Eliesen e3837ba634 commands: Gracefully handle empty commands.
Before this patch sway would proceed into find_handler which would cause
a crash trying to parse a NULL string.

This could be triggered via e.g. `i3-msg -s $(sway --get-socketpath)`.
2015-10-19 19:45:35 +02:00
S. Christoffer Eliesen 71ebe8c36b commands: Catch empty exec with --no-startup-id cases. 2015-10-18 19:14:49 +02:00
S. Christoffer Eliesen 71bcee4f96 commands: Ignore exec switch "--no-startup-id".
When using an i3 config verbatim in sway this switch to exec or
exec_always might appear.

Before this patch the switch would be passed to /bin/sh, causing
an error, and the command would not be run.
2015-10-17 14:28:38 +02:00
taiyu 18f4905e62 #187, let init handle child processes 2015-10-08 08:12:31 -07:00
taiyu 7672886cb5 dont log empty config lines 2015-09-18 08:33:28 -07:00
taiyu 0d51f62224 merge + no c_extensions 2015-09-18 07:23:04 -07:00
Drew DeVault 318e1be240 Fix warnings introduced by prior commit 2015-09-18 07:27:35 -04:00
Drew DeVault 8e25ce4e57 Fix build for debian stretch
Fixes #182
2015-09-18 07:16:20 -04:00
taiyu a04f645d7c style, safer fork 2015-09-15 06:56:51 -07:00
taiyu a18caf6706 nomacro 2015-09-15 06:39:24 -07:00
taiyu 0bea2e2122 multi command keybinds 2015-09-14 19:59:25 -07:00
Drew DeVault e505abfe75 Revert "new_workspace null behavior + testmap functions + regex"
This reverts commit e1d18e42a8.

Fixes #180

cc @taiyu-len
2015-09-13 19:46:16 -04:00
taiyu 2093d4ddee cmd_for_window dummy function 2015-09-12 02:45:03 -07:00
taiyu e1d18e42a8 new_workspace null behavior + testmap functions + regex 2015-09-12 02:38:03 -07:00
taiyu aaa0923bc4 cmd status + workspace ws output op 2015-09-10 11:07:40 -07:00
taiyu 6388241abb mode supports multi token names 2015-09-08 10:53:15 -07:00
taiyu 799ff640f8 remove old things 2015-09-08 10:28:53 -07:00
taiyu aa22dc3113 var replacement changes 2015-09-08 10:27:09 -07:00
taiyu d673a72705 set variable changes 2015-09-08 08:54:57 -07:00
taiyu 3eb29ea736 strdup + style 2015-09-07 15:03:04 -07:00
taiyu 71af5b7dde config modes 2015-09-07 14:29:40 -07:00
taiyu 3e9cdfd6a3 man page 2015-09-06 06:52:20 -07:00
taiyu f25c6b312b gap resize 2015-09-05 20:48:52 -07:00
taiyu afa6747145 enum for command type 2015-09-04 17:09:07 -07:00
taiyu 4cd18449d2 better handling of commands during config 2015-09-04 16:57:03 -07:00
taiyu dbeca88dee default gap value 2015-09-04 16:14:59 -07:00
taiyu 972748e674 cleaned up leaky prev_workspace_name 2015-09-01 09:02:26 -07:00
Luminarys 12e96f0f9e Added in workspace_auto_back_and_forth 2015-08-30 21:34:24 -05:00
Luminarys 23f040133d Removed unnecessary debug line 2015-08-30 20:02:31 -05:00
Luminarys fe2ec8a676 Added in workspace back_and_forth 2015-08-30 19:59:14 -05:00
taiyu f787fac8fc #153 add "ctrl" and "alt" to modifiers struct 2015-08-30 13:20:56 -07:00
Luminarys 28e937020a Made scratchpad handling identical to i3 2015-08-29 21:14:13 -05:00
Luminarys 167409702f Fixed move scratchpad and added in scratchpad show 2015-08-29 00:33:33 -05:00
Luminarys 7eefecf479 Added in scratchpad adding 2015-08-28 23:39:12 -05:00
taiyu 63e735270c move v3 2015-08-28 19:35:29 -07:00
taiyu 28c22c8f80 style 2015-08-28 11:14:59 -07:00
taiyu 1820b3f0bb move function redone 2015-08-28 11:03:10 -07:00
Luminarys acb3fbdfb5 Added in default_orientation handling 2015-08-27 21:52:59 -05:00
taiyu 4df64127e9 slight fix 2015-08-26 16:50:47 -07:00
taiyu 1fa7a91bfb move_container_to fixup 2015-08-26 11:01:26 -07:00
minus e854a54e96 changed workspace_{outout_,}{next,prev} to return workspace
so it can be reused for "move container to workspace next"
2015-08-25 19:00:20 +02:00
minus 03e4a97dbe added "move container to workspace"
makes the previous commit actually testable
2015-08-25 18:25:36 +02:00
taiyu c8415d7fef split_string memory leaks cleanedup 2015-08-23 19:09:18 -07:00
Luminarys 7a21388997 Minor fix 2015-08-23 13:32:47 -05:00
Luminarys e01cf0b566 Added in glitchy disabling 2015-08-23 12:23:01 -05:00
Luminarys 98fad060e2 Added in glitchy disabling 2015-08-23 12:23:01 -05:00
Drew DeVault b7f4607544 Implement output configuration through config
Do not use `output res WIDTHxHEIGHT` yet, wlc has issues with it (cc
@Cloudef)
2015-08-22 11:18:55 -04:00
Luminarys f6b16ca089 Refactored resizing functions into resize.c 2015-08-21 22:26:11 -05:00
Luminarys ad1ca31dd5 Altered resize command to prevent resizing past min h/w 2015-08-21 21:22:29 -05:00
Luminarys 63a3236064 Fixed resizing 2015-08-21 19:37:19 -05:00
taiyu d2e1c660b1 swayc_is_fullscreen 2015-08-21 10:45:18 -07:00
taiyu 1a1ac64662 bugfixes, renames 2015-08-21 10:28:37 -07:00
minus 8dfaf6265b fixed #108 signed/unsigned comparison 2015-08-21 16:53:11 +02:00
Drew DeVault a436fc17ff Merge pull request #105 from Half-Shot/master
Basic 'move' functionality.
2015-08-21 07:24:17 -04:00
Drew DeVault 464b49eda2 Merge pull request #101 from Luminarys/master
Added in basic resizing command.
2015-08-21 07:12:05 -04:00
Luminarys f589731f29 Rewrite of resize command to make it more sane 2015-08-20 21:37:59 -05:00
Half-Shot 68213d57c5 Fixed style errors 2015-08-20 22:29:36 +01:00
Half-Shot 713bf29ec9 Few stray bits 2015-08-20 21:45:00 +01:00
Half-Shot 5a9ba261bc Merge branch 'master' of https://github.com/SirCmpwn/sway 2015-08-20 21:32:08 +01:00
Half-Shot 2a62c5c7fb Basic left right move command implemented. 2015-08-20 21:29:40 +01:00
taiyu 36e07e9ebc find_parent_by_type 2015-08-20 09:52:54 -07:00
Luminarys c9935507f2 Style fixes 2015-08-20 11:42:01 -05:00
Luminarys d06732e1a8 Altered incorrect comment 2015-08-20 11:35:01 -05:00
Luminarys bc3babf566 Added in basic resize command 2015-08-20 11:30:32 -05:00
minus f26ed32e46 added sway_terminate to exit cleanly 2015-08-20 15:27:56 +02:00
minus 91c0877264 properly exit sway
- wlc_terminate() instead of exit(0)
- unlink IPC socket
2015-08-20 15:24:33 +02:00
Drew DeVault 579fe70ed9 Add command line parsing
Closes #6
2015-08-20 08:37:24 -04:00
taiyu f5fde7c45c style 2015-08-20 05:06:22 -07:00
taiyu fbaa9111a8 setup for resizable windows, drop weight 2015-08-20 04:47:36 -07:00
taiyu 5ff0619ca1 input state, find_container_in_direction 2015-08-19 20:22:15 -07:00
taiyu 470b4dfbae key_state.ch, and command conflicts resolved 2015-08-19 18:59:27 -07:00
Luminarys 29b6b2f37b Fixed mode_toggle 2015-08-19 19:57:39 -05:00
taiyu 48a983316c floating mode_toggle 2015-08-19 13:02:29 -07:00
taiyu 289aab9f0a removed debug which shouldnt be there 2015-08-19 09:21:44 -07:00
taiyu 8205a6fd3b floating_modifier uses mod_keys instead of anykey 2015-08-19 09:09:35 -07:00
Drew DeVault 8fb2e7e34e Merge pull request #79 from taiyu-len/master
fixed floating_modifier related things
2015-08-19 07:14:03 -04:00
Syed Amer Gilani 95517ac77e fix a few possible memory leaks 2015-08-19 11:27:48 +02:00
taiyu c5a6982893 fixed some more bugs, moved layout_log into log.ch, restored focus_parent 2015-08-19 01:06:15 -07:00
taiyu e16a4015ff fixed focus key handler 2015-08-19 00:28:53 -07:00
Drew DeVault cf916bbf6f Improvements to gaps 2015-08-18 18:44:50 -04:00
KoffeinFlummi c75d5ceba4 Merge remote-tracking branch 'upstream/master' into gaps 2015-08-19 00:05:18 +02:00
KoffeinFlummi 4c688cba4e Add support for gaps option 2015-08-18 23:53:57 +02:00
Half-Shot f314d95103 Merge branch 'master' of https://github.com/SirCmpwn/sway 2015-08-18 21:42:28 +01:00
Will Hunt d6ab5e481b Beguin work on the move command.
Stubbed method.
2015-08-18 21:42:23 +01:00
taiyu 03e83c7ef9 restored fullscreen/focus behavior 2015-08-18 11:22:52 -07:00
Drew DeVault 85a573dab7 Revert "enhanced whitespace remover"
This reverts commit abd0afb03a.
2015-08-18 08:39:26 -04:00
Drew DeVault 2139001c9f Coding style enforcement
This was done by hand, so I might have missed things. If anyone knows of
a good C style enforcement tool, let me know.
2015-08-18 07:20:34 -04:00
Drew DeVault 2f6dd0687b Merge pull request #65 from taiyu-len/focus_v2
Focus v2
2015-08-18 07:02:31 -04:00
taiyu abd0afb03a enhanced whitespace remover 2015-08-18 03:22:31 -07:00
taiyu 4606fb1ee3 merged Luminarys resizing code 2015-08-18 01:07:12 -07:00
taiyu 11321ca2dd changed handling of focus, handling of view by type 2015-08-18 00:28:44 -07:00
Luminarys e541ba3d87 Added in basic, but semi-broken moving/resizing functionality to floating windows 2015-08-18 01:33:15 -05:00
Drew DeVault 780893a933 Add support for workspace [name] output [name] 2015-08-17 20:34:53 -04:00
Luminarys 3f475f5009 Minor fix to do proper floating refocuses 2015-08-17 10:22:00 -05:00
Luminarys 47ec999e71 Fixes to floating and umanaged views 2015-08-17 10:18:06 -05:00
Luminarys 05f969074e Added in basic floating toggling 2015-08-17 00:38:34 -05:00
Luminarys 6b80879ec9 Minor naming fix workspace changing commands 2015-08-16 15:51:43 -05:00
Drew DeVault 7f4529ec8b Merge pull request #44 from Luminarys/master
Added in workspace next/prev and workspace output_next/prev
2015-08-16 16:46:16 -04:00
taiyu 5b860c67c3 fixed split [vh], small memory leak, unescape_strings handle \xnn 2015-08-16 13:38:54 -07:00
Luminarys 0a0fe18fd6 Added in workspace next/prev and workspace output_next/prev 2015-08-16 14:50:01 -05:00
Luminarys dfaf3a059f Added in better exit handling 2015-08-16 11:54:37 -05:00
Luminarys c94c41d1db Added in kill command 2015-08-16 11:41:41 -05:00
Drew DeVault 360b3d67b0 Add split [h|v|horizontal|vertical] command 2015-08-16 11:01:01 -04:00
taiyu 824a3d81aa fixed fullscreen & focusing 2015-08-15 14:32:14 -07:00
Drew DeVault d5ff5e98fa Fix build 2015-08-15 15:26:05 -04:00
taiyu 9bb2788768 fixed split 2015-08-15 11:19:44 -07:00
Taiyu 80ae2a7774 removed debug 2015-08-14 13:13:06 -07:00
Taiyu b8cba33c01 changed swayc related functions, cleaned up some functions, moved wlc related things into handlers 2015-08-14 12:42:19 -07:00
Luminarys ffe59b27a9 Style fix 2015-08-13 14:49:34 -05:00
Luminarys ea9efc884d Allowed for execd commands to be spawned after abort 2015-08-13 14:41:36 -05:00
Luminarys d785cbd54c Even more style fixes 2015-08-13 14:41:36 -05:00
Luminarys 7788aa4cbd More style fixes 2015-08-13 14:41:36 -05:00
Luminarys 527288a826 fixes to cmd queue freeing, style 2015-08-13 14:41:36 -05:00
Luminarys ab130fb56b Added in command queue 2015-08-13 14:41:36 -05:00
Taiyu 7d294213d1 style 2015-08-13 12:26:39 -07:00
Taiyu e3edab8a4c change workspace layout when trying to split it 2015-08-13 12:23:56 -07:00
Taiyu 57c28f96fd split workspace bug 2015-08-13 12:02:56 -07:00
Taiyu 0a205776d7 small change 2015-08-13 07:50:46 -07:00
Taiyu ad21281540 style, spelling 2015-08-13 07:48:03 -07:00
Taiyu 5df5b00989 moved signal handling to main 2015-08-13 00:44:56 -07:00
Taiyu f798e9bb0b moved fd modifying stuff to log.c 2015-08-13 00:24:03 -07:00
Taiyu ac1c2d31bf no more output from programs called with exec, fixed focus return values 2015-08-12 22:58:15 -07:00
Taiyu dc9efcd79f better error handling 2015-08-12 21:51:38 -07:00
Taiyu 65406cb61b safer forking, reduce duplicate code, cleanup zombie processes 2015-08-12 21:06:09 -07:00
Luminarys a5b02791d4 Changed command handler to perform var subs on all cmd args
Fixed workspace_next_name to use the first workspace name it can find in the config

Minor fixes

Changed command handler to perform var subs on all portions of a command

Revert "Changed command handler to perform var subs on all portions of a command"

This reverts commit fcfcffa1ea9819bcada6e6c85b40b21bf1b3a96e.

Var sub fixes

Minor fixes

More minor fixes
2015-08-11 12:48:55 -05:00
Taiyu beabb12d63 destroys empty workspace + minor bugfixes 2015-08-10 17:32:50 -07:00
Luminarys a386d98518 Changed cmd handlers to use bool instead of int 2015-08-10 16:51:18 -05:00
Taiyu f62a700bc8 return 0 on success for cmd_fullscreen 2015-08-10 14:31:32 -07:00
Taiyu 604be65625 make cmd_workspace return 0 on success 2015-08-10 14:29:24 -07:00
Jose Diez 8cc2c6fa7a Basic workspace functionality 2015-08-10 22:49:50 +02:00
Taiyu 820dda1be6 fixed small memory leak. v2 2015-08-10 13:16:38 -07:00
Drew DeVault 54374d81b5 Fix some errors with config loading 2015-08-10 15:45:36 -04:00
Luminarys d570acd395 Changed cmd_reload to arrange windows post reload 2015-08-10 14:38:15 -05:00
Luminarys 88997bbfe6 Minor fix 2015-08-10 14:24:31 -05:00
Luminarys 508980e3ab Abstracted load_config 2015-08-10 14:22:22 -05:00
Luminarys 7c02a1967b Spaces to Tabs 2015-08-10 14:09:51 -05:00
Luminarys 68beabda03 Style fixes and slight reload command alteration 2015-08-10 14:00:10 -05:00
Luminarys c0ee2a6406 Added in reload and exec_always handling 2015-08-10 13:53:43 -05:00
Taiyu b43161fd45 fixed focus_parent, moved into move_focus() function 2015-08-10 00:05:44 -07:00
Drew DeVault f6e65b6bb2 Don't override keys if command fails 2015-08-09 23:04:37 -04:00
Drew DeVault b49cfa0c16 Fix bug with focus parent
Thanks anon
2015-08-09 22:53:00 -04:00
Drew DeVault 0078a6fa36 Flesh out fullscreen support a bit 2015-08-09 20:49:58 -04:00
jdiez17 56d29bbec5 log: add newline 2015-08-10 02:24:19 +02:00
Drew DeVault 8597c3c7e7 Implement focus parent 2015-08-09 20:21:08 -04:00
jdiez17 d62efd70e4 commands: re-add log_colors 2015-08-10 02:20:40 +02:00
Drew DeVault 9f091c7f82 Add movement support 2015-08-09 20:10:26 -04:00
Drew DeVault 2231586569 Implement splith/splitv
Ref #2
2015-08-09 19:27:25 -04:00
jdiez17 c688ff704d log, commands: Add log_colors command 2015-08-09 20:38:02 +02:00
Drew DeVault ec2fedf6d0 Implement layout [splith|splitv|toggle split] 2015-08-09 14:35:59 -04:00
Drew DeVault b075b06478 Load config after xwayland is created
This lets us run x commands on startup
2015-08-09 14:03:54 -04:00
Drew DeVault ea9659f39c Implement exec 2015-08-09 12:26:32 -04:00
Drew DeVault f97a48d5b7 Implement focus_follows_mouse 2015-08-09 09:23:10 -04:00
Drew DeVault a78b921803 Implement key bindings 2015-08-08 19:24:18 -04:00
Drew DeVault 0427fddb5a Add logging and new windows into layout tree 2015-08-08 17:01:27 -04:00
Drew DeVault 47b28bd335 Clean up config loading and launch wayland 2015-08-05 22:59:06 -04:00
Drew DeVault a74268dfab Add TODO so I don't forget later 2015-08-05 22:55:51 -04:00
Drew DeVault 254d0df3b2 Push the XKB key to the key list
Instead of the key name
2015-08-05 22:41:46 -04:00
Drew DeVault 5767dcc86e Mostly implement bindsym command 2015-08-05 22:40:38 -04:00
Drew DeVault d0f1fb71d1 Flesh out some command parsing
This implements the `set` command from i3
2015-08-05 22:10:56 -04:00
Drew DeVault e07c77fbb7 Build out command subsystem
Everyone loves code stolen from your own projects
2015-08-05 17:30:47 -04:00