New upstream version 2.13.c.1
Arnaud Rebillout
3 years ago
7 | 7 | PointerBindsToType: false |
8 | 8 | ColumnLimit: 0 |
9 | 9 | SpaceBeforeParens: ControlStatements |
10 | SortIncludes: false |
0 | 0 | name: Build Test |
1 | 1 | |
2 | on: | |
3 | push: | |
4 | branches: [ master ] | |
5 | pull_request: | |
6 | branches: [ master ] | |
7 | ||
2 | on: [push, pull_request] | |
8 | 3 | jobs: |
9 | 4 | build: |
10 | ||
11 | 5 | runs-on: ubuntu-latest |
12 | ||
13 | 6 | steps: |
14 | 7 | - uses: actions/checkout@v2 |
15 | - name: Install dependencies | |
8 | - name: Install deps | |
16 | 9 | 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 |
2 | 2 | tags |
3 | 3 | *.swp |
4 | 4 | *.gz |
5 | /pam/i3lock | |
5 | 6 | |
6 | 7 | ################################################################################ |
7 | 8 | # https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore |
29 | 30 | /install-sh |
30 | 31 | /missing |
31 | 32 | /stamp-h1 |
33 | *.in~ | |
34 | pam/i3lock |
6 | 6 | compiler: |
7 | 7 | - gcc |
8 | 8 | - clang |
9 | addons: | |
10 | apt: | |
11 | packages: | |
12 | - clang-format-3.5 | |
13 | 9 | script: |
14 | - clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false) | |
15 | 10 | - 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)' | |
16 | 12 | - 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 | ||
0 | 10 | 2019-07-21 i3lock 2.12 |
1 | 11 | |
2 | 12 | • remove stray \n from error messages |
0 | 0 | Copyright © 2010-2011, Michael Stapelberg |
1 | 1 | Copyright © 2015, Cassandra Fox |
2 | Copyright © 2015, Raymond Li | |
2 | Copyright © 2020, Raymond Li | |
3 | 3 | All rights reserved. |
4 | 4 | |
5 | 5 | Redistribution and use in source and binary forms, with or without |
0 | # i3lock - improved screen locker | |
0 | # i3lock-color | |
1 | 1 | |
2 | 2 | ![Language count](https://img.shields.io/github/languages/count/Raymo111/i3lock-color) |
3 | 3 | ![Top language](https://img.shields.io/github/languages/top/Raymo111/i3lock-color) |
18 | 18 | ![GitHub watchers](https://img.shields.io/github/watchers/Raymo111/i3lock-color) |
19 | 19 | ![Maintenance](https://img.shields.io/maintenance/yes/2020) |
20 | 20 | |
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.** | |
22 | 23 | |
23 | 24 | ![i3lock-color in action](screenshot.png "Screenshot sample") |
24 | 25 | |
57 | 58 | ## Dependencies |
58 | 59 | The following dependencies will need to be installed for a successful build, depending on your OS/distro. |
59 | 60 | |
60 | ### Ubuntu 18.04 LTS | |
61 | ### Ubuntu 18/20.04 LTS | |
61 | 62 | Run this command to install all dependencies: |
62 | 63 | ``` |
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 | |
64 | 65 | ``` |
65 | 66 | |
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 | |
67 | 74 | - autoconf |
68 | 75 | - cairo |
69 | 76 | - fontconfig |
77 | - gcc | |
70 | 78 | - libev |
71 | 79 | - libjpeg-turbo |
72 | 80 | - libxinerama |
77 | 85 | - xcb-util-image |
78 | 86 | - xcb-util-xrm |
79 | 87 | |
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 | ||
80 | 95 | ## Building i3lock-color |
81 | 96 | 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). |
82 | 97 | |
84 | 99 | |
85 | 100 | **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. |
86 | 101 | |
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: | |
88 | 103 | ``` |
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 | |
91 | 116 | ``` |
92 | 117 | You may choose to modify the script based on your needs/OS/distro. |
93 | 118 | |
106 | 131 | |
107 | 132 | On OpenBSD the `i3lock` binary needs to be setgid `auth` to call the authentication helpers, e.g. `/usr/libexec/auth/login_passwd`. |
108 | 133 | |
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 | ||
109 | 137 | ## Upstream |
110 | 138 | 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 PUBLIC KEY BLOCK----- | |
17 | ||
18 | mQINBF3PSOoBEADQP/vqo3XMOntXWo/IOy0jDCicWycWbwU1UfsZYt4MNAf1/M6t | |
19 | yBEKt+U94diDoD4JDDaWPdbHEyQ/6AqRqzUO+dcO19pmFc5p0nj4sPQ+iMJ95I63 | |
20 | FW3ZSq//1vf33sNWA773YBJOD0s02dDtuCriUd+06zHXd92+9Vm+wvsP0yaPUC3g | |
21 | KVgN9IcdKYS6HsBuncfBFVzE/wf9BL3YHwvGgqS+XcQ2mPizy6Ddc/zXfn43zXLT | |
22 | Q/nYb7Gt34EdP2J31ypuLFrVE3oSA9hK4SSvV8Z4INRELYhSjLVYt9S/NuhpIo8T | |
23 | wOirZFKVfeBvtoog0LX1isFmGdje3ML20IH9bOqp7UcmsXbYqmza3xrOUdHQpqe2 | |
24 | Idz5O3XOrlcqcVbeeNNcqeUBr/u5XScYGIyDr9+b4utis/PxnqE6hoiwSrwsLZ6Q | |
25 | QYHcsR+rwLujfxQf3k1emMLkrS+sd61WFGB4ZAvHpdpNtfym/c5g+CTA2SEjhM7+ | |
26 | g0qvT9guEhLk/mEgtXvCCkcESAIZMnk1xUkXldqofl5Vr8r2B6oEw2hmwwcTJrHJ | |
27 | 4x9IfcgrJDlyxcUQJ2UJzmtn/D6L7OdG465cdVZ+8QQRmf4IQV+6SXEqb1s9hFDj | |
28 | sahJIdgftDDYmgaEzNYz09z/obAgUho5stsW7Ah/D8C1DsfD3DMNs5IS7QARAQAB | |
29 | tCdSYXltb25kIExpICgoUmF5bW8xMTEpKSA8aGlAcmF5bW9uZC5saT6JAk4EEwEI | |
30 | ADgWIQRkwvsY4QR1Ip//JdHwWN+YLbQvnQUCXc9I6gIbLwULCQgHAgYVCgkICwIE | |
31 | FgIDAQIeAQIXgAAKCRDwWN+YLbQvndhCEAC1HRAXV2i6pQ6c6frCwAQSbMLiRiqd | |
32 | OYyipejmjkF04wm3Zb4MMfzSWLoVXbHcX8NX8+i/VjMBgoPyLd/XutdDD8qq1TVb | |
33 | paIbN+fIgniMMwW0X/8LRm6jqhlO8Z4igzExHF+GLG2NRMIhTaNdRp51x7Lc5iOu | |
34 | PgR8p1Ql5+vhIb9WdNUq2L74JW7BSqb1Xit86NtJI723gbg+Xwbv60uuzPHhd0bN | |
35 | jHHHJ1f9YSlPPZH5iMlBcl3iNoMfIbCp1G179IaK/sN5C4hPhVvy8GmoTlTIQ6If | |
36 | gs2x1xFwoIMlz8SFX4KJwnIIXZz6JBzpGRNIXV5fhwrzLpvY19iKh+JIHOtxcovy | |
37 | YjKOFe4+dOgBade29C+RyJ+i21cijTzsn8nE7COt49N3gXl+sXHUv4kSUVkGEmNY | |
38 | VtMLFJbjTxDxb/V25iWov23Gz9DhWcl/oCmCnLhi+7YZtmNpCbFrZSkGVq0VNfBE | |
39 | f6Mh96ugGbehg0tbbiLf0hdHMO0qi5DXP3Lfyy7Mw20YlOWiLqyTCs+HgVBXP783 | |
40 | n1SfQrswbObOj7z+Bg8iQvYwKhU2A6sgToROYeZ3mV4kuTEcqpJhfGBXD6xraUm1 | |
41 | kSg3Xc8A/3G1z34uHXGPb5sQx3eu+LbaSfDLTLObfy+ef+Z2fqt8Q8SVzTInnUQq | |
42 | k8K700ofB9zOw7kCDQRdz0jqARAAqfyjVbId7hc4tL9H0rpGr4A2NFdjvs7ktf9L | |
43 | 63/GtzyTJ5oFa2jOMtmU4PDbgwOAHXFZJEQ9etzPsIxZOrH0uuOO/5WPxu+n+mEz | |
44 | M+mnV6YA/wGu/IUKcbpOHMjinH6uaNlJ/PErJkHkGPCb97c/HFYROBoSBPtRW+8q | |
45 | Qdlaq4cccwE93pindt1aoE7nHFlsxuQG0s8fQ8qX7SgO2okve3OJnstADpcpMX5x | |
46 | VausXoGc3h6BQexaAnsIJ574ov5vNxFOHG/22RSsyf+Xd8MPqQv5Znk2lQD9EwzS | |
47 | m15jy008jpkV7kByZHDNuiTjxfrhkCy6gS3RlCgnKZlyTqkjuU1vQ12S/xXZJzwD | |
48 | IBfbxZQP9dfxYo4Pusd7bMlptkJTUmjr5JeLAcfNWyDTvwZ/ea+2gdrXedUYlYNS | |
49 | m984ZIwLjDxC/PjwXyURCTNamYibGgnMHwD8Fr2czszBQxwM/ThGkgN6fdwyvGzL | |
50 | AfeYAjZrZfTtA/OV7fpBR+hUAJcFJCSiHzIOyDlAMYVIaRnAfCGvCnE4ksUWP6so | |
51 | vBBLQsF+XmCw5GhzDC26UV3Cyu/bJ0AXKVYtoKungixjrhwcZ6icAXiAvF6ZtfnA | |
52 | xxqkgmm4lDbLJN9wbInhAVK5fiN+phbFDPgEorpyoxdsJtwmN0AAYHO+leBMFMfQ | |
53 | RsEkPLcAEQEAAYkEbAQYAQgAIBYhBGTC+xjhBHUin/8l0fBY35gttC+dBQJdz0jq | |
54 | AhsuAkAJEPBY35gttC+dwXQgBBkBCAAdFiEEs9q7pbmssSalH+X5oBTqibYruxsF | |
55 | Al3PSOoACgkQoBTqibYruxuEmg/8D06MiJ7G9hZpENphSl3YcfGYgmHIfCPdc+D4 | |
56 | mMO50ychMGPMDlsDHtVSpUbTrvPtzNlulYfREAm9LsuFQRvYHOVNQ9rbI7gEo3ga | |
57 | K4LrcCsYkG27TiMeiljgqN2qWHYJAHDdAPbmAEawCMo9Y3uiMvcs8Gt9lFjIiIa9 | |
58 | jfs+rBCw2yJwP2HlYjK7CyIgNvjiMjDbWNIeQY6ONlR+ojDR52bcPljyT4rQ+XTq | |
59 | t2/ArCwcFciX25EoQ4ncl5F44GqwWDkdpj8/HCfNQkRPN7nR9LGftyFCWUxZLZUQ | |
60 | Ux0Is6wubu0KxE3P1Xvz2HDhKZVBiR5P4TiC79CgSpENFyAvmCt4tnsnTu7UGYzj | |
61 | JWl/Lvi+dirC+THmOj00sbTzyKnMn7896hgSiKlgkl968JfTf4SsDmySftg+894f | |
62 | PZizZt8v3jjEy8oRvQ4S619Visz+3fxrM2mKbBXW33G+cWIyVkKqzUQgdI+itaO8 | |
63 | iLDP5HjMNSJd2VvvwswnJq0KnyMCRY2QzJ90E2FPTcl9Ltv1zEl16GqCWyQtSrma | |
64 | tEKZAFTdFVMwdLbggFlWnLx7qOfTs7nBIXGmfi25DmPcufNskmq8RiTSxXyFRBJS | |
65 | OMYP+xkxNR4JSOA+Clt20zclknX6HA9877vWy9Gnqm+gWu5PIfiDvxitQukc+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⏎ |
0 | 0 | #!/bin/bash |
1 | 1 | autoreconf -fiv |
2 | 2 | |
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; } | |
5 | 7 | |
6 | ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers | |
8 | ../configure --prefix=/usr --sysconfdir=/etc | |
7 | 9 | |
8 | 10 | make |
1 | 1 | # Run autoreconf -fi to generate a configure script from this file. |
2 | 2 | |
3 | 3 | 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]) | |
5 | 5 | # For AX_EXTEND_SRCDIR |
6 | 6 | AX_ENABLE_BUILDDIR |
7 | 7 | AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2]) |
65 | 65 | AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK |
66 | 66 | AC_FUNC_STRNLEN |
67 | 67 | 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]) | |
68 | 69 | |
69 | 70 | # Checks for libraries. |
70 | 71 | |
74 | 75 | AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])]) |
75 | 76 | |
76 | 77 | 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 | |
77 | 85 | |
78 | 86 | # Only disable PAM on OpenBSD where i3lock uses BSD Auth instead |
79 | 87 | case "$host" in |
7 | 7 | .fi |
8 | 8 | .. |
9 | 9 | |
10 | .TH i3lock-color 1 "JANUARY 2012" Linux "User Manuals" | |
10 | .TH i3lock-color 1 "JULY 2020" Linux "User Manuals" | |
11 | 11 | |
12 | 12 | .SH NAME |
13 | 13 | i3lock-color \- improved screen locker |
106 | 106 | .BI \-c\ rrggbbaa \fR,\ \fB\-\-color= rrggbbaa |
107 | 107 | Turn the screen into the given color instead of white. Color must be given in 4-byte |
108 | 108 | 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). | |
110 | 110 | |
111 | 111 | .TP |
112 | 112 | .B \-t, \-\-tiling |
147 | 147 | |
148 | 148 | .SH i3lock-color options |
149 | 149 | .TP |
150 | .B \-S=number, \-\-screen=number | |
150 | .B \-S number, \-\-screen=number | |
151 | 151 | Specifies which display to draw the unlock indicator and clock on. By default, they'll be placed on every screen. |
152 | 152 | Note that this number is zero indexed. The ordering is dependent on libxinerama. |
153 | 153 | |
154 | 154 | .TP |
155 | .B \-B=sigma, \-\-blur=sigma | |
155 | .B \-B sigma, \-\-blur=sigma | |
156 | 156 | Captures the screen and blurs it using the given sigma (radius). |
157 | 157 | Images may still be overlaid over the blurred screenshot. |
158 | 158 | As an alternative to this option, you could specify a translucent background color |
197 | 197 | .B \-\-pass\-power\-keys |
198 | 198 | Allow the following keys to be used while the screen is locked by passing them through: |
199 | 199 | 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. | |
200 | 205 | |
201 | 206 | .TP |
202 | 207 | .B \-\-insidevercolor=rrggbbaa |
336 | 341 | |
337 | 342 | .TP |
338 | 343 | .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. | |
340 | 345 | |
341 | 346 | .TP |
342 | 347 | .B \-\-refresh\-rate=seconds\-as\-double |
458 | 463 | |
459 | 464 | Pandora <pandora at techfo dot xyz> |
460 | 465 | |
461 | Raymond Li <hi at raymond.li> | |
466 | Raymond Li <i3lock-color at raymond.li> |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | 4 | * © 2015 Cassandra Fox |
5 | * © 2020 Raymond Li | |
5 | 6 | * |
6 | 7 | * See LICENSE for licensing information |
7 | 8 | * |
16 | 17 | #include <stdlib.h> |
17 | 18 | #include <pwd.h> |
18 | 19 | #include <sys/types.h> |
19 | #include <string.h> | |
20 | 20 | #include <dirent.h> |
21 | 21 | #include <unistd.h> |
22 | 22 | #include <stdbool.h> |
43 | 43 | #include <xkbcommon/xkbcommon-x11.h> |
44 | 44 | #include <cairo.h> |
45 | 45 | #include <cairo/cairo-xcb.h> |
46 | #ifdef __OpenBSD__ | |
46 | #ifdef HAVE_EXPLICIT_BZERO | |
47 | 47 | #include <strings.h> /* explicit_bzero(3) */ |
48 | 48 | #endif |
49 | 49 | #include <xcb/xcb_aux.h> |
234 | 234 | bool pass_media_keys = false; |
235 | 235 | bool pass_screen_keys = false; |
236 | 236 | bool pass_power_keys = false; |
237 | bool pass_volume_keys = false; | |
237 | 238 | |
238 | 239 | // for the rendering thread, so we can clean it up |
239 | 240 | pthread_t draw_thread; |
294 | 295 | */ |
295 | 296 | static char* get_keylayoutname(int mode, xcb_connection_t* conn) { |
296 | 297 | 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; | |
298 | 300 | DEBUG("keylayout answer is: [%s]\n", answer); |
299 | 301 | switch (mode) { |
300 | 302 | case 1: |
301 | 303 | // 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) { | |
303 | 305 | if (answer[i] == '(') { |
304 | 306 | if (i != 0 && answer[i - 1] == ' ') { |
305 | 307 | answer[i - 1] = '\0'; |
312 | 314 | } |
313 | 315 | break; |
314 | 316 | case 2: |
315 | for(int i = 0; answer[i] != '\0'; ++i) { | |
317 | for (int i = 0; answer[i] != '\0'; ++i) { | |
316 | 318 | if (answer[i] == '(') { |
317 | 319 | newans = &answer[i + 1]; |
320 | substringStart = i + 1; | |
318 | 321 | } else if (answer[i] == ')' && newans != NULL) { |
319 | 322 | answer[i] = '\0'; |
323 | substringEnd = i; | |
320 | 324 | break; |
321 | 325 | } |
322 | 326 | } |
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 | } | |
325 | 334 | break; |
326 | 335 | case 0: |
327 | 336 | // fall through |
402 | 411 | * |
403 | 412 | */ |
404 | 413 | static void clear_password_memory(void) { |
405 | #ifdef __OpenBSD__ | |
414 | #ifdef HAVE_EXPLICIT_BZERO | |
406 | 415 | /* Use explicit_bzero(3) which was explicitly designed not to be |
407 | 416 | * optimized out by the compiler. */ |
408 | 417 | explicit_bzero(password, strlen(password)); |
693 | 702 | case XKB_KEY_XF86PowerDown: |
694 | 703 | case XKB_KEY_XF86PowerOff: |
695 | 704 | 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: | |
696 | 716 | xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event); |
697 | 717 | return; |
698 | 718 | } |
880 | 900 | event->state_notify.baseGroup, |
881 | 901 | event->state_notify.latchedGroup, |
882 | 902 | 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(); | |
883 | 909 | break; |
884 | 910 | } |
885 | 911 | } |
890 | 916 | * and also redraw the image, if any. |
891 | 917 | * |
892 | 918 | */ |
893 | void handle_screen_resize(void) { | |
919 | static void handle_screen_resize(void) { | |
894 | 920 | xcb_get_geometry_cookie_t geomc; |
895 | 921 | xcb_get_geometry_reply_t *geom; |
896 | 922 | geomc = xcb_get_geometry(conn, screen->root); |
1202 | 1228 | |
1203 | 1229 | /* In the parent process, we exit */ |
1204 | 1230 | if (fork() != 0) |
1205 | exit(0); | |
1231 | exit(EXIT_SUCCESS); | |
1206 | 1232 | |
1207 | 1233 | ev_loop_fork(EV_DEFAULT); |
1208 | 1234 | } |
1329 | 1355 | d = opendir(path); |
1330 | 1356 | if (d == NULL) { |
1331 | 1357 | printf("Could not open directory: %s\n", path); |
1332 | exit(0); | |
1358 | exit(EXIT_SUCCESS); | |
1333 | 1359 | } |
1334 | 1360 | |
1335 | 1361 | while ((dir = readdir(d)) != NULL) { |
1465 | 1491 | {"pass-media-keys", no_argument, NULL, 601}, |
1466 | 1492 | {"pass-screen-keys", no_argument, NULL, 602}, |
1467 | 1493 | {"pass-power-keys", no_argument, NULL, 603}, |
1494 | {"pass-volume-keys", no_argument, NULL, 604}, | |
1468 | 1495 | |
1469 | 1496 | // bar indicator stuff |
1470 | 1497 | {"bar-indicator", no_argument, NULL, 700}, |
1494 | 1521 | err(EXIT_FAILURE, "getpwuid() failed"); |
1495 | 1522 | if ((username = pw->pw_name) == NULL) |
1496 | 1523 | 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"); | |
1497 | 1526 | |
1498 | 1527 | char *optstring = "hvnbdc:p:ui:tCeI:frsS:kB:m"; |
1499 | 1528 | char *arg = NULL; |
1500 | 1529 | int opt = 0; |
1530 | char padded[9] = "ffffffff"; \ | |
1501 | 1531 | |
1502 | 1532 | #define parse_color(acolor)\ |
1503 | 1533 | arg = optarg;\ |
1504 | 1534 | if (arg[0] == '#') arg++;\ |
1505 | 1535 | if (strlen(arg) == 6) {\ |
1506 | 1536 | /* If 6 digits given, assume RGB and pad 0xff for alpha */\ |
1507 | char padded[9] = "ffffffff"; \ | |
1508 | 1537 | strncpy( padded, arg, 6 );\ |
1509 | 1538 | arg = padded;\ |
1510 | 1539 | }\ |
1514 | 1543 | while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { |
1515 | 1544 | switch (o) { |
1516 | 1545 | 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"); | |
1518 | 1547 | case 'n': |
1519 | 1548 | dont_fork = true; |
1520 | 1549 | break; |
1587 | 1616 | |
1588 | 1617 | // Begin colors |
1589 | 1618 | case 'c': |
1590 | parse_color(color); | |
1619 | parse_color(color); | |
1591 | 1620 | break; |
1592 | 1621 | case 300: |
1593 | 1622 | parse_color(insidevercolor); |
1940 | 1969 | break; |
1941 | 1970 | case 603: |
1942 | 1971 | pass_power_keys = true; |
1972 | break; | |
1973 | case 604: | |
1974 | pass_volume_keys = true; | |
1943 | 1975 | break; |
1944 | 1976 | |
1945 | 1977 | // Bar indicator |
2078 | 2110 | if ((conn = xcb_connect(NULL, &screennr)) == NULL || |
2079 | 2111 | xcb_connection_has_error(conn)) |
2080 | 2112 | errx(EXIT_FAILURE, "Could not connect to X11, maybe you need to set DISPLAY?"); |
2081 | ||
2082 | ||
2083 | 2113 | |
2084 | 2114 | if (xkb_x11_setup_xkb_extension(conn, |
2085 | 2115 | XKB_X11_MIN_MAJOR_XKB_VERSION, |
7 | 7 | * This is important because xautolock (for example) closes stdout/stderr by |
8 | 8 | * default, so just printing something to stdout will lead to the data ending |
9 | 9 | * 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 | } \ | |
14 | 15 | } while (0) |
15 | 16 | |
16 | 17 | #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" |
32 | 32 | --indicator \ |
33 | 33 | --timestr="%H:%M:%S" \ |
34 | 34 | --datestr="%A, %m %Y" \ |
35 | --keylayout 2 \ | |
35 | --keylayout 1 \ | |
36 | 36 | |
37 | 37 | # --veriftext="Drinking verification can..." |
38 | 38 | # --wrongtext="Nope!" |
62 | 62 | # LICENSE |
63 | 63 | # |
64 | 64 | # Copyright (c) 2016 Michael Stapelberg <[email protected]> |
65 | # Copyright (c) 2020 Raymond Li <[email protected]> | |
65 | 66 | # |
66 | 67 | # Copying and distribution of this file, with or without modification, are |
67 | 68 | # permitted in any medium without royalty provided the copyright notice |
68 | 68 | # LICENSE |
69 | 69 | # |
70 | 70 | # Copyright (c) 2016 Michael Stapelberg <[email protected]> |
71 | # Copyright (c) 2020 Raymond Li <[email protected]> | |
71 | 72 | # |
72 | 73 | # Copying and distribution of this file, with or without modification, |
73 | 74 | # are permitted in any medium without royalty provided the copyright |
0 | 0 | # |
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. | |
3 | 4 | # |
4 | 5 | |
5 | auth include login | |
6 | #auth include system-auth # For Arch/Gentoo | |
7 | auth include login # For Debian |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | * © 2020 Raymond Li | |
4 | 5 | * |
5 | 6 | * See LICENSE for licensing information |
6 | 7 | * |
10 | 10 | # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. |
11 | 11 | |
12 | 12 | # 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), | |
14 | 14 | # lintian (for checking spelling errors), |
15 | 15 | # test suite dependencies (for running tests) |
16 | 16 | RUN apt-get update && \ |
18 | 18 | build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \ |
19 | 19 | libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \ |
20 | 20 | libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \ |
21 | libxkbcommon-x11-dev && \ | |
21 | libxkbcommon-x11-dev clang-format-9 && \ | |
22 | 22 | rm -rf /var/lib/apt/lists/* |
23 | 23 | |
24 | 24 | WORKDIR /usr/src |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | 3 | * © 2010 Michael Stapelberg |
4 | * © 2010 Cassandra Fox | |
4 | * © 2015 Cassandra Fox | |
5 | * © 2020 Raymond Li | |
5 | 6 | * |
6 | 7 | * See LICENSE for licensing information |
7 | 8 | * |
608 | 609 | te_expr *expr = te_compile(expression, variables, var_count, &te_err); |
609 | 610 | if (te_err) { |
610 | 611 | fprintf(stderr, "Failed to reason about '%s' given by '%s'\n", expression, from); |
611 | exit(1); | |
612 | exit(EXIT_FAILURE); | |
612 | 613 | } |
613 | 614 | return expr; |
614 | 615 | } |
792 | 793 | draw_data.mod_text.size = modifier_size; |
793 | 794 | draw_data.mod_text.font = get_font_face(WRONG_FONT); |
794 | 795 | draw_data.mod_text.align = modif_align; |
795 | ||
796 | 796 | draw_data.mod_text.color = wrong16; |
797 | 797 | } |
798 | 798 | |
894 | 894 | if (screen_number < 0 || screen_number > xr_screens) { |
895 | 895 | screen_number = 0; |
896 | 896 | } |
897 | ||
898 | DEBUG("Drawing indicator on %d screens\n", screen_number); | |
897 | 899 | |
898 | 900 | int current_screen = screen_number == 0 ? 0 : screen_number - 1; |
899 | 901 | const int end_screen = screen_number == 0 ? xr_screens : screen_number; |
0 | 0 | /* |
1 | 1 | * vim:ts=4:sw=4:expandtab |
2 | 2 | * |
3 | * © 2010 Michael Stapelberg | |
3 | * © 2010 Michael | |
4 | * @ © 2020 Raymond Li | |
4 | 5 | * |
5 | 6 | * xcb.c: contains all functions which use XCB to talk to X11. Mostly wrappers |
6 | 7 | * around the rather complicated/ugly parts of the XCB API. |
535 | 536 | } |
536 | 537 | |
537 | 538 | |
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 | ||
538 | 550 | char* xcb_get_key_group_names(xcb_connection_t *conn) { |
539 | 551 | uint8_t xkb_base_event; |
540 | 552 | uint8_t xkb_base_error; |
583 | 595 | |
584 | 596 | int length; |
585 | 597 | xcb_atom_t *iter; |
598 | uint8_t index; | |
586 | 599 | char* answer = NULL; |
587 | 600 | length = xcb_xkb_get_names_value_list_groups_length(reply, &list); |
588 | 601 | iter = xcb_xkb_get_names_value_list_groups(&list); |
602 | index = xcb_get_key_group_index(conn); | |
589 | 603 | |
590 | 604 | for (int i = 0; i < length; i++) { |
591 | 605 | xcb_atom_t group_name = *iter; |
592 | 606 | char* name = get_atom_name(conn, group_name); |
593 | 607 | DEBUG("group_name %d: %s\n", i, name); |
594 | if (i == 0) { | |
608 | if (i == index) { | |
595 | 609 | answer = name; |
596 | 610 | } else { |
597 | 611 | free(name); |