├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── ci └── script.sh └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | 3 | cache: cargo 4 | 5 | git: 6 | depth: 1 7 | 8 | env: 9 | global: 10 | - NAME=swaylock-blur 11 | 12 | matrix: 13 | include: 14 | - env: TARGET=x86_64-unknown-linux-gnu 15 | os: linux 16 | 17 | install: true 18 | script: ./ci/script.sh 19 | 20 | deploy: 21 | provider: releases 22 | api_key: $GITHUB_TOKEN 23 | file_glob: true 24 | file: "./*.tar.gz" 25 | skip_cleanup: true 26 | on: 27 | tags: true 28 | 29 | if: tag IS present 30 | 31 | notifications: 32 | email: 33 | on_success: never 34 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased] 8 | 9 | ## [0.3.1] 10 | 11 | ### Changed 12 | 13 | - Change ffmpeg loglevel to 'fatal' [#2] 14 | 15 | ## [0.3.0] 16 | 17 | ### Added 18 | 19 | - Add `blur-sigma` option which allows for adjusting bluriness 20 | 21 | ### Changed 22 | 23 | - Switch from imagemagick to ffmpeg 24 | - swaylock arguments have to be preceeded by `--` now 25 | 26 | [#2]: https://github.com/cjbassi/swaylock-blur/pull/2 27 | 28 | [Unreleased]: https://github.com/cjbassi/swaylock-blur/compare/0.3.0...HEAD 29 | [0.3.0]: https://github.com/cjbassi/swaylock-blur/compare/0.2.1...0.3.0 30 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "ansi_term" 3 | version = "0.11.0" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | dependencies = [ 6 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 7 | ] 8 | 9 | [[package]] 10 | name = "atty" 11 | version = "0.2.11" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | dependencies = [ 14 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 15 | "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 16 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 17 | ] 18 | 19 | [[package]] 20 | name = "autocfg" 21 | version = "0.1.2" 22 | source = "registry+https://github.com/rust-lang/crates.io-index" 23 | 24 | [[package]] 25 | name = "bitflags" 26 | version = "1.0.4" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | 29 | [[package]] 30 | name = "byteorder" 31 | version = "1.3.1" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | 34 | [[package]] 35 | name = "cfg-if" 36 | version = "0.1.6" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | 39 | [[package]] 40 | name = "clap" 41 | version = "2.32.0" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | dependencies = [ 44 | "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 45 | "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 46 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 47 | "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 48 | "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 49 | "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 50 | "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", 51 | ] 52 | 53 | [[package]] 54 | name = "cloudabi" 55 | version = "0.0.3" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | dependencies = [ 58 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 59 | ] 60 | 61 | [[package]] 62 | name = "fuchsia-cprng" 63 | version = "0.1.1" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | 66 | [[package]] 67 | name = "heck" 68 | version = "0.3.1" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | dependencies = [ 71 | "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 72 | ] 73 | 74 | [[package]] 75 | name = "i3ipc" 76 | version = "0.10.0" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | dependencies = [ 79 | "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 80 | "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 81 | "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", 82 | "serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", 83 | ] 84 | 85 | [[package]] 86 | name = "itoa" 87 | version = "0.4.3" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | 90 | [[package]] 91 | name = "libc" 92 | version = "0.2.49" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | 95 | [[package]] 96 | name = "log" 97 | version = "0.4.6" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | dependencies = [ 100 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 101 | ] 102 | 103 | [[package]] 104 | name = "proc-macro2" 105 | version = "0.4.27" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | dependencies = [ 108 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 109 | ] 110 | 111 | [[package]] 112 | name = "quote" 113 | version = "0.6.11" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | dependencies = [ 116 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 117 | ] 118 | 119 | [[package]] 120 | name = "rand" 121 | version = "0.6.5" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | dependencies = [ 124 | "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 125 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 126 | "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 127 | "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 129 | "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 130 | "rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 131 | "rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 134 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 135 | ] 136 | 137 | [[package]] 138 | name = "rand_chacha" 139 | version = "0.1.1" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | dependencies = [ 142 | "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 143 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 144 | ] 145 | 146 | [[package]] 147 | name = "rand_core" 148 | version = "0.3.1" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | dependencies = [ 151 | "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 152 | ] 153 | 154 | [[package]] 155 | name = "rand_core" 156 | version = "0.4.0" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | 159 | [[package]] 160 | name = "rand_hc" 161 | version = "0.1.0" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | dependencies = [ 164 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 165 | ] 166 | 167 | [[package]] 168 | name = "rand_isaac" 169 | version = "0.1.1" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | dependencies = [ 172 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 173 | ] 174 | 175 | [[package]] 176 | name = "rand_jitter" 177 | version = "0.1.3" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | dependencies = [ 180 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 181 | "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 182 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 183 | ] 184 | 185 | [[package]] 186 | name = "rand_os" 187 | version = "0.1.2" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | dependencies = [ 190 | "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 191 | "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 192 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 193 | "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 194 | "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 195 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 196 | ] 197 | 198 | [[package]] 199 | name = "rand_pcg" 200 | version = "0.1.2" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | dependencies = [ 203 | "autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 204 | "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 205 | ] 206 | 207 | [[package]] 208 | name = "rand_xorshift" 209 | version = "0.1.1" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | dependencies = [ 212 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 213 | ] 214 | 215 | [[package]] 216 | name = "rdrand" 217 | version = "0.4.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | dependencies = [ 220 | "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 221 | ] 222 | 223 | [[package]] 224 | name = "redox_syscall" 225 | version = "0.1.51" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | 228 | [[package]] 229 | name = "redox_termios" 230 | version = "0.1.1" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | dependencies = [ 233 | "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", 234 | ] 235 | 236 | [[package]] 237 | name = "remove_dir_all" 238 | version = "0.5.1" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | dependencies = [ 241 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 242 | ] 243 | 244 | [[package]] 245 | name = "ryu" 246 | version = "0.2.7" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | 249 | [[package]] 250 | name = "serde" 251 | version = "1.0.88" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | 254 | [[package]] 255 | name = "serde_json" 256 | version = "1.0.38" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | dependencies = [ 259 | "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 260 | "ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", 261 | "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", 262 | ] 263 | 264 | [[package]] 265 | name = "strsim" 266 | version = "0.7.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | 269 | [[package]] 270 | name = "structopt" 271 | version = "0.2.15" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | dependencies = [ 274 | "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", 275 | "structopt-derive 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", 276 | ] 277 | 278 | [[package]] 279 | name = "structopt-derive" 280 | version = "0.2.15" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | dependencies = [ 283 | "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 284 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 285 | "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", 286 | "syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)", 287 | ] 288 | 289 | [[package]] 290 | name = "swaylock-blur" 291 | version = "0.3.1" 292 | dependencies = [ 293 | "i3ipc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 294 | "structopt 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", 295 | "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", 296 | ] 297 | 298 | [[package]] 299 | name = "syn" 300 | version = "0.15.29" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | dependencies = [ 303 | "proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)", 304 | "quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", 305 | "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 306 | ] 307 | 308 | [[package]] 309 | name = "tempfile" 310 | version = "3.0.7" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | dependencies = [ 313 | "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 314 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 315 | "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", 316 | "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", 317 | "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 318 | "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 319 | ] 320 | 321 | [[package]] 322 | name = "termion" 323 | version = "1.5.1" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | dependencies = [ 326 | "libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)", 327 | "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", 328 | "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 329 | ] 330 | 331 | [[package]] 332 | name = "textwrap" 333 | version = "0.10.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | dependencies = [ 336 | "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 337 | ] 338 | 339 | [[package]] 340 | name = "unicode-segmentation" 341 | version = "1.2.1" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | 344 | [[package]] 345 | name = "unicode-width" 346 | version = "0.1.5" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | 349 | [[package]] 350 | name = "unicode-xid" 351 | version = "0.1.0" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | 354 | [[package]] 355 | name = "vec_map" 356 | version = "0.8.1" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | 359 | [[package]] 360 | name = "winapi" 361 | version = "0.3.6" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | dependencies = [ 364 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 365 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 366 | ] 367 | 368 | [[package]] 369 | name = "winapi-i686-pc-windows-gnu" 370 | version = "0.4.0" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | 373 | [[package]] 374 | name = "winapi-x86_64-pc-windows-gnu" 375 | version = "0.4.0" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | 378 | [metadata] 379 | "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 380 | "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" 381 | "checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" 382 | "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" 383 | "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" 384 | "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" 385 | "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" 386 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 387 | "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 388 | "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" 389 | "checksum i3ipc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "56d3a38784b5a66229b203a56e0867fc6a5607653e6cb26858623f5451d6f624" 390 | "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" 391 | "checksum libc 0.2.49 (registry+https://github.com/rust-lang/crates.io-index)" = "413f3dfc802c5dc91dc570b05125b6cda9855edfaa9825c9849807876376e70e" 392 | "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" 393 | "checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915" 394 | "checksum quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "cdd8e04bd9c52e0342b406469d494fcb033be4bdbe5c606016defbb1681411e1" 395 | "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 396 | "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 397 | "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 398 | "checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" 399 | "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 400 | "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 401 | "checksum rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b9ea758282efe12823e0d952ddb269d2e1897227e464919a554f2a03ef1b832" 402 | "checksum rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b7c690732391ae0abafced5015ffb53656abfaec61b342290e5eb56b286a679d" 403 | "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 404 | "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 405 | "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 406 | "checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85" 407 | "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" 408 | "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" 409 | "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" 410 | "checksum serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "9f301d728f2b94c9a7691c90f07b0b4e8a4517181d9461be94c04bddeb4bd850" 411 | "checksum serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "27dce848e7467aa0e2fcaf0a413641499c0b745452aaca1194d24dedde9e13c9" 412 | "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" 413 | "checksum structopt 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "3d0760c312538987d363c36c42339b55f5ee176ea8808bbe4543d484a291c8d1" 414 | "checksum structopt-derive 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "528aeb7351d042e6ffbc2a6fb76a86f9b622fdf7c25932798e7a82cb03bc94c6" 415 | "checksum syn 0.15.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1825685f977249735d510a242a6727b46efe914bb67e38d30c071b1b72b1d5c2" 416 | "checksum tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b86c784c88d98c801132806dadd3819ed29d8600836c4088e855cdf3e178ed8a" 417 | "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" 418 | "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" 419 | "checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1" 420 | "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" 421 | "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 422 | "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 423 | "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" 424 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 425 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 426 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swaylock-blur" 3 | version = "0.3.1" 4 | authors = ["Caleb Bassi "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | i3ipc = "0.10.0" 9 | structopt = "0.2.15" 10 | tempfile = "3.0.7" 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Caleb Bassi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Deprecated in favor of https://github.com/mortie/swaylock-effects. 2 | 3 | # swaylock-blur 4 | 5 | A small Rust program that runs [swaylock](https://github.com/swaywm/swaylock) and sets the image to a blurred screenshot of the desktop. 6 | 7 | Note: Only works on Sway. 8 | 9 | ## Usage 10 | 11 | The blur intensity can be set with the `--blur-sigma=uint` flag. 12 | 13 | Swaylock flags can be passed through by adding `--` followed by the flags. 14 | 15 | ## Installation 16 | 17 | Requires: 18 | - grim 19 | - ffmpeg 20 | - swaylock 21 | - sway 22 | 23 | ### Prebuilt binaries: 24 | 25 | Note: (currently only a binary for Linux-x86_64 is available) 26 | 27 | Run the following to download the correct binary for your system from the releases tab into `$CARGO_HOME/bin`, courtesy of [japaric/trust](https://github.com/japaric/trust): 28 | 29 | ```bash 30 | bash <(curl -LSfs https://japaric.github.io/trust/install.sh) \ 31 | -f --git cjbassi/swaylock-blur 32 | ``` 33 | 34 | ### From source: 35 | 36 | ```bash 37 | cargo install --git https://github.com/cjbassi/swaylock-blur 38 | ``` 39 | 40 | ### Arch Linux 41 | 42 | Available in the AUR using `swaylock-blur-bin`. 43 | -------------------------------------------------------------------------------- /ci/script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function main { 4 | rustup target add $TARGET 5 | cargo build --target $TARGET --release 6 | tar -czf $NAME-$TRAVIS_TAG-$TARGET.tar.gz -C ./target/$TARGET/release/ $NAME 7 | } 8 | 9 | main 10 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::process::Command; 3 | 4 | use i3ipc::I3Connection; 5 | use structopt::StructOpt; 6 | 7 | #[derive(StructOpt)] 8 | struct Args { 9 | #[structopt(long = "blur-sigma", default_value = "20")] 10 | blur_sigma: usize, 11 | 12 | /// Must be preceded by `--` 13 | swaylock_args: Vec, 14 | } 15 | 16 | fn main() { 17 | let args = Args::from_args(); 18 | 19 | let outputs: Vec = I3Connection::connect() 20 | .expect("failed to connect to i3/Sway ipc") 21 | .get_outputs() 22 | .expect("failed to get outputs") 23 | .outputs 24 | .into_iter() 25 | .filter(|output| output.active) 26 | .collect(); 27 | 28 | let temp_dir = tempfile::tempdir().expect("failed to create temp dir"); 29 | 30 | let mut swaylock_args = args.swaylock_args.clone(); 31 | 32 | outputs.iter().enumerate().for_each(|(i, output)| { 33 | let screenshot_path_string = temp_dir 34 | .path() 35 | .join(format!("{}.png", i)) 36 | .to_string_lossy() 37 | .to_string(); 38 | let blur_path_string = temp_dir 39 | .path() 40 | .join(format!("{}blur.png", i)) 41 | .to_string_lossy() 42 | .to_string(); 43 | File::create(&screenshot_path_string).expect("failed to create tempfile"); 44 | Command::new("grim") 45 | .args(&["-o", &output.name, &screenshot_path_string]) 46 | .status() 47 | .expect("failed to execute grim"); 48 | Command::new("ffmpeg") 49 | .args(&[ 50 | "-loglevel", 51 | "fatal", 52 | "-i", 53 | &screenshot_path_string, 54 | "-vf", 55 | &format!("gblur=sigma={}", args.blur_sigma), 56 | &blur_path_string, 57 | ]) 58 | .status() 59 | .expect("failed to execute ffmpeg"); 60 | swaylock_args.append(&mut vec![ 61 | "-i".to_string(), 62 | format!("{}:{}", &output.name, &blur_path_string), 63 | ]); 64 | }); 65 | 66 | Command::new("swaylock") 67 | .args(&mut swaylock_args) 68 | .status() 69 | .expect("failed to execute swaylock"); 70 | } 71 | --------------------------------------------------------------------------------