chore: added scripts to bar
857f8f37
1 file(s) · +57 −2
| 24 | 24 | -- Terminal emulator command (defaults to alacritty) |
|
| 25 | 25 | local terminal = "st" |
|
| 26 | 26 | ||
| 27 | + | local scripts = "/home/stevedylandev/dotfiles/scripts" |
|
| 28 | + | ||
| 29 | + | -- Spawn one of those scripts. They resolve their own siblings relative to |
|
| 30 | + | -- themselves, so an absolute path is all they need — PATH is not involved. |
|
| 31 | + | local function script(name) |
|
| 32 | + | return oxwm.spawn({ scripts .. "/" .. name }) |
|
| 33 | + | end |
|
| 34 | + | ||
| 27 | 35 | -- Color palette - customize these to match your theme |
|
| 28 | 36 | -- Alternatively you can import other files in here, such as |
|
| 29 | 37 | -- local colors = require("colors.lua") and make colors.lua a file |
|
| 68 | 76 | color = colors.green, |
|
| 69 | 77 | underline = false, |
|
| 70 | 78 | }), |
|
| 79 | + | -- SSID, "off" when the link is down, "none" without a wireless card. |
|
| 80 | + | -- Click opens the dmenu network menu (connect/disconnect wifi and eth0). |
|
| 81 | + | oxwm.bar.block.shell({ |
|
| 82 | + | format = "Net: {}", |
|
| 83 | + | command = scripts .. "/wifi-status", |
|
| 84 | + | interval = 10, |
|
| 85 | + | color = colors.lavender, |
|
| 86 | + | underline = true, |
|
| 87 | + | click = { command = scripts .. "/dm-net-menu" }, |
|
| 88 | + | }), |
|
| 89 | + | oxwm.bar.block.static({ |
|
| 90 | + | text = "│", |
|
| 91 | + | interval = 999999999, |
|
| 92 | + | color = colors.green, |
|
| 93 | + | underline = false, |
|
| 94 | + | }), |
|
| 95 | + | -- Volume percentage of the default sink; click toggles mute. |
|
| 96 | + | -- The vol-* keybinds also fire a notification, so this can lag a second. |
|
| 97 | + | oxwm.bar.block.shell({ |
|
| 98 | + | format = "Vol: {}", |
|
| 99 | + | command = scripts .. "/vol-status", |
|
| 100 | + | interval = 2, |
|
| 101 | + | color = colors.purple, |
|
| 102 | + | underline = true, |
|
| 103 | + | click = { command = scripts .. "/vol-mute" }, |
|
| 104 | + | }), |
|
| 105 | + | oxwm.bar.block.static({ |
|
| 106 | + | text = "│", |
|
| 107 | + | interval = 999999999, |
|
| 108 | + | color = colors.green, |
|
| 109 | + | underline = false, |
|
| 110 | + | }), |
|
| 71 | 111 | oxwm.bar.block.shell({ |
|
| 72 | 112 | format = "{}", |
|
| 73 | - | command = "/home/stevedylandev/scripts/weather.sh -h", |
|
| 113 | + | command = scripts .. "/weather.sh -h", |
|
| 74 | 114 | interval = 999999999, |
|
| 75 | 115 | color = colors.red, |
|
| 76 | 116 | underline = true, |
|
| 140 | 180 | -- Color of focused window border |
|
| 141 | 181 | oxwm.border.set_focused_color(colors.blue) |
|
| 142 | 182 | -- Color of unfocused window borders |
|
| 143 | - | oxwm.border.set_unfocused_color(colors.grey) |
|
| 183 | + | oxwm.border.set_unfocused_color(colors.bg) |
|
| 144 | 184 | ||
| 145 | 185 | -- Where floating windows spawn: "top-left", "top-center", "top-right", |
|
| 146 | 186 | -- "center-left", "center", "center-right", "bottom-left", "bottom-center", "bottom-right" |
|
| 224 | 264 | oxwm.key.bind({ modkey }, "S", oxwm.spawn({ "sh", "-c", "maim -s ~/Downloads/screenshot-$(date +%Y%m%d-%H%M%S).png" })) |
|
| 225 | 265 | oxwm.key.bind({ modkey }, "O", oxwm.spawn({ "sh", "-c", "helium.AppImage --no-sandbox" })) |
|
| 226 | 266 | oxwm.key.bind({ modkey }, "W", oxwm.client.kill()) |
|
| 267 | + | ||
| 268 | + | -- Volume control (media keys, with Mod+Shift fallbacks for boards without them) |
|
| 269 | + | oxwm.key.bind({}, "XF86AudioRaiseVolume", script("vol-up")) |
|
| 270 | + | oxwm.key.bind({}, "XF86AudioLowerVolume", script("vol-down")) |
|
| 271 | + | oxwm.key.bind({}, "XF86AudioMute", script("vol-mute")) |
|
| 272 | + | oxwm.key.bind({ modkey, "Shift" }, "Equal", script("vol-up")) |
|
| 273 | + | oxwm.key.bind({ modkey, "Shift" }, "Minus", script("vol-down")) |
|
| 274 | + | oxwm.key.bind({ modkey, "Shift" }, "M", script("vol-mute")) |
|
| 275 | + | -- Audio menu (set volume, mic mute, pick an output) - gum based, needs a terminal |
|
| 276 | + | oxwm.key.bind({ modkey, "Shift" }, "U", oxwm.spawn({ terminal, "-e", scripts .. "/audio-menu" })) |
|
| 277 | + | ||
| 278 | + | -- Network menu: connect/disconnect wifi and eth0 through dmenu |
|
| 279 | + | oxwm.key.bind({ modkey, "Shift" }, "N", script("dm-net-menu")) |
|
| 280 | + | -- Straight to the wifi picker, skipping the menu |
|
| 281 | + | oxwm.key.bind({ modkey, "Control", "Shift" }, "N", script("dm-wifi-connect")) |
|
| 227 | 282 | ||
| 228 | 283 | -- Keybind overlay - Shows important keybindings on screen |
|
| 229 | 284 | oxwm.key.bind({ modkey, "Shift" }, "Slash", oxwm.show_keybinds()) |
|