Codebase list i3lock-color / c49bb9e
New upstream version 2.13.c.1 Arnaud Rebillout 3 years ago
27 changed file(s) with 341 addition(s) and 75 deletion(s). Raw diff Collapse all Expand all
77 PointerBindsToType: false
88 ColumnLimit: 0
99 SpaceBeforeParens: ControlStatements
10 SortIncludes: false
0 # Auto detect text files and perform LF normalization
1 * text=auto
2
3 text eol=lf
0 # These are supported funding model platforms
1
2 github: [Raymo111]
00 name: Build Test
11
2 on:
3 push:
4 branches: [ master ]
5 pull_request:
6 branches: [ master ]
7
2 on: [push, pull_request]
83 jobs:
94 build:
10
115 runs-on: ubuntu-latest
12
136 steps:
147 - uses: actions/checkout@v2
15 - name: Install dependencies
8 - name: Install deps
169 run: sudo apt install pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
17 - name: autoreconf
18 run: autoreconf -fiv
19 - name: configure
20 run: ./configure --prefix=/usr --sysconfdir=/etc
21 - name: make
22 run: make
23 - name: make check
24 run: make check
25 - name: make distcheck
26 run: make distcheck
10 - run: chmod +x build.sh
11 - run: ./build.sh
12 - run: cd build && make check
13 - run: cd build && make distcheck
14 - name: Upload binary artifact
15 uses: actions/upload-artifact@v2
16 with:
17 name: i3lock
18 path: /home/runner/work/i3lock-color/i3lock-color/build/i3lock
19 - run: ./install-i3lock-color.sh
0 # For most projects, this workflow file will not need changing; you simply need
1 # to commit it to your repository.
2 #
3 # You may wish to alter this file to override the set of languages analyzed,
4 # or to provide custom queries or build logic.
5 name: "CodeQL"
6
7 on:
8 push:
9 branches: [master]
10 pull_request:
11 # The branches below must be a subset of the branches above
12 branches: [master]
13 schedule:
14 - cron: '0 16 * * 4'
15
16 jobs:
17 analyze:
18 name: Analyze
19 runs-on: ubuntu-latest
20
21 strategy:
22 fail-fast: false
23 matrix:
24 # Override automatic language detection by changing the below list
25 # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
26 language: ['cpp']
27 # Learn more...
28 # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
29
30 steps:
31 - name: Checkout repository
32 uses: actions/checkout@v2
33 with:
34 # We must fetch at least the immediate parents so that if this is
35 # a pull request then we can checkout the head.
36 fetch-depth: 2
37
38 # If this run was triggered by a pull request event, then checkout
39 # the head of the pull request instead of the merge commit.
40 - run: git checkout HEAD^2
41 if: ${{ github.event_name == 'pull_request' }}
42
43 # Initializes the CodeQL tools for scanning.
44 - name: Initialize CodeQL
45 uses: github/codeql-action/init@v1
46 with:
47 languages: ${{ matrix.language }}
48 # If you wish to specify custom queries, you can do so here or in a config file.
49 # By default, queries listed here will override any specified in a config file.
50 # Prefix the list here with "+" to use these queries and those in the config file.
51 # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
53 # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54 # If this step fails, then you should remove it and run the build manually (see below)
55 #- name: Autobuild
56 # uses: github/codeql-action/autobuild@v1
57
58 # ℹ️ Command-line programs to run using the OS shell.
59 # 📚 https://git.io/JvXDl
60
61 # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62 # and modify them (or add more) to build your code if your project
63 # uses a compiled language
64
65 - run: |
66 sudo apt install autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
67 ./build.sh
68
69 - name: Perform CodeQL Analysis
70 uses: github/codeql-action/analyze@v1
22 tags
33 *.swp
44 *.gz
5 /pam/i3lock
56
67 ################################################################################
78 # https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore
2930 /install-sh
3031 /missing
3132 /stamp-h1
33 *.in~
34 pam/i3lock
66 compiler:
77 - gcc
88 - clang
9 addons:
10 apt:
11 packages:
12 - clang-format-3.5
139 script:
14 - clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false)
1510 - docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile .
11 - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'clang-format-9 -i *.[ch] && git diff --exit-code || (echo "Code was not formatted using clang-format!"; false)'
1612 - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"'
0 2020-10-27 i3lock 2.13
1
2 • Throw error when trying to start on Wayland
3 • Use explicit_bzero() where available, not just on OpenBSD
4 • avoid pixmap allocations in the redraw path
5 • make --debug output go to stderr
6 • unlock_indicator.c: fix build failure against gcc-10
7 • fix: call pam_end in cleanup in main, not in event loop
8 • set _NET_WM_BYPASS_COMPOSITOR hint to avoid flickering
9
010 2019-07-21 i3lock 2.12
111
212 • remove stray \n from error messages
0 2.12.c.1-non-git
0 2.13.c.1
00 Copyright © 2010-2011, Michael Stapelberg
11 Copyright © 2015, Cassandra Fox
2 Copyright © 2015, Raymond Li
2 Copyright © 2020, Raymond Li
33 All rights reserved.
44
55 Redistribution and use in source and binary forms, with or without
0 # i3lock - improved screen locker
0 # i3lock-color
11
22 ![Language count](https://img.shields.io/github/languages/count/Raymo111/i3lock-color)
33 ![Top language](https://img.shields.io/github/languages/top/Raymo111/i3lock-color)
1818 ![GitHub watchers](https://img.shields.io/github/watchers/Raymo111/i3lock-color)
1919 ![Maintenance](https://img.shields.io/maintenance/yes/2020)
2020
21 **A modern version of i3lock with color functionality by [eBrnd](https://github.com/eBrnd/i3lock-color), maintained for a few years by [PandorasFox](https://github.com/PandorasFox) and now maintained and being developed by [Raymo111](https://github.com/Raymo111).**
21 ### The world's most popular non-default computer lockscreen.
22 **A modern version of i3lock with color functionality and other features.**
2223
2324 ![i3lock-color in action](screenshot.png "Screenshot sample")
2425
5758 ## Dependencies
5859 The following dependencies will need to be installed for a successful build, depending on your OS/distro.
5960
60 ### Ubuntu 18.04 LTS
61 ### Ubuntu 18/20.04 LTS
6162 Run this command to install all dependencies:
6263 ```
63 sudo apt install pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
64 sudo apt install autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
6465 ```
6566
66 ## Arch Linux
67 ### Debian
68 Replace `libxcb-util-dev` with `libxcb-util0-dev` in the Ubuntu installation command:
69 ```
70 sudo apt install autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev
71 ```
72
73 ### Arch Linux
6774 - autoconf
6875 - cairo
6976 - fontconfig
77 - gcc
7078 - libev
7179 - libjpeg-turbo
7280 - libxinerama
7785 - xcb-util-image
7886 - xcb-util-xrm
7987
88 ### Fedora
89 Run this command to install all dependencies:
90
91 ```sh
92 sudo dnf install -y autoconf automake cairo-devel fontconfig gcc libev-devel libjpeg-turbo-devel libXinerama libxkbcommon-devel libxkbcommon-x11-devel libXrandr pam-devel pkgconf xcb-util-image-devel xcb-util-xrm-devel
93 ```
94
8095 ## Building i3lock-color
8196 Before you build - check and see if there's a packaged version available for your distro (there usually is, either in a community repo/PPA).
8297
8499
85100 **If you want to build a non-debug version, you should tag your build before configuring.** For example: `git tag -f "git-$(git rev-parse --short HEAD)"` will add a tag with the short commit ID, which will be used for the version info. Issues asking about ASAN/complaints about i3lock-color being slow / etc will likely be closed. i3lock-color uses GNU autotools for building.
86101
87 To build i3lock-color, first install the dependencies listed above, then run:
102 To use i3lock-color, first install the dependencies listed above, then clone the repo:
88103 ```
89 chmod +x make.sh
90 ./make.sh
104 git clone https://github.com/Raymo111/i3lock-color.git
105 cd i3lock-color
106 ```
107 To build without installing, run:
108 ```
109 chmod +x build.sh
110 ./build.sh
111 ```
112 To install after building, run:
113 ```
114 chmod +x install-i3lock-color.sh
115 ./install-i3lock-color.sh
91116 ```
92117 You may choose to modify the script based on your needs/OS/distro.
93118
106131
107132 On OpenBSD the `i3lock` binary needs to be setgid `auth` to call the authentication helpers, e.g. `/usr/libexec/auth/login_passwd`.
108133
134 ## Contributors
135 This project was started by [eBrnd](https://github.com/eBrnd/i3lock-color), maintained for a few years by [PandorasFox](https://github.com/PandorasFox) and now maintained and being developed by [Raymo111](https://github.com/Raymo111). The full list of contributors can be found [here](https://github.com/Raymo111/i3lock-color/graphs/contributors).
136
109137 ## Upstream
110138 Please submit pull requests for i3lock things to https://github.com/i3/i3lock and pull requests for additional features on top of regular i3lock at https://github.com/Raymo111/i3lock-color.
0 # Security Policy
1
2 ## Supported Versions
3
4 Use this section to tell people about which versions of your project are
5 currently being supported with security updates.
6
7 | Version | Supported |
8 | ---------- | ------------------ |
9 | 2.12.c.5 | :white_check_mark: |
10 | < 2.12.c.5 | :x: |
11
12 ## Reporting a Vulnerability
13
14 If there's a severe security vulnerability in the latest version of i3lock-color, don't post a public issue. Either email me directly at [[email protected]](mailto:[email protected]?subject=i3lock-color%20security%20vulnerability), or encrypt the issue text with my PGP public key:
15 ```
16 -----BEGIN PGP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PIfiDvxitQukc+e5B
66 N3WQfnEUxQ/8CN1ncUHk4JlP25vjFS9/eK+yTqR8AEEr20DD0cSNvRtpjwiaIZaf
67 Up9SQTtz2RuqiIl7+Hak8VCAKvYWHXy5BjId73x5SfnT9wuic+/jAaUi+5Ypo/Lh
68 R/LfsWPsE1EGtmcmRwltNjxL32gpiD4LS7TuY5XVvmVBUh5185Y/t5WkP3kv4FB6
69 uA2g8kADHQbLtcpVc7c510Ru3MQ8HSmyGKO/3K++itNTST70RV36SOCNfG3WDSBD
70 yO8t2RKzH6Q+f4a2pWJafuknvvMsTf11YRZBBZUVF1XVTABtEu/fucbTMjVHh2gd
71 69iICS0KTL6sf6K3fclPQiqKIbCFgf/CGWUaAyzWBM8bWsxD2kywrdf1qY+UU1AF
72 vV+RmvVjcr1o3V6fZNDSlXET8w7jHjddTBstiCEK4aQCds6DDJU2+Ucqw5sqzwr3
73 9LKbph/uibQxJC/AYNMiCH5OHDknhnyAwNmn+KMXHyJkqGoqB5zXVfsxrHroEBHR
74 Sl77//DFlSl06lLee97HiSoKckpFrsmjpSbkQ+wFcb0x4lRbN5vRx8oUvagpGJ2D
75 mLhEcizl8EB9RwneaN6AfJg0BIikKpxl/K/gf7wr8fdsEgK0WIgCb60Ed8VEd9+l
76 rnKFFKw58bCu0PS5Uk6Lnb/jbbWOaB4ngOeOEGPoeT1vdDI6hkkEma4=
77 =HNQH
78 -----END PGP PUBLIC KEY BLOCK-----
79 ```
80 You can also get my key directly from the [GNUPG keyserver](http://keys.gnupg.net/pks/lookup?op=vindex&fingerprint=on&search=0xF058DF982DB42F9D).
0 theme: jekyll-theme-midnight
00 #!/bin/bash
11 autoreconf -fiv
22
3 rm -rf build/
4 mkdir -p build && cd build/
3 BUILD_DIR=build/
4 rm -rf $BUILD_DIR
5 mkdir -vp $BUILD_DIR
6 cd $BUILD_DIR || { echo "cd $BUILD_DIR"; exit 127; }
57
6 ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
8 ../configure --prefix=/usr --sysconfdir=/etc
79
810 make
11 # Run autoreconf -fi to generate a configure script from this file.
22
33 AC_PREREQ([2.69])
4 AC_INIT([i3lock-color], [2.12.c.1], [https://github.com/Raymo11/i3lock-color/issues])
4 AC_INIT([i3lock-color], [m4_esyscmd_s([cat I3LOCK_VERSION])], [https://github.com/Raymo11/i3lock-color/issues])
55 # For AX_EXTEND_SRCDIR
66 AX_ENABLE_BUILDDIR
77 AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2])
6565 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
6666 AC_FUNC_STRNLEN
6767 AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])])
68 AC_CHECK_FUNCS([explicit_bzero])
6869
6970 # Checks for libraries.
7071
7475 AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])])
7576
7677 AC_SEARCH_LIBS([shm_open], [rt])
78
79 # Use system-auth instead of login on Arch (TODO: Implement Gentoo as well)
80 if [[ -f /etc/arch-release ]]; then
81 echo "Using PAM for Arch"
82 sed -i "s/^#auth include system-auth/auth include system-auth/g" ../pam/i3lock
83 sed -i "s/^auth include login/#auth include login/g" ../pam/i3lock
84 fi
7785
7886 # Only disable PAM on OpenBSD where i3lock uses BSD Auth instead
7987 case "$host" in
77 .fi
88 ..
99
10 .TH i3lock-color 1 "JANUARY 2012" Linux "User Manuals"
10 .TH i3lock-color 1 "JULY 2020" Linux "User Manuals"
1111
1212 .SH NAME
1313 i3lock-color \- improved screen locker
106106 .BI \-c\ rrggbbaa \fR,\ \fB\-\-color= rrggbbaa
107107 Turn the screen into the given color instead of white. Color must be given in 4-byte
108108 format: rrggbbaa (i.e. ff0000ff is opaque red).
109 Use the last byte for alpha. Setting this below FF (i.e. ff000088) will allow your screen to be shown translucently if you use a compositor (e.g. compton, xcompmgr).
109 Use the last byte for alpha. Setting this below FF (i.e. ff000088) will allow your screen to be shown translucently if you use a compositor (e.g. compton, xcompmgr).
110110
111111 .TP
112112 .B \-t, \-\-tiling
147147
148148 .SH i3lock-color options
149149 .TP
150 .B \-S=number, \-\-screen=number
150 .B \-S number, \-\-screen=number
151151 Specifies which display to draw the unlock indicator and clock on. By default, they'll be placed on every screen.
152152 Note that this number is zero indexed. The ordering is dependent on libxinerama.
153153
154154 .TP
155 .B \-B=sigma, \-\-blur=sigma
155 .B \-B sigma, \-\-blur=sigma
156156 Captures the screen and blurs it using the given sigma (radius).
157157 Images may still be overlaid over the blurred screenshot.
158158 As an alternative to this option, you could specify a translucent background color
197197 .B \-\-pass\-power\-keys
198198 Allow the following keys to be used while the screen is locked by passing them through:
199199 XF86PowerDown, XF86PowerOff, XF86Sleep.
200
201 .TP
202 .B \-\-pass\-volume\-keys
203 Allow the following keys to be used while the screen is locked by passing them through:
204 XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume.
200205
201206 .TP
202207 .B \-\-insidevercolor=rrggbbaa
336341
337342 .TP
338343 .B \-\-greeterpos="x position:y position"
339 Sets the position for the date string. All the variables from \-\-indpos and \-\-timepos may be used.
344 Sets the position for the greeter string. All the variables from \-\-indpos and \-\-timepos may be used.
340345
341346 .TP
342347 .B \-\-refresh\-rate=seconds\-as\-double
458463
459464 Pandora <pandora at techfo dot xyz>
460465
461 Raymond Li <hi at raymond.li>
466 Raymond Li <i3lock-color at raymond.li>
22 *
33 * © 2010 Michael Stapelberg
44 * © 2015 Cassandra Fox
5 * © 2020 Raymond Li
56 *
67 * See LICENSE for licensing information
78 *
1617 #include <stdlib.h>
1718 #include <pwd.h>
1819 #include <sys/types.h>
19 #include <string.h>
2020 #include <dirent.h>
2121 #include <unistd.h>
2222 #include <stdbool.h>
4343 #include <xkbcommon/xkbcommon-x11.h>
4444 #include <cairo.h>
4545 #include <cairo/cairo-xcb.h>
46 #ifdef __OpenBSD__
46 #ifdef HAVE_EXPLICIT_BZERO
4747 #include <strings.h> /* explicit_bzero(3) */
4848 #endif
4949 #include <xcb/xcb_aux.h>
234234 bool pass_media_keys = false;
235235 bool pass_screen_keys = false;
236236 bool pass_power_keys = false;
237 bool pass_volume_keys = false;
237238
238239 // for the rendering thread, so we can clean it up
239240 pthread_t draw_thread;
294295 */
295296 static char* get_keylayoutname(int mode, xcb_connection_t* conn) {
296297 if (mode < 0 || mode > 2) return NULL;
297 char* newans = NULL, *answer = xcb_get_key_group_names(conn);
298 char *newans = NULL, *newans2 = NULL, *answer = xcb_get_key_group_names(conn);
299 int substringStart = 0, substringEnd = 0, size = 0;
298300 DEBUG("keylayout answer is: [%s]\n", answer);
299301 switch (mode) {
300302 case 1:
301303 // truncate the string at the first parens
302 for(int i = 0; answer[i] != '\0'; ++i) {
304 for (int i = 0; answer[i] != '\0'; ++i) {
303305 if (answer[i] == '(') {
304306 if (i != 0 && answer[i - 1] == ' ') {
305307 answer[i - 1] = '\0';
312314 }
313315 break;
314316 case 2:
315 for(int i = 0; answer[i] != '\0'; ++i) {
317 for (int i = 0; answer[i] != '\0'; ++i) {
316318 if (answer[i] == '(') {
317319 newans = &answer[i + 1];
320 substringStart = i + 1;
318321 } else if (answer[i] == ')' && newans != NULL) {
319322 answer[i] = '\0';
323 substringEnd = i;
320324 break;
321325 }
322326 }
323 if (newans != NULL)
324 answer = newans;
327 if (newans != NULL) {
328 size = sizeof(char) * (substringEnd - substringStart + 1);
329 newans2 = malloc(size);
330 memcpy(newans2, newans, size);
331 free(answer);
332 answer = newans2;
333 }
325334 break;
326335 case 0:
327336 // fall through
402411 *
403412 */
404413 static void clear_password_memory(void) {
405 #ifdef __OpenBSD__
414 #ifdef HAVE_EXPLICIT_BZERO
406415 /* Use explicit_bzero(3) which was explicitly designed not to be
407416 * optimized out by the compiler. */
408417 explicit_bzero(password, strlen(password));
693702 case XKB_KEY_XF86PowerDown:
694703 case XKB_KEY_XF86PowerOff:
695704 case XKB_KEY_XF86Sleep:
705 xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event);
706 return;
707 }
708 }
709
710 // volume keys
711 if (pass_volume_keys) {
712 switch(ksym) {
713 case XKB_KEY_XF86AudioMute:
714 case XKB_KEY_XF86AudioLowerVolume:
715 case XKB_KEY_XF86AudioRaiseVolume:
696716 xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event);
697717 return;
698718 }
880900 event->state_notify.baseGroup,
881901 event->state_notify.latchedGroup,
882902 event->state_notify.lockedGroup);
903 if (layout_text != NULL) {
904 free(layout_text);
905 layout_text = NULL;
906 }
907 layout_text = get_keylayoutname(keylayout_mode, conn);
908 redraw_screen();
883909 break;
884910 }
885911 }
890916 * and also redraw the image, if any.
891917 *
892918 */
893 void handle_screen_resize(void) {
919 static void handle_screen_resize(void) {
894920 xcb_get_geometry_cookie_t geomc;
895921 xcb_get_geometry_reply_t *geom;
896922 geomc = xcb_get_geometry(conn, screen->root);
12021228
12031229 /* In the parent process, we exit */
12041230 if (fork() != 0)
1205 exit(0);
1231 exit(EXIT_SUCCESS);
12061232
12071233 ev_loop_fork(EV_DEFAULT);
12081234 }
13291355 d = opendir(path);
13301356 if (d == NULL) {
13311357 printf("Could not open directory: %s\n", path);
1332 exit(0);
1358 exit(EXIT_SUCCESS);
13331359 }
13341360
13351361 while ((dir = readdir(d)) != NULL) {
14651491 {"pass-media-keys", no_argument, NULL, 601},
14661492 {"pass-screen-keys", no_argument, NULL, 602},
14671493 {"pass-power-keys", no_argument, NULL, 603},
1494 {"pass-volume-keys", no_argument, NULL, 604},
14681495
14691496 // bar indicator stuff
14701497 {"bar-indicator", no_argument, NULL, 700},
14941521 err(EXIT_FAILURE, "getpwuid() failed");
14951522 if ((username = pw->pw_name) == NULL)
14961523 errx(EXIT_FAILURE, "pw->pw_name is NULL.");
1524 if (getenv("WAYLAND_DISPLAY") != NULL)
1525 errx(EXIT_FAILURE, "i3lock is a program for X11 and does not work on Wayland. Try https://github.com/swaywm/swaylock instead");
14971526
14981527 char *optstring = "hvnbdc:p:ui:tCeI:frsS:kB:m";
14991528 char *arg = NULL;
15001529 int opt = 0;
1530 char padded[9] = "ffffffff"; \
15011531
15021532 #define parse_color(acolor)\
15031533 arg = optarg;\
15041534 if (arg[0] == '#') arg++;\
15051535 if (strlen(arg) == 6) {\
15061536 /* If 6 digits given, assume RGB and pad 0xff for alpha */\
1507 char padded[9] = "ffffffff"; \
15081537 strncpy( padded, arg, 6 );\
15091538 arg = padded;\
15101539 }\
15141543 while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) {
15151544 switch (o) {
15161545 case 'v':
1517 errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, © 2015 Cassandra Fox");
1546 errx(EXIT_SUCCESS, "version " I3LOCK_VERSION " © 2010 Michael Stapelberg, © 2015 Cassandra Fox, © 2020 Raymond Li");
15181547 case 'n':
15191548 dont_fork = true;
15201549 break;
15871616
15881617 // Begin colors
15891618 case 'c':
1590 parse_color(color);
1619 parse_color(color);
15911620 break;
15921621 case 300:
15931622 parse_color(insidevercolor);
19401969 break;
19411970 case 603:
19421971 pass_power_keys = true;
1972 break;
1973 case 604:
1974 pass_volume_keys = true;
19431975 break;
19441976
19451977 // Bar indicator
20782110 if ((conn = xcb_connect(NULL, &screennr)) == NULL ||
20792111 xcb_connection_has_error(conn))
20802112 errx(EXIT_FAILURE, "Could not connect to X11, maybe you need to set DISPLAY?");
2081
2082
20832113
20842114 if (xkb_x11_setup_xkb_extension(conn,
20852115 XKB_X11_MIN_MAJOR_XKB_VERSION,
77 * This is important because xautolock (for example) closes stdout/stderr by
88 * default, so just printing something to stdout will lead to the data ending
99 * up on the X11 socket (!). */
10 #define DEBUG(fmt, ...) \
11 do { \
12 if (debug_mode) \
13 printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \
10 #define DEBUG(fmt, ...) \
11 do { \
12 if (debug_mode) { \
13 fprintf(stderr, "[i3lock-debug] " fmt, ##__VA_ARGS__); \
14 } \
1415 } while (0)
1516
1617 #endif
0 #!/bin/bash
1 ./build.sh
2
3 cd build
4
5 sudo make install
6
7 sudo install -Dm644 ../LICENSE "/usr/share/licenses/i3lock-color/LICENSE"
3232 --indicator \
3333 --timestr="%H:%M:%S" \
3434 --datestr="%A, %m %Y" \
35 --keylayout 2 \
35 --keylayout 1 \
3636
3737 # --veriftext="Drinking verification can..."
3838 # --wrongtext="Nope!"
6262 # LICENSE
6363 #
6464 # Copyright (c) 2016 Michael Stapelberg <[email protected]>
65 # Copyright (c) 2020 Raymond Li <[email protected]>
6566 #
6667 # Copying and distribution of this file, with or without modification, are
6768 # permitted in any medium without royalty provided the copyright notice
6868 # LICENSE
6969 #
7070 # Copyright (c) 2016 Michael Stapelberg <[email protected]>
71 # Copyright (c) 2020 Raymond Li <[email protected]>
7172 #
7273 # Copying and distribution of this file, with or without modification,
7374 # are permitted in any medium without royalty provided the copyright
00 #
1 # PAM configuration file for the i3lock screen locker. By default, it includes
2 # the 'login' configuration file (see /etc/pam.d/login)
1 # PAM configuration file for the i3lock-color screen locker. By default, it includes
2 # the 'system-auth' configuration file (see /etc/pam.d/system-auth) for Arch and Gentoo
3 # and 'login' for Debian. Note that vanilla i3lock upstream uses 'login' instead.
34 #
45
5 auth include login
6 #auth include system-auth # For Arch/Gentoo
7 auth include login # For Debian
11 * vim:ts=4:sw=4:expandtab
22 *
33 * © 2010 Michael Stapelberg
4 * © 2020 Raymond Li
45 *
56 * See LICENSE for licensing information
67 *
1010 # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now.
1111
1212 # Install mk-build-deps (for installing the i3 build dependencies),
13 # clang and clang-format-3.8 (for checking formatting and building with clang),
13 # clang and clang-format-9 (for checking formatting and building with clang),
1414 # lintian (for checking spelling errors),
1515 # test suite dependencies (for running tests)
1616 RUN apt-get update && \
1818 build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \
1919 libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \
2020 libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \
21 libxkbcommon-x11-dev && \
21 libxkbcommon-x11-dev clang-format-9 && \
2222 rm -rf /var/lib/apt/lists/*
2323
2424 WORKDIR /usr/src
11 * vim:ts=4:sw=4:expandtab
22 *
33 * © 2010 Michael Stapelberg
4 * © 2010 Cassandra Fox
4 * © 2015 Cassandra Fox
5 * © 2020 Raymond Li
56 *
67 * See LICENSE for licensing information
78 *
608609 te_expr *expr = te_compile(expression, variables, var_count, &te_err);
609610 if (te_err) {
610611 fprintf(stderr, "Failed to reason about '%s' given by '%s'\n", expression, from);
611 exit(1);
612 exit(EXIT_FAILURE);
612613 }
613614 return expr;
614615 }
792793 draw_data.mod_text.size = modifier_size;
793794 draw_data.mod_text.font = get_font_face(WRONG_FONT);
794795 draw_data.mod_text.align = modif_align;
795
796796 draw_data.mod_text.color = wrong16;
797797 }
798798
894894 if (screen_number < 0 || screen_number > xr_screens) {
895895 screen_number = 0;
896896 }
897
898 DEBUG("Drawing indicator on %d screens\n", screen_number);
897899
898900 int current_screen = screen_number == 0 ? 0 : screen_number - 1;
899901 const int end_screen = screen_number == 0 ? xr_screens : screen_number;
00 /*
11 * vim:ts=4:sw=4:expandtab
22 *
3 * © 2010 Michael Stapelberg
3 * © 2010 Michael
4 * @ © 2020 Raymond Li
45 *
56 * xcb.c: contains all functions which use XCB to talk to X11. Mostly wrappers
67 * around the rather complicated/ugly parts of the XCB API.
535536 }
536537
537538
539 uint8_t xcb_get_key_group_index(xcb_connection_t *conn) {
540 xcb_xkb_get_state_cookie_t cookie;
541 xcb_xkb_get_state_reply_t* reply = NULL;
542 cookie = xcb_xkb_get_state(conn, XCB_XKB_ID_USE_CORE_KBD);
543 reply = xcb_xkb_get_state_reply(conn, cookie, NULL);
544 uint8_t ans = reply->group;
545 free(reply);
546 return ans;
547 }
548
549
538550 char* xcb_get_key_group_names(xcb_connection_t *conn) {
539551 uint8_t xkb_base_event;
540552 uint8_t xkb_base_error;
583595
584596 int length;
585597 xcb_atom_t *iter;
598 uint8_t index;
586599 char* answer = NULL;
587600 length = xcb_xkb_get_names_value_list_groups_length(reply, &list);
588601 iter = xcb_xkb_get_names_value_list_groups(&list);
602 index = xcb_get_key_group_index(conn);
589603
590604 for (int i = 0; i < length; i++) {
591605 xcb_atom_t group_name = *iter;
592606 char* name = get_atom_name(conn, group_name);
593607 DEBUG("group_name %d: %s\n", i, name);
594 if (i == 0) {
608 if (i == index) {
595609 answer = name;
596610 } else {
597611 free(name);