feat: add volume keyboard shortcuts with notification

This commit is contained in:
oddlama 2023-10-16 16:12:47 +02:00
parent 2fe5f11b14
commit 4d42043895
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
13 changed files with 525 additions and 11 deletions

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 512.00 512.00">
<path fill="#e3e6eb" d="
M 0.00 357.50
L 0.00 154.45
Q 2.01 141.43 12.46 137.51
Q 16.67 135.93 27.73 135.94
Q 60.67 135.95 93.66 135.97
Q 94.20 135.97 94.20 136.51
Q 94.23 178.02 94.20 219.41
C 94.20 225.86 94.55 231.27 100.49 233.95
Q 105.56 236.25 110.44 233.74
C 115.71 231.03 116.25 226.19 116.25 220.22
Q 116.24 177.10 116.25 133.99
A 1.00 0.99 -18.0 0 1 116.67 133.18
Q 201.95 74.29 287.23 15.46
C 298.07 7.98 314.81 13.20 319.59 25.60
Q 321.01 29.29 321.01 37.08
Q 321.02 254.66 321.01 472.25
Q 321.01 482.66 319.87 486.14
C 316.69 495.83 305.42 501.89 295.54 499.56
Q 291.63 498.63 284.83 493.96
Q 200.55 436.06 116.29 378.15
C 114.59 376.98 110.95 376.44 108.50 376.44
Q 68.03 376.39 27.56 376.45
Q 17.31 376.46 13.12 374.94
Q 2.10 370.96 0.00 357.50
Z
M 116.66 264.39
A 11.04 11.04 0.0 0 0 105.62 253.35
A 11.04 11.04 0.0 0 0 94.58 264.39
A 11.04 11.04 0.0 0 0 105.62 275.43
A 11.04 11.04 0.0 0 0 116.66 264.39
Z
M 101.20 289.42
C 92.66 292.75 92.41 303.46 99.14 309.02
C 106.39 314.99 116.47 309.71 116.49 300.56
C 116.49 295.62 114.44 291.28 109.65 289.39
Q 105.47 287.75 101.20 289.42
Z
M 115.7405 340.5434
A 10.89 10.83 19.1 0 0 108.9938 326.7462
A 10.89 10.83 19.1 0 0 95.1595 333.4166
A 10.89 10.83 19.1 0 0 101.9062 347.2138
A 10.89 10.83 19.1 0 0 115.7405 340.5434
Z"
/>
<path fill="#e3e6eb" d="
M 452.06 288.55
Q 445.96 301.88 437.19 309.92
C 430.30 316.24 417.95 311.82 418.36 301.67
C 418.61 295.62 423.44 292.44 426.74 287.92
C 441.45 267.84 440.21 239.98 424.01 221.29
Q 419.70 216.32 418.98 214.43
C 415.52 205.45 424.77 196.56 433.56 200.36
Q 436.44 201.61 440.12 205.66
C 460.76 228.43 464.67 260.98 452.06 288.55
Z"
/>
<circle fill="#e3e6eb" cx="389.19" cy="256.42" r="16.06"/>
</svg>

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1 @@
audio-sink-decrease.svg

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 512.00 512.00">
<path fill="#e3e6eb" d="
M 0.00 357.50
L 0.00 154.45
Q 2.01 141.43 12.46 137.51
Q 16.67 135.93 27.73 135.94
Q 60.67 135.95 93.66 135.97
Q 94.20 135.97 94.20 136.51
Q 94.23 178.02 94.20 219.41
C 94.20 225.86 94.55 231.27 100.49 233.95
Q 105.56 236.25 110.44 233.74
C 115.71 231.03 116.25 226.19 116.25 220.22
Q 116.24 177.10 116.25 133.99
A 1.00 0.99 -18.0 0 1 116.67 133.18
Q 201.95 74.29 287.23 15.46
C 298.07 7.98 314.81 13.20 319.59 25.60
Q 321.01 29.29 321.01 37.08
Q 321.02 254.66 321.01 472.25
Q 321.01 482.66 319.87 486.14
C 316.69 495.83 305.42 501.89 295.54 499.56
Q 291.63 498.63 284.83 493.96
Q 200.55 436.06 116.29 378.15
C 114.59 376.98 110.95 376.44 108.50 376.44
Q 68.03 376.39 27.56 376.45
Q 17.31 376.46 13.12 374.94
Q 2.10 370.96 0.00 357.50
Z
M 116.66 264.39
A 11.04 11.04 0.0 0 0 105.62 253.35
A 11.04 11.04 0.0 0 0 94.58 264.39
A 11.04 11.04 0.0 0 0 105.62 275.43
A 11.04 11.04 0.0 0 0 116.66 264.39
Z
M 101.20 289.42
C 92.66 292.75 92.41 303.46 99.14 309.02
C 106.39 314.99 116.47 309.71 116.49 300.56
C 116.49 295.62 114.44 291.28 109.65 289.39
Q 105.47 287.75 101.20 289.42
Z
M 115.7405 340.5434
A 10.89 10.83 19.1 0 0 108.9938 326.7462
A 10.89 10.83 19.1 0 0 95.1595 333.4166
A 10.89 10.83 19.1 0 0 101.9062 347.2138
A 10.89 10.83 19.1 0 0 115.7405 340.5434
Z"
/>
<path fill="#e3e6eb" d="
M 512.00 253.80
L 512.00 259.00
Q 510.12 309.82 476.77 346.75
Q 471.99 352.05 468.47 353.18
C 463.26 354.84 457.49 352.69 455.11 347.59
C 452.10 341.13 455.41 336.95 460.09 331.82
C 499.72 288.37 499.17 224.51 460.34 181.03
Q 455.27 175.35 454.45 172.86
C 451.52 163.92 461.13 155.60 469.56 159.57
Q 472.15 160.79 475.99 164.98
Q 510.17 202.26 512.00 253.80
Z"
/>
<path fill="#e3e6eb" d="
M 452.06 288.55
Q 445.94 301.92 437.19 309.92
C 430.21 316.31 417.73 311.71 418.38 301.41
C 418.75 295.51 423.58 292.26 426.83 287.80
C 441.45 267.72 440.17 239.93 424.01 221.29
Q 419.70 216.32 418.98 214.43
C 415.52 205.45 424.77 196.56 433.56 200.36
Q 436.44 201.61 440.12 205.66
C 460.76 228.43 464.67 260.98 452.06 288.55
Z"
/>
<circle fill="#e3e6eb" cx="389.19" cy="256.42" r="16.06"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 512.00 512.00">
<path fill="#e3e6eb" d="
M 0.00 357.50
L 0.00 154.45
Q 2.01 141.43 12.46 137.51
Q 16.67 135.93 27.73 135.94
Q 60.67 135.95 93.66 135.97
Q 94.20 135.97 94.20 136.51
Q 94.23 178.02 94.20 219.41
C 94.20 225.86 94.55 231.27 100.49 233.95
Q 105.56 236.25 110.44 233.74
C 115.71 231.03 116.25 226.19 116.25 220.22
Q 116.24 177.10 116.25 133.99
A 1.00 0.99 -18.0 0 1 116.67 133.18
Q 201.95 74.29 287.23 15.46
C 298.07 7.98 314.81 13.20 319.59 25.60
Q 321.01 29.29 321.01 37.08
Q 321.02 254.66 321.01 472.25
Q 321.01 482.66 319.87 486.14
C 316.69 495.83 305.42 501.89 295.54 499.56
Q 291.63 498.63 284.83 493.96
Q 200.55 436.06 116.29 378.15
C 114.59 376.98 110.95 376.44 108.50 376.44
Q 68.03 376.39 27.56 376.45
Q 17.31 376.46 13.12 374.94
Q 2.10 370.96 0.00 357.50
Z
M 116.66 264.39
A 11.04 11.04 0.0 0 0 105.62 253.35
A 11.04 11.04 0.0 0 0 94.58 264.39
A 11.04 11.04 0.0 0 0 105.62 275.43
A 11.04 11.04 0.0 0 0 116.66 264.39
Z
M 101.20 289.42
C 92.66 292.75 92.41 303.46 99.14 309.02
C 106.39 314.99 116.47 309.71 116.49 300.56
C 116.49 295.62 114.44 291.28 109.65 289.39
Q 105.47 287.75 101.20 289.42
Z
M 115.7405 340.5434
A 10.89 10.83 19.1 0 0 108.9938 326.7462
A 10.89 10.83 19.1 0 0 95.1595 333.4166
A 10.89 10.83 19.1 0 0 101.9062 347.2138
A 10.89 10.83 19.1 0 0 115.7405 340.5434
Z"
/>
<path fill="#e3e6eb" d="
M 446.22 279.89
A 6.11 6.10 -45.0 0 0 437.58 279.90
Q 419.99 297.54 401.25 316.17
Q 397.08 320.31 394.10 321.30
C 388.46 323.16 382.57 320.92 380.06 315.40
C 377.13 308.93 380.30 304.41 385.14 299.55
Q 403.69 280.95 421.24 263.45
A 6.06 6.06 0.0 0 0 421.24 254.87
Q 403.54 237.22 384.86 218.48
Q 381.06 214.68 379.99 212.34
C 375.61 202.82 385.58 192.93 395.09 197.27
Q 397.44 198.34 401.21 202.10
Q 420.06 220.92 437.71 238.59
A 5.93 5.93 0.0 0 0 446.10 238.58
Q 463.74 220.90 482.53 202.17
Q 486.37 198.34 488.73 197.26
C 498.27 192.91 508.24 202.88 503.79 212.41
Q 502.71 214.72 498.93 218.51
Q 480.19 237.29 462.59 254.86
A 6.09 6.08 45.0 0 0 462.59 263.47
Q 480.11 280.96 498.80 299.69
C 503.29 304.19 506.41 308.51 504.09 314.54
Q 502.05 319.86 496.56 321.44
C 490.76 323.10 486.87 320.51 482.59 316.23
Q 463.83 297.49 446.22 279.89
Z"
/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1 @@
audio-source-default.svg

View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 512.00 512.00">
<path fill="#e3e6eb" d="
M 250.78 0.00
L 261.31 0.00
C 310.89 2.85 351.36 35.02 366.14 81.90
Q 367.29 85.56 368.03 89.30
Q 368.15 89.86 367.57 89.86
Q 345.39 89.84 323.26 89.88
Q 316.61 89.90 313.48 91.31
C 301.98 96.51 302.46 113.42 313.92 118.55
Q 316.72 119.81 322.27 119.82
Q 346.40 119.89 370.54 119.85
Q 371.00 119.85 371.00 120.31
L 371.00 149.47
Q 371.00 149.96 370.51 149.96
Q 346.20 149.94 321.92 149.97
Q 316.91 149.98 314.26 151.10
C 301.88 156.33 302.01 174.04 314.64 178.90
Q 317.30 179.93 322.99 179.93
Q 346.72 179.95 370.46 179.96
Q 371.00 179.96 371.00 180.51
L 371.00 210.47
Q 371.00 210.94 370.52 210.94
Q 346.83 210.98 323.21 210.95
Q 317.00 210.94 314.00 212.24
C 304.70 216.25 302.03 228.36 308.86 235.90
Q 313.62 241.17 321.25 241.11
Q 345.81 240.92 370.38 240.95
Q 370.88 240.95 370.89 241.46
C 371.34 274.76 372.86 298.06 360.21 325.51
C 336.53 376.94 277.31 403.46 222.83 386.97
C 176.30 372.88 142.90 330.20 141.08 281.97
Q 140.75 273.10 141.10 241.53
Q 141.10 241.03 141.60 241.02
Q 166.60 240.87 191.49 240.80
C 207.82 240.75 213.05 219.25 198.43 212.36
Q 195.53 211.00 189.84 210.99
Q 165.67 210.94 141.49 210.96
Q 141.00 210.96 141.00 210.47
L 141.00 180.52
Q 141.00 179.99 141.53 179.99
Q 166.29 179.89 190.99 179.98
C 211.91 180.05 212.07 150.04 191.75 150.01
Q 166.61 149.98 141.47 149.93
Q 141.00 149.93 141.00 149.46
L 141.00 120.30
Q 141.00 119.85 141.45 119.85
Q 165.59 119.89 189.62 119.83
Q 195.20 119.81 198.15 118.46
C 209.92 113.07 209.85 96.11 197.99 91.24
Q 194.46 89.79 186.32 89.82
Q 165.27 89.90 144.18 89.84
A 0.34 0.33 6.7 0 1 143.85 89.43
C 155.83 38.76 198.37 3.24 250.78 0.00
Z"
/>
<path fill="#e3e6eb" d="
M 357.71 512.00
L 154.16 512.00
Q 145.77 510.19 142.61 503.62
C 138.89 495.88 142.09 486.55 150.21 483.27
Q 153.44 481.97 160.44 481.98
Q 200.48 482.04 240.50 481.98
Q 241.00 481.98 241.00 481.48
L 241.00 451.76
Q 241.00 451.23 240.47 451.18
C 155.27 443.39 88.04 375.26 81.54 290.24
C 80.38 275.07 80.97 257.49 81.01 241.16
A 1.15 1.14 0.2 0 0 79.86 240.01
Q 68.74 239.99 57.25 240.00
C 41.47 240.02 35.93 218.22 50.54 211.42
Q 53.53 210.03 59.68 210.02
Q 75.08 210.00 90.48 209.97
Q 98.86 209.96 102.30 211.46
C 109.99 214.82 111.03 221.42 111.01 229.72
Q 110.96 266.55 111.01 277.25
C 111.42 375.55 207.84 445.38 301.26 414.74
C 355.70 396.87 395.24 347.40 400.39 289.74
Q 400.98 283.18 401.00 269.75
Q 401.02 250.41 400.98 231.06
Q 400.96 222.12 402.49 218.64
C 405.79 211.15 412.26 209.95 420.40 209.95
Q 435.81 209.95 451.22 209.98
Q 458.33 209.99 461.56 211.43
C 473.38 216.69 472.40 234.74 460.06 239.06
Q 457.50 239.96 451.33 239.95
Q 441.41 239.93 431.47 239.96
A 0.55 0.55 0.0 0 0 430.93 240.52
Q 431.22 274.20 430.80 285.50
Q 429.61 316.76 415.97 347.75
C 390.51 405.61 335.10 445.21 271.53 451.18
Q 271.00 451.23 271.00 451.76
L 271.00 481.27
A 0.74 0.73 0.0 0 0 271.74 482.00
Q 312.57 481.99 352.89 482.01
Q 358.79 482.01 361.47 483.05
C 376.20 488.73 372.96 509.22 357.71 512.00
Z"
/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -0,0 +1 @@
audio-source-default.svg

View file

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0.00 0.00 512.00 512.00">
<path fill="#e3e6eb" d="
M 250.52 0.00
L 260.60 0.00
C 304.03 2.41 341.55 27.79 359.94 67.17
Q 360.16 67.64 359.79 68.02
L 338.27 89.53
A 1.18 1.15 22.2 0 1 337.41 89.88
Q 329.80 89.82 322.29 89.88
Q 316.13 89.92 312.94 91.35
C 302.86 95.87 301.58 109.66 310.34 116.70
A 0.48 0.47 42.3 0 1 310.38 117.41
L 206.47 221.35
Q 206.23 221.59 206.03 221.31
L 204.00 218.32
A 1.11 1.08 78.0 0 0 203.33 217.87
Q 202.66 217.72 202.82 217.04
Q 202.94 216.51 202.57 216.13
C 199.04 212.42 195.37 211.06 189.95 211.03
Q 165.28 210.93 140.67 211.02
A 0.33 0.32 0.0 0 1 140.34 210.70
L 140.36 180.38
Q 140.36 179.92 140.81 179.92
Q 165.73 179.81 190.52 179.72
Q 200.66 179.68 204.82 171.28
C 208.36 164.13 204.86 154.21 197.22 151.19
Q 194.17 149.99 187.11 150.00
Q 163.92 150.03 140.71 149.99
A 0.44 0.44 0.0 0 1 140.28 149.55
L 140.51 120.44
Q 140.51 119.88 141.07 119.88
Q 163.93 119.82 186.72 119.86
Q 194.17 119.87 197.12 118.72
C 209.72 113.76 209.20 94.70 196.35 90.66
Q 193.65 89.81 185.57 89.85
Q 164.67 89.95 143.77 89.81
Q 143.23 89.81 143.36 89.28
C 155.45 38.38 198.32 2.95 250.52 0.00
Z"
/>
<rect fill="#e3e6eb" x="-305.64" y="-15.00" transform="translate(243.14,248.30) rotate(-45.0)" width="611.28" height="30.00" rx="14.94"/>
<path fill="#e3e6eb" d="
M 370.45 185.36
L 370.45 210.70
A 0.30 0.30 0.0 0 1 370.15 211.00
L 344.81 211.00
A 0.30 0.30 0.0 0 1 344.59 210.49
L 369.94 185.14
A 0.30 0.30 0.0 0 1 370.45 185.36
Z"
/>
<path fill="#e3e6eb" d="
M 79.86 239.99
Q 71.12 239.87 57.50 240.00
C 40.75 240.16 34.99 218.06 50.33 211.27
Q 53.14 210.03 58.88 210.02
Q 74.77 210.00 90.67 209.98
Q 98.26 209.97 101.62 211.41
C 109.68 214.89 110.47 221.76 110.46 230.41
Q 110.43 253.45 110.46 276.50
Q 110.49 294.71 114.85 312.37
Q 114.97 312.83 114.63 313.17
L 91.53 336.28
Q 91.03 336.77 90.80 336.11
C 83.41 315.62 80.61 295.67 80.50 274.00
Q 80.41 257.30 80.45 240.59
Q 80.46 240.00 79.86 239.99
Z"
/>
<path fill="#e3e6eb" d="
M 357.13 512.00
L 153.64 512.00
Q 144.39 510.26 141.56 502.73
C 138.50 494.59 142.39 485.46 150.66 482.79
Q 153.17 481.98 159.92 481.99
Q 199.93 482.04 239.94 481.98
Q 240.44 481.98 240.44 481.49
L 240.44 451.76
Q 240.44 451.33 240.01 451.29
Q 185.94 446.04 144.10 411.81
Q 143.65 411.44 144.06 411.03
L 164.70 390.38
A 0.39 0.38 41.4 0 1 165.21 390.35
C 204.98 421.90 258.33 430.54 305.75 412.94
C 356.55 394.09 393.11 347.74 399.45 293.46
Q 400.30 286.16 400.38 273.51
Q 400.51 251.99 400.42 230.47
Q 400.39 222.10 401.87 218.72
C 404.93 211.75 410.87 210.01 418.50 209.99
Q 436.01 209.93 453.50 209.95
C 474.37 209.97 474.44 239.72 454.25 239.83
Q 442.58 239.89 430.91 240.01
Q 430.38 240.01 430.39 240.54
Q 430.64 273.76 430.24 285.00
Q 429.26 313.00 418.03 341.51
C 394.02 402.49 336.93 444.97 270.97 451.17
A 0.58 0.58 0.0 0 0 270.45 451.75
L 270.43 481.63
A 0.38 0.37 -90.0 0 0 270.80 482.01
Q 311.35 481.98 351.95 482.02
Q 358.74 482.02 361.82 483.44
C 369.50 486.96 372.50 496.32 368.69 503.96
Q 365.41 510.52 357.13 512.00
Z"
/>
<path fill="#e3e6eb" d="
M 140.57 286.22
L 140.29 241.39
A 0.42 0.42 0.0 0 1 140.71 240.97
L 185.89 240.91
A 0.42 0.42 0.0 0 1 186.19 241.63
L 141.29 286.51
A 0.42 0.42 0.0 0 1 140.57 286.22
Z"
/>
<path fill="#e3e6eb" d="
M 370.38 277.74
C 369.62 371.71 262.48 425.01 186.70 369.02
A 0.40 0.40 0.0 0 1 186.66 368.42
L 313.79 241.30
Q 314.08 241.00 314.50 241.00
L 369.96 241.00
Q 370.42 241.00 370.42 241.45
Q 370.52 259.68 370.38 277.74
Z"
/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -3,5 +3,6 @@ _final: prev: {
screenshot-area = prev.callPackage ./screenshot-area.nix {};
screenshot-area-scan-qr = prev.callPackage ./screenshot-area-scan-qr.nix {};
screenshot-screen = prev.callPackage ./screenshot-screen.nix {};
volume = prev.callPackage ./volume.nix {};
};
}

View file

@ -36,7 +36,7 @@ writeShellApplication {
${xclip}/bin/xclip -selection clipboard <<< "$DATA"
${libnotify}/bin/notify-send \
"🔍 QR Code scan" " $N codes detected\n📋 copied ''${#DATA} bytes" \
--hint="string:image-path:"${./assets/qr-scan.png} \
--hint="string:image-path:"${./assets}/qr-scan.png \
--hint="string:wired-tag:screenshot-$date" \
|| true
else
@ -44,14 +44,14 @@ writeShellApplication {
"4")
${libnotify}/bin/notify-send \
"🔍 QR Code scan" " 0 codes detected" \
--hint="string:image-path:"${./assets/qr-scan.png} \
--hint="string:image-path:"${./assets}/qr-scan.png \
--hint="string:wired-tag:screenshot-$date" \
|| true
;;
*)
${libnotify}/bin/notify-send \
"🔍 QR Code scan" " Error while processing image: zbarimg exited with code $?" \
--hint="string:image-path:"${./assets/qr-scan.png} \
--hint="string:image-path:"${./assets}/qr-scan.png \
--hint="string:wired-tag:screenshot-$date" \
|| true
;;

48
pkgs/scripts/volume.nix Normal file
View file

@ -0,0 +1,48 @@
{
writeShellApplication,
bc,
libnotify,
wireplumber,
}:
writeShellApplication {
name = "volume";
text = ''
set -euo pipefail
${wireplumber}/bin/wpctl "$1" "$2" "$3"
current_volume=$(${wireplumber}/bin/wpctl get-volume "$2")
case "''${2,,}" in
*"source"*) type=source ;;
*) type=sink ;;
esac
case "$3" in
*"%+") image=${./assets}/audio-"$type"-increase.svg ;;
*"%-") image=${./assets}/audio-"$type"-decrease.svg ;;
*) image=${./assets}/audio-"$type"-default.svg ;;
esac
value=$(grep -o '[0-9]\.[0-9]*' <<< "$current_volume" || echo 0.0)
value=$(${bc}/bin/bc <<< "scale=0; $value*100/1")
if grep -q MUTED <<< "$current_volume"; then
image=${./assets}/audio-"$type"-mute.svg
fi
if [[ "$value" -gt 100 ]]; then
note=volume-overdrive
indicator_value=$((value - 100))
else
note=volume
indicator_value="$value"
fi
${libnotify}/bin/notify-send \
"Volume" "$value%" \
--hint=string:image-path:"$image" \
--hint=int:value:"$indicator_value" \
--hint="string:wired-tag:indicator" \
--hint="string:wired-note:$note" \
--expire-time=1000 \
|| true
'';
}

View file

@ -66,13 +66,10 @@ in {
keybindings =
{
"XF86AudioRaiseVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec --no-startup-id wpctl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioMute" = "exec --no-startup-id wpctl set-sink-mute @DEFAULT_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id wpctl set-source-mute @DEFAULT_SOURCE@ toggle";
#"Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
#"${mod}+Print" = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot save area";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${getExe pkgs.scripts.volume} set-volume @DEFAULT_AUDIO_SINK@ 5%+";
"XF86AudioLowerVolume" = "exec --no-startup-id ${getExe pkgs.scripts.volume} set-volume @DEFAULT_AUDIO_SINK@ 5%-";
"XF86AudioMute" = "exec --no-startup-id ${getExe pkgs.scripts.volume} set-mute @DEFAULT_AUDIO_SINK@ toggle";
"XF86AudioMicMute" = "exec --no-startup-id ${getExe pkgs.scripts.volume} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
}
# // optionalAttrs useBacklight {
# "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";

View file

@ -547,6 +547,7 @@
(Not (Or [
(struct "Note" "brightness")
(struct "Note" "volume")
(struct "Note" "volume-overdrive")
]))
];
}
@ -576,11 +577,29 @@
];
}
# text extra
{}
{
text = "%b";
}
# progress extra
{
fill_color = colors.base0B;
})
(mkIndicatorValue "indicator" "volume_overdrive" "hint" {
render_criteria = [
(And [
(struct "Note" "volume-overdrive")
])
];
}
# text extra
{
text = "%b";
}
# progress extra
{
background_color = colors.base0B;
fill_color = colors.base0A;
})
]);
});
};