Pi66

walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs

← back to log

add autocomplete

author: pixel2175
date: 2025-06-03 20:53
hash: 40b8174e7d10444cfba513299f1080a225af9625

Diffstat:

M

Cargo.lock
46 ++++----

M

Makefile
1

A

autocomplete.sh
170 ++++++++++++++++++++++++++++++
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
diff --git a/Cargo.lock b/Cargo.lock
index c59528d..18acd8d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -92,9 +92,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"

 [[package]]
 name = "av1-grain"
-version = "0.2.3"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf"
+checksum = "4f3efb2ca85bc610acfa917b5aaa36f3fcbebed5b3182d7f877b02531c4b80c8"
 dependencies = [
  "anyhow",
  "arrayvec",
@@ -127,9 +127,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"

 [[package]]
 name = "bitflags"
-version = "2.9.0"
+version = "2.9.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
+checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"

 [[package]]
 name = "bitstream-io"
@@ -157,9 +157,9 @@ checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06"

 [[package]]
 name = "bytemuck"
-version = "1.22.0"
+version = "1.23.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540"
+checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c"

 [[package]]
 name = "byteorder"
@@ -175,9 +175,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"

 [[package]]
 name = "cc"
-version = "1.2.20"
+version = "1.2.25"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a"
+checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951"
 dependencies = [
  "jobserver",
  "libc",
@@ -340,9 +340,9 @@ dependencies = [

 [[package]]
 name = "getrandom"
-version = "0.3.2"
+version = "0.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
+checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
 dependencies = [
  "cfg-if",
  "libc",
@@ -372,9 +372,9 @@ dependencies = [

 [[package]]
 name = "hashbrown"
-version = "0.15.2"
+version = "0.15.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
+checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"

 [[package]]
 name = "heck"
@@ -466,7 +466,7 @@ version = "0.1.33"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
 dependencies = [
- "getrandom 0.3.2",
+ "getrandom 0.3.3",
  "libc",
 ]

@@ -888,7 +888,7 @@ version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
 dependencies = [
- "getrandom 0.3.2",
+ "getrandom 0.3.3",
 ]

 [[package]]
@@ -978,9 +978,9 @@ checksum = "a157657054ffe556d8858504af8a672a054a6e0bd9e8ee531059100c0fa11bb2"

 [[package]]
 name = "rustversion"
-version = "1.0.20"
+version = "1.0.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
+checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"

 [[package]]
 name = "serde"
@@ -1311,15 +1311,15 @@ dependencies = [

 [[package]]
 name = "weezl"
-version = "0.1.8"
+version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
+checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3"

 [[package]]
 name = "winnow"
-version = "0.7.7"
+version = "0.7.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5"
+checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec"
 dependencies = [
  "memchr",
 ]
@@ -1330,7 +1330,7 @@ version = "0.39.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
 dependencies = [
- "bitflags 2.9.0",
+ "bitflags 2.9.1",
 ]

 [[package]]
@@ -1370,9 +1370,9 @@ dependencies = [

 [[package]]
 name = "zune-jpeg"
-version = "0.4.14"
+version = "0.4.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99a5bab8d7dedf81405c4bb1f2b83ea057643d9cb28778cea9eecddeedd2e028"
+checksum = "b63fd466826ec8fe25e1fc010c169213fec4e135ac39caccdba830eaa3895923"
 dependencies = [
  "zune-core",
 ]
diff --git a/Makefile b/Makefile
index 7542e79..1faa9af 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,7 @@ install: build
    sudo install -m755 target/release/walrs /usr/bin/walrs
    sudo install -d ./templates/ /etc/walrs/templates
    sudo cp -r templates/ /etc/walrs/
+   bash ./autocomplete.sh
    sudo cp -r colorschemes/ /etc/walrs/

 uninstall:
diff --git a/autocomplete.sh b/autocomplete.sh
new file mode 100755
index 0000000..8593116
--- /dev/null
+++ b/autocomplete.sh
@@ -0,0 +1,170 @@
+#!/bin/bash
+
+# walrs Auto-completion Installer
+# Simple, single-file installer that detects shell using $SHELL
+
+set -e
+
+# Colors
+GREEN='\033[0;32m'
+RED='\033[0;31m'
+YELLOW='\033[1;33m'
+NC='\033[0m'
+
+
+# Check if walrs exists
+if ! command -v walrs &> /dev/null; then
+    echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>R</mi><mi>E</mi><mi>D</mi></mrow><mi>E</mi><mi>r</mi><mi>r</mi><mi>o</mi><mi>r</mi><mi>:</mi><mi>w</mi><mi>a</mi><mi>l</mi><mi>r</mi><mi>s</mi><mi>n</mi><mi>o</mi><mi>t</mi><mi>f</mi><mi>o</mi><mi>u</mi><mi>n</mi><mi>d</mi><mi>i</mi><mi>n</mi><mi>P</mi><mi>A</mi><mi>T</mi><mi>H</mi></mrow></math>{NC}"
+    exit 1
+fi
+
+# Get shell from $SHELL variable
+CURRENT_SHELL=<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>b</mi><mi>a</mi><mi>s</mi><mi>e</mi><mi>n</mi><mi>a</mi><mi>m</mi><mi>e</mi><mi>"</mi></mrow></math>SHELL")
+
+# Create completion based on shell
+case "$CURRENT_SHELL" in
+    "fish")
+        echo "Installing Fish completion..."
+        
+        # Create fish completions directory
+        mkdir -p ~/.config/fish/completions
+        
+        # Write fish completion file
+        cat > ~/.config/fish/completions/walrs.fish << 'EOF'
+# walrs completion for fish shell
+
+# Clear existing completions
+complete -c walrs -e
+
+# Basic flags
+complete -c walrs -s i -l image -d "path to image or wallpapers directory" -r -F
+complete -c walrs -s k -l backend -d "change the colors backend" -x -a "kmeans color_thief palette_extract all backends"
+complete -c walrs -s r -l reload -d "reload without changing the wallpaper"
+complete -c walrs -s R -l reload-no -d "reload with changing the wallpaper"  
+complete -c walrs -s t -l theme -d "use external theme file" -r -F
+complete -c walrs -s g -l generate -d "generate theme in themes folder" -x
+complete -c walrs -s s -l saturation -d "saturation value -128 to 127" -x
+complete -c walrs -s b -l brightness -d "brightness value -128 to 127" -x
+complete -c walrs -s q -l quit -d "set quit mode (no output)"
+complete -c walrs -s v -l version -d "show version"
+complete -c walrs -l help -d "display help"
+complete -c walrs -a help -d "display help"
+
+# Saturation and brightness numeric completion
+for i in (seq -128 127)
+    complete -c walrs -s s -l saturation -x -a "$i"
+    complete -c walrs -s b -l brightness -x -a "$i"
+end
+EOF
+        
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>G</mi><mi>R</mi><mi>E</mi><mi>E</mi><mi>N</mi></mrow><mi>F</mi><mi>i</mi><mi>s</mi><mi>h</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>l</mi><mi>e</mi><mi>d</mi><mi>t</mi><mi>o</mi><mi>:</mi><mtext>&#x000A0;</mtext><mo>&#x0002F;</mo><mo>&#x0002E;</mo><mi>c</mi><mi>o</mi><mi>n</mi><mi>f</mi><mi>i</mi><mi>g</mi><mo>&#x0002F;</mo><mi>f</mi><mi>i</mi><mi>s</mi><mi>h</mi><mo>&#x0002F;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>s</mi><mo>&#x0002F;</mo><mi>w</mi><mi>a</mi><mi>l</mi><mi>r</mi><mi>s</mi><mo>&#x0002E;</mo><mi>f</mi><mi>i</mi><mi>s</mi><mi>h</mi></mrow></math>{NC}"
+        ;;
+        
+    "zsh")
+        echo "Installing Zsh completion..."
+        
+        # Create zsh completions directory
+        mkdir -p ~/.zsh/completions
+        
+        # Write zsh completion file
+        cat > ~/.zsh/completions/_walrs << 'EOF'
+#compdef walrs
+
+_walrs() {
+    local context state line
+    typeset -A opt_args
+
+    _arguments \
+        '(-i --image)'{-i,--image}'[path to image or wallpapers directory]:image file:_files -g "*.{jpg,jpeg,png,bmp,gif,tiff,webp}(-.)"' \
+        '(-k --backend)'{-k,--backend}'[change the colors backend]:backend:(kmeans color_thief palette_extract all backends)' \
+        '(-r --reload)'{-r,--reload}'[reload without changing the wallpaper]' \
+        '(-R --reload-no)'{-R,--reload-no}'[reload with changing the wallpaper]' \
+        '(-t --theme)'{-t,--theme}'[use external theme file]:theme file:_files -g "*.json(-.)"' \
+        '(-g --generate)'{-g,--generate}'[generate theme in themes folder]:theme name:' \
+        '(-s --saturation)'{-s,--saturation}'[specify the saturation value -128 => 127]:saturation:({-128..127})' \
+        '(-b --brightness)'{-b,--brightness}'[specify the brightness value -128 => 127]:brightness:({-128..127})' \
+        '(-q --quit)'{-q,--quit}'[set quit mode (no output)]' \
+        '(-v --version)'{-v,--version}'[version]' \
+        '(--help)--help[display usage information]'
+}
+
+_walrs "$@"
+EOF
+        
+        # Add to fpath in .zshrc if not already there
+        if ! grep -q "fpath=(.*\.zsh/completions" ~/.zshrc 2>/dev/null; then
+            echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
+            echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>G</mi><mi>R</mi><mi>E</mi><mi>E</mi><mi>N</mi></mrow><mi>A</mi><mi>d</mi><mi>d</mi><mi>e</mi><mi>d</mi><mtext>&#x000A0;</mtext><mo>&#x0002F;</mo><mo>&#x0002E;</mo><mi>z</mi><mi>s</mi><mi>h</mi><mo>&#x0002F;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>f</mi><mi>p</mi><mi>a</mi><mi>t</mi><mi>h</mi><mi>i</mi><mi>n</mi><mtext>&#x000A0;</mtext><mo>&#x0002F;</mo><mo>&#x0002E;</mo><mi>z</mi><mi>s</mi><mi>h</mi><mi>r</mi><mi>c</mi></mrow></math>{NC}"
+        fi
+        
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>G</mi><mi>R</mi><mi>E</mi><mi>E</mi><mi>N</mi></mrow><mi>Z</mi><mi>s</mi><mi>h</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>l</mi><mi>e</mi><mi>d</mi><mi>t</mi><mi>o</mi><mi>:</mi><mtext>&#x000A0;</mtext><mo>&#x0002F;</mo><mo>&#x0002E;</mo><mi>z</mi><mi>s</mi><mi>h</mi><mo>&#x0002F;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>s</mi><msub><mo>&#x0002F;</mo><mi>w</mi></msub><mi>a</mi><mi>l</mi><mi>r</mi><mi>s</mi></mrow></math>{NC}"
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>Y</mi><mi>E</mi><mi>L</mi><mi>L</mi><mi>O</mi><mi>W</mi></mrow><mi>R</mi><mi>e</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>r</mi><mi>t</mi><mi>z</mi><mi>s</mi><mi>h</mi><mi>o</mi><mi>r</mi><mi>r</mi><mi>u</mi><mi>n</mi><mi>:</mi><mi>s</mi><mi>o</mi><mi>u</mi><mi>r</mi><mi>c</mi><mi>e</mi><mtext>&#x000A0;</mtext><mo>&#x0002F;</mo><mo>&#x0002E;</mo><mi>z</mi><mi>s</mi><mi>h</mi><mi>r</mi><mi>c</mi><mi>&</mi><mi>&</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>i</mi><mi>n</mi><mi>i</mi><mi>t</mi></mrow></math>{NC}"
+        ;;
+        
+    "bash")
+        echo "Installing Bash completion..."
+        
+        # Try different locations for bash completion
+        if [ -d "/usr/share/bash-completion/completions" ] && [ -w "/usr/share/bash-completion/completions" ]; then
+            COMPLETION_DIR="/usr/share/bash-completion/completions"
+        elif [ -d "/etc/bash_completion.d" ] && [ -w "/etc/bash_completion.d" ]; then
+            COMPLETION_DIR="/etc/bash_completion.d"
+        else
+            # Use user directory
+            COMPLETION_DIR="$HOME/.local/share/bash-completion/completions"
+            mkdir -p "$COMPLETION_DIR"
+        fi
+        
+        # Write bash completion file
+        cat > "$COMPLETION_DIR/walrs" << 'EOF'
+_walrs_completion() {
+    shopt -s extglob
+    local cur prev opts
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    opts="-i --image -k --backend -r --reload -R --reload-no -t --theme -g --generate -s --saturation -b --brightness -q --quit -v --version --help help"
+
+    case ${prev} in
+        -i|--image)
+            COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>f</mi><mo>&#x02212;</mo><msup><mi>X</mi><mi>&#x02032;</mi></msup><mo>&#x00021;</mo><mo>&#x0002A;</mo><mo>&#x0002E;</mo><mi>@</mi><mo stretchy="false">&#x00028;</mo><mi>j</mi><mi>p</mi><mi>g</mi><mo stretchy="false">&#x0007C;</mo><mi>j</mi><mi>p</mi><mi>e</mi><mi>g</mi><mo stretchy="false">&#x0007C;</mo><mi>p</mi><mi>n</mi><mi>g</mi><mo stretchy="false">&#x0007C;</mo><mi>b</mi><mi>m</mi><mi>p</mi><mo stretchy="false">&#x0007C;</mo><mi>g</mi><mi>i</mi><mi>f</mi><mo stretchy="false">&#x0007C;</mo><mi>t</mi><mi>i</mi><mi>f</mi><mi>f</mi><mo stretchy="false">&#x0007C;</mo><mi>w</mi><mi>e</mi><mi>b</mi><mi>p</mi><msup><mo stretchy="false">&#x00029;</mo><mi>&#x02032;</mi></msup><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>"</mi></mrow></math>{cur}") )
+            COMPREPLY+=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>d</mi><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>"</mi></mrow></math>{cur}") )
+            return 0
+            ;;
+        -k|--backend)
+            COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>W</mi><mi>"</mi><mi>k</mi><mi>m</mi><mi>e</mi><mi>a</mi><mi>n</mi><mi>s</mi><mi>c</mi><mi>o</mi><mi>l</mi><mi>o</mi><msub><mi>r</mi><mi>t</mi></msub><mi>h</mi><mi>i</mi><mi>e</mi><mi>f</mi><mi>p</mi><mi>a</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>t</mi><msub><mi>e</mi><mi>e</mi></msub><mi>x</mi><mi>t</mi><mi>r</mi><mi>a</mi><mi>c</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>l</mi><mi>b</mi><mi>a</mi><mi>c</mi><mi>k</mi><mi>e</mi><mi>n</mi><mi>d</mi><mi>s</mi><mi>"</mi><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>"</mi></mrow></math>{cur}") )
+            return 0
+            ;;
+        -t|--theme)
+            COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>f</mi><mo>&#x02212;</mo><msup><mi>X</mi><mi>&#x02032;</mi></msup><mo>&#x00021;</mo><mo>&#x0002A;</mo><mo>&#x0002E;</mo><mi>j</mi><mi>s</mi><mi>o</mi><msup><mi>n</mi><mi>&#x02032;</mi></msup><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>"</mi></mrow></math>{cur}") )
+            return 0
+            ;;
+        -g|--generate)
+            COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>W</mi><mi>"</mi><mi>"</mi><mo>&#x02212;</mo><mo>&#x02212;</mo><mi>"</mi></mrow></math>{cur}") )
+            return 0
+            ;;
+        -s|--saturation|-b|--brightness)
+            COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>W</mi><mi>"</mi></mrow></math>(seq -128 127)" -- "${cur}") )
+            return 0
+            ;;
+    esac
+
+    COMPREPLY=( <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mo stretchy="false">&#x00028;</mo><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>g</mi><mi>e</mi><mi>n</mi><mo>&#x02212;</mo><mi>W</mi><mi>"</mi></mrow></math>{opts}" -- "${cur}") )
+    return 0
+}
+
+complete -F _walrs_completion walrs
+EOF
+        
+
+        echo "source ~/.local/share/bash-completion/completions/walrs" >> ~/.bashrc
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>G</mi><mi>R</mi><mi>E</mi><mi>E</mi><mi>N</mi></mrow><mi>B</mi><mi>a</mi><mi>s</mi><mi>h</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>i</mi><mi>n</mi><mi>s</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>l</mi><mi>e</mi><mi>d</mi><mi>t</mi><mi>o</mi><mi>:</mi></mrow></math>COMPLETION_DIR/walrs${NC}"
+        ;;
+        
+    *)
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>R</mi><mi>E</mi><mi>D</mi></mrow><mi>U</mi><mi>n</mi><mi>s</mi><mi>u</mi><mi>p</mi><mi>p</mi><mi>o</mi><mi>r</mi><mi>t</mi><mi>e</mi><mi>d</mi><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mi>:</mi></mrow></math>CURRENT_SHELL${NC}"
+        echo -e "<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow><mrow><mi>Y</mi><mi>E</mi><mi>L</mi><mi>L</mi><mi>O</mi><mi>W</mi></mrow><mi>S</mi><mi>u</mi><mi>p</mi><mi>p</mi><mi>o</mi><mi>r</mi><mi>t</mi><mi>e</mi><mi>d</mi><mi>s</mi><mi>h</mi><mi>e</mi><mi>l</mi><mi>l</mi><mi>s</mi><mi>:</mi><mi>f</mi><mi>i</mi><mi>s</mi><mi>h</mi><mo>&#x0002C;</mo><mi>z</mi><mi>s</mi><mi>h</mi><mo>&#x0002C;</mo><mi>b</mi><mi>a</mi><mi>s</mi><mi>h</mi></mrow></math>{NC}"
+        exit 1
+        ;;
+esac