diff --git a/Bugs.md b/Bugs.md index d8a33a1..5b5bd4a 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1170,3 +1170,12 @@ leading to a termination of cagebreak. * Fixed: 2.1.0 Prior to release 2.1.0 `meson install` did not work perfectly. + +## Issue 60 + + * github issue number: N/A + * Fixed: 2.1.2 + +In the `merge_output_configs` function, when copying the properties of +one config to another, the `angles` element of an input structure was +being copied to the `status` element of the resultant structure. diff --git a/README.md b/README.md index aca03a6..004239a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.1)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.2)](https://repology.org/project/cagebreak/versions) ## Quick Introduction @@ -633,14 +633,17 @@ The release procedure outlines the process for a release to occur. * [ ] Synchronize any socket changes to cagebreak-socket man page * [ ] Document fixed bugs in Bugs.md * [ ] Include issue discussion from github, where applicable + * [ ] `meson compile adjust-epoch -C build` * [ ] Commit changes * [ ] `git push origin development` * [ ] Testing * [ ] Manual testing * [ ] `meson compile fuzz -C build` for at least one hour + * [ ] Adjust Hashes.md - Use `meson compile output-hashes -C build` to add Hashes or aid in repro check + * [ ] Commit changes + * [ ] `git push origin development` * [ ] Complete release-non-auto-checks - * [ ] Use `meson compile output-hashes -C build` to add Hashes or aid in repro check - * [ ] `meson compile create-signatures -C build` + * [ ] `meson compile create-sigs -C build` * [ ] Commit and push signatures, hashes and non-auto-check files * [ ] `meson test -C build` passes everything except some release tests * [ ] `git add` relevant files @@ -660,6 +663,7 @@ The release procedure outlines the process for a release to occur. * [ ] `git merge master` * [ ] `git push --tags origin hotfix` * [ ] Upload archives and signatures as release assets + * [ ] Delete feature branches if appropriate * [ ] Manage package release ## Roadmap @@ -743,6 +747,8 @@ see [SECURITY.md](SECURITY.md). * Oliver Friedmann * [Add output scaling](https://github.com/project-repo/cagebreak/pull/34), released in 2.0.0 with slight modifications + * Tom Greig + * Fix bug in merge_output_configs in 2.1.2 ## License diff --git a/example_scripts/focus_follows_cursor.sh b/example_scripts/focus_follows_cursor.sh deleted file mode 100644 index e47bf88..0000000 --- a/example_scripts/focus_follows_cursor.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors -# SPDX-License-Identifier: MIT - -# This script uses the cagebreak socket to modify the compositor's behaviour in -# such a way that the currently focussed tile follows the cursor, i.e. that the -# currently focussed tile is always the one within which the cursor is located. - -# Start up the ipc link -source "$(dirname "${BASH_SOURCE[0]}")/cb_script_header.sh" - -while IFS= read -r -d $'\0' event -do - # Remove the cg-ipc header - event="${event:6}" - if [[ "$(echo "${event}" | jq ".event_name")" = "\"cursor_switch_tile\"" ]] - then - new_tile="$(echo "${event}"|jq -r ".new_tile")" - new_output_id="$(echo "${event}"|jq -r ".new_output_id")" - # Send the new tile to focus to cagebreak - echo -e "screen ${new_output_id}\nfocus_tile ${new_tile}" >&3 - fi -done <&4 diff --git a/keybinding.c b/keybinding.c index 44ccffb..eaf2ae7 100644 --- a/keybinding.c +++ b/keybinding.c @@ -96,6 +96,12 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { if(keybinding->data.c != NULL) { free(keybinding->data.c); } + break; + case KEYBINDING_SEND_CUSTOM_EVENT: + if(keybinding->data.c != NULL) { + free(keybinding->data.c); + } + break; default: break; } @@ -1245,6 +1251,12 @@ keybinding_display_message(struct cg_server *server, char *msg) { message_printf(server->curr_output, "%s", msg); } +void +keybinding_send_custom_event(struct cg_server *server, char *msg) { + ipc_send_event(server, + "{\"event_name\":\"custom_event\",\"message\":\"%s\"}", msg); +} + void keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { @@ -1706,6 +1718,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_DISPLAY_MESSAGE: keybinding_display_message(server, data.c); break; + case KEYBINDING_SEND_CUSTOM_EVENT: + keybinding_send_custom_event(server, data.c); + break; case KEYBINDING_RESIZE_TILE_HORIZONTAL: resize_tile(server, data.i, 0); break; diff --git a/keybinding.h b/keybinding.h index 6d6cf87..a5958f0 100644 --- a/keybinding.h +++ b/keybinding.h @@ -63,6 +63,7 @@ struct cg_server; KEYBINDING(KEYBINDING_SHOW_TIME, time) \ KEYBINDING(KEYBINDING_SHOW_INFO, show_info) \ KEYBINDING(KEYBINDING_DISPLAY_MESSAGE, message) \ + KEYBINDING(KEYBINDING_SEND_CUSTOM_EVENT, custom_event) \ KEYBINDING(KEYBINDING_CURSOR, cursor) \ \ KEYBINDING(KEYBINDING_SWAP_LEFT, exchangeleft) \ diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index bb04547..cb7c91b 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak-config(5) "Version 2.1.2" "Cagebreak Manual" # NAME @@ -81,9 +81,17 @@ configure_message display_time 4 *cursor [enable|disable]* Enable or disable cursor + This simply hides the cursor. Pointing and clicking is still possible. +*custom_event * + Send a custom event to the IPC socket + + This sends an event of type "custom_event" to all programs + listening to the IPC socket along with the string . + See *cagebreak-socket(7)* for more details. + *definekey * Bind to execute if pressed in - *definekey* is a more general version of *bind*. diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 19b7370..e8b88d3 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.1.2" "Cagebreak Manual" # NAME @@ -113,6 +113,17 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1","output_id":1} cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_output_id":1,"old_tile":2,"new_output":"eDP-1","new_output_id":1,"new_tile":3} ``` +*custom_event* + - Trigger: Cagebreak receives the *custom_event* command, either in the config file or via the IPC socket (see *cagebreak-config(5)*). + - JSON + - event_name: "custom_event" + - message: The message passed to the *custom_event* command + +``` +custom_event Hello World! +cg-ipc{"event_name":"custom_event","message":"Hello World!"} +``` + *cycle_outputs* - Trigger: *nextscreen* and *prevscreen* commands - JSON diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index fdc2da1..c8fc85e 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak(1) "Version 2.1.2" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 26b0746..777c8d3 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.1.1', +version : '2.1.2', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) @@ -260,7 +260,7 @@ install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_nam if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1681758922 + secssinceepoch = 1682363199 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') diff --git a/output.c b/output.c index b8fc627..506f5bd 100644 --- a/output.c +++ b/output.c @@ -399,7 +399,7 @@ merge_output_configs(struct cg_output_config *cfg1, out_cfg->scale = cfg1->scale; } if(cfg1->angle == out_cfg->angle) { - out_cfg->status = cfg2->angle; + out_cfg->angle = cfg2->angle; } else { out_cfg->angle = cfg1->angle; } diff --git a/parse.c b/parse.c index 68767c6..c163b3a 100644 --- a/parse.c +++ b/parse.c @@ -811,6 +811,15 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, return -1; } keybinding->data.c = strdup(saveptr); + } else if(strcmp(action, "custom_event") == 0) { + keybinding->action = KEYBINDING_SEND_CUSTOM_EVENT; + if(saveptr == NULL) { + *errstr = + log_error("Not enough paramaters to \"custom_event\". Expected " + "string to send."); + return -1; + } + keybinding->data.c = strdup(saveptr); } else if(strcmp(action, "time") == 0) { keybinding->action = KEYBINDING_SHOW_TIME; } else if(strcmp(action, "nextscreen") == 0) { diff --git a/release-non-auto-checks/meson-epoch b/release-non-auto-checks/meson-epoch deleted file mode 100644 index aa7d21e..0000000 --- a/release-non-auto-checks/meson-epoch +++ /dev/null @@ -1,2 +0,0 @@ -2.1.1 -2023-04-17 diff --git a/scripts/set-version b/scripts/set-version index c4506cb..3ee035c 100755 --- a/scripts/set-version +++ b/scripts/set-version @@ -15,6 +15,6 @@ version="${1}" sed -i -e "s/minversion\=[0-9]*\.[0-9]*.[0-9]*/minversion=$version/" README.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak.1.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-config.5.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-socket.7.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak.1.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak-config.5.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak-socket.7.md