From 016261fd642412dec789a0a92b7a5511d9fe09da Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 20 Oct 2017 15:12:28 -0600 Subject: [PATCH 01/14] Print log level even if STDERR is not a tty Makes reading debug logs much easier, debug lines will start with `E`, info lines with `I` and error lines with `E`. --- common/log.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/common/log.c b/common/log.c index af1bdc3f6..6dc9d7432 100644 --- a/common/log.c +++ b/common/log.c @@ -22,6 +22,12 @@ static const char *verbosity_colors[] = { [L_INFO ] = "\x1B[1;34m", [L_DEBUG ] = "\x1B[1;30m", }; +static const char verbosity_chars[] = { + [L_SILENT] = '\0', + [L_ERROR ] = 'E', + [L_INFO ] = 'I', + [L_DEBUG ] = 'D', +}; void init_log(log_importance_t verbosity) { if (verbosity != L_DEBUG) { @@ -62,6 +68,16 @@ void _sway_vlog(const char *filename, int line, log_importance_t verbosity, static struct tm *tm_info; char buffer[26]; + unsigned int c = verbosity; + if (c > sizeof(verbosity_colors) / sizeof(char *) - 1) { + c = sizeof(verbosity_colors) / sizeof(char *) - 1; + } + + // First, if not printing color, show the log level + if (!(colored && isatty(STDERR_FILENO)) && c != L_SILENT) { + fprintf(stderr, "%c: ", verbosity_chars[c]); + } + // get current time t = time(NULL); // convert time to local time (determined by the locale) @@ -70,11 +86,6 @@ void _sway_vlog(const char *filename, int line, log_importance_t verbosity, strftime(buffer, sizeof(buffer), "%x %X - ", tm_info); fprintf(stderr, "%s", buffer); - unsigned int c = verbosity; - if (c > sizeof(verbosity_colors) / sizeof(char *) - 1) { - c = sizeof(verbosity_colors) / sizeof(char *) - 1; - } - if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "%s", verbosity_colors[c]); } @@ -124,6 +135,8 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) { if (colored && isatty(STDERR_FILENO)) { fprintf(stderr, "%s", verbosity_colors[c]); + } else if (c != L_SILENT) { + fprintf(stderr, "%c: ", verbosity_chars[c]); } va_list args; From 98875443ea96361eb4da7890c87922ccb3571f51 Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Sun, 22 Oct 2017 01:00:32 -0700 Subject: [PATCH 02/14] swaygrab: Increase max depth of JSON parsing to 256. Prevent segfault if IPC response can't be parsed. The default max nesting depth of json-c is 32, which can cause some valid trees to fail to be parsed, so increase that. Also instead of segfaulting, just abort and print the error returned by json-c. --- swaygrab/json.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/swaygrab/json.c b/swaygrab/json.c index 80dae299f..32b68612c 100644 --- a/swaygrab/json.c +++ b/swaygrab/json.c @@ -4,6 +4,7 @@ #include #include #include +#include "log.h" #include "ipc-client.h" #include "swaygrab/json.h" @@ -12,7 +13,15 @@ static json_object *tree; void init_json_tree(int socketfd) { uint32_t len = 0; char *res = ipc_single_command(socketfd, IPC_GET_TREE, NULL, &len); - tree = json_tokener_parse(res); + struct json_tokener *tok = json_tokener_new_ex(256); + if (!tok) { + sway_abort("Unable to get json tokener."); + } + tree = json_tokener_parse_ex(tok, res, len); + if (!tree || tok->err != json_tokener_success) { + sway_abort("Unable to parse IPC response as JSON: %s", json_tokener_error_desc(tok->err)); + } + json_tokener_free(tok); } void free_json_tree() { From 29f27c7cdc9e11aa560a5d49d110fc705dbc21cb Mon Sep 17 00:00:00 2001 From: Geoff Greer Date: Sun, 22 Oct 2017 18:03:45 -0700 Subject: [PATCH 03/14] swaygrab: Add some error handling. - If IPC response contains `success: false`, abort and print error message. - If tree has no nodes, abort with error msg instead of segfaulting. --- swaygrab/json.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/swaygrab/json.c b/swaygrab/json.c index 32b68612c..286085c35 100644 --- a/swaygrab/json.c +++ b/swaygrab/json.c @@ -21,6 +21,14 @@ void init_json_tree(int socketfd) { if (!tree || tok->err != json_tokener_success) { sway_abort("Unable to parse IPC response as JSON: %s", json_tokener_error_desc(tok->err)); } + json_object *success; + json_object_object_get_ex(tree, "success", &success); + if (success && !json_object_get_boolean(success)) { + json_object *error; + json_object_object_get_ex(tree, "error", &error); + sway_abort("IPC request failed: %s", json_object_get_string(error)); + } + json_object_put(success); json_tokener_free(tok); } @@ -72,7 +80,9 @@ json_object *get_focused_container() { char *get_focused_output() { json_object *outputs, *output, *name; json_object_object_get_ex(tree, "nodes", &outputs); - + if (!outputs) { + sway_abort("Unabled to get focused output. No nodes in tree."); + } for (int i = 0; i < json_object_array_length(outputs); i++) { output = json_object_array_get_idx(outputs, i); From 0d2baa1c89a845782cba37f62f6a7d38cfab6b62 Mon Sep 17 00:00:00 2001 From: Ranieri Althoff Date: Tue, 24 Oct 2017 01:43:11 +0000 Subject: [PATCH 04/14] Use add_compile_options instead of interpolation Uses CMake's `add_compile_options` directive instead of interpolating `CMAKE_C_FLAGS` for adding compilation flags. --- CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95f539e7d..b253f1fc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,16 +2,12 @@ cmake_minimum_required(VERSION 3.1.0) project(sway C) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") +add_compile_options(-g) set(CMAKE_C_STANDARD 99) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") +add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/CMake From 88d042ec498b0edf480d36f737da93160b2c9a2c Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Tue, 24 Oct 2017 22:35:31 +0000 Subject: [PATCH 05/14] nvidia: Validate the nvidia_drm module options When the proprietary nvidia driver is used, ensure the modeset option is set instead of checking /proc/cmdline for nvidia-drm.modeset=1. --- sway/main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sway/main.c b/sway/main.c index 6d13955c0..cc9147b8a 100644 --- a/sway/main.c +++ b/sway/main.c @@ -135,6 +135,29 @@ void detect_proprietary() { "You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm." "\x1B[0m\n"); } +#ifdef __linux__ + f = fopen("/sys/module/nvidia_drm/parameters/modeset", "r"); + if (f) { + char *line = read_line(f); + if (line && strstr(line, "Y")) { + // nvidia-drm.modeset is set to 0 + fprintf(stderr, "\x1B[1;31mWarning: You must load " + "nvidia-drm with the modeset option on to use " + "the proprietary driver. Consider adding " + "nvidia-drm.modeset=1 to your kernel command line " + "parameters.\x1B[0m\n"); + } + fclose(f); + free(line); + } else { + // nvidia-drm.modeset is not set + fprintf(stderr, "\x1B[1;31mWarning: You must load " + "nvidia-drm with the modeset option on to use " + "the proprietary driver. Consider adding " + "nvidia-drm.modeset=1 to your kernel command line " + "parameters.\x1B[0m\n"); + } +#else f = fopen("/proc/cmdline", "r"); if (f) { char *line = read_line(f); @@ -146,6 +169,7 @@ void detect_proprietary() { fclose(f); free(line); } +#endif } } From 3d209be3d64081ee47f39d7e494830a73b178a72 Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Thu, 26 Oct 2017 14:07:36 +0000 Subject: [PATCH 06/14] Add Address Sanitized build type - Add -DCMAKE_BUILD_TYPE=ASAN to possible builds --- .travis.yml | 7 ++++++- CMakeLists.txt | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 696347657..3eeb16820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,11 @@ compiler: - gcc - clang +env: + - BUILD_TYPE=Release + - BUILD_TYPE=Debug + - BUILD_TYPE=ASAN + arch: packages: - cmake @@ -19,7 +24,7 @@ arch: - wlc-git - libcap script: - - "cmake ." + - "cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ." - "make" script: diff --git a/CMakeLists.txt b/CMakeLists.txt index b253f1fc4..367630057 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,17 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror) +# Add Address Sanitiezed build type +set(CMAKE_C_FLAGS_ASAN + "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -fno-omit-frame-pointer" + CACHE STRING "Flags used by the C compiler during address sanitizer builds." + FORCE ) +mark_as_advanced( + CMAKE_C_FLAGS_ASAN + CMAKE_EXE_LINKER_FLAGS_DEBUG + CMAKE_SHARED_LINKER_FLAGS_DEBUG + ) + list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/CMake ) From 69e9b1386ffa2f78bfa69ccd84e815c9f1d5920e Mon Sep 17 00:00:00 2001 From: Marius Orcsik Date: Fri, 27 Oct 2017 12:14:40 +0200 Subject: [PATCH 07/14] Explicitly setting the version of json-c required to 0.12.1. This is needed because the development version breaks the existing API of json_object_array_length() by moving the return from int to size_t. This would fix #1355 --- CMake/FindJsonC.cmake | 16 ++++++++++++++-- CMakeLists.txt | 2 +- README.de.md | 2 +- README.el.md | 2 +- README.fr.md | 2 +- README.it.md | 2 +- README.ja.md | 2 +- README.md | 2 +- README.pt.md | 2 +- README.ru.md | 2 +- README.uk.md | 2 +- 11 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMake/FindJsonC.cmake b/CMake/FindJsonC.cmake index 2ca0df39f..bbf6930cf 100644 --- a/CMake/FindJsonC.cmake +++ b/CMake/FindJsonC.cmake @@ -8,10 +8,22 @@ # find_package(PkgConfig) -pkg_check_modules(PC_JSONC QUIET JSONC) + +if (JsonC_FIND_REQUIRED) + set(_pkgconfig_REQUIRED "REQUIRED") +else() + set(_pkgconfig_REQUIRED "") +endif() + +if(JsonC_FIND_VERSION) + pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c=${JsonC_FIND_VERSION}) +else() + pkg_check_modules(PC_JSONC ${_pkgconfig_REQUIRED} json-c) +endif() + find_path(JSONC_INCLUDE_DIRS NAMES json-c/json.h HINTS ${PC_JSONC_INCLUDE_DIRS}) find_library(JSONC_LIBRARIES NAMES json-c HINTS ${PC_JSONC_LIBRARY_DIRS}) - include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(JSONC DEFAULT_MSG JSONC_LIBRARIES JSONC_INCLUDE_DIRS) mark_as_advanced(JSONC_LIBRARIES JSONC_INCLUDE_DIRS) diff --git a/CMakeLists.txt b/CMakeLists.txt index b253f1fc4..bf37d9dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ if (LD_LIBRARY_PATH) add_definitions(-D_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}") endif() -find_package(JsonC REQUIRED) +find_package(JsonC 0.12.1 REQUIRED) find_package(PCRE REQUIRED) find_package(WLC REQUIRED) find_package(Wayland REQUIRED) diff --git a/README.de.md b/README.de.md index 92a15b995..1b0811ffc 100644 --- a/README.de.md +++ b/README.de.md @@ -60,7 +60,7 @@ Abhängigkeiten: * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.el.md b/README.el.md index 1e5b83582..03a49ae7c 100644 --- a/README.el.md +++ b/README.el.md @@ -53,7 +53,7 @@ To username μου στο Freenode είναι kon14 και θα με βρείτ * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.fr.md b/README.fr.md index 03b5a803f..060ae0632 100644 --- a/README.fr.md +++ b/README.fr.md @@ -55,7 +55,7 @@ Installez les dépendances : * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.it.md b/README.it.md index ca3e1ea3b..58b965d87 100644 --- a/README.it.md +++ b/README.it.md @@ -56,7 +56,7 @@ Installa queste dipendenze: * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.ja.md b/README.ja.md index 7573ecc4a..f8cbecb05 100644 --- a/README.ja.md +++ b/README.ja.md @@ -49,7 +49,7 @@ Swayは沢山のディストリビューションで提供されています。" * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.md b/README.md index 9dbbfdfe1..33d52fb1e 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Install dependencies: * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.pt.md b/README.pt.md index 96827623b..7d105e42c 100644 --- a/README.pt.md +++ b/README.pt.md @@ -62,7 +62,7 @@ Antes de iniciar a compilação, instale as dependências: * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.ru.md b/README.ru.md index 891adf999..2a27247c0 100644 --- a/README.ru.md +++ b/README.ru.md @@ -55,7 +55,7 @@ Sway доступен во многих дистрибутивах и наход * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * diff --git a/README.uk.md b/README.uk.md index 02b64804a..7cb3b95f7 100644 --- a/README.uk.md +++ b/README.uk.md @@ -62,7 +62,7 @@ Sway доступний у багатьох дистрибутивах Linux (а * libcap * asciidoc * pcre -* json-c +* json-c <= 0.12.1 * pango * cairo * gdk-pixbuf2 * From 675e4b7de75cff4af5ab21d594b627eff294255f Mon Sep 17 00:00:00 2001 From: Joona Romppanen Date: Sat, 28 Oct 2017 17:35:48 +0300 Subject: [PATCH 08/14] Removed trailing comma from swaybar click event json --- swaybar/status_line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swaybar/status_line.c b/swaybar/status_line.c index cc324fdb7..87e90caf4 100644 --- a/swaybar/status_line.c +++ b/swaybar/status_line.c @@ -440,7 +440,7 @@ bool status_line_mouse_event(struct bar *bar, int x, int y, uint32_t button) { json_object_object_add(event_json, "x", json_object_new_int(x)); json_object_object_add(event_json, "y", json_object_new_int(y)); - int len = snprintf(event_buff, sizeof(event_buff), "%s,\n", json_object_to_json_string(event_json)); + int len = snprintf(event_buff, sizeof(event_buff), "%s\n", json_object_to_json_string(event_json)); json_object_put(event_json); From 85159b03b7c63fb4f846062b1a45f357bfd31565 Mon Sep 17 00:00:00 2001 From: yuilib Date: Wed, 1 Nov 2017 16:58:34 +0900 Subject: [PATCH 09/14] Update README.ja.md --- README.ja.md | 54 +++++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/README.ja.md b/README.ja.md index f8cbecb05..3593df15d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -3,43 +3,40 @@ "**S**irCmpwn's **Way**land compositor"は**開発中**の i3互換な[Wayland](http://wayland.freedesktop.org/)コンポジタです。 [FAQ](https://github.com/swaywm/sway/wiki)も合わせてご覧ください。 -[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on -irc.freenode.net)もあります。 +[IRC チャンネル](http://webchat.freenode.net/?channels=sway&uio=d4) (#sway on irc.freenode.net)もあります。 + +**注意**: Swayは現在*凍結中*であり、Swayとwlrootsの統合が完了するまで、新たな機能は追加されません。バグフィックスは行われます。詳しくは[この記事](https://drewdevault.com/2017/10/09/Future-of-sway.html)をご覧ください。wlrootsとの統合状況については、[このチケット](https://github.com/swaywm/sway/issues/1390)をご覧ください。 [![](https://sr.ht/ICd5.png)](https://sr.ht/ICd5.png) -もしSwayの開発を支援したい場合は[SirCmpwnのPatreon](https://patreon.com/sircmpwn)や -[こちら](https://github.com/swaywm/sway/issues/986)をご覧ください。 +Swayの開発を支援したい場合は、[SirCmpwnのPatreon](https://patreon.com/sircmpwn)や、特定の機能に対する[報奨金のページ](https://github.com/swaywm/sway/issues/986)から寄付ができます。誰でも報奨金を請求できますし、自分の欲しい機能に報奨金を懸ける事も出来ます。またSwayのメンテナンスを支援するには、Patreonがより有用です。 -誰でも賞金を受け取る事ができますし、自分の欲しい機能に賞金を掛ける事が出来ます。 -PatreonはSwayの開発を支援するのにもっとも便利です。 +## 日本語サポート +SirCmpwnは、日本語でのサポートをIRCとGitHubで行います。タイムゾーンはUTC-4です。 -## リリース +## リリースの署名 -Swayのリリースは[B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)で書名されて -[GitHub](https://github.com/swaywm/sway/releases)で公開されています。 +Swayのリリースは[B22DA89A](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x52CB6609B22DA89A)で署名され、[GitHub](https://github.com/swaywm/sway/releases)で公開されています。 ## 開発状況 -- [i3のサポート](https://github.com/swaywm/sway/issues/2) -- [IPCのサポート](https://github.com/swaywm/sway/issues/98) -- [i3barのサポート](https://github.com/swaywm/sway/issues/343) -- [i3-gapsのサポート](https://github.com/swaywm/sway/issues/307) -- [セキュリティ対応](https://github.com/swaywm/sway/issues/984) +- [i3の機能のサポート](https://github.com/swaywm/sway/issues/2) +- [IPCの機能のサポート](https://github.com/swaywm/sway/issues/98) +- [i3barの機能のサポート](https://github.com/swaywm/sway/issues/343) +- [i3-gapsの機能のサポート](https://github.com/swaywm/sway/issues/307) +- [セキュリティ機能](https://github.com/swaywm/sway/issues/984) ## インストール ### パッケージから -Swayは沢山のディストリビューションで提供されています。"sway"パッケージをインストールしてみてください。 -もし、パッケージが存在しないならば、[このページ](https://github.com/swaywm/sway/wiki/Unsupported-packages) -を参照してインストールしてみてください。 +Swayは沢山のディストリビューションで提供されています。"sway"パッケージのインストールを試してください。パッケージが存在しない場合は、[このページ](https://github.com/swaywm/sway/wiki/Unsupported-packages)で、あなたのディストリビューションでのインストールに関する情報を調べてください。 -もし、Swayのパッケージを提供したいならば、SwayのIRCチャンネルか"sir@cmpwn.com"に連絡してください。 +あなたのディストリビューションにSwayのパッケージを提供したい場合は、SwayのIRCチャンネルを訪れるか、sir@cmpwn.comにメールを送り、相談してください。 -### ソースコードから +### ソースコードからコンパイル -まずはコンパイルや実行に必要なソフトウェアやライブラリをインストールしてください。: +次の依存パッケージをインストールしてください: * cmake * [wlc](https://github.com/Cloudef/wlc) @@ -57,11 +54,11 @@ Swayは沢山のディストリビューションで提供されています。" * imagemagick (swaygrabでスクリーンショットを撮るのに必要です) * ffmpeg (swaygrabで画面を録画するのに必要です) -_\*swaybar,swaybg,swaylockが使用します_ +_\*swaybar,swaybg,swaylockでのみ必要です_ -_\*\*swaylockが使用します_ +_\*\*swaylockでのみ必要です_ -ターミナルで次のコマンドを実行してください: +次のコマンドを実行してください: mkdir build cd build @@ -69,22 +66,19 @@ _\*\*swaylockが使用します_ make sudo make install -logindを使用している場合はバイナリにcapを設定してください: +logindを使用しているシステムでは、バイナリにいくつかのケーパビリティを設定する必要があります: sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway -logindを使用していない場合はバイナリにsuidを設定してください: +logindを使用していないシステムでは、バイナリにsuidを設定する必要があります: sudo chmod a+s /usr/local/bin/sway ## 設定 -もし、既にi3を使用しているなら、i3のコンフィグファイルを`~/.config/sway/config`にコピーすれば動きます。 -そうでないならば、サンプルのコンフィグファイルを`~/.config/sway/config`にコピーしてください。 -サンプルのコンフィグファイルは基本的には`/etc/sway/config`にあります。 -`man 5 sway`で各種設定について確認できます。 +既にi3を使用している場合は、i3の設定ファイルを`~/.config/sway/config`にコピーすれば動きます。そうでない場合は、サンプルの設定ファイルを`~/.config/sway/config`にコピーしてください。サンプルの設定ファイルは、通常`/etc/sway/config`にあります。`man 5 sway`を実行することで、設定に関する情報を見ることができます。 ## 実行 -`sway`をTTYから実行してください。いくつかのDesktopManagerはSwayからサポートされていませんが、動く場合もあります(gdmは特にSwayと相性が良いそうです)。 +`sway`をTTYから実行してください。いくつかのディスプレイマネージャは動くかもしれませんが、Swayからサポートされていません(gdmは非常に良く動作することが知られています)。 From 7f7e94bf5904d8f95cfbc8cdeea412eb54fe0949 Mon Sep 17 00:00:00 2001 From: Konstantinos Feretos Date: Wed, 1 Nov 2017 12:08:23 +0200 Subject: [PATCH 10/14] Update README.el.md --- README.el.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.el.md b/README.el.md index 03a49ae7c..df39364fe 100644 --- a/README.el.md +++ b/README.el.md @@ -75,7 +75,7 @@ _\*\*Απαιτείται μόνο για swaylock_ Σε συστήματα με logind, χρειάζεται να ορίσετε μερικά δικαιώματα caps στο εκτελέσιμο αρχείο: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway Σε συστήματα χωρίς logind, χρειάζεται να θέσετε το suid bit στο εκτελέσιμο αρχείο: From 4ab66bbbc3e3419a312b337fb2b79371a36d9aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Mon, 30 Oct 2017 10:02:18 +0100 Subject: [PATCH 11/14] Update README.md --- README.de.md | 2 +- README.fr.md | 2 +- README.it.md | 2 +- README.ja.md | 2 +- README.md | 2 +- README.pt.md | 2 +- README.ru.md | 2 +- README.uk.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.de.md b/README.de.md index 1b0811ffc..701cc34fc 100644 --- a/README.de.md +++ b/README.de.md @@ -82,7 +82,7 @@ Führe diese Befehle aus: In Systemen mit logind musst du `sway` einige Capabilities geben: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway In Systemen ohne logind musst du `sway` das suid-Flag geben: diff --git a/README.fr.md b/README.fr.md index 060ae0632..47b6c4101 100644 --- a/README.fr.md +++ b/README.fr.md @@ -77,7 +77,7 @@ Exécutez ces commandes : Sur les systèmes avec logind, vous devez définir quelques caps sur le binaire : - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway Sur les systèmes sans logind, vous devez suid le binaire de sway : diff --git a/README.it.md b/README.it.md index 58b965d87..f5e0d8e2d 100644 --- a/README.it.md +++ b/README.it.md @@ -78,7 +78,7 @@ Esegui questi comandi: Per i sistemi con logind, devi impostare un paio di caps sull'eseguibile: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway Per i sistemi senza logind, devi cambiare i permessi (suid): diff --git a/README.ja.md b/README.ja.md index 3593df15d..2e8f9bfbc 100644 --- a/README.ja.md +++ b/README.ja.md @@ -68,7 +68,7 @@ _\*\*swaylockでのみ必要です_ logindを使用しているシステムでは、バイナリにいくつかのケーパビリティを設定する必要があります: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway logindを使用していないシステムでは、バイナリにsuidを設定する必要があります: diff --git a/README.md b/README.md index 33d52fb1e..2c5857915 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Run these commands: On systems with logind, you need to set a few caps on the binary: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway On systems without logind, you need to suid the sway binary: diff --git a/README.pt.md b/README.pt.md index 7d105e42c..b5ca132f2 100644 --- a/README.pt.md +++ b/README.pt.md @@ -84,7 +84,7 @@ Para compilar, execute estes comandos: Em sistemas com logind, configure as seguintes capacidades para o arquivo binário: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway Em sistemas sem logind, ative a *flag* de *suid* do arquivo binário: diff --git a/README.ru.md b/README.ru.md index 2a27247c0..4035b0fc9 100644 --- a/README.ru.md +++ b/README.ru.md @@ -77,7 +77,7 @@ _\*\*Требуется только для swaylock_ Если у вас logind: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway Иначе: diff --git a/README.uk.md b/README.uk.md index 7cb3b95f7..2e107afc5 100644 --- a/README.uk.md +++ b/README.uk.md @@ -85,7 +85,7 @@ _\*\*Лише для swaylock_ На системах **з** logind, варто встановити декілька можливостей (caps) на виконуваний файл sway: - sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/bin/sway + sudo setcap "cap_sys_ptrace,cap_sys_tty_config=eip" /usr/local/bin/sway На системах **без** logind, необхідно встановити біт SUID на виконуваний файл sway: From 501c788f5f2a4a4b20ca8bd73bc2c3d06b5fc6a8 Mon Sep 17 00:00:00 2001 From: Adam Mizerski Date: Sun, 5 Nov 2017 20:09:16 +0100 Subject: [PATCH 12/14] Fix init_tray function declaration This fixes compilation failure: error: call to function 'init_tray' without a real prototype --- include/swaybar/tray/tray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/swaybar/tray/tray.h b/include/swaybar/tray/tray.h index b718e555b..2d0662bed 100644 --- a/include/swaybar/tray/tray.h +++ b/include/swaybar/tray/tray.h @@ -27,6 +27,6 @@ void tray_upkeep(struct bar *bar); /** * Initializes the tray with D-Bus */ -void init_tray(); +void init_tray(struct bar *bar); #endif /* _SWAYBAR_TRAY_H */ From 462390089827952303a8d98ff5ae552d7d93b3d0 Mon Sep 17 00:00:00 2001 From: Adam Mizerski Date: Sun, 5 Nov 2017 20:19:38 +0100 Subject: [PATCH 13/14] Dbus must be at least version 1.10 Function dbus_message_iter_get_element_count is available since 1.10. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf3732805..dc5215708 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ find_package(Cairo REQUIRED) find_package(Pango REQUIRED) find_package(GdkPixbuf) find_package(PAM) -find_package(DBus) +find_package(DBus 1.10) find_package(LibInput REQUIRED) From e677888b620d7e04b640b2f104161e2d1d28607c Mon Sep 17 00:00:00 2001 From: Adam Mizerski Date: Sun, 5 Nov 2017 20:24:57 +0100 Subject: [PATCH 14/14] Add dbus info to readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2c5857915..29e8a674f 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Install dependencies: * cairo * gdk-pixbuf2 * * pam ** +* dbus >= 1.10 *** * imagemagick (required for image capture with swaygrab) * ffmpeg (required for video capture with swaygrab) @@ -73,6 +74,8 @@ _\*Only required for swaybar, swaybg, and swaylock_ _\*\*Only required for swaylock_ +_\*\*\*Only required for tray support_ + Run these commands: mkdir build