├── .gitmodules ├── README.md ├── assets ├── battery-10.svg ├── battery-20.svg ├── battery-30.svg ├── battery-40.svg ├── battery-50.svg ├── battery-60.svg ├── battery-70.svg ├── battery-80.svg ├── battery-90.svg ├── battery-charging-10.svg ├── battery-charging-100.svg ├── battery-charging-20.svg ├── battery-charging-30.svg ├── battery-charging-40.svg ├── battery-charging-50.svg ├── battery-charging-60.svg ├── battery-charging-70.svg ├── battery-charging-80.svg ├── battery-charging-90.svg ├── battery.svg ├── bluetooth-off.svg ├── bluetooth.svg ├── cookie-small.svg ├── cookie3.svg ├── moon.svg ├── star.svg ├── volume-off.svg ├── volume.svg ├── wifi-off.svg └── wifi.svg ├── base ├── auto.lua ├── init.lua ├── keys.lua └── scratchpad.lua ├── helpers.lua ├── rc.lua ├── scripts └── nvim-reload.py ├── signals ├── battery │ ├── battery.lua │ ├── init.lua │ └── powerlevel.lua ├── bluetooth │ └── init.lua ├── caffeine │ └── init.lua ├── client │ └── init.lua ├── compositor │ └── init.lua ├── init.lua ├── music │ └── init.lua ├── network │ └── init.lua ├── ruled │ └── init.lua ├── screen │ └── init.lua ├── screenshot │ └── init.lua ├── tag │ └── init.lua └── volume │ ├── control.lua │ ├── init.lua │ └── notify.lua ├── theme ├── colorscheme │ ├── adwaita │ │ ├── adwaita.sh │ │ ├── init.lua │ │ └── wallpaper.png │ ├── biscuit │ │ ├── biscuit.sh │ │ ├── init.lua │ │ └── wallpaper.png │ ├── camellia │ │ ├── camellia.sh │ │ ├── init.lua │ │ └── wallpaper.png │ ├── fullerene │ │ ├── fullerene.sh │ │ ├── init.lua │ │ └── wallpaper.png │ ├── init.lua │ ├── latte │ │ ├── init.lua │ │ ├── latte.sh │ │ └── wallpaper.png │ ├── oxocarbon │ │ ├── init.lua │ │ ├── oxocarbon.sh │ │ └── wallpaper.png │ ├── sakura │ │ ├── init.lua │ │ ├── sakura.sh │ │ └── wallpaper.png │ ├── solarized │ │ ├── init.lua │ │ ├── solarized.sh │ │ └── wallpaper.png │ └── stardew │ │ ├── init.lua │ │ ├── stardew.sh │ │ └── wallpaper.png ├── desktop.sh ├── init.lua └── reload-theme.lua ├── user.lua └── widget ├── bar ├── components │ ├── battery.lua │ ├── clock.lua │ ├── home.lua │ ├── layoutbox.lua │ ├── pfp.lua │ ├── status.lua │ ├── systray.lua │ ├── systray_btn.lua │ ├── taglist.lua │ └── tasklist.lua └── init.lua ├── control_center ├── components │ ├── music.lua │ ├── profile.lua │ └── statusbuttons.lua └── init.lua ├── dock ├── geticon.lua └── init.lua ├── init.lua ├── launcher └── init.lua ├── music └── init.lua ├── notifications └── init.lua └── titlebar └── init.lua /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "modules/bling"] 2 | path = modules/bling 3 | url = https://github.com/BlingCorp/bling 4 | [submodule "modules/rubato"] 5 | path = modules/rubato 6 | url = https://github.com/andOrlando/rubato 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tsukiyomi 2 | 3 | An elegant AwesomeWM configuration focused on beauty. Comes with a carefully crafted UI, three colorschemes, and a couple of variables to tweak the interface to the user's likings. A WIP currently. You can see this repo as a hybrid between dotfiles and an AWM configuration, but it should be modular enough to only pick what you really plan to use. 4 | 5 | > __WARNING__: This configuration was not tested on other machines or OS's outside of mine, my code is also not perfect, since this is my first real attempt at AWM, the code may or may not work on your end, some things here need manual tweaking and errors may occur, procceed at your own caution, you've been warned. 6 | 7 | --- 8 | 9 | ### Dependencies 10 | 11 | #### Awesome-related, obligatory 12 | - [awesome-git](https://github.com/awesomeWM/awesome) 13 | - [rubato](https://github.com/andOrlando/rubato) (animations library) 14 | - [bling](https://blingcorp.github.io/bling/) (scratchpads and launcher) 15 | 16 | > __WARNING 2:__ As of November 6 2023 you need to manually build awesome from source with [this patch](https://github.com/awesomeWM/awesome/pull/3811) for this configuration to work, this is because of a small screen signal for properly setting wallpapers, everything else can be used as is 17 | 18 | #### Music related, optional 19 | - `mpd` 20 | - `playerctl` 21 | - `mpDris2` 22 | - `ncmpcpp` 23 | - [`clematis`](https://github.com/TorchedSammy/clematis/tree/host-album-art) 24 | 25 | #### Misc Software 26 | - `picom` (optional) 27 | - `bluez` (optional) 28 | - `maim`, `xclip`, `slop` (obligatory) 29 | - `IBM Plex Sans` (optional) and/or any [Nerd Font](https://www.nerdfonts.com/) 30 | - `Pipewire` and `Wireplumber` (obligatory) 31 | - `nemo` (optional) 32 | 33 | Your suite of apps can be swapped out with relative ease, but if you want to use exactly what i have, [siduck's build of st](https://github.com/siduck/st), [my custom neovim configuration](https://github.com/tsukki9696/totsuka) and firefox. 34 | 35 | --- 36 | 37 | ### Features 38 | 39 | Tsukiyomi has a powerful user configuration in which you can tweak things like: 40 | - Colorscheme 41 | - Suite of apps 42 | - Font and icon theme 43 | - UI elements (gaps, spacing, borders) 44 | - Toggleable UI elements and signals 45 | - Accent color 46 | - Layouts and tags 47 | - Wallpaper, avatar, home icon 48 | - Dock widget 49 | - Vertical bar 50 | - Titlebars 51 | - Modkeys 52 | 53 | And other aspects can also be tweaked outside of user configuration, like keybinds and scratchpads. 54 | 55 | --- 56 | 57 | ### File structure 58 | 59 | - `assets`: images and svgs 60 | - `base`: keybinds, autostart, scratchpad config 61 | - `modules`: external libraries 62 | - `signals`: for awm signals 63 | - `theme`: theme variables and colorschemes 64 | - `widget`: bar, launcher, notifications, titlebar config and others 65 | 66 | - `helpers.lua`: helper functions 67 | - `user.lua`: user configuration 68 | - `rc.lua`: file that loads everything 69 | 70 | --- 71 | 72 | ### Keybinds 73 | 74 | - `Super + Return` opens a terminal. 75 | - `Super + /` shows the keybinds. 76 | 77 | --- 78 | 79 | ### TODO 80 | 81 | - Control center widget 82 | - Better keybinds popup 83 | - Overall cleanup of code 84 | 85 | --- 86 | 87 | ### Gallery 88 |
89 | Colorschemes 90 | 91 | ![biscuit](https://github.com/tsukki9696/tsukiyomi/assets/127806743/84be1cf0-da73-4347-b77f-f7fb35938e67) 92 | ![oxocarbon](https://github.com/tsukki9696/tsukiyomi/assets/127806743/b42bb64b-c681-42ef-be52-aa6072e9c5fa) 93 | ![sakura](https://github.com/tsukki9696/tsukiyomi/assets/127806743/d5d4f925-7f22-4e4e-8b7c-deca79d36024) 94 | ![camellia](https://github.com/tsukki9696/tsukiyomi/assets/127806743/f39a1342-7c18-446c-b828-84c9c0206dcf) 95 | ![adwaita](https://github.com/tsukki9696/tsukiyomi/assets/127806743/c0a28752-5730-4a25-8e3f-3d5c802d0e9b) 96 | ![latte](https://github.com/tsukki9696/tsukiyomi/assets/127806743/ea6f9ce7-2571-44ef-ba64-e7f83acaa6af) 97 | ![catppuccin](https://github.com/tsukki9696/tsukiyomi/assets/127806743/70449b4f-3f74-4593-9718-762a7df07706) 98 | ![fullerene](https://github.com/tsukki9696/tsukiyomi/assets/127806743/71fdbcfc-656b-4fe6-8eff-17d32b13c26a) 99 | 100 | 101 |
102 | 103 | --- 104 | 105 | ### Credits 106 | 107 | - Stardust kyun's [Sakura dotfiles](https://github.com/Stardust-kyun/dotfiles) and support, since they gave me the courage needed to tackle this project and also some sweet reference for how to do things, also the nice colorscheme 108 | - Gwynsav's gwdawful and [gwileful](https://github.com/Gwynsav/gwileful) rices, from which I borrowed some code, widgets and insight on how to execute ideas 109 | - Chadcat's [Crystal](https://github.com/chadcat7/crystal) rice, for the battery and dock widgets 110 | - Ner0z's [dotfiles](https://github.com/ner0z/dotfiles) for the music widget 111 | - Garado's [script](https://github.com/garado/cozy/blob/18d9e810a81da427085a8261194d95aa6df05a97/theme/integration.lua) for changing nvim themes 112 | - The [Unixporn discord server](https://discord.gg/unixporn) for a lot of insight and troubleshooting 113 | - Nyoom for the [oxocarbon](https://github.com/nyoom-engineering/oxocarbon/tree/main) colorscheme 114 | - Sinomor's [dotfiles](https://github.com/Sinomor/dotfiles) for some helper functions and the execution of inner and outer gaps 115 | - My mom, she's very cool 116 | -------------------------------------------------------------------------------- /assets/battery-10.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-20.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-30.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-40.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-50.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-60.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-70.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-90.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-10.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-100.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-20.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-30.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-40.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-50.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-60.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-70.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery-charging-90.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/battery.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/bluetooth-off.svg: -------------------------------------------------------------------------------- 1 | bluetooth-off 2 | -------------------------------------------------------------------------------- /assets/bluetooth.svg: -------------------------------------------------------------------------------- 1 | bluetooth 2 | -------------------------------------------------------------------------------- /assets/cookie-small.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/cookie3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /assets/moon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/star.svg: -------------------------------------------------------------------------------- 1 | 2 | star-rounded-png 3 | 4 | 5 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /assets/volume-off.svg: -------------------------------------------------------------------------------- 1 | volume-variant-off 2 | -------------------------------------------------------------------------------- /assets/volume.svg: -------------------------------------------------------------------------------- 1 | volume-medium 2 | -------------------------------------------------------------------------------- /assets/wifi-off.svg: -------------------------------------------------------------------------------- 1 | wifi-strength-off 2 | -------------------------------------------------------------------------------- /assets/wifi.svg: -------------------------------------------------------------------------------- 1 | wifi-strength-4 2 | -------------------------------------------------------------------------------- /base/auto.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local user = require('user') 3 | 4 | -- handle desktop icons 5 | if user.desktop_icon == true then awful.spawn.once('nemo-desktop') end 6 | 7 | -- handle music shit 8 | if user.music_enabled == true then 9 | if user.music_enabled == "mpd" then 10 | awful.spawn.once('mpd') 11 | end 12 | awful.spawn.once('mpDris2') 13 | end 14 | 15 | awful.spawn.once('picom') 16 | awful.spawn.once('xsettingsd') 17 | -------------------------------------------------------------------------------- /base/init.lua: -------------------------------------------------------------------------------- 1 | require('base.keys') 2 | require('base.scratchpad') 3 | -------------------------------------------------------------------------------- /base/keys.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local bling = require("modules.bling") 3 | local hotkeys_popup = require("awful.hotkeys_popup") 4 | 5 | local launcher = require("widget.launcher") 6 | local user = require("user") 7 | local helpers = require("helpers") 8 | 9 | local modkey = user.modkey 10 | local modkey2 = user.modkey2 11 | 12 | require("awful.autofocus") 13 | require("signals.screenshot") 14 | 15 | local loop_modes = {"none", "playlist", "track"} 16 | local current_loop_mode = 1 -- Start with "loop none" 17 | 18 | awful.keyboard.append_global_keybindings({ 19 | -- General 20 | awful.key( 21 | { modkey }, "/", function () 22 | hotkeys_popup.show_help() 23 | end, 24 | { description = "Show keybinds", group = "Awesome" } 25 | ), 26 | 27 | awful.key( 28 | { modkey }, "Return", function () 29 | awful.spawn(user.terminal) 30 | end, 31 | { description = "Spawn terminal", group = "Awesome" } 32 | ), 33 | 34 | awful.key( 35 | { modkey, "Shift" }, "Return", function () 36 | local app_launcher = bling.widget.app_launcher(launcher) 37 | app_launcher:toggle() 38 | end, 39 | { description = "Spawn app launcher", group = "Awesome" } 40 | ), 41 | 42 | awful.key( 43 | { modkey, "Shift" }, "r", 44 | awesome.restart, 45 | { description = "Restart awesome", group = "Awesome" } 46 | ), 47 | 48 | -- Tags 49 | awful.key( 50 | { modkey2 }, "Tab", 51 | awful.tag.viewnext, 52 | { description = "Jump to next tag", group = "Tags" } 53 | ), 54 | 55 | awful.key( 56 | { modkey2, "Shift" }, "Tab", 57 | awful.tag.viewprev, 58 | { description = "Jump to previous tag", group = "Tags" } 59 | ), 60 | 61 | awful.key( 62 | { modkey }, "numrow", function(i) 63 | local screen = awful.screen.focused() 64 | local tag = screen.tags[i] 65 | if tag then 66 | tag:view_only() 67 | end 68 | end, 69 | { description = "Jump to respective number tag", group = "Tags" } 70 | ), 71 | 72 | awful.key( 73 | { modkey, "Shift" }, "numrow", function(i) 74 | if client.focus then 75 | local tag = client.focus.screen.tags[i] 76 | if tag then 77 | client.focus:move_to_tag(tag) 78 | end 79 | end 80 | end, 81 | { description = "Move focused client to tag", group = "Tags" } 82 | ), 83 | 84 | -- Windows 85 | awful.key( 86 | { modkey, "Shift" }, "j", function () 87 | awful.client.swap.bydirection('down', client.swap) 88 | end, 89 | { description = "Swap below window", group = "Windows" } 90 | ), 91 | 92 | awful.key( 93 | { modkey, "Shift" }, "k", function () 94 | awful.client.swap.bydirection('up', client.swap) 95 | end, 96 | { description = "Swap above window", group = "Windows" } 97 | ), 98 | 99 | awful.key( 100 | { modkey, "Shift" }, "h", function () 101 | awful.client.swap.bydirection('left', client.swap) 102 | end, 103 | { description = "Swap with left window", group = "Windows" } 104 | ), 105 | 106 | awful.key( 107 | { modkey, "Shift" }, "l", function () 108 | awful.client.swap.bydirection('right', client.swap) 109 | end, 110 | { description = "Swap with right window", group = "Windows" } 111 | ), 112 | 113 | -- Layout 114 | awful.key( 115 | { modkey }, "Tab", function () 116 | awful.layout.inc( 1) 117 | end, 118 | { description = "Cycle between layouts", group = "Layout" } 119 | ), 120 | 121 | awful.key( 122 | { modkey, "Shift" }, "Tab", function () 123 | awful.layout.inc(-1) 124 | end, 125 | { description = "Reverse cycle between layouts", group = "Layout" } 126 | ), 127 | 128 | -- Focus 129 | awful.key( 130 | { modkey }, "k", function () 131 | awful.client.focus.byidx(-1) 132 | end, 133 | { description = "Focus on previous tag", group = "Focus" } 134 | ), 135 | 136 | awful.key( 137 | { modkey }, "j", function () 138 | awful.client.focus.byidx( 1) 139 | end, 140 | { description = "Focus on next tag", group = "Focus" } 141 | ), 142 | 143 | awful.key( 144 | { modkey }, "h", function () 145 | awful.client.focus.bydirection('left') 146 | end, 147 | { description = "Focus on left window", group = "Focus" } 148 | ), 149 | 150 | awful.key( 151 | { modkey }, "l", function () 152 | awful.client.focus.bydirection('right') 153 | end, 154 | { description = "Focus on right window", group = "Focus" } 155 | ), 156 | 157 | -- Apps 158 | awful.key( 159 | { modkey }, "w", function () 160 | awful.spawn(user.browser) 161 | end, 162 | { description = "Spawn browser", group = "Apps" } 163 | ), 164 | 165 | awful.key( 166 | { modkey }, "d", function () 167 | awful.spawn(user.chatapp) 168 | end, 169 | { description = "Spawn chatapp", group = "Apps" } 170 | ), 171 | 172 | awful.key( 173 | { modkey }, "e", function () 174 | awful.spawn(user.files) 175 | end, 176 | { description = "Spawn file-explorer", group = "Apps" } 177 | ), 178 | 179 | awful.key( 180 | { modkey }, "s", function () 181 | awful.spawn.with_shell("steam-native") 182 | end, 183 | { description = "Spawn steam", group = "Apps" } 184 | ), 185 | 186 | -- hambuh buh 187 | awful.key( 188 | { modkey }, "]", function () 189 | awesome.emit_signal("controlcenter::toggle") 190 | end, 191 | { description = "Spawn Control Center", group = "Awesome" } 192 | ), 193 | 194 | -- Screenshot 195 | -- requires 'maim', 'slop', 'xclip-git' 196 | awful.key( 197 | { modkey }, "q", function () 198 | awesome.emit_signal("screenshot::full") 199 | end, 200 | { description = "Screenshot whole screen", group = "Screenshot" } 201 | ), 202 | 203 | awful.key( 204 | { modkey, "Shift" }, "q", function () 205 | awesome.emit_signal("screenshot::part") 206 | end, 207 | { description = "Screenshot selection", group = "Screenshot" } 208 | ), 209 | 210 | -- Volume 211 | awful.key( 212 | { nil }, "XF86AudioLowerVolume", function () 213 | awful.spawn.with_shell("wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%-") 214 | end, 215 | { description = "Raise volume", group = "Volume" } 216 | ), 217 | 218 | awful.key( 219 | { nil }, "XF86AudioRaiseVolume", function () 220 | awful.spawn.with_shell("wpctl set-volume @DEFAULT_AUDIO_SINK@ 10%+") 221 | end, 222 | { description = "Decrease volume", group = "Volume" } 223 | ), 224 | 225 | awful.key( 226 | { nil }, "XF86AudioMute", function () 227 | awful.spawn.with_shell("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle") 228 | end, 229 | { description = "Mute volume", group = "Volume" } 230 | ), 231 | 232 | awful.key( 233 | { user.modkey }, "[", function () 234 | awful.screen.focused().wibar.visible = not awful.screen.focused().wibar.visible 235 | end, 236 | { description = "Toggle bar on/off", group = "Awesome" } 237 | ) 238 | }) 239 | 240 | -- Music related keybinds, will only be added if music is enabled 241 | if user.music_enabled == true then 242 | awful.keyboard.append_global_keybindings({ 243 | -- Music Control 244 | awful.key( 245 | { modkey }, "u", function () 246 | awful.spawn.with_shell("playerctl --player=" .. user.music_player .. " previous") 247 | end, 248 | { description = "Previous song", group = "Music" } 249 | ), 250 | 251 | awful.key( 252 | { modkey }, "i", function () 253 | awful.spawn.with_shell("playerctl --player=" .. user.music_player .. " play-pause") 254 | end, 255 | { description = "Toggle playback", group = "Music" } 256 | ), 257 | 258 | awful.key( 259 | { modkey }, "o", function () 260 | awful.spawn.with_shell("playerctl --player=" .. user.music_player .. " next") 261 | end, 262 | { description = "Next song", group = "Music" } 263 | ), 264 | 265 | awful.key( 266 | { modkey }, "y", function () 267 | awful.spawn.with_shell("playerctl --player=" .. user.music_player .. " shuffle toggle") 268 | end, 269 | { description = "Toggle shuffle", group = "Music" } 270 | ), 271 | 272 | awful.key( 273 | { modkey }, "p", function () 274 | current_loop_mode = (current_loop_mode % #loop_modes) + 1 275 | awful.spawn.with_shell("playerctl --player=" .. user.music_player .. " loop " .. loop_modes[current_loop_mode]) 276 | end, 277 | { description = "Toggle loop mode", group = "Music" } 278 | ), 279 | }) 280 | end 281 | 282 | client.connect_signal("request::default_keybindings", function() 283 | awful.keyboard.append_client_keybindings({ 284 | 285 | awful.key( 286 | { modkey }, "f", function(c) 287 | c.fullscreen = not c.fullscreen 288 | c:raise() 289 | end, 290 | { description = "Toggle fullscreen", group = "Awesome" } 291 | ), 292 | 293 | awful.key( 294 | { modkey }, "a", function(c) 295 | c.maximized = not c.maximized 296 | c:raise() 297 | end, 298 | { description = "Toggle maximized", group = "Awesome" } 299 | ), 300 | 301 | awful.key( 302 | { modkey, "Shift" }, "c", function(c) 303 | c:kill() 304 | end, 305 | { description = "Kill, rend and slaughter your windows", group = "Awesome" } 306 | ), 307 | 308 | awful.key( 309 | { modkey, "Shift" }, "space", function(c) 310 | c.floating = not c.floating 311 | c:raise() 312 | end, 313 | { description = "Toggle floating", group = "Awesome" } 314 | ), 315 | 316 | awful.key( 317 | { modkey, "Control" }, "k", function(c) 318 | helpers.resize_client(c.focus, "up") 319 | end, 320 | { description = "Resize vertically -- up", group = "Windows" } 321 | ), 322 | 323 | awful.key( 324 | { modkey, "Control" }, "j", function(c) 325 | helpers.resize_client(c.focus, "down") 326 | end, 327 | { description = "Resize vertically -- down", group = "Windows" } 328 | ), 329 | 330 | awful.key( 331 | { modkey, "Control" }, "h", function(c) 332 | helpers.resize_client(c.focus, "left") 333 | end, 334 | { description = "Resize horizontally -- left", group = "Windows" } 335 | ), 336 | 337 | awful.key( 338 | { modkey, "Control" }, "l", function(c) 339 | helpers.resize_client(c.focus, "right") 340 | end, 341 | { description = "Resize horizontally -- right", group = "Windows" } 342 | ), 343 | 344 | }) 345 | end) 346 | 347 | awful.keyboard.append_global_keybindings({ 348 | awful.key { 349 | modifiers = { modkey }, 350 | keygroup = "numrow", 351 | description = "only view tag", 352 | group = "Tags", 353 | on_press = function (index) 354 | local screen = awful.screen.focused() 355 | local tag = screen.tags[index] 356 | if tag then 357 | tag:view_only() 358 | end 359 | end, 360 | }, 361 | awful.key { 362 | modifiers = { modkey, "Shift" }, 363 | keygroup = "numrow", 364 | description = "move focused client to tag", 365 | group = "Tags", 366 | on_press = function (index) 367 | if client.focus then 368 | local tag = client.focus.screen.tags[index] 369 | if tag then 370 | client.focus:move_to_tag(tag) 371 | end 372 | end 373 | end, 374 | } 375 | }) 376 | 377 | -- Enable sloppy focus, so that focus follows mouse. 378 | client.connect_signal("mouse::enter", function(c) 379 | c:activate { context = "mouse_enter", raise = false } 380 | end) 381 | 382 | awful.mouse.append_global_mousebindings({ 383 | awful.button({ }, 4, awful.tag.viewprev), 384 | awful.button({ }, 5, awful.tag.viewnext), 385 | }) 386 | 387 | client.connect_signal("request::default_mousebindings", function() 388 | awful.mouse.append_client_mousebindings({ 389 | awful.button({ }, 1, function (c) 390 | c:activate { context = "mouse_click" } 391 | end), 392 | awful.button({ modkey }, 1, function (c) 393 | c:activate { context = "mouse_click", action = "mouse_move" } 394 | end), 395 | awful.button({ modkey }, 3, function (c) 396 | c:activate { context = "mouse_click", action = "mouse_resize"} 397 | end), 398 | }) 399 | end) 400 | -------------------------------------------------------------------------------- /base/scratchpad.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | 3 | local bling = require("modules.bling") 4 | local user = require("user") 5 | local modkey = user.modkey 6 | 7 | -- function to make the scratchpads centered 8 | local function center(client) 9 | local screen = awful.screen.focused() 10 | local screen_geometry = screen.geometry 11 | 12 | local x = (screen_geometry.width - client.geometry.width) / 2 13 | local y = (screen_geometry.height - client.geometry.height) / 2 14 | 15 | client.geometry.x = x 16 | client.geometry.y = y 17 | 18 | client:toggle() 19 | end 20 | 21 | local spad = bling.module.scratchpad { 22 | command = user.term_cmd .. "spad -n spad", 23 | rule = { instance = "spad" }, 24 | sticky = true, 25 | autoclose = true, 26 | floating = true, 27 | geometry = { height=550, width=900 }, 28 | reapply = true, 29 | dont_focus_before_close = true, 30 | } 31 | 32 | local music = bling.module.scratchpad { 33 | command = "spotify", 34 | rule = { instance = "spotify" }, 35 | sticky = true, 36 | autoclose = true, 37 | floating = true, 38 | geometry = { height=550, width=900}, 39 | reapply = true, 40 | dont_focus_before_close = true, 41 | } 42 | 43 | local fileman = bling.module.scratchpad { 44 | command = user.term_cmd .. "fileman -n fileman -e " .. user.files_cli, 45 | rule = { instance = "fileman" }, 46 | sticky = true, 47 | autoclose = true, 48 | floating = true, 49 | geometry = { height=550, width=900}, 50 | reapply = true, 51 | dont_focus_before_close = true, 52 | } 53 | 54 | awful.keyboard.append_global_keybindings({ 55 | awful.key({ modkey }, "m", function() center(spad) end), 56 | awful.key({ modkey }, "n", function() center(music) end), 57 | awful.key({ modkey }, "b", function() center(fileman) end), 58 | }) 59 | -------------------------------------------------------------------------------- /helpers.lua: -------------------------------------------------------------------------------- 1 | local helpers = {} 2 | 3 | local awful = require("awful") 4 | local beautiful = require("beautiful") 5 | local gears = require("gears") 6 | local dpi = beautiful.xresources.apply_dpi 7 | local cairo = require('lgi').cairo 8 | local capi = { client = client, mouse = mouse } 9 | 10 | -- i stole all of these 11 | 12 | -- from chadcat, this rounds the rect 13 | helpers.rrect = function(radius) 14 | radius = radius or dpi(4) 15 | return function(cr, width, height) 16 | gears.shape.rounded_rect(cr, width, height, radius) 17 | end 18 | end 19 | 20 | -- also from chadcat, this ummm colors text 21 | helpers.colorizeText = function(txt, fg) 22 | if fg == "" then 23 | fg = "#ffffff" 24 | end 25 | 26 | return "" .. txt .. "" 27 | end 28 | 29 | -- got it from blyaticon i forgot what this does 30 | helpers.crop_surface = function(ratio, surf) 31 | local old_w, old_h = gears.surface.get_size(surf) 32 | local old_ratio = old_w / old_h 33 | if old_ratio == ratio then return surf end 34 | 35 | local new_w = old_w 36 | local new_h = old_h 37 | local offset_w, offset_h = 0, 0 38 | -- quick mafs 39 | if (old_ratio < ratio) then 40 | new_h = math.ceil(old_w * (1 / ratio)) 41 | offset_h = math.ceil((old_h - new_h) / 2) 42 | else 43 | new_w = math.ceil(old_h * ratio) 44 | offset_w = math.ceil((old_w - new_w) / 2) 45 | end 46 | 47 | local out_surf = cairo.ImageSurface(cairo.Format.ARGB32, new_w, new_h) 48 | local cr = cairo.Context(out_surf) 49 | cr:set_source_surface(surf, -offset_w, -offset_h) 50 | cr.operator = cairo.Operator.SOURCE 51 | cr:paint() 52 | 53 | return out_surf 54 | end 55 | 56 | -- from sammyette, this changes the cursor on hover 57 | function helpers.hoverCursor(w, cursorType) 58 | cursorType = cursorType or 'hand2' 59 | local oldCursor = 'left_ptr' 60 | local wbx 61 | 62 | w.hcDisabled = false 63 | local enterCb = function() 64 | wbx = mouse.current_wibox 65 | if wbx then wbx.cursor = cursorType end 66 | end 67 | local leaveCb = function() 68 | if wbx then wbx.cursor = oldCursor end 69 | end 70 | 71 | w:connect_signal('hover::disconnect', function() 72 | w:disconnect_signal('mouse::enter', enterCb) 73 | w:disconnect_signal('mouse::leave', leaveCb) 74 | leaveCb() 75 | end) 76 | 77 | function w:toggleHoverCursor() 78 | w.hcDisabled = not w.hcDisabled 79 | if w.hcDisabled then 80 | leaveCb() 81 | else 82 | enterCb() 83 | end 84 | end 85 | 86 | w:connect_signal('mouse::enter', enterCb) 87 | w:connect_signal('mouse::leave', leaveCb) 88 | end 89 | 90 | -- i forgot what this does 91 | helpers.inTable = function(t, v) 92 | for _, value in ipairs(t) do 93 | if value == v then 94 | return true 95 | end 96 | end 97 | 98 | return false 99 | end 100 | 101 | -- Resize client or factor 102 | local floating_resize_amount = 20 103 | local tiling_resize_factor = 0.10 104 | 105 | helpers.resize_client = function(c, direction) 106 | if c and c.floating or awful.layout.get(capi.mouse.screen) == awful.layout.suit.floating then 107 | if direction == "up" then 108 | c:relative_move(0, 0, 0, -floating_resize_amount) 109 | elseif direction == "down" then 110 | c:relative_move(0, 0, 0, floating_resize_amount) 111 | elseif direction == "left" then 112 | c:relative_move(0, 0, -floating_resize_amount, 0) 113 | elseif direction == "right" then 114 | c:relative_move(0, 0, floating_resize_amount, 0) 115 | end 116 | 117 | elseif awful.layout.get(capi.mouse.screen) ~= awful.layout.suit.floating then 118 | if direction == "up" then 119 | awful.client.incwfact(-tiling_resize_factor) 120 | elseif direction == "down" then 121 | awful.client.incwfact(tiling_resize_factor) 122 | elseif direction == "left" then 123 | awful.tag.incmwfact(-tiling_resize_factor) 124 | elseif direction == "right" then 125 | awful.tag.incmwfact(tiling_resize_factor) 126 | end 127 | end 128 | end 129 | 130 | -- Move client DWIM (Do What I Mean) 131 | -- Move to edge if the client / layout is floating 132 | -- Swap by index if maximized 133 | -- Else swap client by direction 134 | function helpers.move_client(c, direction) 135 | if c.floating or (awful.layout.get(capi.mouse.screen) == awful.layout.suit.floating) then 136 | client.move_to_edge(c, direction) 137 | elseif awful.layout.get(capi.mouse.screen) == awful.layout.suit.max then 138 | if direction == "up" or direction == "left" then 139 | awful.client.swap.byidx(-1, c) 140 | elseif direction == "down" or direction == "right" then 141 | awful.client.swap.byidx(1, c) 142 | end 143 | else 144 | awful.client.swap.bydirection(direction, c, nil) 145 | end 146 | end 147 | 148 | function helpers.centered_client_placement(c) 149 | return gears.timer.delayed_call(function() 150 | awful.placement.centered(c, { honor_padding = true, honor_workarea = true }) 151 | end) 152 | end 153 | 154 | return helpers 155 | -------------------------------------------------------------------------------- /rc.lua: -------------------------------------------------------------------------------- 1 | pcall(require, "luarocks.loader") 2 | 3 | local beautiful = require('beautiful') 4 | local gfs = require('gears.filesystem') 5 | local naughty = require('naughty') 6 | 7 | -- This ensures every error will leave a traceback notification, since awm logs are shit 8 | naughty.connect_signal("request::display_error", function(message, startup) 9 | naughty.notification { 10 | urgency = "critical", 11 | title = "You fucked up hard"..(startup and " during startup!" or "!"), 12 | message = message 13 | } 14 | end) 15 | 16 | beautiful.init(gfs.get_configuration_dir() .. 'theme/init.lua') 17 | 18 | require('user') 19 | require('base') 20 | require('signals') 21 | require('widget') 22 | 23 | require('theme.reload-theme') -- theme 24 | require('base.auto') -- autostarts 25 | -------------------------------------------------------------------------------- /scripts/nvim-reload.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | from pynvim import attach 6 | 7 | def get_all_instances(): 8 | instances = [] 9 | directory_content = os.listdir('/run/user/1000') 10 | for dirent in directory_content: 11 | if dirent.startswith('nvim'): 12 | instances.append('/run/user/1000/' + dirent) 13 | return instances 14 | 15 | def reload_theme(instance, cmd): 16 | try: 17 | nvim = attach('socket', path=instance) 18 | except Exception as e: 19 | return 20 | nvim.command(cmd) 21 | 22 | def main(): 23 | # search for neovim instances 24 | instances = get_all_instances() 25 | 26 | # get args 27 | cmd = sys.argv[1] 28 | 29 | # connect to instances and reload them 30 | for instance in instances: 31 | reload_theme(instance, cmd) 32 | 33 | if __name__ == '__main__': 34 | main() 35 | -------------------------------------------------------------------------------- /signals/battery/battery.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local gears = require('gears') 3 | 4 | -- Battery information script 5 | local battery_script = "bash -c 'echo $(cat /sys/class/power_supply/BAT1/capacity) echo $(cat /sys/class/power_supply/BAT1/status)'" 6 | 7 | local function battery_emit() 8 | awful.spawn.easy_async_with_shell( 9 | battery_script, function(stdout) 10 | local level = string.match(stdout:match('(%d+)'), '(%d+)') 11 | local level_int = tonumber(level) -- integer 12 | local power = not stdout:match('Discharging') -- boolean 13 | awesome.emit_signal('signal::battery', level_int, power) 14 | end) 15 | end 16 | 17 | -- Refreshing 18 | gears.timer { 19 | timeout = 10, 20 | call_now = true, 21 | autostart = true, 22 | callback = function() 23 | battery_emit() 24 | end 25 | } 26 | -------------------------------------------------------------------------------- /signals/battery/init.lua: -------------------------------------------------------------------------------- 1 | require('signals.battery.battery') 2 | require('signals.battery.powerlevel') 3 | -------------------------------------------------------------------------------- /signals/battery/powerlevel.lua: -------------------------------------------------------------------------------- 1 | local naughty = require('naughty') 2 | local batstatus = require('widget.bar.components.battery') 3 | 4 | -- Flags to track notification state 5 | local batteryLowNotified = false 6 | local batteryFullNotified = false 7 | local batteryChargeNotified = false 8 | 9 | awesome.connect_signal("signal::battery", function(value, state) 10 | batstatus.state = state 11 | batstatus.value = value 12 | 13 | if batstatus.state then 14 | if not batteryChargeNotified then 15 | naughty.notification { 16 | title = "Power Management", 17 | message = "Battery is charging", timeout = 0 18 | } 19 | batteryChargeNotified = true 20 | end 21 | else 22 | if batstatus.value <= 18 and not batteryLowNotified then 23 | naughty.notification { 24 | title = "Power Management", 25 | message = "Battery is running low!", timeout = 0 26 | } 27 | batteryLowNotified = true 28 | end 29 | 30 | if batstatus.value == 100 and not batteryFullNotified then 31 | naughty.notification { 32 | title = "Power Management", 33 | message = "Battery is full!", timeout = 0 34 | } 35 | batteryFullNotified = true 36 | end 37 | end 38 | end) 39 | -------------------------------------------------------------------------------- /signals/bluetooth/init.lua: -------------------------------------------------------------------------------- 1 | -- Reports bluetooth status, and can change it. 2 | 3 | local awful = require('awful') 4 | local gears = require('gears') 5 | 6 | -- Bluetooth Fetching and Signal Emitting 7 | -- Emit a bluetooth status signal 8 | local status_old = -1 9 | local function emit_bluetooth_status() 10 | awful.spawn.easy_async_with_shell( 11 | "bash -c 'bluetoothctl show | grep -i powered:'", function(stdout) 12 | local status = stdout:match("yes") -- boolean 13 | local status_id = status and 1 or 0 -- integer 14 | if status_id ~= status_old then 15 | awesome.emit_signal('signal::bluetooth', status) 16 | status_old = status_id 17 | end 18 | end) 19 | end 20 | 21 | -- Change bluetooth status 22 | awesome.connect_signal('bluetooth::toggle', function() 23 | if status_old == 0 then 24 | awful.spawn("bluetoothctl power on") 25 | else 26 | awful.spawn("bluetoothctl power off") 27 | end 28 | end) 29 | 30 | -- Refreshing 31 | gears.timer { 32 | timeout = 5, 33 | call_now = true, 34 | autostart = true, 35 | callback = function() 36 | emit_bluetooth_status() 37 | end 38 | } 39 | -------------------------------------------------------------------------------- /signals/caffeine/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local gears = require('gears') 3 | 4 | local status_old = -1 5 | 6 | local function emit_caffeine_status() 7 | awful.spawn.easy_async_with_shell( 8 | "bash -c 'pgrep xset'", function(stdout) 9 | local status = stdout:match("%d+") 10 | local status_id = status and 0 or 1 11 | 12 | if status_id ~= status_old then 13 | awesome.emit_signal('signal::caffeine', status_id) 14 | status_old = status_id 15 | end 16 | end 17 | ) 18 | end 19 | 20 | awesome.connect_signal('caffeine::toggle', function() 21 | awful.spawn.easy_async("pgrep xset", function(stdout) 22 | local is_running = stdout ~= "" 23 | if is_running then 24 | awful.spawn("killall xset") 25 | else 26 | awful.spawn("xset s off") 27 | awful.spawn("xset -dpms") 28 | end 29 | awesome.emit_signal("signal::caffeine", not is_running) 30 | end) 31 | end) 32 | 33 | -- Refreshing 34 | gears.timer { 35 | timeout = 5, 36 | call_now = true, 37 | autostart = true, 38 | callback = function() 39 | emit_caffeine_status() 40 | end 41 | } 42 | -------------------------------------------------------------------------------- /signals/client/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | 3 | -- Put new windows in stack 4 | client.connect_signal('manage', function(c) 5 | if not awesome.startup then awful.client.setslave(c) end 6 | if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then 7 | awful.placement.no_offscreen(c) 8 | end 9 | end) 10 | 11 | -- Floating windows always on top. 12 | client.connect_signal('property::floating', function(c) c.ontop = c.floating end) 13 | 14 | -- Send fullscreen windows to the top. 15 | client.connect_signal('property::fullscreen', function(c) c:raise() end) 16 | -------------------------------------------------------------------------------- /signals/compositor/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local gears = require('gears') 3 | 4 | local status_old = -1 5 | 6 | local function emit_compositor_status() 7 | awful.spawn.easy_async_with_shell( 8 | "bash -c 'pgrep picom'", function(stdout) 9 | local status = stdout:match("%d+") -- Check if any process with name 'picom' is running 10 | local status_id = status and 0 or 1 -- 0 if picom is running, 1 if not running 11 | 12 | if status_id ~= status_old then 13 | awesome.emit_signal('signal::compositor', status_id) 14 | status_old = status_id 15 | end 16 | end 17 | ) 18 | end 19 | 20 | awesome.connect_signal('compositor::toggle', function() 21 | awful.spawn.easy_async("pgrep picom", function(stdout) 22 | local is_running = stdout ~= "" 23 | if is_running then 24 | awful.spawn("killall picom") 25 | else 26 | awful.spawn("picom") 27 | end 28 | awesome.emit_signal("signal::compositor", not is_running) -- Invert the status 29 | end) 30 | end) 31 | 32 | -- Refreshing 33 | gears.timer { 34 | timeout = 5, 35 | call_now = true, 36 | autostart = true, 37 | callback = function() 38 | emit_compositor_status() 39 | end 40 | } 41 | -------------------------------------------------------------------------------- /signals/init.lua: -------------------------------------------------------------------------------- 1 | local user = require('user') 2 | 3 | require('signals.screen') 4 | require('signals.client') 5 | require('signals.ruled') 6 | require('signals.tag') 7 | require('signals.volume') 8 | require('signals.network') 9 | require('signals.compositor') 10 | require('signals.caffeine') 11 | 12 | if user.bluetooth_enabled then 13 | require('signals.bluetooth') 14 | end 15 | 16 | if user.battery_enabled then 17 | require('signals.battery') 18 | end 19 | 20 | -- if user.music_enabled then 21 | -- require('signals.music') 22 | -- end 23 | -------------------------------------------------------------------------------- /signals/music/init.lua: -------------------------------------------------------------------------------- 1 | local naughty = require('naughty') 2 | local beautiful = require('beautiful') 3 | local bling = require('modules.bling') 4 | local playerctl = bling.signal.playerctl.lib() 5 | 6 | local function notif(title, artist, album_path) 7 | local previous = naughty.action { name = "PRV" } 8 | previous:connect_signal('invoked', function() 9 | playerctl:previous() 10 | end) 11 | local pause = naughty.action { name = "PS" } 12 | pause:connect_signal('invoked', function() 13 | playerctl:play_pause() 14 | end) 15 | local next = naughty.action { name = "NXT" } 16 | next:connect_signal('invoked', function() 17 | playerctl:next() 18 | end) 19 | 20 | naughty.notify { 21 | title = title, 22 | text = "by " .. artist:match('.+') or "Unknown", 23 | image = album_path:match('/') and album_path or beautiful.bg_light, 24 | actions = { previous, pause, next }, 25 | timeout = 2 26 | } 27 | end 28 | 29 | local info_first = true 30 | playerctl:connect_signal("metadata", 31 | function(_, title, artist, album_path, _, _, _) 32 | if info_first then 33 | info_first = false 34 | else 35 | notif(title, artist, album_path) 36 | end 37 | end) 38 | -------------------------------------------------------------------------------- /signals/network/init.lua: -------------------------------------------------------------------------------- 1 | -- Reports status, and can toggle it. 2 | local awful = require('awful') 3 | local gears = require('gears') 4 | 5 | -- Network Fetching and Signal Emitting 6 | -- Emit a network status signal 7 | local status_old = -1 8 | local function emit_network_status() 9 | awful.spawn.easy_async_with_shell( 10 | "bash -c 'nmcli networking connectivity check'", function(stdout) 11 | local status = stdout:match("full") -- boolean 12 | local status_id = status and 1 or 0 -- integer 13 | if status_id ~= status_old then 14 | awesome.emit_signal('signal::network', status) 15 | status_old = status_id 16 | end 17 | end) 18 | end 19 | 20 | -- Change network status 21 | awesome.connect_signal('network::toggle', function() 22 | if status_old == 0 then 23 | awful.spawn("nmcli networking on") 24 | else 25 | awful.spawn("nmcli networking off") 26 | end 27 | end) 28 | 29 | -- Refreshing 30 | gears.timer { 31 | timeout = 5, 32 | call_now = true, 33 | autostart = true, 34 | callback = function() 35 | emit_network_status() 36 | end 37 | } 38 | -------------------------------------------------------------------------------- /signals/ruled/init.lua: -------------------------------------------------------------------------------- 1 | local ruled = require("ruled") 2 | local awful = require("awful") 3 | local user = require("user") 4 | 5 | ruled.client.connect_signal("request::rules", function() 6 | ruled.client.append_rule { 7 | id = "global", 8 | rule = { }, 9 | properties = { 10 | raise = true, 11 | size_hints_honor = false, 12 | screen = awful.screen.preferred, 13 | focus = awful.client.focus.filter, 14 | placement = function(c) 15 | awful.placement.centered(c, c.transient_for) 16 | awful.placement.no_overlap(c) 17 | awful.placement.no_offscreen(c) 18 | end, 19 | } 20 | } 21 | 22 | if user.desktop_icon == true then 23 | ruled.client.append_rule { 24 | id = "desktop", 25 | rule_any = { 26 | class = { 27 | "Nemo-desktop" 28 | } 29 | }, 30 | properties = { 31 | -- tag = " ", 32 | border_width = 0, 33 | sticky = true 34 | } 35 | } 36 | end 37 | 38 | ruled.client.append_rule { 39 | id = "floating", 40 | rule_any = { 41 | instance = { "copyq", "pinentry" }, 42 | class = { 43 | "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv", 44 | "Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer", "feh", "qview", "ncmpcpp", 45 | "Places" 46 | }, 47 | name = { 48 | "Event Tester", -- xev. 49 | }, 50 | role = { 51 | "AlarmWindow", -- Thunderbird's calendar. 52 | "ConfigManager", -- Thunderbird's about:config. 53 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. 54 | } 55 | }, 56 | properties = { floating = true } 57 | } 58 | 59 | if user.titlebar == true then 60 | ruled.client.append_rule { 61 | id = "titlebars", 62 | rule_any = { type = { "normal" } }, 63 | properties = { titlebars_enabled = true }, 64 | } 65 | end 66 | 67 | ruled.client.append_rule { rule = { class = user.browser, user.chatapp }, properties = { screen = 1, tag = "1" } } 68 | end) 69 | -------------------------------------------------------------------------------- /signals/screen/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local wibox = require('wibox') 4 | local gears = require('gears') 5 | 6 | local dpi = beautiful.xresources.apply_dpi 7 | local user = require('user') 8 | 9 | screen.connect_signal('request::wallpaper', function(s) 10 | 11 | -- This will only work if you compile awesome with this patch added: 12 | -- https://github.com/awesomeWM/awesome/pull/3811 13 | -- Cause that enables the use of "cover" so we can set our notches 14 | -- while keeping the wallpaper fitting the screen properly 15 | awful.wallpaper { 16 | screen = s, 17 | honor_workarea = true, 18 | bg = beautiful.bg_dark, 19 | widget = { 20 | { 21 | image = user.wallpaper or beautiful.wallpaper, 22 | valign = "center", 23 | halign = "center", 24 | horizontal_fit_policy = "cover", 25 | vertical_fit_policy = "cover", 26 | widget = wibox.widget.imagebox, 27 | }, 28 | widget = wibox.container.background, 29 | -- GNOME style notches around the bar, this handles the corners to round depending on bar position 30 | bg = beautiful.bg_normal, 31 | shape = function(c, w, h) 32 | if user.bar_pos == "top" then 33 | gears.shape.partially_rounded_rect(c, w, h, true, true, false, false, dpi(12)) 34 | elseif user.bar_pos == "bottom" then 35 | gears.shape.partially_rounded_rect(c, w, h, false, false, true, true, dpi(12)) 36 | elseif user.bar_pos == "left" then 37 | gears.shape.partially_rounded_rect(c, w, h, true, false, false, true, dpi(12)) 38 | elseif user.bar_pos == "right" then 39 | gears.shape.partially_rounded_rect(c, w, h, false, true, true, false, dpi(12)) 40 | end 41 | end, 42 | } 43 | } 44 | end) 45 | -------------------------------------------------------------------------------- /signals/screenshot/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local naughty = require("naughty") 3 | local user = require("user") 4 | 5 | local function screenshot(args, time) 6 | local tmp = "/tmp/" .. os.date("%F-%H%M%S") .. ".png" 7 | 8 | awful.spawn.easy_async_with_shell("sleep " .. time .. " && maim " .. args .. " " .. tmp, function() 9 | awful.spawn.easy_async_with_shell("[ -e '" .. tmp .. "' ] && echo exists", function(output) 10 | if output:match('%w+') then 11 | awful.spawn.easy_async_with_shell("cat " .. tmp .. " | xclip -selection clipboard -t image/png -i") 12 | awful.spawn.easy_async_with_shell("cp " .. tmp .. " " .. user.screenshotdir) 13 | awful.spawn.easy_async_with_shell("rm " .. tmp) 14 | 15 | naughty.notification { 16 | title = "Screenshot", 17 | text = "Saved to " .. user.screenshotdir 18 | } 19 | else 20 | naughty.notification { 21 | title = "Screenshot", 22 | text = "Cancelled" 23 | } 24 | end 25 | end) 26 | end) 27 | end 28 | 29 | awesome.connect_signal("screenshot::full", function() 30 | screenshot("-u", "0") 31 | end) 32 | 33 | awesome.connect_signal("screenshot::fullwait", function() 34 | screenshot("-u", "5") 35 | end) 36 | 37 | awesome.connect_signal("screenshot::part", function() 38 | screenshot("-s -u", "0") 39 | end) 40 | -------------------------------------------------------------------------------- /signals/tag/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local user = require("user") 3 | 4 | tag.connect_signal("request::default_layouts", function(s) 5 | awful.layout.append_default_layouts(user.layouts, s) 6 | end) 7 | -------------------------------------------------------------------------------- /signals/volume/control.lua: -------------------------------------------------------------------------------- 1 | -- Allows checking level and state, and changing both of those. 2 | local awful = require('awful') 3 | local gears = require('gears') 4 | 5 | -- Volume Fetching and Signal Emitting 6 | -- Emit a volume level signal 7 | local volume_old = -1 8 | local muted_old = -1 9 | local function volume_emit() 10 | awful.spawn.easy_async_with_shell( 11 | "bash -c 'wpctl get-volume @DEFAULT_AUDIO_SINK@'", function(stdout) 12 | local volume = string.match(stdout:match('(%d%.%d+)')*100, '(%d+)') 13 | local muted = stdout:match('MUTED') 14 | local muted_int = muted and 1 or 0 15 | local volume_int = tonumber(volume) -- integer 16 | if volume_int ~= volume_old or muted_int ~= muted_old then 17 | awesome.emit_signal('signal::volume', volume_int, muted) -- integer 18 | volume_old = volume_int 19 | muted_old = muted_int 20 | end 21 | end) 22 | end 23 | -- Connect to set volume to a specific amount. 24 | awesome.connect_signal('volume::set', function(amount) 25 | awful.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ " .. amount .. "%") 26 | end) 27 | -- Connect to add a specific amount to volume. 28 | awesome.connect_signal('volume::change', function(amount) 29 | awful.spawn("wpctl set-volume @DEFAULT_AUDIO_SINK@ " .. volume_old + amount .. "%") 30 | end) 31 | -- Toggle audio. 32 | awesome.connect_signal('volume::mute', function() 33 | awful.spawn("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle") 34 | end) 35 | 36 | -- Refreshing 37 | gears.timer { 38 | timeout = 1, 39 | call_now = true, 40 | autostart = true, 41 | callback = function() 42 | volume_emit() 43 | end 44 | } 45 | -------------------------------------------------------------------------------- /signals/volume/init.lua: -------------------------------------------------------------------------------- 1 | require("signals.volume.notify") 2 | require("signals.volume.control") 3 | -------------------------------------------------------------------------------- /signals/volume/notify.lua: -------------------------------------------------------------------------------- 1 | local naughty = require('naughty') 2 | local beautiful = require('beautiful') 3 | 4 | local audio_on = beautiful.volumeicon 5 | local audio_off = beautiful.volumeofficon 6 | 7 | local timeout = 1.5 8 | local first = true 9 | awesome.connect_signal('signal::volume', function(volume, muted) 10 | if first then 11 | first = false 12 | else 13 | local message 14 | if muted then 15 | message = "Muted" 16 | else 17 | message = tostring(volume) .. "%" 18 | end 19 | local notif = naughty.notification({ 20 | title = "Audio", message = message, 21 | icon = muted and audio_off or audio_on, 22 | timeout = timeout, app_name = "volume" 23 | }, notif) 24 | end 25 | end) 26 | 27 | -------------------------------------------------------------------------------- /theme/colorscheme/adwaita/adwaita.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#1e1e1e" 7 | FG="#eeeeee" 8 | BL="#353535" 9 | WH="#444444" 10 | R="#ed333b" 11 | G="#e66100" 12 | Y="#ffa348" 13 | B="#5bc8af" 14 | M="#1c71d8" 15 | C="#E05C91" 16 | 17 | term 18 | gtk "adwaita-base16" 19 | browser $BG $BL $FG "#eeeeee" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/adwaita.theme.css" 21 | nvim "adwaita" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/adwaita/init.lua: -------------------------------------------------------------------------------- 1 | -- Adwaita, the GTK colorscheme. 2 | local _C = {} 3 | 4 | -- Monochrome 5 | _C.bg_dark = '#1e1e1e' 6 | _C.bg_dim = '#232323' 7 | _C.bg_normal = '#282828' 8 | _C.bg_light = '#353535' 9 | _C.mid_dark = '#444444' 10 | _C.mid_normal = '#696969' 11 | _C.mid_light = '#a3a3a3' 12 | _C.fg_normal = '#eeeeee' 13 | 14 | -- Colors 15 | _C.red = '#ed333b' 16 | _C.orange = '#e66100' 17 | _C.yellow = '#ffa348' 18 | _C.green = '#57e389' 19 | _C.cyan = '#5bc8af' 20 | _C.lightblue = '#62a0ea' 21 | _C.blue = '#1c71d8' 22 | _C.purple = '#c061cb' 23 | _C.magenta = '#E05C91' 24 | 25 | return _C 26 | -------------------------------------------------------------------------------- /theme/colorscheme/adwaita/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/adwaita/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/biscuit/biscuit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#181515" 7 | FG="#F4E6D2" 8 | BL="#423939" 9 | WH="#6D5F5F" 10 | R="#CA3F3F" 11 | G="#E46A3A" 12 | Y="#E39C45" 13 | B="#989F56" 14 | M="#517894" 15 | C="#C45497" 16 | 17 | term 18 | gtk "biscuit" 19 | browser $BG $BL $FG "#F4E6D2" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/biscuit.theme.css" 21 | nvim "biscuit" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/biscuit/init.lua: -------------------------------------------------------------------------------- 1 | local _C = {} 2 | 3 | -- Monochrome 4 | _C.bg_dark = '#181515' 5 | _C.bg_dim = '#221E1E' 6 | _C.bg_normal = '#2B2626' 7 | _C.bg_light = '#423939' 8 | _C.mid_dark = '#6D5F5F' 9 | _C.mid_normal = '#978787' 10 | _C.mid_light = '#B6A8A5' 11 | _C.fg_normal = '#F4E6D2' 12 | 13 | -- Colors 14 | _C.red = '#CA3F3F' 15 | _C.orange = '#E46A3A' 16 | _C.yellow = '#E39C45' 17 | _C.green = '#989F56' 18 | _C.cyan = '#629386' 19 | _C.lightblue = '#517894' 20 | _C.blue = '#4A5A8D' 21 | _C.purple = '#9F569A' 22 | _C.magenta = '#C45497' 23 | 24 | return _C 25 | -------------------------------------------------------------------------------- /theme/colorscheme/biscuit/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/biscuit/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/camellia/camellia.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#17181C" 7 | FG="#E4E5E6" 8 | BL="#333438" 9 | WH="#8F9093" 10 | R="#FA3867" 11 | G="#F57F3D" 12 | Y="#F5CA32" 13 | B="#65DB3D" 14 | M="#4CB2E5" 15 | C="#A673EB" 16 | 17 | term 18 | gtk "camellia" 19 | browser $BG $BL $FG "#E4E5E6" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/camellia.theme.css" 21 | nvim "camellia" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/camellia/init.lua: -------------------------------------------------------------------------------- 1 | local _C = {} 2 | 3 | -- Monochrome 4 | _C.bg_dark = '#17181C' 5 | _C.bg_dim = '#1B1C20' 6 | _C.bg_normal = '#1E1F24' 7 | _C.bg_light = '#26272B' 8 | _C.mid_dark = '#333438' 9 | _C.mid_normal = '#8F9093' 10 | _C.mid_light = '#B0B1B4' 11 | _C.fg_normal = '#E4E5E6' 12 | 13 | -- Colors 14 | _C.red = '#FA3867' 15 | _C.orange = '#F57F3D' 16 | _C.yellow = '#F5CA32' 17 | _C.green = '#65DB3D' 18 | _C.cyan = '#5CDD84' 19 | _C.lightblue = '#53DFCA' 20 | _C.blue = '#4CB2E5' 21 | _C.purple = '#A673EB' 22 | _C.magenta = '#FA4242' 23 | 24 | return _C 25 | -------------------------------------------------------------------------------- /theme/colorscheme/camellia/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/camellia/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/fullerene/fullerene.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#0f0f0f" 7 | FG="#c6c6c6" 8 | BL="#161616" 9 | WH="#262626" 10 | R="#c1374b" 11 | G="#CB604A" 12 | Y="#D58848" 13 | B="#32ae80" 14 | M="#5e76de" 15 | C="#9366d6" 16 | 17 | term 18 | gtk "fullerene-base16" 19 | browser $BG $WH $FG "#393939" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/fullerene.theme.css" 21 | nvim "fullerene" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/fullerene/init.lua: -------------------------------------------------------------------------------- 1 | -- gw's colorscheme 2 | local _C = {} 3 | 4 | -- Monochrome 5 | _C.bg_dark = '#0f0f0f' 6 | _C.bg_dim = '#161616' 7 | _C.bg_normal = '#1f1f1f' 8 | _C.bg_light = '#262626' 9 | _C.mid_dark = '#393939' 10 | _C.mid_normal = '#8d8d8d' 11 | _C.mid_light = '#a8a8a8' 12 | _C.fg_normal = '#c6c6c6' 13 | 14 | -- Colors 15 | _C.red = '#c1374b' 16 | _C.orange = '#CB604A' 17 | _C.yellow = '#D58848' 18 | _C.green = '#32ae80' 19 | _C.cyan = '#1ea3a1' 20 | _C.lightblue = '#5e76de' 21 | _C.blue = '#3f59ca' 22 | _C.purple = '#9366d6' 23 | _C.magenta = '#BF63A7' 24 | 25 | return _C 26 | -------------------------------------------------------------------------------- /theme/colorscheme/fullerene/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/fullerene/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/init.lua: -------------------------------------------------------------------------------- 1 | local user = require('user') 2 | 3 | local colorscheme = require('theme.colorscheme.adwaita') 4 | if user.colorscheme ~= nil then 5 | colorscheme = require('theme.colorscheme.' .. user.colorscheme) 6 | end 7 | return colorscheme 8 | -------------------------------------------------------------------------------- /theme/colorscheme/latte/init.lua: -------------------------------------------------------------------------------- 1 | -- hehehehehehe 2 | local _C = {} 3 | 4 | -- Monochrome 5 | _C.bg_dark = '#dce0e8' 6 | _C.bg_dim = '#e6e9ef' 7 | _C.bg_normal = '#eff1f5' 8 | _C.bg_light = '#ccd0da' 9 | _C.mid_dark = '#bcc0cc' 10 | _C.mid_normal = '#acb0be' 11 | _C.mid_light = '#9ca0b0' 12 | _C.fg_normal = '#4c4f69' 13 | 14 | -- Colors 15 | _C.red = '#d20f39' 16 | _C.orange = '#fe640b' 17 | _C.yellow = '#df8e1d' 18 | _C.green = '#40a02b' 19 | _C.cyan = '#179299' 20 | _C.lightblue = '#04a5e5' 21 | _C.blue = '#1e66f5' 22 | _C.purple = '#8839ef' 23 | _C.magenta = '#ea76cb' 24 | 25 | return _C 26 | -------------------------------------------------------------------------------- /theme/colorscheme/latte/latte.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#eff1f5" 7 | FG="#4c4f69" 8 | BL="#e6e9ef" 9 | WH="#9ca0b0" 10 | R="#d20f39" 11 | G="#fe640b" 12 | Y="#df8e1d" 13 | B="#40a02b" 14 | M="#04a5e5" 15 | C="#ea76cb" 16 | 17 | term 18 | gtk "latte-base16" 19 | nvim "catppuccin-latte" 20 | browser $BG $WH $FG "#4c4f69" 21 | discord "https://catppuccin.github.io/discord/dist/catppuccin-latte-sky.theme.css" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/latte/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/latte/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/oxocarbon/init.lua: -------------------------------------------------------------------------------- 1 | -- Oxocarbon colorscheme by nyoom and IBM 2 | -- https://github.com/nyoom-engineering/oxocarbon/tree/main 3 | local _C = {} 4 | 5 | -- Monochrome 6 | _C.bg_dark = '#161616' 7 | _C.bg_dim = '#1E1E1E' 8 | _C.bg_normal = '#262626' 9 | _C.bg_light = '#393939' 10 | _C.mid_dark = '#464646' 11 | _C.mid_normal = '#525252' 12 | _C.mid_light = '#696969' -- nice 13 | _C.fg_normal = '#dde1e6' 14 | 15 | -- Colors 16 | _C.red = '#ee5396' 17 | _C.orange = '#ff7eb6' 18 | _C.yellow = '#78a9ff' 19 | _C.green = '#42be65' 20 | _C.cyan = '#08bdba' 21 | _C.lightblue = '#82cfff' 22 | _C.blue = '#33b1ff' 23 | _C.purple = '#be95ff' 24 | _C.magenta = '#3ddbd9' 25 | 26 | return _C 27 | -------------------------------------------------------------------------------- /theme/colorscheme/oxocarbon/oxocarbon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#161616" 7 | FG="#dde1e6" 8 | BL="#393939" 9 | WH="#464646" 10 | R="#ee5396" 11 | G="#ff7eb6" 12 | Y="#78a9ff" 13 | B="#42be65" 14 | M="#08bdba" 15 | C="#3ddbd9" 16 | 17 | term 18 | gtk "oomox-base16-oxocarbon-dark" 19 | nvim "oxocarbon" 20 | browser $BG $BL $FG "#dde1e6" 21 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/oxocarbon.theme.css" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/oxocarbon/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/oxocarbon/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/sakura/init.lua: -------------------------------------------------------------------------------- 1 | -- Stardust-kyun's colorscheme 2 | -- https://github.com/stardust-kyun/dotfiles#sakura 3 | local _C = {} 4 | 5 | -- Monochrome 6 | _C.bg_dark = '#000f14' 7 | _C.bg_dim = '#051419' 8 | _C.bg_normal = '#0a191e' 9 | _C.bg_light = '#202E32' 10 | _C.mid_dark = '#344145' 11 | _C.mid_normal = '#465256' 12 | _C.mid_light = '#667073' 13 | _C.fg_normal = '#a0a0b4' 14 | 15 | -- Colors 16 | _C.red = '#824655' 17 | _C.orange = '#825854' 18 | _C.yellow = '#827d50' 19 | _C.green = '#468264' 20 | _C.cyan = '#327d7d' 21 | _C.lightblue = '#326482' 22 | _C.blue = '#374C6D' 23 | _C.purple = '#645078' 24 | _C.magenta = '#83495D' 25 | 26 | return _C 27 | -------------------------------------------------------------------------------- /theme/colorscheme/sakura/sakura.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#000f14" 7 | FG="#a0a0b4" 8 | BL="#0a191e" 9 | WH="#a0a0b4" 10 | R="#824655" 11 | G="#468264" 12 | Y="#827d50" 13 | B="#326482" 14 | M="#645078" 15 | C="#327d7d" 16 | 17 | term 18 | gtk "sakura-base16" 19 | browser $BG $BL $FG "#a0a0b475" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/sakura.theme.css" 21 | nvim "sakura" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/sakura/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/sakura/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/solarized/init.lua: -------------------------------------------------------------------------------- 1 | -- SCIENCE YEAH 2 | local _C = {} 3 | 4 | -- Monochrome 5 | _C.bg_dark = '#002b36' 6 | _C.bg_dim = '#04313C' 7 | _C.bg_normal = '#073642' 8 | _C.bg_light = '#1E4853' 9 | _C.mid_dark = '#325963' 10 | _C.mid_normal = '#456871' 11 | _C.mid_light = '#56767E' 12 | _C.fg_normal = '#fdf6e3' 13 | 14 | -- Colors 15 | _C.red = '#dc322f' 16 | _C.orange = '#cb4b16' 17 | _C.yellow = '#b58900' 18 | _C.green = '#859900' 19 | _C.cyan = '#2aa198' 20 | _C.lightblue = '#268bd2' 21 | _C.blue = '#495FCC' 22 | _C.purple = '#6c71c4' 23 | _C.magenta = '#d33682' 24 | 25 | return _C 26 | -------------------------------------------------------------------------------- /theme/colorscheme/solarized/solarized.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#002b36" 7 | FG="#fdf6e3" 8 | BL="#073642" 9 | WH="#325963" 10 | R="#dc322f" 11 | G="#cb4b16" 12 | Y="#b58900" 13 | B="#859900" 14 | M="#495FCC" 15 | C="#d33682" 16 | 17 | term 18 | gtk "solarized-base16" 19 | browser $BG $WH $FG "#56767E" 20 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/solarized.theme.css" 21 | nvim "solarized" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/solarized/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/solarized/wallpaper.png -------------------------------------------------------------------------------- /theme/colorscheme/stardew/init.lua: -------------------------------------------------------------------------------- 1 | -- Stardew from TorchedSammy 2 | local _C = {} 3 | 4 | -- Monochrome 5 | _C.bg_dark = '#16161a' 6 | _C.bg_dim = '#212126' 7 | _C.bg_normal = '#2a2a30' 8 | _C.bg_light = '#373740' 9 | _C.mid_dark = '#4f4f5c' 10 | _C.mid_normal = '#676778' 11 | _C.mid_light = '#9595ab' 12 | _C.fg_normal = '#DCDFE4' 13 | 14 | -- Colors 15 | _C.red = '#f25c5c' 16 | _C.orange = '#F97C63' 17 | _C.yellow = '#ff9c6a' 18 | _C.green = '#55b682' 19 | _C.cyan = '#62BFA6' 20 | _C.lightblue = '#7aaaff' 21 | _C.blue = '#7A85FF' 22 | _C.purple = '#b87aff' 23 | _C.magenta = '#f17ac6' 24 | 25 | return _C 26 | -------------------------------------------------------------------------------- /theme/colorscheme/stardew/stardew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source $HOME/.config/awesome/theme/desktop.sh 4 | 5 | # Colors 6 | BG="#16161a" 7 | FG="#DCDFE4" 8 | BL="#2a2a30" 9 | WH="#373740" 10 | R="#f25c5c" 11 | G="#F97C63" 12 | Y="#ff9c6a" 13 | B="#55b682" 14 | M="#7A85FF" 15 | C="#b87aff" 16 | 17 | term 18 | gtk "stardew-base16" 19 | nvim "stardew" 20 | browser $BG $BL $FG "#DCDFE4" 21 | discord "https://raw.githubusercontent.com/tsukki9696/discord-themes/main/stardew.theme.css" 22 | -------------------------------------------------------------------------------- /theme/colorscheme/stardew/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deceptionfalls/tsukiyomi/a471ad05fe8aad93e02f0a9b6b0f654563347848/theme/colorscheme/stardew/wallpaper.png -------------------------------------------------------------------------------- /theme/desktop.sh: -------------------------------------------------------------------------------- 1 | # paths 2 | config="$HOME/.config" 3 | nvim="$config/nvim" 4 | xresources="$HOME/.Xresources" 5 | gtk="$config/gtk-3.0/settings.ini" 6 | firefox="$HOME/.mozilla/firefox/eui5p2r2.default-release/chrome" 7 | discord="$config/Vencord/themes" 8 | 9 | term() { 10 | # Xresources 11 | sed -i -e "s/#define FG .*/#define FG $FG/g" \ 12 | -e "s/#define BG .*/#define BG $BG/g" \ 13 | -e "s/#define BL .*/#define BL $BL/g" \ 14 | -e "s/#define WH .*/#define WH $WH/g" \ 15 | -e "s/#define R .*/#define R $R/g" \ 16 | -e "s/#define G .*/#define G $G/g" \ 17 | -e "s/#define Y .*/#define Y $Y/g" \ 18 | -e "s/#define B .*/#define B $B/g" \ 19 | -e "s/#define M .*/#define M $M/g" \ 20 | -e "s/#define C .*/#define C $C/g" $xresources 21 | 22 | # Update Xresources, Terminals, and Vim 23 | xrdb $xresources 24 | pidof st | xargs kill -s USR1 25 | 26 | } 27 | 28 | gtk() { 29 | sed -i -e "s/gtk-theme-name=.*/gtk-theme-name=$1/g" $gtk 30 | sed -i -e "s/Net\/ThemeName .*/Net\/ThemeName \"$1\"/g" $HOME/.config/xsettingsd/xsettingsd.conf 31 | 32 | # Apply 33 | killall xsettingsd 34 | xsettingsd & 35 | } 36 | 37 | browser() { 38 | sed -i -e "s/--bg: .*/--bg: $1;/g" \ 39 | -e "s/--bg-alt: .*/--bg-alt: $2;/g" \ 40 | -e "s/--fg: .*/--fg: $3;/g" \ 41 | -e "s/--fg-alt: .*/--fg-alt: $4;/g" $firefox/userChrome.css 42 | } 43 | 44 | css() { 45 | sed -i -e "s/--bg: .*/--bg: $1 !important;/g" \ 46 | -e "s/--bg2: .*/--bg2: $2 !important;/g" \ 47 | -e "s/--bg3: .*/--bg3: $3 !important;/g" \ 48 | -e "s/--fg: .*/--fg: $4 !important;/g" $firefox/userContent.css 49 | } 50 | 51 | nvim() { 52 | sed -i -e "s/vim.cmd 'colorscheme .*'/vim.cmd 'colorscheme $1'/" $config/nvim/init.lua 53 | } 54 | 55 | discord() { 56 | sed -i -e "s|@import url('.*')|@import url('$1')|" $discord/whatever.theme.css 57 | } 58 | -------------------------------------------------------------------------------- /theme/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local gears = require("gears") 3 | local dpi = require('beautiful').xresources.apply_dpi 4 | local gfs = require("gears.filesystem") 5 | 6 | local user = require('user') 7 | local helpers = require('helpers') 8 | local color = require('theme.colorscheme') 9 | 10 | local path = gfs.get_themes_dir() 11 | local icon_path = gfs.get_configuration_dir() .. 'assets/' 12 | local pltt_path = gfs.get_configuration_dir() .. "theme/colorscheme/" .. user.colorscheme .. "/" 13 | 14 | local _T = {} 15 | 16 | _T.fontsize = user.fontsize 17 | _T.font = user.font 18 | _T.font_mono = user.font_mono 19 | 20 | -- colors 21 | _T.red = color.red 22 | _T.orange = color.orange 23 | _T.yellow = color.yellow 24 | _T.green = color.green 25 | _T.cyan = color.cyan 26 | _T.lightblue = color.lightblue 27 | _T.blue = color.blue 28 | _T.purple = color.purple 29 | _T.magenta = color.magenta 30 | 31 | -- function to get the accent color from the user file 32 | local function getAccentColor() 33 | local accentColor = nil 34 | 35 | if user.accent == "red" then 36 | accentColor = color.red 37 | elseif user.accent == "orange" then 38 | accentColor = color.orange 39 | elseif user.accent == "yellow" then 40 | accentColor = color.yellow 41 | elseif user.accent == "green" then 42 | accentColor = color.green 43 | elseif user.accent == "cyan" then 44 | accentColor = color.cyan 45 | elseif user.accent == "lightblue" then 46 | accentColor = color.lightblue 47 | elseif user.accent == "blue" then 48 | accentColor = color.blue 49 | elseif user.accent == "purple" then 50 | accentColor = color.purple 51 | elseif user.accent == "magenta" then 52 | accentColor = color.magenta 53 | elseif user.accent == "white" then 54 | accentColor = color.fg_normal 55 | else 56 | -- default 57 | accentColor = color.fg_normal 58 | end 59 | 60 | return accentColor 61 | end 62 | 63 | _T.accent = getAccentColor() 64 | 65 | _T.bg_dark = color.bg_dark 66 | _T.bg_dim = color.bg_dim 67 | _T.bg_normal = color.bg_normal 68 | _T.bg_light = color.bg_light 69 | _T.mid_dark = color.mid_dark 70 | _T.mid_normal = color.mid_normal 71 | _T.mid_light = color.mid_light 72 | _T.fg_normal = color.fg_normal 73 | 74 | _T.transparent = '#00000000' 75 | 76 | _T.wallpaper = pltt_path .. "wallpaper.png" 77 | 78 | -- AWM values 79 | _T.useless_gap = dpi(user.inner_gaps) 80 | _T.border_width = dpi(user.border) 81 | _T.border_color_normal = color.bg_normal 82 | 83 | if user.titlebar == true then 84 | _T.border_color_active = color.bg_light 85 | else 86 | _T.border_color_active = _T.accent 87 | end 88 | 89 | _T.menu_height = dpi(15) 90 | _T.menu_width = dpi(100) 91 | 92 | _T.awesome_icon = require('beautiful.theme_assets').awesome_icon(dpi(100), _T.accent, color.bg_dark) 93 | 94 | _T.layout_dwindle = gears.color.recolor_image(path .. "default/layouts/dwindle.png", color.fg_normal) 95 | _T.layout_tile = gears.color.recolor_image(path .. "default/layouts/tilew.png", color.fg_normal) 96 | _T.layout_max = gears.color.recolor_image(path .. "default/layouts/max.png", color.fg_normal) 97 | _T.layout_floating = gears.color.recolor_image(path .. "default/layouts/floatingw.png", color.fg_normal) 98 | 99 | _T.star = gears.color.recolor_image(icon_path .. "star.svg", _T.accent) 100 | _T.cookie = gears.color.recolor_image(icon_path .. "cookie3.svg", _T.accent) 101 | _T.moon = gears.color.recolor_image(icon_path .. "moon.svg", _T.accent) 102 | _T.cookie_small = gears.color.recolor_image(icon_path .. "cookie-small.svg", _T.accent) 103 | 104 | _T.volumeicon = gears.color.recolor_image(icon_path .. "volume.svg", color.fg_normal) 105 | _T.volumeofficon = gears.color.recolor_image(icon_path .. "volume-off.svg", color.mid_normal) 106 | _T.bluetoothicon = gears.color.recolor_image(icon_path .. "bluetooth.svg", color.fg_normal) 107 | _T.bluetoothofficon = gears.color.recolor_image(icon_path .. "bluetooth-off.svg", color.mid_normal) 108 | _T.wifiicon = gears.color.recolor_image(icon_path .. "wifi.svg", color.fg_normal) 109 | _T.wifiofficon = gears.color.recolor_image(icon_path .. "wifi-off.svg", color.mid_normal) 110 | 111 | _T.battery = gears.color.recolor_image(icon_path .. "battery.svg", color.fg_normal) 112 | _T.battery10 = gears.color.recolor_image(icon_path .. "battery-10.svg", color.fg_normal) 113 | _T.battery20 = gears.color.recolor_image(icon_path .. "battery-20.svg", color.fg_normal) 114 | _T.battery30 = gears.color.recolor_image(icon_path .. "battery-30.svg", color.fg_normal) 115 | _T.battery40 = gears.color.recolor_image(icon_path .. "battery-40.svg", color.fg_normal) 116 | _T.battery50 = gears.color.recolor_image(icon_path .. "battery-50.svg", color.fg_normal) 117 | _T.battery60 = gears.color.recolor_image(icon_path .. "battery-60.svg", color.fg_normal) 118 | _T.battery70 = gears.color.recolor_image(icon_path .. "battery-70.svg", color.fg_normal) 119 | _T.battery80 = gears.color.recolor_image(icon_path .. "battery-80.svg", color.fg_normal) 120 | _T.battery90 = gears.color.recolor_image(icon_path .. "battery-90.svg", color.fg_normal) 121 | 122 | _T.batterycharging100 = gears.color.recolor_image(icon_path .. "battery-charging-100.svg", color.fg_normal) 123 | _T.batterycharging10 = gears.color.recolor_image(icon_path .. "battery-charging-10.svg", color.fg_normal) 124 | _T.batterycharging20 = gears.color.recolor_image(icon_path .. "battery-charging-20.svg", color.fg_normal) 125 | _T.batterycharging30 = gears.color.recolor_image(icon_path .. "battery-charging-30.svg", color.fg_normal) 126 | _T.batterycharging40 = gears.color.recolor_image(icon_path .. "battery-charging-40.svg", color.fg_normal) 127 | _T.batterycharging50 = gears.color.recolor_image(icon_path .. "battery-charging-50.svg", color.fg_normal) 128 | _T.batterycharging60 = gears.color.recolor_image(icon_path .. "battery-charging-60.svg", color.fg_normal) 129 | _T.batterycharging70 = gears.color.recolor_image(icon_path .. "battery-charging-70.svg", color.fg_normal) 130 | _T.batterycharging80 = gears.color.recolor_image(icon_path .. "battery-charging-80.svg", color.fg_normal) 131 | _T.batterycharging90 = gears.color.recolor_image(icon_path .. "battery-charging-90.svg", color.fg_normal) 132 | 133 | -- Taglist 134 | _T.taglist_font = _T.font 135 | _T.taglist_bg_focus = _T.accent 136 | _T.taglist_bg_occupied = color.mid_dark 137 | _T.taglist_bg_empty = color.bg_light 138 | _T.taglist_bg_urgent = color.yellow 139 | 140 | -- Tasklist 141 | _T.tasklist_bg_focus = color.bg_light 142 | _T.tasklist_bg_normal = color.bg_normal 143 | 144 | -- Titlebar 145 | _T.titlebar_bg_normal = color.bg_normal 146 | _T.titlebar_bg_focus = color.bg_light 147 | _T.titlebar_bg_urgent = color.bg_normal 148 | 149 | _T.titlebar_fg_normal = color.fg_normal 150 | _T.titlebar_fg_focus = color.fg_normal 151 | _T.titlebar_fg_urgent = color.red 152 | 153 | -- Icons 154 | _T.icon_theme = user.icon_theme 155 | 156 | -- Snap 157 | _T.snap_border_width = dpi(4) 158 | _T.snap_border_radius = dpi(4) 159 | _T.snap_bg = _T.accent 160 | _T.snap_shape = helpers.rrect(15) 161 | _T.snapper_gap = dpi(user.inner_gaps) 162 | 163 | -- Systray 164 | _T.systray_max_rows = 1 165 | _T.systray_icon_spacing = dpi(2) 166 | _T.bg_systray = color.bg_dark 167 | 168 | -- Notifications 169 | _T.notification_spacing = dpi(user.outer_gaps) 170 | 171 | -- Tooltips 172 | _T.tooltip_bg = color.bg_normal 173 | _T.tooltip_fg = color.fg_normal 174 | _T.tooltip_opacity = 0 175 | 176 | return _T 177 | -------------------------------------------------------------------------------- /theme/reload-theme.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local gfs = require("gears.filesystem") 3 | local user = require('user') 4 | 5 | -- Function to reload themes on awm restarts 6 | -- Requires pynvim 7 | 8 | local function reload_theme() 9 | local path = gfs.get_configuration_dir() .. "theme/colorscheme/" .. user.colorscheme .. "/" .. user.colorscheme .. ".sh" 10 | local awcfg = gfs.get_configuration_dir() 11 | local reload = "python " .. awcfg .. "scripts/nvim-reload.py" 12 | 13 | local reload_cmd = reload .. " 'source ~/.config/nvim/init.lua'" -- this assumes you have nvim there obv 14 | 15 | awful.spawn.easy_async_with_shell("bash -e " .. path) 16 | awful.spawn.easy_async_with_shell(reload_cmd, function() end) 17 | end 18 | 19 | reload_theme() 20 | -------------------------------------------------------------------------------- /user.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local home = os.getenv('HOME') .. '/' 3 | 4 | local _U = {} 5 | 6 | --------------------------------------------- 7 | -- Functionality 8 | --------------------------------------------- 9 | _U.modkey = "Mod4" -- Windows/Super key 10 | _U.modkey2 = "Mod1" -- Alt key 11 | 12 | --------------------------------------------- 13 | -- Signals 14 | --------------------------------------------- 15 | 16 | -- Turn on/off signals 17 | _U.bluetooth_enabled = true 18 | _U.battery_enabled = true 19 | 20 | --------------------------------------------- 21 | -- Desktop Icons 22 | --------------------------------------------- 23 | 24 | -- Use desktop icons if enabled 25 | -- WARNING: this only works with the floating layout, it will break everything else 26 | -- requires Nemo as your file manager, plus some setup regarding Nemo: learn more about it on 27 | -- https://star.is-a.dev/blog/icons 28 | _U.desktop_icon = false 29 | 30 | --------------------------------------------- 31 | -- Apps 32 | --------------------------------------------- 33 | 34 | -- Terminal and terminal command for scratchpads 35 | _U.terminal = "st" 36 | _U.term_cmd = "st -c " 37 | 38 | -- GUI Apps 39 | _U.browser = os.getenv("BROWSER") or "firefox" 40 | _U.editor = os.getenv("EDITOR") or "nvim" 41 | _U.files = "nemo" 42 | _U.chatapp = "discord" 43 | 44 | -- CLI apps 45 | _U.files_cli = "ranger" 46 | 47 | --------------------------------------------- 48 | -- Music 49 | --------------------------------------------- 50 | 51 | -- Turn on/off music related decorations and signals 52 | _U.music_enabled = true 53 | 54 | -- Music player to send play/pause/toggle signals to 55 | _U.music_player = "spotify" 56 | 57 | --------------------------------------------- 58 | -- Awesome related 59 | --------------------------------------------- 60 | 61 | _U.layouts = { 62 | awful.layout.suit.tile, 63 | -- awful.layout.suit.spiral.dwindle, 64 | awful.layout.suit.max, 65 | -- awful.layout.suit.floating, 66 | -- awful.layout.suit.tile.left, 67 | -- awful.layout.suit.tile.bottom, 68 | -- awful.layout.suit.tile.top, 69 | -- awful.layout.suit.fair, 70 | -- awful.layout.suit.fair.horizontal, 71 | -- awful.layout.suit.spiral, 72 | -- awful.layout.suit.max.fullscreen, 73 | -- awful.layout.suit.magnifier, 74 | -- awful.layout.suit.corner.nw, 75 | } 76 | 77 | _U.tags = { '1', '2', '3', '4' } 78 | 79 | --------------------------------------------- 80 | -- Titlebars 81 | --------------------------------------------- 82 | 83 | -- Toggle titlebars on/off 84 | _U.titlebar = false 85 | 86 | -- Position of titlebar 87 | _U.titlebar_pos = "top" 88 | 89 | -- Toggle visibility of titlebar icons 90 | _U.titlebar_icons = true 91 | 92 | --------------------------------------------- 93 | -- Bar 94 | --------------------------------------------- 95 | 96 | -- Type of bar: 97 | -- horizontal, vertical 98 | _U.bar_type = "horizontal" 99 | 100 | -- Position of the bar: 101 | -- bottom, top, left, right 102 | _U.bar_pos = "top" 103 | 104 | --------------------------------------------- 105 | -- Dock 106 | --------------------------------------------- 107 | 108 | -- Toggle the dock on/off 109 | _U.dock_enabled = false 110 | 111 | --------------------------------------------- 112 | -- Notifications 113 | --------------------------------------------- 114 | 115 | -- Position of notifications 116 | _U.notification_pos = "top_right" 117 | 118 | --------------------------------------------- 119 | -- Borders and gaps 120 | --------------------------------------------- 121 | 122 | -- Border width 123 | -- If titlebars are off, this will use the color of your accent color, 124 | -- else it will use bg colors 125 | _U.border = 0 126 | 127 | -- Spacing between UI elements 128 | _U.spacing = 8 129 | 130 | -- Inner and outer gaps 131 | _U.inner_gaps = 3 132 | _U.outer_gaps = 8 133 | 134 | --------------------------------------------- 135 | -- Color and themes 136 | --------------------------------------------- 137 | 138 | -- Available colorschemes: 139 | -- biscuit, sakura, oxocarbon, camellia, adwaita, latte, fullerene, stardew, solarized 140 | _U.colorscheme = "camellia" 141 | 142 | -- Dictates color of homeicon, active tag, active border, etc. 143 | -- Available accent colors: 144 | -- white, red, orange, yellow, green, cyan, lightblue, blue, magenta, purple 145 | -- defaults to "white" if nil 146 | _U.accent = "red" 147 | 148 | -- Available icons: 149 | -- cookie, cookie_small, moon, star, awm 150 | _U.icon = "cookie_small" 151 | 152 | -- Font config 153 | -- the little space is for declaring a custom font size 154 | _U.font = "IBM Plex Sans" .. " " 155 | _U.font_mono = "IBM Plex Mono" .. " " 156 | _U.fontsize = "14" 157 | 158 | -- Path to your icon theme 159 | _U.icon_theme = home .. ".icons/Colloid" 160 | 161 | -- Image related 162 | _U.avatar = home .. 'Pictures/Anime/gojo/9f14e7384844b59079d5f053a3af0d93.jpg' 163 | -- _U.wallpaper = home .. 'Wallpapers/solarized-dusk.png' 164 | 165 | _U.screenshotdir = home .. 'Pictures/Screenshots/' 166 | 167 | _U.username = os.getenv("USER") 168 | 169 | return _U 170 | -------------------------------------------------------------------------------- /widget/bar/components/battery.lua: -------------------------------------------------------------------------------- 1 | local gears = require('gears') 2 | local wibox = require("wibox") 3 | local beautiful = require("beautiful") 4 | local helpers = require("helpers") 5 | local dpi = beautiful.xresources.apply_dpi 6 | 7 | local user = require("user") 8 | 9 | -- Stolen from chadcat7 10 | -- https://github.com/chadcat7/crystal/tree/the-awesome-config 11 | 12 | -- le batterie 13 | local battery = wibox.widget { 14 | id = "battery", 15 | widget = wibox.widget.progressbar, 16 | max_value = 100, 17 | forced_width = user.bar_type == "vertical" and 50 or 70, 18 | forced_height = 90, 19 | shape = user.style == "rounded" and helpers.rrect(30) or gears.shape.rectangle, 20 | } 21 | 22 | -- le batterie widgetté 23 | local batstatus = wibox.widget { 24 | { 25 | { 26 | { 27 | { 28 | battery, 29 | { 30 | { 31 | font = user.font .. "16", 32 | markup = user.colorscheme == "latte" and helpers.colorizeText("󱐋", beautiful.fg_normal) or helpers.colorizeText("󱐋", beautiful.bg_dark), 33 | widget = wibox.widget.textbox, 34 | valign = "center", 35 | align = "center" 36 | }, 37 | direction = user.bar_type == "vertical" and "east" or "north", 38 | widget = wibox.container.rotate 39 | }, 40 | layout = wibox.layout.stack 41 | }, 42 | layout = wibox.layout.fixed.horizontal, 43 | spacing = dpi(15) 44 | }, 45 | margins = dpi(0), 46 | widget = wibox.container.margin 47 | }, 48 | layout = wibox.layout.stack 49 | }, 50 | bg = beautiful.bg_dark, 51 | widget = wibox.container.background, 52 | shape = helpers.rrect(2), 53 | } 54 | 55 | local vbar_batstatus = wibox.widget { 56 | batstatus, 57 | direction = "east", 58 | widget = wibox.container.rotate 59 | } 60 | 61 | awesome.connect_signal("signal::battery", function(value, state) 62 | local b = battery 63 | b.state = state 64 | b.value = value 65 | if state then 66 | b.color = beautiful.green 67 | b.background_color = beautiful.green .. '80' 68 | elseif value < 18 then 69 | b.color = beautiful.red 70 | b.background_color = beautiful.red .. '80' 71 | elseif value < 30 then 72 | b.color = beautiful.yellow 73 | b.background_color = beautiful.yellow .. '80' 74 | else 75 | b.color = beautiful.green 76 | b.background_color = beautiful.green .. '80' 77 | end 78 | end) 79 | 80 | if user.bar_type == "vertical" then 81 | return vbar_batstatus 82 | else 83 | return batstatus 84 | end 85 | -------------------------------------------------------------------------------- /widget/bar/components/clock.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local beautiful = require("beautiful") 3 | local gears = require("gears") 4 | 5 | local dpi = beautiful.xresources.apply_dpi 6 | local helpers = require("helpers") 7 | local user = require('user') 8 | 9 | return function () 10 | local clock = { 11 | { 12 | { 13 | format = '%I:%M', 14 | valign = "center", 15 | halign = "center", 16 | widget = wibox.widget.textclock, 17 | font = user.font .. "11" 18 | }, 19 | left = dpi(15), 20 | right = dpi(15), 21 | bottom = dpi(2), 22 | top = dpi(2), 23 | widget = wibox.container.margin 24 | }, 25 | fg = beautiful.fg_normal, 26 | bg = beautiful.bg_normal, 27 | shape = helpers.rrect(50), 28 | widget = wibox.container.background, 29 | } 30 | 31 | local vbar_clock = { 32 | { 33 | { 34 | { 35 | format = '%I', 36 | font = beautiful.font, 37 | halign = "center", 38 | widget = wibox.widget.textclock 39 | }, 40 | { 41 | format = '%M', 42 | font = beautiful.font, 43 | halign = "center", 44 | widget = wibox.widget.textclock 45 | }, 46 | layout = wibox.layout.fixed.vertical 47 | }, 48 | left = dpi(2), 49 | right = dpi(2), 50 | bottom = dpi(9), 51 | top = dpi(9), 52 | widget = wibox.container.margin 53 | }, 54 | fg = beautiful.fg_normal, 55 | bg = beautiful.bg_normal, 56 | shape = helpers.rrect(50), 57 | widget = wibox.container.background 58 | } 59 | 60 | if user.bar_type == "vertical" then 61 | return vbar_clock else 62 | return clock 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /widget/bar/components/home.lua: -------------------------------------------------------------------------------- 1 | local wibox = require('wibox') 2 | local awful = require('awful') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local bling = require('modules.bling') 6 | 7 | local dpi = beautiful.xresources.apply_dpi 8 | local launcher = require('widget.launcher') 9 | local helpers = require('helpers') 10 | local user = require('user') 11 | 12 | -- icon handling 13 | if user.icon == "cookie" then 14 | icon = beautiful.cookie 15 | elseif user.icon == "star" then 16 | icon = beautiful.star 17 | elseif user.icon == "cookie_small" then 18 | icon = beautiful.cookie_small 19 | elseif user.icon == "moon" then 20 | icon = beautiful.moon 21 | elseif user.icon == "awm" then 22 | icon = beautiful.awesome_icon 23 | end 24 | 25 | return function () 26 | 27 | local home = wibox.widget { 28 | { 29 | { 30 | { 31 | image = icon, 32 | halign = "center", 33 | valign = "center", 34 | widget = wibox.widget.imagebox 35 | }, 36 | margins = dpi(5), 37 | widget = wibox.container.margin 38 | }, 39 | align = "center", 40 | widget = wibox.container.place 41 | }, 42 | bg = user.icon == "awm" and beautiful.bg_dark or beautiful.bg_normal, 43 | shape = gears.shape.circle, 44 | widget = wibox.container.background, 45 | buttons = { 46 | awful.button({}, 1, function() 47 | local app_launcher = bling.widget.app_launcher(launcher) 48 | app_launcher:toggle() 49 | end) 50 | }, 51 | } 52 | 53 | helpers.hoverCursor(home) 54 | 55 | return home 56 | end 57 | -------------------------------------------------------------------------------- /widget/bar/components/layoutbox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local user = require('user') 3 | local helpers = require('helpers') 4 | 5 | local function getlayout(s) 6 | return awful.widget.layoutbox { 7 | screen = s, 8 | visible = #user.layouts > 1, 9 | buttons = { 10 | awful.button({ }, 1, function () awful.layout.inc( 1) end), 11 | awful.button({ }, 3, function () awful.layout.inc(-1) end), 12 | awful.button({ }, 4, function () awful.layout.inc(-1) end), 13 | awful.button({ }, 5, function () awful.layout.inc( 1) end), 14 | } 15 | } 16 | end 17 | 18 | return getlayout 19 | -------------------------------------------------------------------------------- /widget/bar/components/pfp.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | local gears = require("gears") 5 | 6 | local helpers = require("helpers") 7 | local user = require('user') 8 | 9 | return function() 10 | 11 | local pfp = wibox.widget { 12 | widget = wibox.widget.imagebox, 13 | image = user.avatar, 14 | clip_shape = gears.shape.circle, 15 | resize = true, 16 | valign = "center", 17 | halign = "center", 18 | spacing = user.spacing, 19 | buttons = { 20 | awful.button({}, 1, function() 21 | awesome.emit_signal("controlcenter::toggle") 22 | end) 23 | } 24 | } 25 | 26 | helpers.hoverCursor(pfp) 27 | 28 | return pfp 29 | end 30 | -------------------------------------------------------------------------------- /widget/bar/components/status.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | 5 | local dpi = beautiful.xresources.apply_dpi 6 | local helpers = require("helpers") 7 | local user = require("user") 8 | local batstatus = require("widget.bar.components.battery") 9 | 10 | return function () 11 | local function status_widget(button) 12 | local status = wibox.widget { 13 | { 14 | { 15 | id = "image_role", 16 | align = "center", 17 | widget = wibox.widget.imagebox 18 | }, 19 | valign = "center", 20 | halign = "center", 21 | widget = wibox.container.place 22 | }, 23 | forced_width = dpi(16), 24 | widget = wibox.container.place, 25 | buttons = { 26 | awful.button({}, 1, button) 27 | }, 28 | set_image = function(self, content) 29 | self:get_children_by_id('image_role')[1].image = content 30 | end 31 | } 32 | return status 33 | end 34 | 35 | bar_btn_sound = status_widget(function() awesome.emit_signal("volume::mute") end) 36 | bar_btn_net = status_widget(function() awesome.emit_signal("network::toggle") end) 37 | bar_btn_blue = status_widget(function() awesome.emit_signal("bluetooth::toggle") end) 38 | bar_btn_bat = status_widget() 39 | 40 | helpers.hoverCursor(bar_btn_sound) 41 | helpers.hoverCursor(bar_btn_net) 42 | helpers.hoverCursor(bar_btn_blue) 43 | -- helpers.hoverCursor(bar_btn_bat) 44 | 45 | local buttons = wibox.widget { 46 | { 47 | { 48 | bar_btn_bat, 49 | -- bar_btn_sound, 50 | bar_btn_net, 51 | { 52 | bar_btn_blue, 53 | widget = wibox.widget, 54 | layout = user.bar_type == "vertical" and wibox.layout.fixed.vertical or wibox.layout.fixed.horizontal, 55 | visible = user.bluetooth_enabled 56 | }, 57 | spacing = dpi(user.spacing / 2), 58 | margins = dpi(10), 59 | layout = user.bar_type == "vertical" and wibox.layout.fixed.vertical or wibox.layout.fixed.horizontal 60 | }, 61 | left = dpi(12), 62 | right = dpi(9), 63 | top = user.bar_type == "vertical" and dpi(9) or dpi(0), 64 | bottom = user.bar_type == "vertical" and dpi(9) or dpi(0), 65 | widget = wibox.container.margin 66 | }, 67 | bg = beautiful.bg_normal, 68 | shape = helpers.rrect(30), 69 | widget = wibox.container.background 70 | } 71 | 72 | -- May god have mercy on my soul for this 73 | awesome.connect_signal("signal::battery", function(value, state) 74 | local b = batstatus 75 | b.state = state 76 | b.value = value 77 | 78 | if b.state then 79 | if b.value > 90 then 80 | bar_btn_bat.image = beautiful.batterycharging100 81 | elseif b.value > 80 then 82 | bar_btn_bat.image = beautiful.batterycharging90 83 | elseif b.value > 70 then 84 | bar_btn_bat.image = beautiful.batterycharging80 85 | elseif b.value > 60 then 86 | bar_btn_bat.image = beautiful.batterycharging70 87 | elseif b.value > 50 then 88 | bar_btn_bat.image = beautiful.batterycharging60 89 | elseif b.value > 40 then 90 | bar_btn_bat.image = beautiful.batterycharging50 91 | elseif b.value > 30 then 92 | bar_btn_bat.image = beautiful.batterycharging40 93 | elseif b.value > 30 then 94 | bar_btn_bat.image = beautiful.batterycharging40 95 | elseif b.value > 20 then 96 | bar_btn_bat.image = beautiful.batterycharging30 97 | elseif b.value > 10 then 98 | bar_btn_bat.image = beautiful.batterycharging20 99 | elseif b.value <= 10 then 100 | bar_btn_bat.image = beautiful.batterycharging10 101 | else 102 | bar_btn_bat.image = beautiful.batterycharging100 103 | end 104 | else 105 | if b.value == 100 then 106 | bar_btn_bat.image = beautiful.battery 107 | elseif b.value > 90 then 108 | bar_btn_bat.image = beautiful.battery 109 | elseif b.value > 80 then 110 | bar_btn_bat.image = beautiful.battery90 111 | elseif b.value > 70 then 112 | bar_btn_bat.image = beautiful.battery80 113 | elseif b.value > 60 then 114 | bar_btn_bat.image = beautiful.battery70 115 | elseif b.value > 60 then 116 | bar_btn_bat.image = beautiful.battery70 117 | elseif b.value > 50 then 118 | bar_btn_bat.image = beautiful.battery60 119 | elseif b.value > 40 then 120 | bar_btn_bat.image = beautiful.battery50 121 | elseif b.value > 30 then 122 | bar_btn_bat.image = beautiful.battery40 123 | elseif b.value > 20 then 124 | bar_btn_bat.image = beautiful.battery30 125 | elseif b.value > 10 then 126 | bar_btn_bat.image = beautiful.battery20 127 | elseif b.value <= 10 then 128 | bar_btn_bat.image = beautiful.battery10 129 | else 130 | bar_btn_bat.image = beautiful.battery 131 | end 132 | end 133 | end) 134 | 135 | awesome.connect_signal("signal::volume", function(volume, muted) 136 | if muted then bar_btn_sound.image = beautiful.volumeofficon else bar_btn_sound.image = beautiful.volumeicon end 137 | end) 138 | 139 | awesome.connect_signal("signal::bluetooth", function(is_enabled) 140 | if is_enabled then bar_btn_blue.image = beautiful.bluetoothicon else bar_btn_blue.image = beautiful.bluetoothofficon end 141 | end) 142 | 143 | awesome.connect_signal("signal::network", function(is_enabled) 144 | bar_btn_net.image = is_enabled and beautiful.wifiicon or beautiful.wifiofficon 145 | end) 146 | 147 | return buttons 148 | 149 | end 150 | -------------------------------------------------------------------------------- /widget/bar/components/systray.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local beautiful = require("beautiful") 3 | 4 | local dpi = beautiful.xresources.apply_dpi 5 | local user = require("user") 6 | 7 | return function() 8 | local systray = wibox.widget { 9 | { 10 | horizontal = user.bar_pos == "vertical" and false or true, 11 | base_size = dpi(25), 12 | widget = wibox.widget.systray 13 | }, 14 | align = "center", 15 | visible = false, 16 | layout = wibox.container.place 17 | } 18 | 19 | awesome.connect_signal('systray::toggle', function() 20 | systray.visible = not systray.visible 21 | end) 22 | 23 | return systray 24 | end 25 | -------------------------------------------------------------------------------- /widget/bar/components/systray_btn.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | 5 | local helpers = require("helpers") 6 | local user = require('user') 7 | 8 | return function() 9 | local systray_btn = wibox.widget { 10 | { 11 | { 12 | text = "󰅂", 13 | font = user.font .. "16", 14 | align = "center", 15 | widget = wibox.widget.textbox, 16 | }, 17 | direction = user.bar_type == "vertical" and "south" or "south", 18 | widget = wibox.container.rotate 19 | }, 20 | bg = beautiful.bg_dark, 21 | fg = beautiful.bg_light, 22 | shape = helpers.rrect(), 23 | widget = wibox.container.background, 24 | buttons = { 25 | awful.button({}, 1, function() 26 | awesome.emit_signal("systray::toggle") 27 | end) 28 | } 29 | } 30 | helpers.hoverCursor(systray_btn) 31 | 32 | return systray_btn 33 | end 34 | -------------------------------------------------------------------------------- /widget/bar/components/taglist.lua: -------------------------------------------------------------------------------- 1 | -- Stolen from gw with love :3 2 | 3 | local awful = require('awful') 4 | local wibox = require('wibox') 5 | local beautiful = require('beautiful') 6 | local gears = require('gears') 7 | 8 | local helpers = require('helpers') 9 | local rubato = require('modules.rubato') 10 | local dpi = beautiful.xresources.apply_dpi 11 | local user = require('user') 12 | 13 | local function gettaglist(s) 14 | return awful.widget.taglist { 15 | screen = s, 16 | filter = awful.widget.taglist.filter.all, 17 | style = { shape = helpers.rrect(50) }, 18 | layout = { spacing = dpi(5), layout = wibox.layout.fixed.vertical }, 19 | buttons = { 20 | awful.button({}, 1, function (t) 21 | t:view_only() 22 | end), 23 | awful.button({}, 3, function (t) 24 | awful.tag.viewtoggle(t) 25 | end), 26 | awful.button({}, 4, function (t) 27 | awful.tag.viewprev(t.screen) 28 | end), 29 | awful.button({}, 5, function (t) 30 | awful.tag.viewnext(t.screen) 31 | end) 32 | }, 33 | widget_template = { 34 | { 35 | markup = '', 36 | widget = wibox.widget.textbox, 37 | }, 38 | id = 'background_role', 39 | forced_height = dpi(60), 40 | forced_width = dpi(60), 41 | widget = wibox.container.background, 42 | create_callback = function (self, tag) 43 | self.animate = rubato.timed { 44 | duration = 0.15, 45 | subscribed = function (h) 46 | self:get_children_by_id('background_role')[1].forced_height = h 47 | end 48 | } 49 | 50 | self.update = function () 51 | if tag.selected then 52 | self.animate.target = dpi(60) 53 | elseif #tag:clients() > 0 then 54 | self.animate.target = dpi(25) 55 | else 56 | if user.bar_type == "vertical" then 57 | self.animate.target = dpi(14) 58 | else 59 | self.animate.target = dpi(13) 60 | end 61 | end 62 | end 63 | 64 | self.update() 65 | end, 66 | update_callback = function (self) 67 | self.update() 68 | end, 69 | } 70 | } 71 | end 72 | 73 | return gettaglist 74 | -------------------------------------------------------------------------------- /widget/bar/components/tasklist.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local gears = require('gears') 4 | local beautiful = require('beautiful') 5 | local dpi = beautiful.xresources.apply_dpi 6 | local helpers = require('helpers') 7 | local user = require('user') 8 | 9 | local function gettasklist(s) 10 | return awful.widget.tasklist { 11 | screen = s, 12 | filter = awful.widget.tasklist.filter.currenttags, 13 | source = function() 14 | local ret = {} 15 | for _, t in ipairs(s.tags) do 16 | gears.table.merge(ret, t:clients()) 17 | end 18 | return ret 19 | end, 20 | buttons = { 21 | awful.button({ }, 1, function (c) 22 | if not c.active then 23 | c:activate { switch_to_tag = true } 24 | else 25 | c.minimized = true 26 | end 27 | end), 28 | awful.button({ }, 4, function() awful.client.focus.byidx(-1) end), 29 | awful.button({ }, 5, function() awful.client.focus.byidx( 1) end), 30 | }, 31 | layout = { 32 | spacing = dpi(user.spacing), 33 | layout = user.bar_type == "vertical" and wibox.layout.fixed.vertical or wibox.layout.fixed.horizontal 34 | }, 35 | style = { shape = gears.shape.circle }, 36 | widget_template = { 37 | { 38 | { 39 | widget = awful.widget.clienticon 40 | }, 41 | margins = dpi(user.spacing), 42 | widget = wibox.container.margin 43 | }, 44 | id = 'background_role', 45 | widget = wibox.container.background 46 | } 47 | } 48 | 49 | 50 | end 51 | 52 | return gettasklist 53 | -------------------------------------------------------------------------------- /widget/bar/init.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | local gears = require("gears") 5 | 6 | local home = require("widget.bar.components.home") 7 | local pfp = require("widget.bar.components.pfp") 8 | local clock = require("widget.bar.components.clock") 9 | local tags = require("widget.bar.components.taglist") 10 | local tasks = require("widget.bar.components.tasklist") 11 | local layouts = require("widget.bar.components.layoutbox") 12 | local status = require("widget.bar.components.status") 13 | local battery = require("widget.bar.components.battery") 14 | local systray = require("widget.bar.components.systray") 15 | local systray_btn = require("widget.bar.components.systray_btn") 16 | 17 | local dpi = beautiful.xresources.apply_dpi 18 | local helpers = require("helpers") 19 | local user = require('user') 20 | 21 | screen.connect_signal("request::desktop_decoration", function(s) 22 | awful.tag(user.tags, s, awful.layout.layouts[1]) 23 | 24 | local taglist_v = wibox.widget { 25 | { 26 | tags(s), 27 | margins = dpi(9), 28 | widget = wibox.container.margin 29 | }, 30 | bg = beautiful.bg_normal, 31 | shape = helpers.rrect(50), 32 | widget = wibox.container.background 33 | } 34 | helpers.hoverCursor(taglist_v) 35 | 36 | local taglist = wibox.widget { 37 | { 38 | { 39 | tags(s), 40 | margins = dpi(9), 41 | widget = wibox.container.margin, 42 | }, 43 | bg = beautiful.bg_normal, 44 | shape = helpers.rrect(50), 45 | widget = wibox.container.background 46 | }, 47 | direction = "east", 48 | widget = wibox.container.rotate 49 | } 50 | helpers.hoverCursor(taglist) 51 | helpers.hoverCursor(layouts(s)) 52 | 53 | 54 | -- le bar 55 | s.wibar = awful.wibar { 56 | position = user.bar_pos, 57 | screen = s, 58 | height = user.bar_type == "vertical" and dpi(750) or dpi(30), 59 | border_width = dpi(10), 60 | border_color = beautiful.bg_dark, 61 | bg = beautiful.bg_dark, 62 | widget = { 63 | { 64 | home(s), 65 | -- tasks(s), 66 | spacing = dpi(user.spacing), 67 | layout = user.bar_type == "vertical" and wibox.layout.fixed.vertical or wibox.layout.fixed.horizontal 68 | }, 69 | user.bar_type == "vertical" and taglist_v or taglist, 70 | expand = "none", 71 | { 72 | systray_btn(s), 73 | systray(s), 74 | -- { 75 | -- battery, 76 | -- widget = wibox.widget, 77 | -- layout = wibox.layout.fixed.horizontal, 78 | -- visible = user.battery_enabled 79 | -- }, 80 | clock(s), 81 | status(s), 82 | -- { 83 | -- { 84 | -- layouts(s), 85 | -- margins = dpi(7), 86 | -- widget = wibox.container.margin 87 | -- }, 88 | -- bg = beautiful.bg_normal, 89 | -- shape = user.style == "rounded" and helpers.rrect(30) or user.style == "semi-rounded" and helpers.rrect(10) or gears.shape.rectangle, 90 | -- widget = wibox.container.background 91 | -- }, 92 | pfp(s), 93 | spacing = dpi(user.spacing), 94 | layout = user.bar_type == "vertical" and wibox.layout.fixed.vertical or wibox.layout.fixed.horizontal 95 | }, 96 | layout = user.bar_type == "vertical" and wibox.layout.align.vertical or wibox.layout.align.horizontal, 97 | right = dpi(user.outer_gaps), 98 | left = dpi(user.outer_gaps), 99 | bottom = dpi(user.outer_gaps), 100 | top = dpi(user.outer_gaps), 101 | widget = wibox.container.margin 102 | } 103 | } 104 | 105 | -- apply le outer gaps 106 | local screen = awful.screen.focused() 107 | screen.padding = { 108 | right = dpi(user.outer_gaps), 109 | left = dpi(user.outer_gaps), 110 | bottom = dpi(user.outer_gaps), 111 | top = dpi(user.outer_gaps) 112 | } 113 | end) 114 | -------------------------------------------------------------------------------- /widget/control_center/components/music.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local beautiful = require("beautiful") 3 | local gears = require("gears") 4 | local wibox = require("wibox") 5 | 6 | local playerctl = require("modules.bling").signal.playerctl.lib() 7 | local dpi = beautiful.xresources.apply_dpi 8 | local user = require("user") 9 | local helpers = require("helpers") 10 | 11 | local album_art = wibox.widget{ 12 | widget = wibox.widget.imagebox, 13 | clip_shape = helpers.rrect(15), 14 | forced_height = dpi(85), 15 | forced_width = dpi(85), 16 | image = beautiful.cookie3, 17 | } 18 | 19 | local song_artist = wibox.widget{ 20 | widget = wibox.widget.textbox, 21 | markup = helpers.colorizeText("Unknown", beautiful.mid_light), 22 | font = beautiful.font .. "Medium", 23 | align = "left", 24 | valign = "center" 25 | } 26 | 27 | local song_name = wibox.widget{ 28 | widget = wibox.widget.textbox, 29 | markup = helpers.colorizeText("None", beautiful.fg_normal), 30 | font = beautiful.font .. "Bold", 31 | align = "left", 32 | valign = "center" 33 | } 34 | 35 | local toggle_button = wibox.widget{ 36 | widget = wibox.widget.textbox, 37 | markup = helpers.colorizeText("󰏤", beautiful.fg_normal), 38 | font = beautiful.font .. "24", 39 | align = "right", 40 | valign = "center" 41 | } 42 | 43 | local next_button = wibox.widget{ 44 | widget = wibox.widget.textbox, 45 | markup = helpers.colorizeText("󰒭", beautiful.fg_normal), 46 | font = beautiful.font .. "24", 47 | align = "right", 48 | valign = "center" 49 | } 50 | 51 | -- prev button 52 | local prev_button = wibox.widget{ 53 | widget = wibox.widget.textbox, 54 | markup = helpers.colorizeText("󰒮", beautiful.fg_normal), 55 | font = beautiful.font .. "24", 56 | align = "right", 57 | valign = "center" 58 | } 59 | 60 | local toggle_command = function() playerctl:play_pause() end 61 | local prev_command = function() playerctl:previous() end 62 | local next_command = function() playerctl:next() end 63 | 64 | toggle_button:buttons(gears.table.join( 65 | awful.button({}, 1, function() toggle_command() end))) 66 | 67 | next_button:buttons(gears.table.join( 68 | awful.button({}, 1, function() next_command() end))) 69 | 70 | prev_button:buttons(gears.table.join( 71 | awful.button({}, 1, function() prev_command() end))) 72 | 73 | helpers.hoverCursor(toggle_button) 74 | helpers.hoverCursor(prev_button) 75 | helpers.hoverCursor(next_button) 76 | 77 | playerctl:connect_signal("metadata", function(_, title, artist, album_path, __, ___, ____) 78 | if title == "" then 79 | title = "None" 80 | end 81 | if artist == "" then 82 | artist = "Unknown" 83 | end 84 | if album_path == "" then 85 | album_path = beautiful.cookie3 86 | end 87 | 88 | album_art:set_image(gears.surface.load_uncached(album_path)) 89 | song_name:set_markup_silently(helpers.colorizeText(title, beautiful.fg_normal)) 90 | song_artist:set_markup_silently(helpers.colorizeText(artist, beautiful.mid_light)) 91 | 92 | end) 93 | 94 | playerctl:connect_signal("playback_status", function(_, playing, __) 95 | if playing then 96 | toggle_button.markup = helpers.colorizeText("󰏤", beautiful.fg_normal) 97 | else 98 | toggle_button.markup = helpers.colorizeText("󰐊", beautiful.fg_normal) 99 | end 100 | end) 101 | 102 | return function () 103 | local widget = wibox.widget { 104 | { 105 | { 106 | album_art, 107 | { 108 | { 109 | nil, 110 | { 111 | { 112 | step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, 113 | widget = wibox.container.scroll.horizontal, 114 | forced_width = dpi(170), 115 | speed = 30, 116 | song_name, 117 | }, 118 | { 119 | step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, 120 | widget = wibox.container.scroll.horizontal, 121 | forced_width = dpi(170), 122 | speed = 30, 123 | song_artist, 124 | }, 125 | spacing = dpi(2), 126 | layout = wibox.layout.fixed.vertical, 127 | }, 128 | layout = wibox.layout.align.vertical, 129 | expand = "none" 130 | }, 131 | { 132 | prev_button, 133 | toggle_button, 134 | next_button, 135 | layout = wibox.layout.fixed.horizontal, 136 | spacing = dpi(15) 137 | }, 138 | layout = wibox.layout.fixed.horizontal, 139 | spacing = dpi(50) 140 | }, 141 | layout = wibox.layout.fixed.horizontal, 142 | spacing = dpi(10) 143 | }, 144 | margins = dpi(12), 145 | widget = wibox.container.margin 146 | }, 147 | widget = wibox.container.background, 148 | forced_height = dpi(110), 149 | bg = beautiful.bg_normal, 150 | shape = helpers.rrect(15) 151 | } 152 | return widget 153 | end 154 | -------------------------------------------------------------------------------- /widget/control_center/components/profile.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local gears = require("gears") 4 | local beautiful = require("beautiful") 5 | 6 | local helpers = require("helpers") 7 | local user = require("user") 8 | local dpi = beautiful.xresources.apply_dpi 9 | 10 | return function() 11 | local profile_image = wibox.widget { 12 | { 13 | image = user.avatar, 14 | clip_shape = gears.shape.circle, 15 | widget = wibox.widget.imagebox 16 | }, 17 | forced_width = dpi(45), 18 | forced_height = dpi(45), 19 | shape = user.style == "rounded" and gears.shape.circle or user.style == "semi-rounded" and helpers.rrect(5) or gears.shape.rectangle, 20 | widget = wibox.container.background, 21 | } 22 | 23 | local username = wibox.widget{ 24 | widget = wibox.widget.textbox, 25 | markup = user.username:gsub("^%l", string.upper), 26 | font = beautiful.font .. "Bold", 27 | align = "left", 28 | valign = "center" 29 | } 30 | 31 | local desc = wibox.widget{ 32 | widget = wibox.widget.textbox, 33 | markup = helpers.colorizeText("user@machine", beautiful.mid_light), 34 | font = beautiful.font, 35 | align = "left", 36 | valign = "center" 37 | } 38 | awful.spawn.easy_async_with_shell( 39 | "uname -n", function(stdout) 40 | local hostname = stdout:match('(%w+)') 41 | desc.markup = helpers.colorizeText(user.username .. "@" .. hostname, beautiful.mid_normal) 42 | end 43 | ) 44 | 45 | return wibox.widget{ 46 | profile_image, 47 | { 48 | nil, 49 | { 50 | username, 51 | desc, 52 | layout = wibox.layout.fixed.vertical, 53 | spacing = dpi(1) 54 | }, 55 | layout = wibox.layout.align.vertical, 56 | expand = "none" 57 | }, 58 | layout = wibox.layout.fixed.horizontal, 59 | spacing = dpi(10) 60 | } 61 | end 62 | -------------------------------------------------------------------------------- /widget/control_center/components/statusbuttons.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local beautiful = require("beautiful") 4 | 5 | local dpi = beautiful.xresources.apply_dpi 6 | local helpers = require("helpers") 7 | local user = require("user") 8 | 9 | -- Function that creates a button based on given parameters, this is here so 10 | -- we don't need to make a separate widget for every button 11 | -- original code is from Chadcat7 12 | local createButton = function(signal, icon, name, labelConnected, labelDisconnected) 13 | local widget = wibox.widget { 14 | { 15 | { 16 | { 17 | { 18 | markup = icon, 19 | id = "icon", 20 | font = user.font .. "22", 21 | forced_width = dpi(30), 22 | widget = wibox.widget.textbox, 23 | }, 24 | { 25 | { 26 | markup = name, 27 | id = "name", 28 | font = beautiful.font .. "Bold ", 29 | widget = wibox.widget.textbox, 30 | }, 31 | { 32 | markup = labelConnected, 33 | id = "label", 34 | font = beautiful.font, 35 | widget = wibox.widget.textbox, 36 | }, 37 | layout = wibox.layout.fixed.vertical, 38 | spacing = 0 39 | }, 40 | layout = wibox.layout.fixed.horizontal, 41 | spacing = dpi(10), 42 | }, 43 | layout = wibox.layout.align.horizontal, 44 | }, 45 | widget = wibox.container.margin, 46 | margins = { top = dpi(10), bottom = dpi(10), left = dpi(20), right = dpi(20) } 47 | }, 48 | id = "back", 49 | bg = beautiful.accent, 50 | shape = helpers.rrect(15), 51 | widget = wibox.container.background, 52 | buttons = { awful.button({}, 1, function() 53 | awesome.emit_signal(signal .. "::toggle") 54 | end) } 55 | } 56 | awesome.connect_signal('signal::' .. signal, function(status) 57 | if status then 58 | widget:get_children_by_id("back")[1].bg = beautiful.accent 59 | widget:get_children_by_id("name")[1].markup = helpers.colorizeText(name, beautiful.bg_dark) 60 | widget:get_children_by_id("icon")[1].markup = helpers.colorizeText(icon, beautiful.bg_dark) 61 | widget:get_children_by_id("label")[1].markup = helpers.colorizeText(labelConnected, beautiful.bg_dark) 62 | else 63 | widget:get_children_by_id("back")[1].bg = beautiful.bg_normal 64 | widget:get_children_by_id("name")[1].markup = helpers.colorizeText(name, beautiful.mid_normal) 65 | widget:get_children_by_id("icon")[1].markup = helpers.colorizeText(icon, beautiful.mid_normal) 66 | widget:get_children_by_id("label")[1].markup = helpers.colorizeText(labelDisconnected, beautiful.mid_normal) 67 | end 68 | end) 69 | 70 | helpers.hoverCursor(widget) 71 | return widget 72 | end 73 | 74 | return function () 75 | local widget = wibox.widget { 76 | { 77 | createButton("network", "󰤨", "Wi-fi", "On", "Off"), 78 | createButton("bluetooth", "󰂯", "Bluetooth", "On", "Off"), 79 | spacing = dpi(user.spacing), 80 | layout = wibox.layout.flex.horizontal 81 | }, 82 | { 83 | createButton("compositor", "", "Compositor", "On", "Off"), 84 | createButton("caffeine", "󰅶", "Caffeine", "On", "Off"), 85 | spacing = dpi(user.spacing), 86 | layout = wibox.layout.flex.horizontal 87 | }, 88 | layout = wibox.layout.fixed.vertical, 89 | spacing = dpi(user.spacing) 90 | } 91 | 92 | return widget 93 | end 94 | -------------------------------------------------------------------------------- /widget/control_center/init.lua: -------------------------------------------------------------------------------- 1 | local wibox = require("wibox") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | local gears = require("gears") 5 | 6 | local dpi = beautiful.xresources.apply_dpi 7 | local helpers = require("helpers") 8 | local user = require("user") 9 | 10 | local profile = require("widget.control_center.components.profile") 11 | local statusbuttons = require("widget.control_center.components.statusbuttons") 12 | local music = require("widget.control_center.components.music") 13 | 14 | screen.connect_signal("request::desktop_decoration", function(s) 15 | s.control_center = wibox ({ 16 | shape = user.style == "rounded" and helpers.rrect(15) or user.style == "semi-rounded" and helpers.rrect(10), 17 | width = dpi(470), 18 | height = dpi(700), 19 | bg = beautiful.bg_dark, 20 | ontop = true, 21 | visible = false, 22 | }) 23 | 24 | s.control_center:setup({ 25 | { 26 | profile(s), 27 | margins = { top = dpi(20), bottom = dpi(0), left = dpi(20), right = dpi(20) }, 28 | widget = wibox.container.margin, 29 | }, 30 | { 31 | statusbuttons(s), 32 | margins = { top = dpi(20), bottom = dpi(0), left = dpi(20), right = dpi(20) }, 33 | widget = wibox.container.margin, 34 | }, 35 | { 36 | music(s), 37 | margins = dpi(20), 38 | widget = wibox.container.margin, 39 | }, 40 | layout = wibox.layout.fixed.vertical, 41 | }) 42 | 43 | awesome.connect_signal('controlcenter::toggle', function() 44 | s.control_center.visible = not s.control_center.visible 45 | end) 46 | 47 | awful.placement.right(s.control_center, { honor_padding = true, margins = { top = dpi(50) } }) 48 | end) 49 | 50 | -------------------------------------------------------------------------------- /widget/dock/geticon.lua: -------------------------------------------------------------------------------- 1 | local icon_cache = {} 2 | local user = require("user") 3 | 4 | local function Get_icon(client, program_string, class_string, is_steam) 5 | client = client or nil 6 | program_string = program_string or nil 7 | class_string = class_string or nil 8 | is_steam = is_steam or nil 9 | 10 | if (client or program_string or class_string) then 11 | local clientName 12 | if is_steam then 13 | clientName = "steam_icon_" .. tostring(client) .. ".svg" 14 | elseif client then 15 | if client.class then 16 | clientName = string.lower(client.class:gsub(" ", "")) .. ".svg" 17 | elseif client.name then 18 | clientName = string.lower(client.name:gsub(" ", "")) .. ".svg" 19 | else 20 | if client.icon then 21 | return client.icon 22 | else 23 | return user.icon_theme .. "/apps/scalable/default-application.svg" 24 | end 25 | end 26 | else 27 | if program_string then 28 | clientName = program_string .. ".svg" 29 | else 30 | clientName = class_string .. ".svg" 31 | end 32 | end 33 | 34 | for index, icon in ipairs(icon_cache) do 35 | if icon:match(clientName) then 36 | return icon 37 | end 38 | end 39 | 40 | local iconDir = user.icon_theme .. "/apps/scalable/" 41 | local ioStream = io.open(iconDir .. clientName, "r") 42 | if ioStream ~= nil then 43 | icon_cache[#icon_cache + 1] = iconDir .. clientName 44 | return iconDir .. clientName 45 | else 46 | clientName = clientName:gsub("^%l", string.upper) 47 | iconDir = user.icon_theme .. "/apps/scalable/" 48 | ioStream = io.open(iconDir .. clientName, "r") 49 | if ioStream ~= nil then 50 | icon_cache[#icon_cache + 1] = iconDir .. clientName 51 | return iconDir .. clientName 52 | elseif not class_string then 53 | return user.icon_theme .. "/apps/scalable/default-application.svg" 54 | else 55 | clientName = class_string .. ".svg" 56 | iconDir = user.icon_theme .. "apps/scalable/" 57 | ioStream = io.open(iconDir .. clientName, "r") 58 | if ioStream ~= nil then 59 | icon_cache[#icon_cache + 1] = iconDir .. clientName 60 | return iconDir .. clientName 61 | else 62 | return user.icon_theme .. "/apps/scalable/default-application.svg" 63 | end 64 | end 65 | end 66 | end 67 | if client then 68 | return user.icon_theme .. "/apps/scalable/default-application.svg" 69 | end 70 | end 71 | 72 | 73 | return Get_icon 74 | -------------------------------------------------------------------------------- /widget/dock/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local gears = require("gears") 4 | local helpers = require("helpers") 5 | local beautiful = require("beautiful") 6 | 7 | local dpi = beautiful.xresources.apply_dpi 8 | local user = require("user") 9 | local geticon = require("widget.dock.geticon") 10 | 11 | local placeDock = function(c, m) 12 | awful.placement.bottom(c, { margins = dpi(m) }) 13 | end 14 | 15 | local layout = wibox.layout.fixed.horizontal 16 | local rlayout = wibox.layout.fixed.vertical 17 | local flexlayout = wibox.layout.flex.horizontal 18 | 19 | local dock = function(s) 20 | -- this is the main dock 21 | local dock = awful.popup { 22 | widget = wibox.container.background, 23 | ontop = true, 24 | bg = beautiful.bg_dark, 25 | visible = true, 26 | screen = s, 27 | height = 150, 28 | width = 600, 29 | placement = function(c) placeDock(c, 10) end, 30 | shape = user.style == "rounded" and helpers.rrect(10) 31 | } 32 | 33 | -- autohiding the dock 34 | local function check_for_dock_hide() 35 | if not awful.screen.focused().selected_tag then 36 | dock.visible = true -- No tag selected, so make the dock visible 37 | return 38 | end 39 | 40 | for _, client in ipairs(awful.screen.focused().selected_tag:clients()) do 41 | if client.fullscreen then 42 | dock.visible = false -- Disable dock on fullscreen 43 | return 44 | end 45 | end 46 | 47 | -- Make dock visible if nothing is open 48 | if #awful.screen.focused().selected_tag:clients() < 1 then 49 | dock.visible = true 50 | return 51 | end 52 | 53 | if awful.screen.focused() == mouse.screen then 54 | local minimized 55 | 56 | for _, c in ipairs(awful.screen.focused().selected_tag:clients()) do 57 | if c.minimized then 58 | minimized = true 59 | end 60 | 61 | if c.fullscreen then 62 | dock.visible = false 63 | return 64 | end 65 | 66 | if not c.minimized then 67 | -- If the client enters the dock area, hide it 68 | local y = c:geometry().y 69 | local h = c.height 70 | 71 | if (y + h) >= awful.screen.focused().geometry.height - 85 then 72 | dock.visible = false 73 | return 74 | else 75 | dock.visible = true 76 | end 77 | end 78 | end 79 | 80 | if minimized then 81 | dock.visible = true 82 | end 83 | else 84 | dock.visible = false 85 | end 86 | end 87 | 88 | -- a timer to check for dock hide 89 | local dockHide = gears.timer { 90 | timeout = 1, 91 | autostart = true, 92 | call_now = true, 93 | callback = function() 94 | check_for_dock_hide() 95 | end 96 | } 97 | 98 | dockHide:again() 99 | 100 | -- a hotarea at the bottom which will toggle the dock upon hover 101 | local hotpop = wibox({ 102 | type = "desktop", 103 | height = user.inner_gaps * 3, 104 | width = 200, 105 | screen = s, 106 | ontop = true, 107 | visible = true, 108 | bg = beautiful.bg_dark .. '00' 109 | }) 110 | 111 | placeDock(hotpop, 0) 112 | hotpop:setup { 113 | widget = wibox.container.margin, 114 | margins = 10, 115 | layout = layout 116 | } 117 | 118 | -- Window state indicators 119 | local createDockIndicators = function(data) 120 | local clients = data.clients 121 | local indicators = wibox.widget { layout = flexlayout, spacing = 4 } 122 | 123 | for _, v in ipairs(clients) do 124 | local bac 125 | local click 126 | 127 | if v == client.focus then 128 | bac = beautiful.accent 129 | click = function() 130 | v.minimized = true 131 | end 132 | 133 | elseif v.urgent then 134 | bac = beautiful.red 135 | 136 | elseif v.minimized then 137 | bac = beautiful.mid_dark 138 | click = function() 139 | v.minimized = false 140 | v = client.focus 141 | end 142 | 143 | elseif v.maximized then 144 | bac = beautiful.green 145 | click = function() 146 | v.maximized = false 147 | v = client.focus 148 | end 149 | 150 | elseif v.fullscreen then 151 | bac = beautiful.yellow 152 | click = function() 153 | v.fullscreen = false 154 | v = client.focus 155 | end 156 | 157 | else 158 | bac = beautiful.mid_dark 159 | click = function() 160 | v.minimized = true 161 | end 162 | 163 | end 164 | 165 | local widget = wibox.widget { 166 | bg = bac, 167 | forced_height = dpi(5), 168 | forced_width = dpi(20), 169 | shape = user.style == "rounded" and helpers.rrect(50), 170 | widget = wibox.container.background, 171 | buttons = { 172 | awful.button({}, 1, function() 173 | click() 174 | end) 175 | }, 176 | } 177 | 178 | indicators:add(widget) 179 | end 180 | 181 | return wibox.widget { 182 | { 183 | { 184 | indicators, 185 | spacing = user.spacing, 186 | layout = layout 187 | }, 188 | widget = wibox.container.place, 189 | halign = 'center' 190 | }, 191 | forced_height = 4, 192 | forced_width = 45, 193 | widget = wibox.container.background 194 | } 195 | 196 | end 197 | 198 | -- creating 1 icon on the dock 199 | local createDockElement = function(data) 200 | 201 | local class = string.lower(data.class) 202 | local command = string.lower(data.class) 203 | 204 | -- 205 | local customIcons = { 206 | { 207 | name = "st", 208 | convert = "gnome-terminal", 209 | command = "st" 210 | }, 211 | { 212 | name = "steam", 213 | convert = "steam", 214 | command = "steam-native" 215 | }, 216 | { 217 | name = "ncmpcpp", 218 | convert = "spotify", 219 | command = user.term_cmd .. "ncmpcpp -n ncmpcpp -e ncmpcpp" 220 | }, 221 | } 222 | 223 | for _, v in pairs(customIcons) do 224 | if class == v.name then 225 | class = v.convert 226 | command = v.command 227 | end 228 | end 229 | 230 | local dockelement = wibox.widget { 231 | { 232 | { 233 | { 234 | forced_height = 50, 235 | forced_width = 50, 236 | buttons = { 237 | awful.button({}, 1, function() 238 | awful.spawn.with_shell(command) 239 | end) 240 | }, 241 | image = geticon(nil, class, class, false), 242 | clip_shape = user.style == "rounded" and helpers.rrect(8), 243 | widget = wibox.widget.imagebox, 244 | }, 245 | layout = layout 246 | }, 247 | createDockIndicators(data), 248 | layout = rlayout 249 | }, 250 | forced_width = 50, 251 | widget = wibox.container.background 252 | } 253 | 254 | helpers.hoverCursor(dockelement) 255 | return dockelement 256 | end 257 | 258 | -- the main function 259 | local createDockElements = function() 260 | if not mouse.screen then 261 | return wibox.widget { layout = layout } -- No screen selected, return an empty widget 262 | end 263 | 264 | local clients = mouse.screen.selected_tag and mouse.screen.selected_tag:clients() or {} 265 | 266 | -- making some pinned apps 267 | local metadata = { 268 | { 269 | count = 0, 270 | id = 1, 271 | clients = {}, 272 | name = "nemo", 273 | class = "nemo" 274 | }, 275 | { 276 | count = 0, 277 | id = 2, 278 | clients = {}, 279 | name = "st", 280 | class = "st" 281 | }, 282 | { 283 | count = 0, 284 | id = 3, 285 | clients = {}, 286 | name = "firefox", 287 | class = "firefox" 288 | }, 289 | { 290 | count = 0, 291 | id = 4, 292 | name = "discord", 293 | clients = {}, 294 | class = "discord" 295 | }, 296 | { 297 | count = 0, 298 | id = 5, 299 | name = "ncmpcpp", 300 | clients = {}, 301 | class = "ncmpcpp" 302 | }, 303 | { 304 | count = 0, 305 | id = 6, 306 | name = "steam", 307 | clients = {}, 308 | class = "steam" 309 | }, 310 | } 311 | 312 | local classes = { "st", "discord", "firefox", "nemo", "ncmpcpp", "steam" } 313 | local dockElements = wibox.widget { layout = layout, spacing = user.spacing } 314 | 315 | -- generating the data 316 | for _, c in ipairs(clients) do 317 | local class = string.lower(c.class) 318 | 319 | if helpers.inTable(classes, class) then 320 | for _, j in pairs(metadata) do 321 | if j.name == class then 322 | table.insert(j.clients, c) 323 | j.count = j.count + 1 324 | end 325 | end 326 | 327 | else 328 | table.insert(classes, class) 329 | local toInsert = { 330 | count = 1, 331 | id = #classes + 1, 332 | clients = { c }, 333 | class = class, 334 | name = class, 335 | } 336 | table.insert(metadata, toInsert) 337 | end 338 | end 339 | 340 | table.sort(metadata, function(a, b) return a.id < b.id end) 341 | for _, j in pairs(metadata) do 342 | dockElements:add(createDockElement(j)) 343 | end 344 | 345 | return dockElements 346 | 347 | end 348 | 349 | local refresh = function() 350 | check_for_dock_hide() 351 | dock:setup { 352 | { 353 | createDockElements(), 354 | layout = layout 355 | }, 356 | widget = wibox.container.margin, 357 | margins = { 358 | top = 10, 359 | bottom = 7, 360 | left = 10, 361 | right = 10, 362 | }, 363 | } 364 | end 365 | 366 | refresh() 367 | 368 | client.connect_signal("focus", function() refresh() end) 369 | client.connect_signal("property::minimized", function() refresh() end) 370 | client.connect_signal("property::maximized", function() refresh() end) 371 | client.connect_signal("manage", function() refresh() end) 372 | client.connect_signal("unmanage", function() refresh() end) 373 | 374 | hotpop:connect_signal("mouse::enter", function() 375 | dockHide:stop() 376 | dock.visible = true 377 | end) 378 | 379 | hotpop:connect_signal("mouse::leave", function() dockHide:again() end) 380 | 381 | dock:connect_signal("mouse::enter", function() 382 | dockHide:stop() 383 | dock.visible = true 384 | end) 385 | 386 | dock:connect_signal("mouse::leave", function() dockHide:again() end) 387 | tag.connect_signal("property::selected", function() refresh() end) 388 | 389 | end 390 | 391 | screen.connect_signal('request::desktop_decoration', function(s) 392 | dock(s) 393 | end) 394 | -------------------------------------------------------------------------------- /widget/init.lua: -------------------------------------------------------------------------------- 1 | local user = require('user') 2 | 3 | if user.dock_enabled == true then require('widget.dock') end 4 | if user.music_enabled == true then require('widget.music') end 5 | 6 | require('widget.bar') 7 | require('widget.titlebar') 8 | require('widget.notifications') 9 | require('widget.launcher') 10 | require('widget.control_center') 11 | -------------------------------------------------------------------------------- /widget/launcher/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local dpi = beautiful.xresources.apply_dpi 4 | local helpers = require("helpers") 5 | local user = require('user') 6 | 7 | return { 8 | 9 | shape = helpers.rrect(10), 10 | 11 | reset_on_hide = false, 12 | save_history = true, 13 | wrap_page_scrolling = true, -- leave this in true because it fucking floods me with errors otherwise 14 | wrap_app_scrolling = true, 15 | 16 | prompt_show_icon = false, 17 | prompt_icon = "", 18 | prompt_text_halign = "left", 19 | 20 | prompt_height = dpi(25), 21 | prompt_margins = dpi(10), 22 | prompt_paddings = dpi(5), 23 | 24 | apps_per_row = 10, 25 | apps_per_column = 1, 26 | apps_spacing = dpi(0), 27 | 28 | apps_margin = dpi(7), 29 | app_width = dpi(400), 30 | app_height = dpi(40), 31 | 32 | app_name_halign = "left", 33 | app_name_valign = "center", 34 | 35 | app_show_icon = false, 36 | 37 | app_content_padding = dpi(10), 38 | app_content_spacing = dpi(0), 39 | 40 | prompt_icon_font = user.font, 41 | app_name_font = user.font, 42 | 43 | app_shape = user.style == "rounded" and helpers.rrect(15), 44 | 45 | border_color = beautiful.bg_normal, 46 | 47 | background = beautiful.bg_dark, 48 | prompt_color = beautiful.bg_dark, 49 | prompt_border_color = beautiful.bg_dark, 50 | prompt_icon_color = beautiful.bg_dark, 51 | prompt_text_color = beautiful.mid_normal, 52 | prompt_cursor_color = beautiful.mid_normal, 53 | app_normal_color = beautiful.bg_dark, 54 | app_normal_hover_color = beautiful.bg_normal, 55 | app_selected_color = beautiful.accent, 56 | app_selected_hover_color = beautiful.bg_light, 57 | app_name_normal_color = beautiful.fg_normal, 58 | app_name_selected_color = beautiful.bg_dark, 59 | } 60 | -------------------------------------------------------------------------------- /widget/music/init.lua: -------------------------------------------------------------------------------- 1 | local gears = require("gears") 2 | local awful = require("awful") 3 | local beautiful = require("beautiful") 4 | local ruled = require("ruled") 5 | local wibox = require("wibox") 6 | 7 | local helpers = require("helpers") 8 | local user = require("user") 9 | local dpi = beautiful.xresources.apply_dpi 10 | 11 | -- whole code is from ner0z's dotfiles, i dont really plan to make my own version of this, lmao 12 | -- https://github.com/ner0z/dotfiles/blob/main/config/awesome/misc/deco.lua 13 | 14 | local music_art = wibox.widget { 15 | image = gears.filesystem.get_configuration_dir() .. "assets/cookie3.svg", 16 | resize = true, 17 | widget = wibox.widget.imagebox 18 | } 19 | 20 | local music_art_container = wibox.widget{ 21 | music_art, 22 | shape = helpers.rrect(6), 23 | widget = wibox.container.background 24 | } 25 | 26 | local music_now = wibox.widget{ 27 | font = user.font .. "Bold", 28 | valign = "center", 29 | widget = wibox.widget.textbox 30 | } 31 | 32 | local music_pos = wibox.widget{ 33 | font = user.font, 34 | valign = "center", 35 | widget = wibox.widget.textbox 36 | } 37 | 38 | local music_bar = wibox.widget { 39 | max_value = 100, 40 | value = 0, 41 | background_color = beautiful.bg_dark, 42 | color = beautiful.accent, 43 | forced_height = dpi(3), 44 | widget = wibox.widget.progressbar 45 | } 46 | 47 | local control_button_bg = beautiful.transparent 48 | 49 | local control_button = function(c, symbol, color, size, on_click, on_right_click) 50 | local icon = wibox.widget{ 51 | markup = helpers.colorizeText(symbol, color), 52 | font = user.font, 53 | align = "center", 54 | valign = "center", 55 | widget = wibox.widget.textbox() 56 | } 57 | 58 | local button = wibox.widget { 59 | icon, 60 | bg = control_button_bg, 61 | shape = helpers.rrect(dpi(4)), 62 | widget = wibox.container.background 63 | } 64 | 65 | local container = wibox.widget { 66 | button, 67 | strategy = "min", 68 | width = dpi(30), 69 | widget = wibox.container.constraint, 70 | } 71 | 72 | container:buttons(gears.table.join( 73 | awful.button({ }, 1, on_click), 74 | awful.button({ }, 3, on_right_click) 75 | )) 76 | 77 | return container 78 | end 79 | 80 | local music_play_pause = control_button(c, "󰏤", beautiful.fg_normal, dpi(30), function() 81 | awful.spawn.with_shell("playerctl --player=mpd play-pause") 82 | end) 83 | 84 | local music_play_pause_textbox = music_play_pause:get_all_children()[1]:get_all_children()[1] 85 | 86 | local mpc = require("modules.bling").signal.playerctl.lib() 87 | local music_length = 0 88 | 89 | mpc:connect_signal("metadata", function(_, title, artist, album_path, album, ___, player_name) 90 | if player_name == "mpd" then 91 | local m_now = title .. " - " .. artist 92 | 93 | music_art:set_image(gears.surface.load_uncached(album_path)) 94 | music_now:set_markup_silently(m_now) 95 | end 96 | end) 97 | 98 | mpc:connect_signal("position", function(_, interval_sec, length_sec, player_name) 99 | if player_name == "mpd" then 100 | local pos_now = tostring(os.date("!%M:%S", math.floor(interval_sec))) 101 | local pos_length = tostring(os.date("!%M:%S", math.floor(length_sec))) 102 | local pos_markup = pos_now .. helpers.colorizeText(" / " .. pos_length, beautiful.accent) 103 | 104 | music_art:set_image(gears.surface.load_uncached(album_path)) 105 | music_pos:set_markup_silently(pos_markup) 106 | music_bar.value = (interval_sec / length_sec) * 100 107 | music_length = length_sec 108 | end 109 | end) 110 | 111 | mpc:connect_signal("playback_status", function(_, playing, player_name) 112 | if player_name == "mpd" then 113 | if playing then 114 | music_play_pause_textbox:set_markup_silently("󰏤") 115 | else 116 | music_play_pause_textbox:set_markup_silently("󰐊") 117 | end 118 | end 119 | end) 120 | 121 | 122 | local music_create_decoration = function (c) 123 | 124 | -- Hide default titlebar 125 | awful.titlebar.hide(c, user.titlebar_pos) 126 | 127 | -- Sidebar 128 | awful.titlebar(c, { position = "left", size = dpi(250), bg = beautiful.bg_dim }):setup { 129 | nil, 130 | { 131 | music_art_container, 132 | left = dpi(15), 133 | right = dpi(15), 134 | widget = wibox.container.margin 135 | }, 136 | nil, 137 | expand = "none", 138 | layout = wibox.layout.align.vertical 139 | } 140 | 141 | -- Toolbar 142 | awful.titlebar(c, { position = "bottom", size = dpi(63), bg = beautiful.bg_normal }):setup { 143 | music_bar, 144 | { 145 | { 146 | { 147 | -- Go to playlist and focus currently playing song 148 | control_button(c, "󰒮", beautiful.fg_normal, dpi(30), function() 149 | awful.spawn.with_shell("playerctl --player=mpd previous") 150 | end), 151 | -- Toggle play pause 152 | music_play_pause, 153 | -- Go to list of playlists 154 | control_button(c, "󰒭", beautiful.fg_normal, dpi(30), function() 155 | awful.spawn.with_shell("playerctl --player=mpd next") 156 | end), 157 | layout = wibox.layout.flex.horizontal 158 | }, 159 | { 160 | { 161 | step_function = wibox.container.scroll 162 | .step_functions 163 | .waiting_nonlinear_back_and_forth, 164 | speed = 50, 165 | { 166 | widget = music_now, 167 | }, 168 | widget = wibox.container.scroll.horizontal 169 | }, 170 | left = dpi(20), 171 | right = dpi(20), 172 | widget = wibox.container.margin 173 | }, 174 | { 175 | music_pos, 176 | spacing = dpi(10), 177 | layout = wibox.layout.fixed.horizontal 178 | }, 179 | layout = wibox.layout.align.horizontal 180 | }, 181 | top = dpi(15), 182 | bottom = dpi(15), 183 | left = dpi(25), 184 | right = dpi(25), 185 | widget = wibox.container.margin 186 | }, 187 | layout = wibox.layout.align.vertical 188 | } 189 | 190 | -- Set custom decoration flags 191 | c.custom_decoration = { left = true, bottom = true } 192 | end 193 | 194 | -- Add the titlebar whenever a new music client is spawned 195 | ruled.client.connect_signal("request::rules", function() 196 | ruled.client.append_rule { 197 | id = "ncmpcpp", 198 | rule = {instance = "ncmpcpp"}, 199 | callback = music_create_decoration 200 | } 201 | end) 202 | -------------------------------------------------------------------------------- /widget/notifications/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local ruled = require('ruled') 4 | local naughty = require('naughty') 5 | local beautiful = require('beautiful') 6 | 7 | local user = require('user') 8 | local dpi = beautiful.xresources.apply_dpi 9 | 10 | naughty.config.defaults.ontop = true 11 | naughty.config.defaults.screen = awful.screen.focused() 12 | naughty.config.defaults.border_width = 0 13 | naughty.config.defaults.title = "Notification" 14 | 15 | ruled.notification.connect_signal('request::rules', function() 16 | 17 | ruled.notification.append_rule { 18 | rule = { urgency = 'critical' }, 19 | properties = { 20 | bg = beautiful.bg_dark, 21 | fg = beautiful.fg_red, 22 | position = user.notification_pos, 23 | spacing = dpi(user.outer_gaps), 24 | timeout = 5 25 | } 26 | } 27 | ruled.notification.append_rule { 28 | rule = { urgency = 'normal' }, 29 | properties = { 30 | bg = beautiful.bg_dark, 31 | fg = beautiful.fg_normal, 32 | position = user.notification_pos, 33 | spacing = dpi(user.outer_gaps), 34 | timeout = 5 35 | } 36 | } 37 | ruled.notification.append_rule { 38 | rule = { urgency = 'low' }, 39 | properties = { 40 | bg = beautiful.bg_dark, 41 | fg = beautiful.fg_normal, 42 | position = user.notification_pos, 43 | spacing = dpi(user.outer_gaps), 44 | timeout = 5 45 | } 46 | } 47 | 48 | end) 49 | 50 | naughty.connect_signal("request::display", function(n) 51 | naughty.layout.box { 52 | notification = n, 53 | type = "notification", 54 | bg = beautiful.bg_dark, 55 | widget_template = { 56 | { 57 | { 58 | { 59 | { 60 | { 61 | { 62 | naughty.widget.title, 63 | forced_height = dpi(31), 64 | layout = wibox.layout.align.horizontal 65 | }, 66 | left = dpi(15), 67 | right = dpi(15), 68 | top = dpi(10), 69 | bottom = dpi(10), 70 | widget = wibox.container.margin 71 | }, 72 | bg = beautiful.bg_normal, 73 | widget = wibox.container.background 74 | }, 75 | strategy = "min", 76 | width = dpi(300), 77 | widget = wibox.container.constraint 78 | }, 79 | strategy = "max", 80 | width = dpi(400), 81 | widget = wibox.container.constraint 82 | }, 83 | { 84 | { 85 | { 86 | naughty.widget.message, 87 | left = dpi(15), 88 | right = dpi(15), 89 | top = dpi(15), 90 | bottom = dpi(15), 91 | widget = wibox.container.margin 92 | }, 93 | strategy = "min", 94 | height = dpi(60), 95 | widget = wibox.container.constraint 96 | }, 97 | strategy = "max", 98 | width = dpi(400), 99 | widget = wibox.container.constraint 100 | }, 101 | layout = wibox.layout.align.vertical 102 | }, 103 | id = "background_role", 104 | widget = naughty.container.background, 105 | } 106 | } 107 | end) 108 | -------------------------------------------------------------------------------- /widget/titlebar/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local wibox = require("wibox") 3 | local gears = require("gears") 4 | local helpers = require("helpers") 5 | local beautiful = require("beautiful") 6 | local dpi = beautiful.xresources.apply_dpi 7 | local user = require("user") 8 | 9 | local createButton = function(c, fn) 10 | local btn = wibox.widget { 11 | forced_width = dpi(15), 12 | forced_height = (user.titlebar_pos == "left" and dpi(40)) or (user.titlebar_pos == "right" and dpi(40)) or dpi(15), 13 | bg = beautiful.bg_light, 14 | shape = user.style == "rounded" and helpers.rrect(15) or user.style == "semi-rounded" and helpers.rrect(5) or gears.shape.rectangle, 15 | buttons = { 16 | awful.button({}, 1, function() 17 | fn(c) 18 | end) 19 | }, 20 | widget = wibox.container.background 21 | } 22 | 23 | c:connect_signal("focus", function() 24 | btn.bg = beautiful.bg_normal 25 | end) 26 | 27 | c:connect_signal("unfocus", function() 28 | btn.bg = beautiful.bg_dark -- Reset the button's background color when unfocused 29 | end) 30 | 31 | return btn 32 | end 33 | 34 | client.connect_signal("request::titlebars", function(c) 35 | -- buttons for the titlebar 36 | local close = createButton(c, function(c1) 37 | c1:kill() 38 | end) 39 | 40 | local maximize = createButton(c, function(c1) 41 | c1.maximized = not c1.maximized 42 | end) 43 | 44 | local minimize = createButton(c, function(c1) 45 | gears.timer.delayed_call(function() 46 | c1.minimized = not c1.minimized 47 | end) 48 | end) 49 | 50 | local buttons = gears.table.join( 51 | 52 | awful.button({}, 1, function() 53 | client.focus = c 54 | c:raise() 55 | awful.mouse.client.move(c) 56 | end), 57 | 58 | awful.button({}, 3, function() 59 | client.focus = c 60 | c:raise() 61 | awful.mouse.client.resize(c) 62 | end) 63 | ) 64 | 65 | awful.titlebar(c, { 66 | size = dpi(40), 67 | position = user.titlebar_pos 68 | }):setup { 69 | { 70 | { 71 | { 72 | { 73 | align = 'center', 74 | widget = awful.widget.clienticon(c), 75 | }, 76 | spacing = dpi(user.spacing), 77 | widget = wibox.container.margin, 78 | visible = user.titlebar_icons, 79 | align = 'center', 80 | }, 81 | top = dpi(5), 82 | bottom = dpi(5), 83 | widget = wibox.container.margin 84 | }, 85 | { 86 | { 87 | { 88 | align = 'center', 89 | widget = awful.titlebar.widget.titlewidget(c), 90 | }, 91 | spacing = dpi(user.spacing), 92 | widget = wibox.container.margin, 93 | visible = user.titlebar_icons, 94 | align = 'center', 95 | }, 96 | top = dpi(5), 97 | bottom = dpi(5), 98 | widget = wibox.container.margin 99 | }, 100 | { 101 | { 102 | { 103 | minimize, 104 | maximize, 105 | close, 106 | spacing = dpi(user.spacing), 107 | widget = wibox.container.place, 108 | halign = 'center', 109 | visible = user.titlebar_icons, 110 | layout = (user.titlebar_pos == "left" and wibox.layout.fixed.vertical) or (user.titlebar_pos == "right" and wibox.layout.fixed.vertical) or wibox.layout.fixed.horizontal 111 | }, 112 | top = dpi(5), 113 | bottom = dpi(5), 114 | widget = wibox.container.margin 115 | }, 116 | widget = wibox.container.place, 117 | halign = 'center', 118 | }, 119 | layout = (user.titlebar_pos == "left" and wibox.layout.align.vertical) or (user.titlebar_pos == "right" and wibox.layout.align.vertical) or wibox.layout.align.horizontal 120 | }, 121 | right = dpi(10), 122 | left = dpi(10), 123 | top = dpi(5), 124 | bottom = dpi(5), 125 | widget = wibox.container.margin 126 | } 127 | end) 128 | --------------------------------------------------------------------------------