diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | config | 21 | ||||
-rw-r--r-- | include/container.h | 5 | ||||
-rw-r--r-- | sway/commands.c | 8 | ||||
-rw-r--r-- | sway/container.c | 10 | ||||
-rw-r--r-- | sway/handlers.c | 6 | ||||
-rw-r--r-- | sway/main.c | 8 | ||||
-rw-r--r-- | wallpaper.jpg | bin | 0 -> 2458443 bytes |
8 files changed, 56 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 94f2ab29..109b233a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,4 +119,10 @@ install( COMPONENT data ) +install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg + DESTINATION share/sway + COMPONENT data +) + feature_summary(WHAT ALL) @@ -16,6 +16,15 @@ set $term urxvt # Your preferred application launcher set $menu dmenu_run +### Output configuration +# +# Default wallpaper - CC-BY-NC from Netzlemming http://netzlemming.deviantart.com/art/Field-of-Barley-05240017-307176737 +output * bg /usr/share/sway/wallpaper.jpg fill +# +# Example output configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 + ### Key bindings # # Basics: @@ -130,3 +139,15 @@ set $menu dmenu_run # Show the next scratchpad window or hide the focused scratchpad window. # If there are multiple scratchpad windows, this command cycles through them. bindsym $mod+minus scratchpad show + +# +# Status Bar: +# +bar { + position top + colors { + statusline #ffffff + background #323232 + inactive_workspace #32323200 #32323200 #5c5c5c + } +} diff --git a/include/container.h b/include/container.h index d76160de..d5126e74 100644 --- a/include/container.h +++ b/include/container.h @@ -260,4 +260,9 @@ void add_gaps(swayc_t *view, void *amount); */ void update_visibility(swayc_t *container); +/** + * Close all child views of container + */ +void close_views(swayc_t *container); + #endif diff --git a/sway/commands.c b/sway/commands.c index 0955db38..fe341cd5 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -318,12 +318,6 @@ static struct cmd_results *cmd_exec(int argc, char **argv) { return cmd_exec_always(argc, argv); } -static void kill_views(swayc_t *container, void *data) { - if (container->type == C_VIEW) { - wlc_view_close(container->handle); - } -} - static struct cmd_results *cmd_exit(int argc, char **argv) { struct cmd_results *error = NULL; if (config->reading) return cmd_results_new(CMD_FAILURE, "exit", "Can't be used in config file."); @@ -331,7 +325,7 @@ static struct cmd_results *cmd_exit(int argc, char **argv) { return error; } // Close all views - container_map(&root_container, kill_views, NULL); + close_views(&root_container); sway_terminate(); return cmd_results_new(CMD_SUCCESS, NULL, NULL); } diff --git a/sway/container.c b/sway/container.c index e6fa4f37..dcf4dcc8 100644 --- a/sway/container.c +++ b/sway/container.c @@ -796,3 +796,13 @@ void add_gaps(swayc_t *view, void *_data) { } } } + +static void close_view(swayc_t *container, void *data) { + if (container->type == C_VIEW) { + wlc_view_close(container->handle); + } +} + +void close_views(swayc_t *container) { + container_map(container, close_view, NULL); +} diff --git a/sway/handlers.c b/sway/handlers.c index b8bd9eff..6c6d0e60 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -252,8 +252,12 @@ static void handle_view_destroyed(wlc_handle handle) { } if (view) { - swayc_t *parent = destroy_view(view); + bool fullscreen = swayc_is_fullscreen(view); remove_view_from_scratchpad(view); + swayc_t *parent = destroy_view(view); + if (fullscreen) { + parent->fullscreen = NULL; + } arrange_windows(parent, -1, -1); } else { // Is it unmanaged? diff --git a/sway/main.c b/sway/main.c index 382e7ca2..37681f2d 100644 --- a/sway/main.c +++ b/sway/main.c @@ -26,6 +26,11 @@ void sway_terminate(void) { wlc_terminate(); } +void sig_handler(int signal) { + close_views(&root_container); + sway_terminate(); +} + static void wlc_log_handler(enum wlc_log_type type, const char *str) { if (type == WLC_LOG_ERROR) { sway_log(L_ERROR, "[wlc] %s", str); @@ -176,6 +181,9 @@ int main(int argc, char **argv) { } register_extensions(); + // handle SIGTERM signals + signal(SIGTERM, sig_handler); + #if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); #endif diff --git a/wallpaper.jpg b/wallpaper.jpg Binary files differnew file mode 100644 index 00000000..65a167f0 --- /dev/null +++ b/wallpaper.jpg |