├── README.md ├── awesome ├── .editorconfig ├── binding │ ├── bindings_key.lua │ └── bindings_mouse.lua ├── deco │ ├── menu.lua │ ├── rightthing.lua │ ├── screens.lua │ ├── titlebar.lua │ └── widgets │ │ └── slider.lua ├── lib │ ├── battery.lua │ ├── battery_upower.lua │ ├── color.lua │ ├── cpu.lua │ ├── disk.lua │ ├── network.lua │ ├── playerctl │ │ ├── init.lua │ │ ├── playerctl_cli.lua │ │ └── playerctl_lib.lua │ ├── ram.lua │ └── volume.lua ├── main │ ├── error-handling.lua │ └── variables.lua ├── rc.lua └── themes │ ├── alena-aenami-cold-1k.jpg │ ├── alena-aenami-endless-1k.jpg │ ├── alena-aenami-mountains2k.jpg │ ├── alena-aenami-reflect1k.jpg │ ├── alena-aenami-sky1k.jpg │ ├── images │ ├── battery_0.png │ ├── battery_10.png │ ├── battery_20.png │ ├── battery_30.png │ ├── battery_40.png │ ├── battery_50.png │ ├── battery_60.png │ ├── battery_70.png │ ├── battery_80.png │ ├── battery_90.png │ ├── battery_charging.png │ ├── battery_full.png │ ├── battery_low.png │ ├── battery_unknown.png │ ├── brightness.png │ ├── calendar.png │ ├── cool_question_mark.png │ ├── cpu.png │ ├── init.lua │ ├── lightbulb.png │ ├── lock.png │ ├── pause.png │ ├── ram.png │ ├── scissors.png │ ├── skip_next.png │ ├── skip_prev.png │ ├── ssd.png │ ├── theme.png │ ├── volume_high.png │ ├── volume_low.png │ ├── volume_mid.png │ ├── volume_mute.png │ ├── wifi_0.png │ ├── wifi_1.png │ ├── wifi_2.png │ └── wifi_3.png │ ├── k58mn95834y41.jpg │ ├── light │ └── theme.lua │ ├── suncolors │ └── theme.lua │ ├── thing.png │ └── zurich.png ├── i3 └── config ├── kitty ├── kitty.conf └── suntheme.conf ├── nvim ├── init.lua └── lua │ ├── lsp.lua │ ├── opts.lua │ └── plugins.lua ├── picom ├── picom.conf └── picom2.conf └── polybar ├── config └── launch.sh /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 |

It's my dotfiles

3 | but only the important ones 4 | 5 | I mostly wanna flex my awesome and neovim configuration 6 | 7 | It's not actually super portable since I've never had to 8 | move computers, but this is in preparation to possibly 9 | eventually someday having to move computers so in time it 10 | may be made semi-portable. It'll probably never not support 11 | true color though because I like that too much 12 | 13 | all the coolest stuff is done in awesome/deco 14 | 15 | Fun fact I switched to nix as of recent so most of this is 16 | super old- I'll probably fix it up once I have a good setup 17 | going 18 | -------------------------------------------------------------------------------- /awesome/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.lua] 4 | charset = utf-8 5 | intent_style = tab 6 | indent_size = 4 7 | trim_trailing_whitespace = true 8 | max_line_length = 120 9 | 10 | [*.md] 11 | trim_trailing_whitespace = false 12 | -------------------------------------------------------------------------------- /awesome/binding/bindings_key.lua: -------------------------------------------------------------------------------- 1 | local gears = require("gears") 2 | local awful = require("awful") 3 | local vars = require("main.variables") 4 | local mymainmenu = require("deco.menu") 5 | local hotkeys_popup = require("awful.hotkeys_popup") 6 | require("awful.hotkeys_popup.keys") 7 | 8 | local mk = vars.modkey 9 | 10 | globalkeys = gears.table.join( 11 | --- Utils 12 | awful.key({mk}, "s", hotkeys_popup.show_help, 13 | {description="Show Help", group="Utils"}), 14 | awful.key({}, "Print", 15 | function() awful.spawn("shutter -s") end, 16 | {description="Screenshot to Clipboard", group="Utils"}), 17 | awful.key({mk}, "Return", function() awful.spawn(vars.terminal) end, 18 | {description="Open Terminal", group="Utils"}), 19 | --the old thing was awful.screen.focused().mypromptbox:run() 20 | awful.key({mk}, "d", function () os.execute("rofi -modi drun,run -show drun") end, 21 | {description="Open ROFI", group="Utils"}), 22 | 23 | awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +5%") end, 24 | {description="Increase Volume", group="Utils"}), 25 | awful.key({}, "XF86AudioLowerVolume", function() awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -5%") end, 26 | {description="Decrease Volume", group="Utils"}), 27 | awful.key({}, "XF86AudioMute", function() awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle") end, 28 | {description="Mute Volume", group="Utils"}), 29 | 30 | 31 | --- State 32 | awful.key({mk, "Control"}, "r", awesome.restart, 33 | {description="Restart Awesome", group="State"}), 34 | awful.key({mk, "Shift"}, "e", awesome.quit, 35 | {description="Quit Awesome", group="State"}), 36 | 37 | --- Window Management 38 | awful.key({mk}, "j", function() awful.client.focus.byidx(1) end), 39 | awful.key({mk}, "k", function() awful.client.focus.byidx(-1) end), 40 | awful.key({mk, "Shift"}, "j", function() awful.client.swap.byidx(1) end), 41 | awful.key({mk, "Shift"}, "k", function() awful.client.swap.byidx(-1) end), 42 | awful.key({mk}, "u", awful.client.urgent.jumpto, 43 | {description="Jump to Urgent Client", group="Windows"}), 44 | awful.key({mk}, "Escape", awful.tag.history.restore, 45 | {description="Restore last Tag", group="Windows"}), 46 | awful.key({mk, "Shift"}, "j", function() awful.client.swap.byidx(1) end, 47 | {description="Increment Focus", group="Windows"}), 48 | awful.key({mk, "Shift"}, "k", function() awful.client.swap.byidx(-1) end, 49 | {description="Decrement Focus", group="Windows"}), 50 | 51 | --- Layout 52 | awful.key({mk}, "h", function() awful.tag.incmwfact(0.05) end, 53 | {description="Increase master client width", group="Layout"}), 54 | awful.key({mk}, "l", function() awful.tag.incmwfact(-0.05) end, 55 | {description="Decrease master client width", group="Layout"}), 56 | 57 | -- TODO: Figure out exactly what this actually does 58 | awful.key({mk, "Shift"}, "h", function() awful.tag.incnmaster(1, nil, true) end, 59 | {description="Increase number of master clients", group="Layout"}), 60 | awful.key({mk, "Shift"}, "l", function() awful.tag.incnmaster(-1, nil, true) end, 61 | {description="Decrease number of master clients", group="Layout"}), 62 | awful.key({mk, "Control"}, "h", function() awful.tag.incncol(1, nil, true) end, 63 | {description="Increase number of columns", group="Layout"}), 64 | awful.key({mk, "Control"}, "l", function() awful.tag.incncol(-1, nil, true) end, 65 | {description="Decrease number of columns", group="Layout"}), 66 | 67 | -- Client 68 | awful.key({mk, "Control"}, "n", function() 69 | local c = awful.client.restore() 70 | if c then c:emit_signal("request::activate", "key.unminimize", {raise=true}) end 71 | end, 72 | {description="Unminimize all clients", group="Client"}) 73 | 74 | --- Bad ones that are useful to keep around 75 | --awful.key({mk}, "Left", awful.tag.viewprev) 76 | --awful.key({mk}, "Right", awful.tag.viewnext) 77 | --awful.key({mk}, "w", function() mymainmenu:show() end) 78 | --awful.key({mk, "Control"}, "j", function() awful.screen.focus_relative(1) end) 79 | --awful.key({mk, "Control"}, "k", function() awful.screen.focus_relative(-1) end) 80 | --awful.key({mk}, "Tab", 81 | -- function() 82 | -- awful.client.focus.history.previous() 83 | -- if client.focus then client.focus:raise() end 84 | -- end end,) --Goes back one client 85 | --awful.key({mk}, "space", function() awful.layout.inc(1) end) 86 | --awful.key({mk, "Shift"}, "space" function() awful.layout.inc(-1) end) 87 | 88 | ) 89 | 90 | clientkeys = gears.table.join( 91 | awful.key({mk}, "f", function(c) c.fullscreen = not c.fullscreen; c:raise() end, 92 | {description="Toggle focused client fullscreen", group="Client"}), 93 | 94 | awful.key({mk, "Shift"}, "q", function(c) c:kill() end, 95 | {description="Kill focused client", group="Client"}), 96 | 97 | awful.key({mk}, "space", awful.client.floating.toggle, 98 | {description="Toggle focused cleint floating", group="Client"}) 99 | ) 100 | 101 | globalkeys = gears.table.join(globalkeys, 102 | 103 | awful.key({ vars.modkey }, "x", 104 | function () 105 | awful.prompt.run { 106 | prompt = "Run Lua code: ", 107 | textbox = awful.screen.focused().mypromptbox.widget, 108 | exe_callback = awful.util.eval, 109 | history_path = awful.util.get_cache_dir() .. "/history_eval" 110 | } 111 | end, 112 | {description = "lua execute prompt", group = "awesome"}), 113 | -- Menubar 114 | awful.key({ vars.modkey }, "p", function() menubar.show() end, 115 | {description = "show the menubar", group = "launcher"}) 116 | ) 117 | 118 | clientkeys = gears.table.join(clientkeys, 119 | 120 | 121 | awful.key({ vars.modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, 122 | {description = "move to master", group = "client"}), 123 | awful.key({ vars.modkey, }, "o", function (c) c:move_to_screen() end, 124 | {description = "move to screen", group = "client"}), 125 | awful.key({ vars.modkey, }, "t", function (c) c.ontop = not c.ontop end, 126 | {description = "toggle keep on top", group = "client"}), 127 | awful.key({ vars.modkey, }, "n", 128 | function (c) 129 | -- The client currently has the input focus, so it cannot be 130 | -- minimized, since minimized clients can't have the focus. 131 | c.minimized = true 132 | end , 133 | {description = "minimize", group = "client"}), 134 | awful.key({ vars.modkey, }, "m", 135 | function (c) 136 | c.maximized = not c.maximized 137 | c:raise() 138 | end , 139 | {description = "(un)maximize", group = "client"}), 140 | awful.key({ vars.modkey, "Control" }, "m", 141 | function (c) 142 | c.maximized_vertical = not c.maximized_vertical 143 | c:raise() 144 | end , 145 | {description = "(un)maximize vertically", group = "client"}), 146 | awful.key({ vars.modkey, "Shift" }, "m", 147 | function (c) 148 | c.maximized_horizontal = not c.maximized_horizontal 149 | c:raise() 150 | end , 151 | {description = "(un)maximize horizontally", group = "client"}) 152 | ) 153 | 154 | -- Bind all key numbers to tags. 155 | -- Be careful: we use keycodes to make it work on any keyboard layout. 156 | -- This should map on the top row of your keyboard, usually 1 to 9. 157 | for i = 1, 9 do 158 | globalkeys = gears.table.join(globalkeys, 159 | -- View tag only. 160 | awful.key({ vars.modkey }, "#" .. i + 9, 161 | function () 162 | local screen = awful.screen.focused() 163 | local tag = screen.tags[i] 164 | if tag then 165 | tag:view_only() 166 | end 167 | end, 168 | {description = "view tag #"..i, group = "tag"}), 169 | -- Toggle tag display. 170 | awful.key({ vars.modkey, "Control" }, "#" .. i + 9, 171 | function () 172 | local screen = awful.screen.focused() 173 | local tag = screen.tags[i] 174 | if tag then 175 | awful.tag.viewtoggle(tag) 176 | end 177 | end, 178 | {description = "toggle tag #" .. i, group = "tag"}), 179 | -- Move client to tag. 180 | awful.key({ vars.modkey, "Shift" }, "#" .. i + 9, 181 | function () 182 | if client.focus then 183 | local tag = client.focus.screen.tags[i] 184 | if tag then 185 | client.focus:move_to_tag(tag) 186 | end 187 | end 188 | end, 189 | {description = "move focused client to tag #"..i, group = "tag"}), 190 | -- Toggle tag on focused client. 191 | awful.key({ vars.modkey, "Control", "Shift" }, "#" .. i + 9, 192 | function () 193 | if client.focus then 194 | local tag = client.focus.screen.tags[i] 195 | if tag then 196 | client.focus:toggle_tag(tag) 197 | end 198 | end 199 | end, 200 | {description = "toggle focused client on tag #" .. i, group = "tag"}) 201 | ) 202 | end 203 | 204 | clientbuttons = gears.table.join( 205 | awful.button({ }, 1, function (c) 206 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 207 | end), 208 | awful.button({ vars.modkey }, 1, function (c) 209 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 210 | awful.mouse.client.move(c) 211 | end), 212 | awful.button({ vars.modkey }, 3, function (c) 213 | c:emit_signal("request::activate", "mouse_click", {raise = true}) 214 | awful.mouse.client.resize(c) 215 | end) 216 | ) 217 | 218 | -- Set keys 219 | root.keys(globalkeys) 220 | -- }}} 221 | -------------------------------------------------------------------------------- /awesome/binding/bindings_mouse.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local mainmenu = require("deco.menu") 3 | local gears = require("gears") 4 | 5 | -- {{{ Mouse bindings 6 | root.buttons(gears.table.join( 7 | awful.button({ }, 3, function () mainmenu:toggle() end), 8 | awful.button({ }, 4, awful.tag.viewnext), 9 | awful.button({ }, 5, awful.tag.viewprev) 10 | )) 11 | -- }}} 12 | 13 | -------------------------------------------------------------------------------- /awesome/deco/menu.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local vars = require("main.variables") 3 | local beautiful = require("beautiful") 4 | 5 | -- {{{ Menu 6 | -- Create a launcher widget and a main menu 7 | menuitems = { 8 | { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, 9 | { "manual", vars.terminal .. " -e man awesome" }, 10 | { "edit config", vars.editor_cmd .. " " .. awesome.conffile }, 11 | { "restart", awesome.restart }, 12 | { "quit", function() awesome.quit() end }, 13 | } 14 | 15 | mainmenu = awful.menu( 16 | { items = { 17 | { "awesome", menuitems, beautiful.awesome_icon }, 18 | { "open terminal", vars.terminal }} 19 | }) 20 | 21 | return mainmenu 22 | -------------------------------------------------------------------------------- /awesome/deco/rightthing.lua: -------------------------------------------------------------------------------- 1 | local awful = require 'awful' 2 | local wibox = require 'wibox' 3 | local variables = require 'main.variables' 4 | local naughty = require 'naughty' 5 | local rubato = require 'lib.rubato' 6 | local dpi = require('beautiful.xresources').apply_dpi 7 | local gears = require 'gears' 8 | local beautiful = require 'beautiful' 9 | local color = require 'lib.color' 10 | local slider = require 'deco.widgets.slider' 11 | 12 | local function create_music_widget(s_dpi) 13 | 14 | local art = wibox.widget { 15 | image = nil, --TODO: Get actual picture for this 16 | resize = true, 17 | forced_height = dpi(80), 18 | forced_width = dpi(80), 19 | buttons = {awful.button({}, 1, function() 20 | end)}, 21 | widget = wibox.widget.imagebox 22 | } 23 | 24 | local function headerize(str) return ""..str.."" end 25 | local function subheaderize(str) return ""..str.."" end 26 | 27 | local title_widget = wibox.widget.textbox(headerize("No media playing")) 28 | local artist_widget = wibox.widget.textbox("") 29 | title_widget.ellipsize = "end" 30 | artist_widget.ellipsize = "end" 31 | 32 | local _, t_height = title_widget:get_preferred_size_at_dpi(s_dpi) 33 | local _, a_height = title_widget:get_preferred_size_at_dpi(s_dpi) 34 | 35 | local playpause_widget = require("lib.awesome-widgets.playpause") { 36 | forced_width = dpi(25), 37 | forced_height = dpi(25), 38 | button = awful.button({}, 1, function() awful.spawn("playerctl play-pause") end), 39 | } 40 | 41 | --sets playpause status based off playerctl 42 | local function set_playpause_status() 43 | awful.spawn.with_line_callback("playerctl status", { 44 | stdout = function(string) 45 | if string == "Paused" then playpause_widget:set(1) 46 | else playpause_widget:set(0) end 47 | end 48 | }) 49 | end 50 | 51 | set_playpause_status() 52 | 53 | -- Get Song Info 54 | awesome.connect_signal("bling::playerctl::title_artist_album", 55 | function(title, artist, art_path, player_name) 56 | art:set_image(gears.surface.load_uncached(art_path or nil)) 57 | title_widget:set_markup_silently(headerize(title or "No Title")) 58 | artist_widget:set_markup_silently(subheaderize((artist and artist.." via " or "")..player_name)) 59 | 60 | set_playpause_status() 61 | end) 62 | 63 | awesome.connect_signal("bling::playerctl::no_players", 64 | function() 65 | art:set_image(nil) 66 | title_widget:set_markup_silently("No media playing") 67 | artist_widget:set_markup_silently("") 68 | 69 | set_playpause_status() 70 | end) 71 | 72 | --[[awesome.connect_signal("bling::playerctl::position", 73 | function(interval_sec, length_sec) 74 | naughty.notify {text=tostring(interval_sec).." "..tostring(length_sec)} 75 | end)]] 76 | 77 | 78 | 79 | return 80 | { 81 | { 82 | art, 83 | shape = gears.shape.rounded_rect, 84 | shape_clip = true, 85 | bg = beautiful.bg_normal_1, 86 | layout = wibox.container.background 87 | }, 88 | { 89 | { 90 | { 91 | { 92 | title_widget, 93 | strategy = "max", 94 | height = t_height, 95 | layout = wibox.container.constraint 96 | }, 97 | { 98 | artist_widget, 99 | strategy = "max", 100 | height = a_height, 101 | layout = wibox.container.constraint 102 | }, 103 | layout = wibox.layout.fixed.vertical 104 | }, 105 | left = dpi(8), 106 | layout = wibox.container.margin 107 | }, 108 | { 109 | { 110 | { 111 | { 112 | { 113 | { 114 | image = beautiful.skip_prev, 115 | forced_width = dpi(25), 116 | forced_height = dpi(25), 117 | widget = wibox.widget.imagebox 118 | }, 119 | --[[{ 120 | image = beautiful.pause, 121 | forced_width = dpi(25), 122 | forced_height = dpi(25), 123 | widget = wibox.widget.imagebox 124 | },]] 125 | playpause_widget, 126 | { 127 | image = beautiful.skip_next, 128 | forced_width = dpi(25), 129 | forced_height = dpi(25), 130 | widget = wibox.widget.imagebox 131 | }, 132 | layout = wibox.layout.fixed.horizontal 133 | }, 134 | margins = dpi(4), 135 | layout = wibox.container.margin 136 | }, 137 | shape = gears.shape.rounded_rect, 138 | bg = beautiful.bg_normal_1, 139 | layout = wibox.container.background 140 | }, 141 | --margins = dpi(4), 142 | layout = wibox.container.margin 143 | }, 144 | valign = "bottom", 145 | halign = "right", 146 | layout = wibox.container.place 147 | }, 148 | layout = wibox.layout.stack 149 | }, 150 | fill_space = true, 151 | layout = wibox.layout.fixed.horizontal, 152 | } 153 | 154 | end 155 | 156 | local function create_brightness_widget() 157 | 158 | local brightness_slider = slider { 159 | lw_margins = dpi(20), 160 | height_bar = dpi(8), 161 | height_handle = dpi(14), 162 | 163 | forced_height = dpi(40), 164 | } 165 | 166 | awful.spawn.with_line_callback("xbacklight", { 167 | stdout = function(out) brightness_slider:hard_set(out/100) end 168 | }) 169 | 170 | local image = wibox.widget { 171 | { 172 | { 173 | image = beautiful.brightness, 174 | forced_width = dpi(20), 175 | forced_height = dpi(20), 176 | widget = wibox.widget.imagebox 177 | }, 178 | margins = dpi(12), 179 | layout = wibox.container.margin 180 | }, 181 | shape = gears.shape.rounded_rect, 182 | bg = beautiful.bg_normal_1.."64", 183 | layout = wibox.container.background 184 | } 185 | 186 | brightness_slider:connect_signal("slider::moved", function(_, pos) 187 | awful.spawn("xbacklight -time 0 -set "..math.floor(5 + pos * 95)) 188 | end) 189 | 190 | 191 | return { 192 | { 193 | wibox.widget {}, --TODO: Make more idiomatic 194 | brightness_slider, 195 | image, 196 | layout = wibox.layout.align.horizontal 197 | }, 198 | right = dpi(20), 199 | layout = wibox.container.margin 200 | } 201 | end 202 | 203 | local function create_volume_widget() 204 | local volume_slider = slider { 205 | lw_margins = dpi(20), 206 | height_bar = dpi(8), 207 | height_handle = dpi(14), 208 | 209 | forced_height = dpi(40), 210 | } 211 | 212 | local button = wibox.widget { 213 | { 214 | { 215 | image = beautiful.volume_high, 216 | forced_width = dpi(24), 217 | forced_height = dpi(24), 218 | widget = wibox.widget.imagebox 219 | }, 220 | margins = dpi(10), 221 | layout = wibox.container.margin 222 | }, 223 | shape = gears.shape.rounded_rect, 224 | bg = beautiful.bg_normal_1.."64", 225 | layout = wibox.container.background 226 | } 227 | 228 | local volume_first = false 229 | local slider_first = false 230 | local finished_setting = true 231 | 232 | awesome.connect_signal("signal::volume", function(percentage) 233 | if finished_setting then 234 | if not slider_first then volume_first = true end 235 | if volume_first then 236 | volume_slider:set(math.min(percentage, 100)/100) 237 | end 238 | end 239 | end) 240 | 241 | volume_slider:connect_signal("slider::moved", function(_, pos) 242 | if not volume_first then slider_first = true end 243 | if slider_first then 244 | finished_setting = false 245 | awful.spawn.with_line_callback("pactl set-sink-volume @DEFAULT_SINK@ "..math.floor(pos * 100).."%", { 246 | exit = function() 247 | finished_setting = true 248 | end 249 | }) 250 | end 251 | end) 252 | 253 | volume_slider:connect_signal("slider::ended", function() 254 | slider_first = false 255 | volume_first = false 256 | end) 257 | 258 | return { 259 | { 260 | wibox.widget {}, 261 | volume_slider, 262 | button, 263 | layout = wibox.layout.align.horizontal 264 | }, 265 | right = dpi(20), 266 | layout = wibox.container.margin 267 | } 268 | end 269 | 270 | local off_rgb, on_rgb = {}, {} 271 | off_rgb.r, off_rgb.g, off_rgb.b = color.hex_to_rgb(beautiful.bg_normal_1) 272 | on_rgb.r, on_rgb.g, on_rgb.b = color.hex_to_rgb(beautiful.light_blue) 273 | 274 | --Toggle is automatically switched because I gotta do some other stuff too 275 | local function toggle_button(icon, button, reset_on_leave) 276 | 277 | --early initialization so it can be used in w's initialization 278 | local rgb_timed 279 | 280 | local d = { r=0, g=0, b=0, dim=0 } 281 | local final = color.color {disable_hsl = true} 282 | 283 | icon = icon or beautiful.battery_charging 284 | local w = wibox.widget { 285 | { 286 | { 287 | image = icon, 288 | widget = wibox.widget.imagebox 289 | }, 290 | margins = dpi(13), 291 | layout = wibox.container.margin 292 | }, 293 | forced_height = dpi(50), 294 | forced_width = dpi(50), 295 | 296 | shape = gears.shape.rounded_rect, 297 | bg = beautiful.bg_normal_1, 298 | buttons = button, 299 | layout = wibox.container.background 300 | } 301 | 302 | function w:update_colors() 303 | final.r = (off_rgb.r - d.r) * d.dim 304 | final.g = (off_rgb.g - d.g) * d.dim 305 | final.b = (off_rgb.b - d.b) * d.dim 306 | self.bg = final.hex 307 | self:emit_signal("widget::redraw_needed") 308 | end 309 | 310 | local hover_timed = rubato.timed { 311 | duration = 0.2, 312 | intro = 0.3, 313 | prop_intro = true, 314 | subscribed = function(pos) 315 | d.dim = 1 - pos 316 | w:update_colors() 317 | end 318 | } 319 | 320 | rgb_timed = rubato.timed { 321 | duration = 0.2, 322 | intro = 0.3, 323 | prop_intro = true, 324 | subscribed = function(pos) 325 | d.r = (off_rgb.r - on_rgb.r) * pos 326 | d.g = (off_rgb.g - on_rgb.g) * pos 327 | d.b = (off_rgb.b - on_rgb.b) * pos 328 | w:update_colors() 329 | end 330 | } 331 | 332 | w:connect_signal("mouse::enter", function() hover_timed.target = 0.2 end) 333 | w:connect_signal("mouse::leave", function() 334 | hover_timed.target = 0 335 | if reset_on_leave then rgb_timed.target = 0 end 336 | end) 337 | 338 | local function rgb(value) rgb_timed.target = value end 339 | local function hover(value) hover_timed.target = value end 340 | 341 | return { 342 | { 343 | w, 344 | margins = dpi(8), 345 | layout = wibox.container.margin 346 | }, 347 | halign = "center", 348 | layout = wibox.container.place, 349 | 350 | --manual set functions 351 | rgb = rgb, 352 | hover = hover, 353 | } 354 | 355 | end 356 | 357 | local function create_storage_widget(image, signal) 358 | local pb = wibox.widget { 359 | forced_height = dpi(10), 360 | forced_width = dpi(100), 361 | 362 | shape = gears.shape.rounded_bar, 363 | bar_shape = gears.shape.rounded_bar, 364 | 365 | color = "#aaaaaa", 366 | background_color = beautiful.bg_normal_1, 367 | value = 0.3, 368 | 369 | widget = wibox.widget.progressbar 370 | } 371 | 372 | awesome.connect_signal(signal, function(used, available) 373 | pb.value = used / (available or 100) 374 | end) 375 | 376 | return { 377 | { 378 | pb, 379 | valign = "center", 380 | widget = wibox.container.place 381 | }, 382 | { 383 | image = beautiful[image], 384 | forced_height = dpi(18), 385 | forced_width = dpi(18), 386 | widget = wibox.widget.imagebox 387 | }, 388 | spacing = dpi(20), 389 | layout = wibox.layout.fixed.horizontal 390 | } 391 | end 392 | 393 | local function create_card(w) 394 | return { 395 | w, 396 | shape = gears.shape.rounded_rect, 397 | bg = beautiful.bg_normal, 398 | layout = wibox.container.background 399 | } 400 | end 401 | 402 | return function(s) 403 | 404 | local rightthing 405 | 406 | local toggle = { 407 | blue = 0, 408 | theme = 0, 409 | wifi = 0, 410 | } 411 | 412 | local blue_light_toggle 413 | blue_light_toggle = toggle_button(beautiful.lightbulb, awful.button({}, 1, function() 414 | toggle.blue = (toggle.blue + 1) % 2 415 | awful.spawn("sct "..tostring(6500 - toggle.blue * 2000)) 416 | blue_light_toggle.rgb(toggle.blue) 417 | end) 418 | ) 419 | 420 | local screenshot_button 421 | screenshot_button = toggle_button(beautiful.scissors, awful.button({}, 1, 422 | function() 423 | screenshot_button.rgb(1) 424 | end, 425 | function() 426 | screenshot_button.rgb(0) 427 | rightthing:set(0) 428 | awful.spawn("shutter -s --delay=3") 429 | end), true 430 | ) 431 | 432 | local media_card = create_card { 433 | create_music_widget(s.dpi), 434 | margins = dpi(10), 435 | layout = wibox.container.margin 436 | } 437 | 438 | local dashboard_card = create_card { 439 | { 440 | { 441 | { 442 | blue_light_toggle, 443 | toggle_button(beautiful.lock), 444 | screenshot_button, 445 | layout = wibox.layout.flex.horizontal 446 | }, 447 | { 448 | toggle_button(beautiful.theme), 449 | toggle_button(beautiful.calendar), 450 | toggle_button(beautiful.wifi_3), 451 | layout = wibox.layout.flex.horizontal 452 | }, 453 | spacing = dpi(5), 454 | layout = wibox.layout.fixed.vertical 455 | }, 456 | left = dpi(40), 457 | right = dpi(40), 458 | top = dpi(10), 459 | --bottom = dpi(10), 460 | layout = wibox.layout.margin --buttons 461 | }, 462 | create_brightness_widget(), 463 | create_volume_widget(), 464 | wibox.widget {}, --just a spacing widget, adds 10dpi of space cuz spacing 465 | spacing = dpi(10), 466 | layout = wibox.layout.fixed.vertical --sections within card 467 | } 468 | 469 | local device_info_card = create_card { 470 | { 471 | { 472 | create_storage_widget("cpu", "signal::cpu"), 473 | create_storage_widget("ram", "signal::ram"), 474 | create_storage_widget("ssd", "signal::disk"), 475 | spacing = dpi(10), 476 | layout = wibox.layout.fixed.vertical 477 | }, 478 | margins = dpi(10), 479 | layout = wibox.container.margin 480 | }, 481 | shape = gears.shape.rounded_rect, 482 | bg = beautiful.bg_normal, 483 | layout = wibox.container.background --card TODO: Add more stuff to this card 484 | } 485 | 486 | --[[local notification_widget = { 487 | { 488 | 489 | naughty.widget.title, 490 | naughty.widget.message, 491 | layout = wibox.layout.fixed.vertical 492 | }, 493 | base_layout = wibox.layout.fixed.vertical, 494 | widget = naughty.list.notifications 495 | }]] 496 | 497 | local notification_card = create_card ()--notification_widget) 498 | 499 | --notification_widget.base_layout = wibox.layout.fixed.horizontal 500 | 501 | 502 | rightthing = awful.popup { 503 | widget = { 504 | { 505 | { 506 | media_card, 507 | dashboard_card, 508 | device_info_card, 509 | spacing = dpi(5), 510 | layout = wibox.layout.fixed.vertical --stacked cards 511 | }, 512 | { 513 | notification_card, 514 | top = dpi(5), 515 | bottom = dpi(5), 516 | layout = wibox.container.margin 517 | 518 | }, 519 | layout = wibox.layout.align.vertical 520 | }, 521 | margins = dpi(5), 522 | layout = wibox.container.margin --transparent margin 523 | }, 524 | screen = s, 525 | maximum_height = s.geometry.height - variables.top_navbar_height, 526 | minimum_height = s.geometry.height - variables.top_navbar_height, 527 | maximum_width = dpi(400), 528 | minimum_width = dpi(400), 529 | bg = "#00000000", 530 | y = variables.top_navbar_height + variables.top_navbar_padding, 531 | ontop = true 532 | } 533 | 534 | local timed = rubato.timed { 535 | duration = 0.4, 536 | intro = 0.3, 537 | rate = 60, 538 | prop_intro = true, 539 | subscribed = function(pos) 540 | rightthing.x = s.geometry.width - rightthing.width * pos 541 | end 542 | } 543 | 544 | --0 is closed, 1 is open 545 | rightthing.closed_state = 0 546 | 547 | function rightthing:toggle() 548 | self.closed_state = (self.closed_state + 1) % 2 549 | timed.target = self.closed_state 550 | end 551 | 552 | function rightthing:set(value) 553 | self.closed_state = value 554 | timed.target = self.closed_state 555 | end 556 | 557 | return rightthing 558 | 559 | end 560 | 561 | 562 | -------------------------------------------------------------------------------- /awesome/deco/screens.lua: -------------------------------------------------------------------------------- 1 | local wibox = require "wibox" 2 | local gears = require "gears" 3 | local awful = require "awful" 4 | local beautiful = require "beautiful" 5 | local naughty = require "naughty" 6 | local dpi = require("beautiful.xresources").apply_dpi 7 | local rubato = require "lib.rubato" 8 | local color = require "lib.color" 9 | local variables = require "main.variables" 10 | 11 | rubato.set_def_rate(60) 12 | 13 | local function round(x, p) 14 | local power = math.pow(10, p or 0) 15 | return (x * power + 0.5 - (x * power + 0.5) % 1) / power 16 | end 17 | 18 | 19 | --- useful color constants 20 | local ia_rgb = color.color {hex=beautiful.gray, disable_hsl=true} --inactive color 21 | local a_rgb = color.color {hex=beautiful.light_gray, disable_hsl=true} --active color 22 | local u_rgb = color.color {hex=beautiful.bg_urgent, disable_hsl=true} --urgent color 23 | local s_rgb = color.color {hex=beautiful.light_blue, disable_hsl=true} --slidey color 24 | 25 | -- Calculate the diff in colors for some stuff later on 26 | local diff = {} 27 | diff.r = ia_rgb.r - a_rgb.r 28 | diff.g = ia_rgb.g - a_rgb.g 29 | diff.b = ia_rgb.b - a_rgb.b 30 | 31 | --- Draws a circle 32 | local function draw_circle(cr, height) 33 | cr:arc(height/2, height/2, dpi(6), 0, math.pi * 2) 34 | cr:fill() 35 | end 36 | 37 | --- Draws the slidey thing 38 | local function draw_slidey_thing(cr, height, xpos) 39 | cr:arc(xpos, height/2, dpi(6), 0, math.pi*2) 40 | cr:fill() 41 | end 42 | 43 | 44 | --- Creates the taglist widgets. 45 | local function create_taglist_widgets(s, slidey_thing) 46 | 47 | local l = {layout = wibox.layout.fixed.horizontal} 48 | 49 | for _, t in pairs(s.tags) do 50 | 51 | -- Create the widget and instantiate its base values 52 | local w = wibox.widget.base.make_widget() 53 | function w:fit(_, _, height) return height, height end 54 | function w:draw(_, cr, _, height) 55 | cr:set_source_rgb(ia_rgb.r / 255, ia_rgb.g / 255, ia_rgb.b / 255) 56 | draw_circle(cr, height) 57 | end 58 | w.buttons = awful.button({}, 1, function() t:view_only() end) 59 | 60 | --difference in color 61 | local d = {ar=0, ag=0, ab=0, ur=0, ug=0, ub=0, dim=0} 62 | 63 | -- All the interpolators 64 | local active_timed = rubato.timed { 65 | intro = 0.075, 66 | duration = 0.2 67 | } 68 | 69 | local urgent_timed = rubato.timed { 70 | intro = 0.075, 71 | duration = 0.2 72 | } 73 | 74 | local hover_timed = rubato.timed { 75 | intro = 0.075, 76 | duration = 0.2 77 | } 78 | 79 | --- Updates RGB for the taglist (to allow for hover) 80 | local function update_rgb(rgb) 81 | local r = (rgb.r + d.ar + d.ur) * d.dim 82 | local g = (rgb.g + d.ag + d.ug) * d.dim 83 | local b = (rgb.b + d.ab + d.ub) * d.dim 84 | function w:draw(_, cr, _, height) 85 | cr:set_source_rgb(r / 255, g / 255, b / 255) 86 | draw_circle(cr, height) 87 | end 88 | w:emit_signal("widget::redraw_needed") 89 | end 90 | 91 | active_timed:subscribe(function(pos) 92 | d.ar = -pos * diff.r 93 | d.ag = -pos * diff.g 94 | d.ab = -pos * diff.b 95 | update_rgb(ia_rgb) 96 | end) 97 | 98 | urgent_timed:subscribe(function(pos) 99 | d.ur = (u_rgb.r - a_rgb.r - d.ar) * pos 100 | d.ug = (u_rgb.g - a_rgb.g - d.ag) * pos 101 | d.ub = (u_rgb.b - a_rgb.b - d.ab) * pos 102 | update_rgb(ia_rgb) 103 | end) 104 | 105 | hover_timed:subscribe(function(pos) 106 | d.dim = 1 - 0.1 * pos 107 | update_rgb(ia_rgb) 108 | end) 109 | 110 | client.connect_signal("tagged", function() 111 | if not (#t:clients() == 0) then active_timed.target = 1 112 | else active_timed.target = 0 end 113 | end) 114 | client.connect_signal("untagged", function() 115 | if not (#t:clients() == 0) then active_timed.target = 1 116 | else active_timed.target = 0 end 117 | end) 118 | 119 | t:connect_signal("property::urgent", function() 120 | if awful.tag.getproperty(t, "urgent") then urgent_timed.target = 1 121 | else urgent_timed.target = 0 end 122 | end) 123 | 124 | w:connect_signal("mouse::enter", function() 125 | --look, I know this isn't by any means idiomatic, but it's either this or 126 | --have a signal for every single one of the taglist widgets, which I really 127 | --don't want to do. So random variable put in tag it is. 128 | t.is_being_hovered = true 129 | hover_timed.target = 1 130 | if s.selected_tag == t then slidey_thing:hover(1) end 131 | end) 132 | w:connect_signal("mouse::leave", function() 133 | t.is_being_hovered = false 134 | hover_timed.target = 0 135 | if s.selected_tag == t then slidey_thing:hover(0) end 136 | end) 137 | 138 | table.insert(l, w) 139 | end 140 | 141 | return l 142 | end 143 | 144 | --- Updates the position of the slidey thing 145 | local function update_slidey_thing(w, dim, pos) 146 | function w:draw(_, cr, _, height) 147 | cr:set_source_rgb(s_rgb.r * dim / 255, s_rgb.g * dim / 255, s_rgb.b * dim / 255) 148 | draw_slidey_thing(cr, height, height/2 + (pos - 1) * height) 149 | end 150 | w:emit_signal("widget::redraw_needed") 151 | end 152 | 153 | --- Creates the slidey thing in the workspace switcher. 154 | local function create_slidey_thing(s) 155 | local w = wibox.widget { 156 | fit = function(self, cocntext, width, height) 157 | return height, height 158 | end, 159 | 160 | draw = function(self, context, cr, width, height) 161 | cr:set_source_rgba(0.6, 0.6, 1, 0.3) 162 | draw_slidey_thing(cr, height, height/2 + variables.taglist_padding_sides) 163 | end, 164 | 165 | layout = wibox.widget.base.make_widget, 166 | } 167 | 168 | local index = 1 169 | 170 | -- Bouncy easing if I so please 171 | --[[local timed = rubato.timed { 172 | duration = 0.85, 173 | intro = 0.25, 174 | outro = 0.65, 175 | inter = 0.05, 176 | prop_intro = true, 177 | pos = index, 178 | easing = rubato.linear, 179 | easing_outro = rubato.bouncy 180 | }]] 181 | 182 | local timed = rubato.timed { 183 | duration = 0.3, 184 | intro = 0.1, 185 | inter = 0.2, 186 | pos = index, 187 | easing = rubato.linear, 188 | } 189 | 190 | local hover_timed = rubato.timed { 191 | intro = 0.075, 192 | duration = 0.2 193 | } 194 | 195 | local ti = {} 196 | for k,v in ipairs(s.tags) do ti[v] = k end 197 | 198 | local pos, dim 199 | 200 | timed:subscribe(function(_pos) 201 | pos = _pos 202 | update_slidey_thing(w, dim, pos) 203 | end) 204 | 205 | hover_timed:subscribe(function(_pos) 206 | dim = 1 - 0.15 * _pos 207 | update_slidey_thing(w, dim, pos) 208 | end) 209 | 210 | s:connect_signal("tag::history::update", function() 211 | if ti[s.selected_tag] == w.index then return end 212 | 213 | timed.target = ti[s.selected_tag] 214 | index = ti[s.selected_tag] 215 | 216 | hover_timed.target = s.selected_tag.is_being_hovered and 1 or 0 217 | end) 218 | 219 | function w:hover(value) hover_timed.target = value end 220 | 221 | return w 222 | end 223 | 224 | local full = color.color {r=60, g=131, b=242} 225 | local empty = color.color {r=89, g=0, b=175} 226 | 227 | --- Create the battery widget 228 | local function create_battery_widget() 229 | 230 | local w = wibox.widget.imagebox() 231 | 232 | local a = wibox.widget { 233 | w, 234 | max_value = 100, 235 | value = 100, 236 | start_angle = 1.5 * math.pi, 237 | border_width = 0, 238 | rounded_edge = true, 239 | widget = wibox.container.arcchart 240 | } 241 | 242 | awesome.connect_signal("signal::battery", function(percentage, state) 243 | 244 | -- Do charging state 245 | --local markup = "" 246 | 247 | -- 4 is charging at full, 2 is not charging, 1 is charging and not at full 248 | if state == 4.0 or state == 1.0 then w.image = beautiful.battery_charging 249 | 250 | elseif state == 2.0 then 251 | if percentage >= 95 then w.image = beautiful.battery_full 252 | elseif percentage >= 85 then w.image = beautiful.battery_90 253 | elseif percentage >= 75 then w.image = beautiful.battery_80 254 | elseif percentage >= 65 then w.image = beautiful.battery_70 255 | elseif percentage >= 55 then w.image = beautiful.battery_60 256 | elseif percentage >= 45 then w.image = beautiful.battery_50 257 | elseif percentage >= 35 then w.image = beautiful.battery_40 258 | elseif percentage >= 25 then w.image = beautiful.battery_30 259 | elseif percentage >= 15 then w.image = beautiful.battery_20 260 | elseif percentage >= 5 then w.image = beautiful.battery_10 261 | else w.image = beautiful.battery_low end 262 | 263 | else w.image = beautiful.battery_unknown end 264 | 265 | --[[markup = markup .. ""]] 266 | --[[w.markup = markup]] 267 | 268 | -- Set percentage and color 269 | a.value = percentage 270 | a.colors = {color.rgb_to_hex { 271 | empty.r + (full.r - empty.r) * percentage / 100, 272 | empty.g + (full.g - empty.g) * percentage / 100, 273 | empty.b + (full.b - empty.b) * percentage / 100, 274 | true 275 | }} 276 | 277 | a:emit_signal("widget::redraw_needed") 278 | end) 279 | 280 | 281 | return a 282 | end 283 | 284 | local green = color.color {r=97, g=232, b=87, disable_hsl=true} 285 | local red = color.color {r=232, g=87, b=87, disable_hsl=true} 286 | 287 | local last_color = color.color {r=232, g=87, b=87} 288 | local next_color = color.color {r=232, g=87, b=87} 289 | last_color.h = last_color.h - 40 290 | 291 | local function create_volume_widget() 292 | 293 | local w = wibox.widget.imagebox() 294 | 295 | local a = wibox.widget { 296 | w, 297 | min_value = 0, 298 | max_value = 100, 299 | start_angle = 1.43 * math.pi, 300 | rounded_edge = true, 301 | widget = wibox.container.arcchart 302 | } 303 | 304 | local prev_pos = 0 305 | 306 | local arc_timed = rubato.timed { 307 | duration = 0.2, 308 | intro = 0.3, 309 | prop_intro = true, 310 | awestore_compat = true, 311 | } 312 | 313 | arc_timed:subscribe(function(pos, time) 314 | pos = round(pos, 5) --rounding because float math sucks 315 | 316 | local value 317 | 318 | --If it's zero just display as blank and quit 319 | if pos == 0 then 320 | a.colors = {"#ffffff00"} 321 | return 322 | end 323 | 324 | if pos % 100 == 0 then value = 100 325 | else value = pos % 100 end 326 | 327 | a.value = 7.5 + value * 0.925 328 | 329 | -- For stuf above 200 just increase hue 330 | if prev_pos > 200 or pos > 200 then 331 | local closest_hundred = round(pos, -2) 332 | if pos > closest_hundred and prev_pos <= closest_hundred then 333 | last_color.h = last_color.h + 40 334 | next_color.h = next_color.h + 40 335 | elseif pos <= closest_hundred and prev_pos > closest_hundred then 336 | last_color.h = last_color.h - 40 337 | next_color.h = next_color.h - 40 338 | end 339 | 340 | -- Do cool transition 341 | a.bg = last_color.hex 342 | a.colors = {color.rgb_to_hex{ 343 | last_color.r + (next_color.r - last_color.r) * value / 100, 344 | last_color.g + (next_color.g - last_color.g) * value / 100, 345 | last_color.b + (next_color.b - last_color.b) * value / 100, 346 | true 347 | }} 348 | end 349 | 350 | if 200 > pos and pos > 100 then 351 | a.bg = beautiful.light_gray 352 | a.colors = {color.rgb_to_hex{ 353 | green.r + (red.r - green.r) * value / 100, 354 | green.g + (red.g - green.g) * value / 100, 355 | green.b + (red.b - green.b) * value / 100, 356 | true 357 | }} 358 | elseif pos <= 100 then 359 | a.bg = nil 360 | a.colors = {beautiful.light_gray} 361 | end 362 | 363 | prev_pos = pos 364 | 365 | end) 366 | 367 | awesome.connect_signal("signal::volume", function(percentage, muted) 368 | 369 | arc_timed:set(percentage) 370 | 371 | --local markup = "" 372 | 373 | if percentage == nil then return 374 | elseif muted then w.image = beautiful.volume_mute 375 | elseif percentage >= 75 then w.image = beautiful.volume_high 376 | elseif percentage >= 25 then w.image = beautiful.volume_mid 377 | else w.image = beautiful.volume_low 378 | end 379 | 380 | --markup = markup .. "" 381 | --w.markup = markup 382 | end) 383 | 384 | return a 385 | end 386 | 387 | local hour_color = color.color {r=50, g=0, b=100, disable_hsl=true} 388 | local min_color = color.color {r=89, g=0, b=175, disable_hsl=true} 389 | local sec_color = color.color {r=60, g=131, b=242, disable_hsl=true} 390 | 391 | -- This thing is just stupidly inefficient. Like seriously, if I keep it at 60fps it's 40% cpu, 392 | -- and if I drop it down to 5fps, it's 3% cpu, whereas awesome normally takes 0.3% cpu. 393 | ---@diagnostic disable-next-line: unused-function, unused-local 394 | local function create_cool_clock_widget() 395 | local time = os.time() 396 | local sec, min, hour = os.date("%S", time), os.date("%M", time), os.date("%H") % 12 397 | 398 | local a1 = wibox.widget { 399 | min_value = 0, 400 | max_value = 100, 401 | start_angle = 1.42 * math.pi, 402 | rounded_edge = true, 403 | bg = "#ffffff00", 404 | colors = {sec_color.hex}, 405 | widget = wibox.container.arcchart 406 | } 407 | 408 | local a2 = wibox.widget { 409 | a1, 410 | min_value = 0, 411 | max_value = 100, 412 | start_angle = 1.42 * math.pi, 413 | rounded_edge = true, 414 | bg = "#ffffff00", 415 | colors = {min_color.hex}, 416 | widget = wibox.container.arcchart 417 | } 418 | 419 | local a3 = wibox.widget { 420 | a2, 421 | min_value = 0, 422 | max_value = 100, 423 | start_angle = 1.42 * math.pi, 424 | rounded_edge = true, 425 | bg = "#ffffff10", 426 | colors = {hour_color.hex}, 427 | widget = wibox.container.arcchart 428 | } 429 | 430 | local a1_timed = rubato.timed { 431 | duration = 1, easing = rubato.zero, rate = 5, 432 | subscribed = function(pos) a1.value = 15+pos/59*100*0.85 end 433 | } 434 | local a2_timed = rubato.timed { 435 | duration = 4, intro = 0.3, prop_intro = true, 436 | subscribed = function(pos) a2.value = 11.25+pos/59*100*0.8975 end 437 | } 438 | local a3_timed = rubato.timed { 439 | duration = 6, intro = 0.4, prop_intro = true, 440 | subscribed = function(pos) a3.value = 7.5+pos/11*100*0.925 end 441 | } 442 | 443 | local timer = gears.timer {timeout = 1} 444 | timer:connect_signal("timeout", function() 445 | -- Do time stuff 446 | sec = sec + 1 447 | if sec == 60 then 448 | a1_timed.rate = 60 449 | sec = 0 450 | min = min + 1 451 | if min == 60 then 452 | min = 0 453 | hour = (hour + 1) % 12 454 | end 455 | elseif sec == 1 then a1_timed.rate = 5 end 456 | 457 | -- Update circles 458 | a1_timed.target = sec 459 | a2_timed.target = min 460 | a3_timed.target = hour 461 | end) 462 | 463 | timer:start() 464 | 465 | return a3 466 | end 467 | 468 | local function create_uncool_clock_widget() 469 | local time = os.time() 470 | local sec, min, hour = os.date("%S", time), os.date("%M", time), os.date("%H") % 12 471 | 472 | local hour_textbox 473 | local min_textbox 474 | local sec_textbox 475 | 476 | local widget = { 477 | { 478 | layout = wibox.layout 479 | }, 480 | shape = gears.shape.rounded_rect, 481 | bg = beautiful.bg_normal_1, 482 | layout = wibox.container.background, 483 | } 484 | 485 | end 486 | 487 | local function create_tasklist_widget(s) --TODO 488 | local w = awful.widget.tasklist { 489 | screen = s, 490 | filter = awful.widget.tasklist.filter.currenttags, 491 | ---@diagnostic disable-next-line: undefined-global 492 | buttons = tasklist_buttons, 493 | layout = {layout = wibox.layout.fixed.vertical}, 494 | widget_template = { 495 | { 496 | { 497 | id = 'clienticon', 498 | widget = awful.widget.clienticon, 499 | }, 500 | margins = 6, 501 | layout = wibox.container.margin 502 | }, 503 | ---@diagnostic disable-next-line: unused-local 504 | create_callback = function(self, c, index, objects) 505 | self:get_children_by_id('clienticon')[1].client = c 506 | end, 507 | layout = wibox.layout.align.vertical, 508 | }, 509 | } 510 | 511 | return w 512 | end 513 | 514 | 515 | local function create_top_navbar(s, rightthing) 516 | 517 | local above_taglist = {layout = wibox.layout.fixed.horizontal} 518 | 519 | --make clickable overlay 520 | --TODO: make slidey thing work with these 521 | for _, t in pairs(s.tags) do 522 | table.insert(above_taglist, wibox.widget { 523 | fit = function(_, _, _, height) return height end, 524 | buttons = awful.button({}, 1, function() t:view_only() end), 525 | widget = wibox.widget.base.make_widget 526 | }) 527 | end 528 | 529 | --- Create the slidey thing beforehand as to pass it into the taglist widgets 530 | local slidey_thing = create_slidey_thing(s) 531 | 532 | local left_widgets = { 533 | { { { create_taglist_widgets(s, slidey_thing), 534 | slidey_thing, 535 | above_taglist, 536 | layout = wibox.layout.stack 537 | }, 538 | left = variables.taglist_padding_sides, 539 | right = variables.taglist_padding_sides, 540 | layout = wibox.container.margin 541 | }, 542 | bg = beautiful.bg_normal_1, 543 | shape = function(cr, width, height) return gears.shape.rounded_rect(cr, width, height, dpi(3)) end, 544 | shape_clip = true, 545 | layout = wibox.container.background 546 | }, 547 | margins = dpi(6), 548 | layout = wibox.container.margin 549 | } 550 | 551 | local middle_widgets = wibox.widget {} 552 | 553 | local right_widgets = { 554 | { { --create_cool_clock_widget(), 555 | create_battery_widget(), 556 | create_volume_widget(), 557 | require("lib.awesome-widgets.hamburger")(awful.button({}, 1, function() 558 | rightthing:toggle() 559 | end)), 560 | spacing = dpi(6), 561 | layout = wibox.layout.fixed.horizontal 562 | }, 563 | margins = dpi(4), 564 | layout = wibox.container.margin 565 | }, 566 | layout = wibox.layout.align.horizontal, 567 | } 568 | 569 | 570 | s.top_navbar = awful.popup { 571 | widget = { 572 | { 573 | { 574 | left_widgets, 575 | middle_widgets, 576 | right_widgets, 577 | layout = wibox.layout.align.horizontal 578 | }, 579 | shape = function(cr, width, height) return gears.shape.rounded_rect(cr, width, height, dpi(4)) end, 580 | bg = beautiful.bg_normal, 581 | layout = wibox.container.background 582 | }, 583 | left = variables.left_navbar_width + variables.top_navbar_padding * 2, 584 | right = variables.top_navbar_padding * 2, 585 | top = variables.top_navbar_padding, 586 | layout = wibox.container.margin 587 | }, 588 | screen = s, 589 | minimum_height = variables.top_navbar_height + variables.top_navbar_padding, 590 | maximum_height = variables.top_navbar_height + variables.top_navbar_padding, 591 | minimum_width = s.geometry.width, 592 | maximum_width = s.geometry.width, 593 | bg = "#ffffff00", 594 | } 595 | 596 | s.top_navbar:struts { 597 | bottom = 0, left = 0, right = 0, 598 | top = variables.top_navbar_height + variables.top_navbar_padding 599 | } 600 | 601 | --naughty.notify {text=tostring(s.top_navbar:get_xproperty("WM_NAME", "TEST"))} 602 | --s.top_navbar:set_xproperty("WM_CLASS", "blur") 603 | 604 | end 605 | 606 | local function create_left_navbar(s) 607 | s.left_navbar = awful.wibar { 608 | position = "left", 609 | screen = s, 610 | bg = beautiful.bg_normal.."64", 611 | width = variables.left_navbar_width, 612 | } 613 | 614 | s.left_navbar:setup { 615 | { create_tasklist_widget(s), 616 | layout = wibox.layout.fixed.vertical 617 | }, 618 | layout = wibox.layout.align.vertical 619 | } 620 | 621 | --naughty.notify {text="heyo "..tostring(s.left_navbar:get_xproperty("WM_CLASS"))} 622 | s.left_navbar:set_xproperty("WM_CLASS", "blur") 623 | 624 | 625 | end 626 | 627 | -- Sets wallpaper 628 | local function set_wallpaper(s) 629 | local wallpaper = beautiful.wallpaper 630 | if type(wallpaper) == "function" then 631 | gears.wallpaper.maximized(wallpaper(s), s, true) 632 | elseif not (wallpaper == nil) then 633 | gears.wallpaper.maximized(wallpaper, s, true) 634 | end 635 | end 636 | 637 | screen.connect_signal("property::geometry", set_wallpaper) 638 | 639 | awful.screen.connect_for_each_screen(function(s) 640 | 641 | local rightthing = require("deco.rightthing")(s) 642 | 643 | --[[local dog, margin, button 644 | button = wibox.widget { 645 | markup = "click me", 646 | widget = wibox.widget.textbox, 647 | buttons = awful.button({}, 1, function() 648 | naughty.notify {text=tostring(awful.widget[1])} 649 | 650 | end) 651 | } 652 | 653 | margin = wibox.container.margin { 654 | widget = button, 655 | left = dpi(0) 656 | }]] 657 | 658 | 659 | --[[awful.popup { 660 | widget = { 661 | require("deco.widgets.slider").create_slider(), 662 | layout = wibox.container.margin 663 | }, 664 | screen = s, 665 | minimum_height = 100, 666 | minimum_width = 100, 667 | maximum_height = 100, 668 | maximum_width = 100, 669 | ontop = true, 670 | x = 20, y = 40 671 | }]] 672 | 673 | --create tags 674 | for i = 1, 9, 1 do 675 | awful.tag.add(tostring(i), { 676 | layout = awful.layout.suit.tile, 677 | gap = variables.window_padding, 678 | gap_single_client = true, 679 | }) 680 | end 681 | 682 | s.tags[1]:view_only() 683 | 684 | create_left_navbar(s) 685 | create_top_navbar(s, rightthing) 686 | set_wallpaper(s) 687 | end) 688 | -------------------------------------------------------------------------------- /awesome/deco/titlebar.lua: -------------------------------------------------------------------------------- 1 | local awful = require "awful" 2 | local wibox = require "wibox" 3 | ---@diagnostic disable-next-line: unused-local 4 | local naughty = require "naughty" 5 | local rubato = require "lib.rubato" 6 | local cairo = require("lgi").cairo 7 | local beautiful = require "beautiful" 8 | local dpi = beautiful.xresources.apply_dpi 9 | 10 | 11 | --- Draw a circle. 12 | local function draw_arc(cr, height) 13 | cr:arc(height/2, height/2, dpi(5), 0, math.pi*2) 14 | cr:fill() 15 | end 16 | 17 | --- Udpate the draw function with new colors. 18 | local function update_rgb(w, r, g, b) 19 | function w:draw(_, cr, width, _) 20 | cr:set_source_rgb( 21 | r > 0 and r or 0, 22 | g > 0 and g or 0, 23 | b > 0 and b or 0 24 | ) 25 | draw_arc(cr, width) 26 | end 27 | w:emit_signal("widget::redraw_needed") 28 | end 29 | 30 | --- Get a circular widget. 31 | local function get_widget(r, g, b, buttons, args) 32 | local w = wibox.widget { 33 | buttons = buttons, 34 | layout = wibox.widget.base.make_widget 35 | } 36 | 37 | function w:fit(_, width, _) return width, width end 38 | function w:draw(_, cr, _, height) 39 | cr:set_source_rgb(r, g, b) 40 | draw_arc(cr, height) 41 | end 42 | 43 | if not args then return w end 44 | 45 | local d_rgb = {r=0, g=0, b=0, dim=0} --change in rgb/dim 46 | 47 | -- dimming and animation 48 | if args.dim then 49 | 50 | --dim interpolator 51 | local dim_timed = rubato.timed { 52 | intro = 0.1, 53 | duration = 0.3, 54 | easing = rubato.zero 55 | } 56 | 57 | dim_timed:subscribe(function(pos) 58 | d_rgb.dim = pos 59 | update_rgb(w, 60 | r + d_rgb.dim + d_rgb.r, 61 | g + d_rgb.dim + d_rgb.g, 62 | b + d_rgb.dim + d_rgb.b 63 | ) 64 | end) 65 | 66 | w:connect_signal("mouse::enter", function() dim_timed.target = -args.dim end) 67 | w:connect_signal("mouse::leave", function() dim_timed.target = 0 end) 68 | end 69 | 70 | --graying and animation 71 | if args.gray then 72 | assert(args.client, "if you want gray, specify a client c") 73 | 74 | --gray interpolator 75 | local gray_timed = rubato.timed { 76 | intro = 0.1, 77 | duration = 0.3, 78 | pos = 1, 79 | easing = rubato.zero 80 | } 81 | 82 | gray_timed:subscribe(function(pos) 83 | d_rgb.r = (args.gray - r) * pos 84 | d_rgb.g = (args.gray - g) * pos 85 | d_rgb.b = (args.gray - b) * pos 86 | update_rgb(w, 87 | r + d_rgb.dim + d_rgb.r, 88 | g + d_rgb.dim + d_rgb.g, 89 | b + d_rgb.dim + d_rgb.b 90 | ) 91 | end) 92 | 93 | args.client:connect_signal("focus", function() gray_timed.target = 0 end) 94 | args.client:connect_signal("unfocus", function() gray_timed.target = 1 end) 95 | end 96 | 97 | return w 98 | end 99 | 100 | --beautiful.bg_normal colors as floats from 0 to 1 101 | local rgb = { 102 | r = tonumber("0x"..beautiful.bg_normal:sub(2, 3)) / 256, 103 | g = tonumber("0x"..beautiful.bg_normal:sub(4, 5)) / 256, 104 | b = tonumber("0x"..beautiful.bg_normal:sub(6, 7)) / 256 105 | } 106 | 107 | --- Gets the middle widget 108 | ---@diagnostic disable-next-line: unused-function, unused-local 109 | local function get_middle_widget(c) 110 | 111 | local w = wibox.widget { 112 | { 113 | wibox.widget { 114 | markup = c.class, 115 | widget = wibox.widget.textbox 116 | }, 117 | left = dpi(15), 118 | widget = wibox.container.margin 119 | }, 120 | { 121 | fit = function(_, _, width, height) 122 | return width, height 123 | end, 124 | 125 | draw = function(_, _, cr, _, height) 126 | local pattern = cairo.LinearPattern(0, 0, height * 0.5, 0) 127 | pattern:add_color_stop_rgba(0, rgb.r, rgb.g, rgb.b, 1) 128 | pattern:add_color_stop_rgba(1, rgb.r, rgb.g, rgb.b, 0) 129 | cr:rectangle(0, 0, height * 0.5, height) 130 | cr:set_source(pattern) 131 | cr:fill() 132 | end, 133 | 134 | widget = wibox.widget.base.make_widget 135 | }, 136 | 137 | 138 | layout = wibox.layout.stack 139 | } 140 | 141 | local width, height = w.children[1].widget:get_preferred_size() 142 | 143 | local timed = rubato.timed { 144 | prop_intro = true, 145 | intro = 0.5, 146 | duration = 0.25, 147 | pos = -1 * width 148 | } 149 | 150 | timed:subscribe(function(pos) 151 | w.children[1].left = pos 152 | w.children[1]:emit_signal("widget::redraw_needed") 153 | end) 154 | 155 | c:connect_signal("focus", function() timed.target = 0.5 * height end) 156 | c:connect_signal("unfocus", function() timed.target = -1 * width end) 157 | 158 | return w 159 | end 160 | 161 | --- Get info dot widget. 162 | local function get_info_dot(c) 163 | 164 | local w = get_widget(0.5, 0.5, 1, 165 | awful.button({}, 1, function() 166 | c.ontop = not c.ontop 167 | end), 168 | { dim = 0.1 }) 169 | 170 | w:connect_signal("mouse::enter", function() end) 171 | w:connect_signal("mouse::leave", function() end) 172 | 173 | --background must be filled for the middle widget to work 174 | local b = wibox.widget {} 175 | 176 | function b:fit(_, width, _) return width, width end 177 | function b:draw(_, cr, width, _) 178 | cr:rectangle(0, 0, width, width) 179 | cr:set_source_rgb(rgb.r, rgb.g, rgb.b) 180 | cr:fill() 181 | end 182 | 183 | return { 184 | b, 185 | w, 186 | layout = wibox.layout.stack 187 | } 188 | end 189 | 190 | --- Create titlebars 191 | local function create_titlebars(c) 192 | 193 | --has two layers so that I can have the fade out animation 194 | --the top layer has the blue dot and it's opaque background 195 | --the bottom layer has everything else 196 | --[[local bottom_layer = { 197 | { --dummy space-taking widget 198 | fit = function(_, _, w, h) return h, h end, 199 | widget = wibox.widget.base.make_widget 200 | }, 201 | get_middle_widget(c), 202 | { 203 | --minimize dot 204 | get_widget(0, 1, 0, 205 | awful.button({}, 1, function() 206 | c.focusable = false 207 | c.minimized = true 208 | end, 209 | function() c.focusable = true end), 210 | { dim = 0.3, gray = 0.6, client = c }), 211 | 212 | --maximize dot 213 | get_widget(1, 1, 0, 214 | awful.button({}, 1, function() 215 | c.fullscreen = not c.fullscreen 216 | end), 217 | { dim = 0.3, gray = 0.6, client = c }), 218 | 219 | --close dot 220 | get_widget(1, 0, 0, 221 | awful.button({}, 1, function() 222 | c:kill() 223 | end), 224 | { dim = 0.3 }), 225 | 226 | layout = wibox.layout.fixed.horizontal 227 | }, 228 | layout = wibox.layout.align.horizontal 229 | } 230 | 231 | --top layer has the draggable stuff 232 | local top_layer = { 233 | get_info_dot(c), 234 | { 235 | fit = function(_, _, w, h) return w, h end, 236 | widget = wibox.widget.base.make_widget, 237 | 238 | buttons = gears.table.join( 239 | awful.button({}, 1, function() 240 | c:emit_signal("request::activate", "titlebar", {raise = true}) 241 | awful.mouse.client.move(c) 242 | end), 243 | awful.button({}, 3, function() 244 | c:emit_signal("request::activate", "titlebar", {raise = true}) 245 | awful.mouse.client.resize(c) 246 | end)), 247 | 248 | }, 249 | { 250 | fit = function(_, _, w, h) return h * 3, h end, 251 | widget = wibox.widget.base.make_widget 252 | }, 253 | layout = wibox.layout.align.horizontal 254 | }]] 255 | 256 | --creates titlebar 257 | --[[awful.titlebar(c, {size=dpi(22)}) : setup { 258 | bottom_layer, 259 | top_layer, 260 | layout = wibox.layout.stack 261 | }]] 262 | 263 | awful.titlebar(c, {size=dpi(30), position="left"}) : setup { 264 | { --close dot 265 | get_widget(1, 0, 0, 266 | awful.button({}, 1, function() c:kill() end), 267 | { dim = 0.3 }), 268 | 269 | --maximize dot 270 | get_widget(1, 1, 0, 271 | awful.button({}, 1, function() c.fullscreen = not c.fullscreen end), 272 | { dim = 0.3, gray = 0.6, client = c }), 273 | 274 | --minimize dot 275 | get_widget(0, 1, 0, 276 | awful.button({}, 1, function() 277 | c.focusable = false 278 | c.minimized = true 279 | end, 280 | function() c.focusable = true end), 281 | { dim = 0.3, gray = 0.6, client = c }), 282 | 283 | layout = wibox.layout.fixed.vertical 284 | 285 | }, 286 | wibox.widget {}, 287 | get_info_dot(c), 288 | layout = wibox.layout.align.vertical 289 | } 290 | end 291 | 292 | --connects titlebar to clients 293 | client.connect_signal("request::titlebars", create_titlebars) 294 | 295 | -------------------------------------------------------------------------------- /awesome/deco/widgets/slider.lua: -------------------------------------------------------------------------------- 1 | local wibox = require 'wibox' 2 | local dpi = require('beautiful.xresources').apply_dpi 3 | local naughty = require 'naughty' 4 | local awful = require 'awful' 5 | local rubato = require 'lib.rubato' 6 | local beautiful = require 'beautiful' 7 | local color = require 'lib.color' 8 | 9 | 10 | local function set_x(x) return function(geo, args) return {x=x, y=(args.parent.height - geo.height)/2} end end 11 | 12 | --height, margins 13 | --height bar, height handle, margins, color bar, color bar active, color handle 14 | local function create_slider(args) 15 | args = args or {} 16 | args.color_bar = args.color_bar or color.color {hex=beautiful.bg_normal_1} 17 | args.color_bar_active = args.color_bar_active or color.color {hex='#aaaaaa'} 18 | args.color_handle = args.color_handle or color.color {hex='#ffffff'} 19 | args.height_bar = args.height_bar or dpi(8) 20 | args.height_handle = args.height_handle or dpi(15) 21 | args.lw_margins = args.lw_margins or dpi(10) 22 | 23 | args.forced_height = args.forced_height or nil 24 | args.forced_width = args.forced_width or nil 25 | 26 | 27 | local dim = 0 28 | local value = 0 29 | local w = 0 30 | 31 | local bar_start, bar_end, bar_current, height2, hb2, pi2, value_min, value_max 32 | hb2 = args.height_bar / 2 --know this is correct 33 | bar_start = args.lw_margins+hb2 34 | bar_end = w-(bar_start) 35 | bar_current = value+args.height_bar 36 | pi2 = math.pi * 2 37 | value_min = args.lw_margins-hb2 38 | value_max = w-bar_start-hb2 39 | 40 | local bar = wibox.widget { 41 | fit = function(_, _, width, height) return width, height end, 42 | draw = function(_, _, cr, width, height) 43 | w = width --get the width whenever redrawing just in case 44 | bar_end = width-(bar_start) --update bar_end which depends on width 45 | height2 = height/2 --update height2 which depends on height 46 | value_max = width-bar_start-hb2 47 | bar_current = value+args.height_bar 48 | 49 | cr:set_line_width(args.height_bar) 50 | 51 | cr:set_source_rgb(args.color_bar.r/255, args.color_bar.g/255, args.color_bar.b/255) 52 | cr:arc(bar_end, height2, hb2, 0, pi2) 53 | cr:fill() 54 | 55 | cr:move_to(bar_start, height2) 56 | cr:line_to(bar_end, height2) 57 | cr:stroke() 58 | 59 | cr:set_source_rgb(args.color_bar_active.r/255, args.color_bar_active.g/255, args.color_bar_active.b/255) 60 | cr:arc(bar_start, height2, hb2, 0, pi2) 61 | cr:arc(bar_current, height2, hb2, 0, pi2) 62 | cr:fill() 63 | 64 | cr:move_to(bar_start, height2) 65 | cr:line_to(bar_current, height2) 66 | cr:stroke() 67 | end, 68 | forced_height = args.forced_height, 69 | forced_width = args.forced_width, 70 | widget = wibox.widget.make_base_widget 71 | } 72 | 73 | 74 | local handle = wibox.widget { 75 | fit = function(_, _, height) return height, height end, 76 | draw = function(_, _, cr, width, height) 77 | cr:set_source_rgb(args.color_handle.r/255*(1-dim), args.color_handle.g/255*(1-dim), args.color_handle.b/255*(1-dim)) 78 | cr:arc(width / 2, height / 2, args.height_handle / 2, 0, pi2) 79 | cr:fill() 80 | end, 81 | forced_width = args.height_handle + dpi(5), 82 | forced_height = args.height_handle + dpi(5), 83 | point = {x=0, y=0}, --initialize point for layout 84 | widget = wibox.widget.make_base_widget 85 | } 86 | 87 | local layout = wibox.layout { 88 | handle, 89 | layout = wibox.layout.manual 90 | } 91 | 92 | local widget = wibox.widget { 93 | bar, 94 | layout, 95 | forced_height = args.forced_height, 96 | forced_width = args.forced_width, 97 | layout = wibox.layout.stack 98 | } 99 | 100 | local ended = false 101 | 102 | local timed = rubato.timed { 103 | intro = 0.1, 104 | prop_intro = true, 105 | duration = 0.075, 106 | pos = value_min, 107 | subscribed = function(pos, time, dt) 108 | value = pos 109 | layout:move(1, set_x(pos)) 110 | bar:emit_signal("widget::redraw_needed") 111 | 112 | widget:emit_signal("slider::moved", 113 | (pos-value_min)/(value_max - value_min)) 114 | 115 | --do started and ended signals 116 | if time == 0 then ended = false 117 | elseif time == 0.075 then 118 | ended = true 119 | widget:emit_signal("slider::ended") 120 | elseif ended then 121 | ended = false 122 | widget:emit_signal("slider::started") 123 | end 124 | 125 | 126 | end 127 | } 128 | 129 | local hover_timed = rubato.timed { 130 | intro = 0.2, 131 | duration = 0.2, 132 | prop_intro = true, 133 | subscribed = function(pos) 134 | dim = pos 135 | handle:emit_signal("widget::redraw_needed") 136 | end 137 | } 138 | 139 | --TODO: Make hover more robust 140 | handle:connect_signal("mouse::enter", function() hover_timed.target = 0.2 end) 141 | handle:connect_signal("mouse::leave", function() hover_timed.target = 0 end) 142 | 143 | local ipos, lpos 144 | 145 | layout:connect_signal("button::press", function(self, x, y, button, _, geo) 146 | if button ~= 1 then return end 147 | 148 | --reset initial position for later 149 | ipos = nil 150 | 151 | --initially move it to the target (only one call of max and min is prolly fine) 152 | timed.target = math.min(math.max(x - args.height_bar, bar_start), bar_end) 153 | 154 | mousegrabber.run(function(mouse) 155 | --stop (and emit signal) if you release mouse 1 156 | if not mouse.buttons[1] then 157 | widget:emit_signal("slider::really_ended") 158 | return false 159 | end 160 | 161 | --get initial position 162 | if not ipos then ipos = mouse.x end 163 | 164 | lpos = x + mouse.x - ipos - args.height_bar 165 | 166 | --short circuit if above or below 167 | if lpos < value_min then 168 | timed.target = value_min 169 | 170 | elseif lpos > value_max then 171 | timed.target = value_max 172 | 173 | else timed.target = lpos end 174 | 175 | return true 176 | end,"fleur") 177 | 178 | 179 | end) 180 | 181 | function widget:set(val) 182 | timed.target = (value_max - value_min) * val + value_min 183 | end 184 | 185 | function widget:hard_set(val) 186 | value = (value_max - value_min) * val + value_min 187 | timed.pos = value 188 | layout:move(1, set_x(value)) 189 | bar:emit_signal("widget::redraw_needed") 190 | end 191 | 192 | 193 | return widget 194 | end 195 | 196 | return create_slider 197 | -------------------------------------------------------------------------------- /awesome/lib/battery.lua: -------------------------------------------------------------------------------- 1 | -- This uses UPowerGlib.Device (https://lazka.github.io/pgi-docs/UPowerGlib-1.0/classes/Device.html) 2 | -- Provides: 3 | -- signal::battery 4 | -- percentage 5 | -- state 6 | local upower_widget = require "lib.battery_upower" 7 | local battery_listener = upower_widget { 8 | device_path = '/org/freedesktop/UPower/devices/battery_BAT0', 9 | instant_update = true 10 | } 11 | 12 | battery_listener:connect_signal("upower::update", function(_, device) 13 | awesome.emit_signal("signal::battery", device.percentage, device.state) 14 | end) 15 | -------------------------------------------------------------------------------- /awesome/lib/battery_upower.lua: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------- 2 | -- A battery widget based on the UPower deamon. 3 | -- 4 | -- @author Aire-One 5 | -- @copyright 2020 Aire-One 6 | --------------------------------------------------------------------------- 7 | 8 | local upower = require("lgi").require("UPowerGlib") 9 | 10 | local gtable = require "gears.table" 11 | local gtimer = require "gears.timer" 12 | local wbase = require "wibox.widget.base" 13 | 14 | local setmetatable = setmetatable -- luacheck: ignore setmetatable 15 | local screen = screen -- luacheck: ignore screen 16 | 17 | local battery_widget = {} 18 | local mt = {} 19 | 20 | --- Helper to get the path of all connected power devices. 21 | -- @treturn table The list of all power devices path. 22 | -- @staticfct battery_widget.list_devices 23 | function battery_widget.list_devices() 24 | local ret = {} 25 | local devices = upower.Client():get_devices() 26 | 27 | for _, d in ipairs(devices) do 28 | table.insert(ret, d:get_object_path()) 29 | end 30 | 31 | return ret 32 | end 33 | 34 | --- Helper function to get a device instance from its path. 35 | -- @tparam string path The path of the device to get. 36 | -- @treturn UPowerGlib.Device|nil The device if it was found, `nil` otherwise. 37 | -- @staticfct battery_widget.get_device 38 | function battery_widget.get_device(path) 39 | local devices = upower.Client():get_devices() 40 | 41 | for _, d in ipairs(devices) do 42 | if d:get_object_path() == path then 43 | return d 44 | end 45 | end 46 | 47 | return nil 48 | end 49 | 50 | --- Helper function to easily get the default BAT0 device path without. 51 | -- @treturn string The BAT0 device path. 52 | -- @staticfct battery_widget.get_BAT0_device_path 53 | function battery_widget.get_BAT0_device_path() 54 | local bat0_path = "/org/freedesktop/UPower/devices/battery_BAT0" 55 | return bat0_path 56 | end 57 | 58 | --- Helper function to convert seconds into a human readable clock string. 59 | -- 60 | -- This translates the given seconds parameter into a human readable string 61 | -- following the notation `HH:MM` (where HH is the number of hours and MM the 62 | -- number of minutes). 63 | -- @tparam number seconds The umber of seconds to translate. 64 | -- @treturn string The human readable generated clock string. 65 | -- @staticfct battery_widget.to_clock 66 | function battery_widget.to_clock(seconds) 67 | if seconds <= 0 then 68 | return "00:00" 69 | else 70 | local hours = string.format("%02.f", math.floor(seconds / 3600)) 71 | local mins = string.format("%02.f", math.floor(seconds / 60 - hours * 60)) 72 | return hours .. ":" .. mins 73 | end 74 | end 75 | 76 | --- Gives the default widget to use if user didn't specify one. 77 | -- The default widget used is an `empty_widget` instance. 78 | -- @treturn widget The default widget to use. 79 | local function default_template() 80 | return wbase.empty_widget() 81 | end 82 | 83 | --- The device monitored by the widget. 84 | -- @property device 85 | -- @tparam UPowerGlib.Device device 86 | 87 | --- Emited when the UPower device notify an update. 88 | -- @signal upower::update 89 | -- @tparam battery_widget widget The widget. 90 | -- @tparam UPowerGlib.Device device The Upower device. 91 | 92 | --- battery_widget constructor. 93 | -- 94 | -- This function creates a new `battery_widget` instance. This widget watches 95 | -- the `display_device` status and report. 96 | -- @tparam table args The arguments table. 97 | -- @tparam[opt=1] screen|number args.screen the widget's screen. 98 | -- @tparam[opt] widget args.widget_template The widget template to use to 99 | -- create the widget instance. 100 | -- @tparam[opt] function args.create_callback User defined callback for the 101 | -- widget initialization. 102 | -- @tparam[opt] string args.device_path Path of the device to monitor. 103 | -- @tparam[opt=false] boolean args.use_display_device Should the widget monitor 104 | -- the _display device_? 105 | -- @tparam[opt] boolean args.instant_update Call an update cycle right after the 106 | -- widget creation. 107 | -- @treturn battery_widget The battery_widget instance build. 108 | -- @constructorfct battery_widget.new 109 | function battery_widget.new(args) 110 | args = 111 | gtable.crush( 112 | { 113 | widget_template = default_template(), 114 | create_callback = nil, 115 | device_path = "", 116 | use_display_device = false 117 | }, 118 | args or {} 119 | ) 120 | args.screen = screen[args.screen or 1] 121 | 122 | local widget = wbase.make_widget_from_value(args.widget_template) 123 | 124 | widget.device = 125 | args.use_display_device and upower.Client():get_display_device() or battery_widget.get_device(args.device_path) 126 | 127 | if type(args.create_callback) == "function" then 128 | args.create_callback(widget, widget.device) 129 | end 130 | 131 | -- Attach signals: 132 | widget.device.on_notify = function(d) 133 | widget:emit_signal("upower::update", d) 134 | end 135 | 136 | -- Call an update cycle if the user asked to instan update the widget. 137 | if args.instant_update then 138 | gtimer.delayed_call(widget.emit_signal, widget, "upower::update", widget.device) 139 | end 140 | 141 | return widget 142 | end 143 | 144 | function mt.__call(self, ...) 145 | return battery_widget.new(...) 146 | end 147 | 148 | return setmetatable(battery_widget, mt) 149 | -------------------------------------------------------------------------------- /awesome/lib/color.lua: -------------------------------------------------------------------------------- 1 | -- much help from https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/ 2 | -- basically a lua implementation of the above link 3 | 4 | -- Helper "round" method 5 | local function round(x, p) 6 | local power = math.pow(10, p or 0) 7 | return (x * power + 0.5 - (x * power + 0.5) % 1) / power 8 | end 9 | 10 | -- Useful public methods 11 | local function hex_to_rgb(hex) 12 | hex = hex:gsub("#", "") 13 | return 14 | tonumber("0x"..hex:sub(1,2)), 15 | tonumber("0x"..hex:sub(3,4)), 16 | tonumber("0x"..hex:sub(5,6)) 17 | end 18 | 19 | local function rgb_to_hex(obj) 20 | local r = obj.r or obj[1] 21 | local g = obj.g or obj[2] 22 | local b = obj.b or obj[3] 23 | local h = (obj.hashtag or obj[4]) and "#" or "" 24 | return h..string.format("%02x%02x%02x", 25 | math.floor(r), 26 | math.floor(g), 27 | math.floor(b)) 28 | end 29 | 30 | --disclaimer I have no idea what any of the math does 31 | local function rgb_to_hsl(obj) 32 | local r = obj.r or obj[1] 33 | local g = obj.g or obj[2] 34 | local b = obj.b or obj[3] 35 | 36 | local R, G, B = r / 255, g / 255, b / 255 37 | local max, min = math.max(R, G, B), math.min(R, G, B) 38 | local l, s, h 39 | 40 | -- Get luminance 41 | l = (max + min) / 2 42 | 43 | -- short circuit saturation and hue if it's grey to prevent divide by 0 44 | if max == min then 45 | s = 0 46 | h = obj.h or obj[4] or 0 47 | return 48 | end 49 | 50 | -- Get saturation 51 | if l <= 0.5 then s = (max - min) / (max + min) 52 | else s = (max - min) / (2 - max - min) 53 | end 54 | 55 | -- Get hue 56 | if max == R then h = (G - B) / (max - min) * 60 57 | elseif max == G then h = (2.0 + (B - R) / (max - min)) * 60 58 | else h = (4.0 + (R - G) / (max - min)) * 60 59 | end 60 | 61 | -- Make sure it goes around if it's negative (hue is a circle) 62 | if h ~= 360 then h = h % 360 end 63 | 64 | return h, s, l 65 | end 66 | 67 | --no clue about any of this either 68 | function hsl_to_rgb(obj) 69 | local h = obj.h or obj[1] 70 | local s = obj.s or obj[2] 71 | local l = obj.l or obj[3] 72 | 73 | local temp1, temp2, temp_r, temp_g, temp_b, temp_h 74 | 75 | -- Set the temp variables 76 | if l <= 0.5 then temp1 = l * (s + 1) 77 | else temp1 = l + s - l * s 78 | end 79 | 80 | temp2 = l * 2 - temp1 81 | 82 | temp_h = h / 360 83 | 84 | temp_r = temp_h + 1/3 85 | temp_g = temp_h 86 | temp_b = temp_h - 1/3 87 | 88 | 89 | -- Make sure it's between 0 and 1 90 | if temp_r ~= 1 then temp_r = temp_r % 1 end 91 | if temp_g ~= 1 then temp_g = temp_g % 1 end 92 | if temp_b ~= 1 then temp_b = temp_b % 1 end 93 | 94 | local rgb = {} 95 | 96 | -- Bunch of tests 97 | -- Once again I haven't the foggiest what any of this does 98 | for _, v in pairs({{temp_r, "r"}, {temp_g, "g"}, {temp_b, "b"}}) do 99 | 100 | if v[1] * 6 < 1 then rgb[v[2]] = temp2 + (temp1 - temp2) * v[1] * 6 101 | elseif v[1] * 2 < 1 then rgb[v[2]] = temp1 102 | elseif v[1] * 3 < 2 then rgb[v[2]] = temp2 + (temp1 - temp2) * (2/3 - v[1]) * 6 103 | else rgb[v[2]] = temp2 104 | end 105 | 106 | end 107 | 108 | return 109 | round(rgb.r * 255), 110 | round(rgb.g * 255), 111 | round(rgb.b * 255) 112 | end 113 | 114 | local function color(args) 115 | -- The object that will be returned 116 | local obj = {} 117 | 118 | -- Default properties here 119 | args.r = args.r or 0 120 | args.g = args.g or 0 121 | args.b = args.b or 0 122 | args.h = args.h or 0 123 | args.s = args.s or 0 124 | args.l = args.l or 0 125 | args.hex = args.hex or "000000" 126 | args.hex = args.hex:gsub("#", "") 127 | obj._props = args 128 | 129 | -- Default actual normal properties 130 | obj.hashtag = args.hashtag or true 131 | obj.disable_hsl = args.disable_hsl or false 132 | 133 | -- Set access to any 134 | obj._access = "rgbhslhex" 135 | 136 | -- Methods and stuff 137 | function obj:_hex_to_rgb() 138 | obj._props.r, obj._props.g, obj._props.b = hex_to_rgb(obj._props.hex) 139 | end 140 | function obj:_rgb_to_hex() 141 | obj._props.hex = rgb_to_hex(obj._props) 142 | end 143 | function obj:_rgb_to_hsl() 144 | obj._props.h, obj._props.s, obj._props.l = rgb_to_hsl(obj._props) 145 | end 146 | function obj:_hsl_to_rgb() 147 | obj._props.r, obj._props.g, obj._props.b = hsl_to_rgb(obj._props) 148 | end 149 | function obj:set_no_update(key, value) 150 | obj._props[key] = value 151 | end 152 | 153 | -- Initially set other values 154 | if obj._props.r ~= 0 or obj._props.g ~= 0 or obj._props.b ~= 0 then 155 | obj:_rgb_to_hex() 156 | if not obj.disable_hsl then obj:_rgb_to_hsl() end 157 | 158 | elseif obj._props.hex ~= "000000" then 159 | obj:_hex_to_rgb() 160 | if not obj.disable_hsl then obj:_rgb_to_hsl() end 161 | 162 | elseif obj._props.h ~= 0 or obj._props.s ~= 0 or obj._props.l ~= 0 then 163 | obj:_hsl_to_rgb() 164 | obj:_rgb_to_hex() 165 | 166 | end --otherwise it's just black and everything is correct already 167 | 168 | 169 | -- Set up the metatable 170 | local mt = getmetatable(obj) or {} 171 | 172 | -- Check if it's already in _props to return it 173 | -- TODO: Only remake values if necessary 174 | mt.__index = function(self, key) 175 | if self._props[key] then 176 | -- Check if to just return nil for hsl 177 | if obj.disable_hsl and string.match("hsl", key) then return self._props[key] end 178 | 179 | -- Check if it's not currently accessible 180 | if not string.match(obj._access, key) then 181 | if obj._access == "rgb" then 182 | self:_rgb_to_hex() 183 | if not obj.disable_hsl then obj:_rgb_to_hsl() end 184 | 185 | elseif obj._access == "hex" then 186 | self:_rgb_to_hex() 187 | if not obj.disable_hsl then obj:_rgb_to_hsl() end 188 | 189 | elseif obj._access == "hsl" then 190 | self:_hsl_to_rgb() 191 | self:_rgb_to_hex() 192 | end 193 | 194 | -- Reset accessibleness 195 | obj._access = "rgbhexhsl" 196 | end 197 | 198 | -- Check for hashtaginess 199 | if obj.hashtag and key == "hex" then return "#"..self._props[key] end 200 | 201 | return self._props[key] 202 | 203 | else return rawget(self, key) end 204 | end 205 | 206 | mt.__newindex = function(self, key, value) 207 | if self._props[key] ~= nil then 208 | 209 | -- Set basic important stuff 210 | self._props[key] = value 211 | 212 | -- Set what values are currently accessible 213 | if string.match("rgb", key) then obj._access = "rgb" 214 | elseif string.match("hsl", key) and not obj.disable_hsl then obj._access = "hsl" 215 | elseif string.match("hex", key) then obj._access = "hex" 216 | end 217 | 218 | -- If it's not part of _props just normally set it 219 | else rawset(self, key, value) end 220 | end 221 | 222 | setmetatable(obj, mt) 223 | return obj 224 | end 225 | 226 | return { 227 | color = color, 228 | hex_to_rgb = hex_to_rgb, 229 | rgb_to_hex = rgb_to_hex, 230 | rgb_to_hsl = rgb_to_hsl, 231 | hsl_to_rgb = hsl_to_rgb 232 | } 233 | -------------------------------------------------------------------------------- /awesome/lib/cpu.lua: -------------------------------------------------------------------------------- 1 | -- Thanks JavaCafe 2 | -- Provides: 3 | -- signal::cpu 4 | -- used percentage (integer) 5 | local awful = require("awful") 6 | 7 | local update_interval = 5 8 | local cpu_idle_script = [[ 9 | sh -c " 10 | vmstat 1 2 | tail -1 | awk '{printf \"%d\", $15}' 11 | "]] 12 | 13 | -- Periodically get cpu info 14 | awful.widget.watch(cpu_idle_script, update_interval, function(widget, stdout) 15 | -- local cpu_idle = stdout:match('+(.*)%.%d...(.*)%(') 16 | local cpu_idle = stdout 17 | cpu_idle = string.gsub(cpu_idle, '^%s*(.-)%s*$', '%1') 18 | awesome.emit_signal("signal::cpu", 100 - tonumber(cpu_idle)) 19 | end) 20 | -------------------------------------------------------------------------------- /awesome/lib/disk.lua: -------------------------------------------------------------------------------- 1 | -- Thanks JavaCafe 2 | -- Provides: 3 | -- signal::disk 4 | -- used (integer - mega bytes) 5 | -- total (integer - mega bytes) 6 | local awful = require("awful") 7 | --local helpers = require("helpers") 8 | 9 | local update_interval = 10 -- every 3 minutes 10 | 11 | -- Use /dev/sdxY according to your setup 12 | local disk_script = [[ 13 | sh -c " 14 | df -kh -B 1MB /dev/nvme0n1p7 | tail -1 | awk '{printf \"%d@%d\", $4, $3}' 15 | " 16 | ]] 17 | 18 | -- Periodically get disk space info 19 | awful.widget.watch(disk_script, update_interval, function(_, stdout) 20 | local available = tonumber(stdout:match('^(.*)@')) / 1000 21 | local used = tonumber(stdout:match('@(.*)$')) / 1000 22 | awesome.emit_signal("signal::disk", used, available + used) 23 | end) 24 | -------------------------------------------------------------------------------- /awesome/lib/network.lua: -------------------------------------------------------------------------------- 1 | -- Provides: 2 | -- daemons::network::wired::disconnected 3 | -- (No parameters) 4 | -- daemons::network::wireless::disconnected 5 | -- (No parameters) 6 | -- daemons::network::wired::connected 7 | -- interface (string) 8 | -- health (bool) 9 | -- daemons::network::wireless::connected 10 | -- essid (string) 11 | -- interface (string) 12 | -- strength (number) 13 | -- strength_level (number) 14 | -- bitrate (number) 15 | -- healthy (bool) 16 | 17 | local awful = require("awful") 18 | local gears = require("gears") 19 | 20 | local update_interval = 2 21 | local interfaces = 22 | { 23 | wlan_interface = 'wlp4s0', 24 | lan_interface = 'enp0s25' 25 | } 26 | 27 | local network_mode = nil 28 | local is_startup = true 29 | local is_disconnected = true 30 | 31 | local check_internet_health_script = [=[ 32 | status_ping=0 33 | packets="$(ping -q -w2 -c2 1.1.1.1 | grep -o "100% packet loss")" 34 | if [ ! -z "${packets}" ]; 35 | then 36 | status_ping=0 37 | else 38 | status_ping=1 39 | fi 40 | if [ $status_ping -eq 0 ]; 41 | then 42 | echo 'Connected but no internet' 43 | fi 44 | ]=] 45 | 46 | local update_wireless = function() 47 | network_mode = 'wireless' 48 | 49 | local update_wireless_data = function(strength, strength_level, healthy) 50 | awful.spawn.easy_async_with_shell("iwconfig", function(stdout) 51 | local essid = stdout:match('ESSID:(.-)\n') or 'N/A' 52 | essid = essid:gsub("%\"", "") 53 | local bitrate = stdout:match('Bit Rate=(.+/s)') or 'N/A' 54 | 55 | if essid:match("off/any") == nil and healthy and (is_disconnected or is_startup) then 56 | awesome.emit_signal('daemons::network::wireless::connected', essid, interfaces.wlan_interface, strength, strength_level, bitrate, healthy) 57 | is_disconnected = false 58 | end 59 | is_startup = false 60 | end) 61 | end 62 | 63 | local update_wireless_connection_state = function(strength, strength_level) 64 | awful.spawn.easy_async_with_shell(check_internet_health_script, function(stdout) 65 | if not stdout:match('Connected but no internet') then 66 | update_wireless_data(strength, strength_level, true) 67 | else 68 | update_wireless_data(strength, strength_level, false) 69 | end 70 | end) 71 | end 72 | 73 | local update_wireless_strength = function() 74 | awful.spawn.easy_async_with_shell([[awk 'NR==3 {printf "%3.0f" ,($3/70)*100}' /proc/net/wireless]], function(stdout) 75 | if not tonumber(stdout) then 76 | return 77 | end 78 | local strength = tonumber(stdout) 79 | local strength_level = math.floor(strength / 25 + 0.5) 80 | update_wireless_connection_state(strength, strength_level) 81 | end) 82 | end 83 | 84 | update_wireless_strength() 85 | is_startup = false 86 | end 87 | 88 | local update_wired = function() 89 | network_mode = 'wired' 90 | 91 | awful.spawn.easy_async_with_shell(check_internet_health_script, function(stdout) 92 | if is_startup or is_disconnected then 93 | local healthy = stdout:match('Connected but no internet') and false or true 94 | awesome.emit_signal('daemons::network::wired::connected', interfaces.lan_interface, healthy) 95 | is_disconnected = false 96 | end 97 | is_startup = false 98 | end) 99 | end 100 | 101 | local update_disconnected = function() 102 | if network_mode == 'wireless' then 103 | if not is_disconnected then 104 | is_disconnected = true 105 | awesome.emit_signal("daemons::network::wireless::disconnected") 106 | end 107 | elseif network_mode == 'wired' then 108 | if not is_disconnected then 109 | is_disconnected = true 110 | awesome.emit_signal("daemons::network::wired::disconnected") 111 | end 112 | end 113 | end 114 | 115 | local check_network_mode = function() 116 | awful.spawn.easy_async_with_shell( 117 | [=[ 118 | wireless="]=] .. tostring(interfaces.wlan_interface) .. [=[" 119 | wired="]=] .. tostring(interfaces.lan_interface) .. [=[" 120 | net="/sys/class/net/" 121 | wired_state="down" 122 | wireless_state="down" 123 | network_mode="" 124 | # Check network state based on interface's operstate value 125 | function check_network_state() { 126 | # Check what interface is up 127 | if [[ "${wireless_state}" == "up" ]]; 128 | then 129 | network_mode='wireless' 130 | elif [[ "${wired_state}" == "up" ]]; 131 | then 132 | network_mode='wired' 133 | else 134 | network_mode='No internet connection' 135 | fi 136 | } 137 | # Check if network directory exist 138 | function check_network_directory() { 139 | if [[ -n "${wireless}" && -d "${net}${wireless}" ]]; 140 | then 141 | wireless_state="$(cat "${net}${wireless}/operstate")" 142 | fi 143 | if [[ -n "${wired}" && -d "${net}${wired}" ]]; then 144 | wired_state="$(cat "${net}${wired}/operstate")" 145 | fi 146 | check_network_state 147 | } 148 | # Start script 149 | function print_network_mode() { 150 | # Call to check network dir 151 | check_network_directory 152 | # Print network mode 153 | printf "${network_mode}" 154 | } 155 | print_network_mode 156 | ]=], 157 | function(stdout) 158 | local mode = stdout:gsub('%\n', '') 159 | if stdout:match('No internet connection') then 160 | update_disconnected() 161 | elseif stdout:match('wireless') then 162 | update_wireless() 163 | elseif stdout:match('wired') then 164 | update_wired() 165 | end 166 | end 167 | ) 168 | end 169 | 170 | local network_updater = gears.timer { timeout = update_interval, autostart = true, call_now = true, callback = function() 171 | check_network_mode() 172 | end} 173 | -------------------------------------------------------------------------------- /awesome/lib/playerctl/init.lua: -------------------------------------------------------------------------------- 1 | local beautiful = require("beautiful") 2 | 3 | -- Use CLI backend as default as it is supported on most if not all systems 4 | local backend_config = beautiful.playerctl_backend or "playerctl_cli" 5 | local backends = { 6 | playerctl_cli = require(... .. ".playerctl_cli"), 7 | playerctl_lib = require(... .. ".playerctl_lib") 8 | } 9 | 10 | local function enable_wrapper(args) 11 | backend_config = (args and args.backend) or backend_config 12 | backends[backend_config].enable(args) 13 | end 14 | 15 | local function disable_wrapper() 16 | backends[backend_config].disable() 17 | end 18 | 19 | return {enable = enable_wrapper, disable = disable_wrapper} 20 | -------------------------------------------------------------------------------- /awesome/lib/playerctl/playerctl_cli.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Provides: 3 | -- bling::playerctl::status 4 | -- playing (boolean) 5 | -- bling::playerctl::title_artist_album 6 | -- title (string) 7 | -- artist (string) 8 | -- album_path (string) 9 | -- bling::playerctl::position 10 | -- interval_sec (number) 11 | -- length_sec (number) 12 | -- bling::playerctl::no_players 13 | -- 14 | local awful = require("awful") 15 | local beautiful = require("beautiful") 16 | 17 | local interval = beautiful.playerctl_position_update_interval or 1 18 | 19 | local function emit_player_status() 20 | local status_cmd = "playerctl status -F" 21 | 22 | -- Follow status 23 | awful.spawn.easy_async({ 24 | "pkill", "--full", "--uid", os.getenv("USER"), "^playerctl status" 25 | }, function() 26 | awful.spawn.with_line_callback(status_cmd, { 27 | stdout = function(line) 28 | local playing = false 29 | if line:find("Playing") then 30 | playing = true 31 | else 32 | playing = false 33 | end 34 | awesome.emit_signal("bling::playerctl::status", playing) 35 | end 36 | }) 37 | collectgarbage("collect") 38 | end) 39 | end 40 | 41 | local function emit_player_info() 42 | local art_script = [[ 43 | sh -c ' 44 | 45 | tmp_dir="$XDG_CACHE_HOME/awesome/" 46 | 47 | if [ -z ${XDG_CACHE_HOME} ]; then 48 | tmp_dir="$HOME/.cache/awesome/" 49 | fi 50 | 51 | tmp_cover_path=${tmp_dir}"cover.png" 52 | 53 | if [ ! -d $tmp_dir ]; then 54 | mkdir -p $tmp_dir 55 | fi 56 | 57 | link="$(playerctl metadata mpris:artUrl)" 58 | 59 | curl -s "$link" --output $tmp_cover_path 60 | 61 | echo "$tmp_cover_path" 62 | ']] 63 | 64 | -- Command that lists artist and title in a format to find and follow 65 | local song_follow_cmd = 66 | "playerctl metadata --format 'artist_{{artist}}title_{{title}}' -F" 67 | 68 | -- Progress Cmds 69 | local prog_cmd = "playerctl position" 70 | local length_cmd = "playerctl metadata mpris:length" 71 | 72 | awful.widget.watch(prog_cmd, interval, function(_, interval) 73 | awful.spawn.easy_async_with_shell(length_cmd, function(length) 74 | local length_sec = tonumber(length) -- in microseconds 75 | local interval_sec = tonumber(interval) -- in seconds 76 | if length_sec and interval_sec then 77 | if interval_sec >= 0 and length_sec > 0 then 78 | awesome.emit_signal("bling::playerctl::position", 79 | interval_sec, length_sec / 1000000) 80 | end 81 | end 82 | end) 83 | collectgarbage("collect") 84 | end) 85 | 86 | -- Follow title 87 | awful.spawn.easy_async({ 88 | "pkill", "--full", "--uid", os.getenv("USER"), "^playerctl metadata" 89 | }, function() 90 | awful.spawn.with_line_callback(song_follow_cmd, { 91 | stdout = function(line) 92 | local album_path = "" 93 | awful.spawn.easy_async_with_shell(art_script, function(out) 94 | -- Get album path 95 | album_path = out:gsub('%\n', '') 96 | -- Get title and artist 97 | local artist = line:match('artist_(.*)title_') 98 | local title = line:match('title_(.*)') 99 | -- If the title is nil or empty then the players stopped 100 | if title and title ~= "" then 101 | awesome.emit_signal( 102 | "bling::playerctl::title_artist_album", title, 103 | artist, album_path) 104 | else 105 | awesome.emit_signal("bling::playerctl::no_players") 106 | end 107 | end) 108 | collectgarbage("collect") 109 | end 110 | }) 111 | collectgarbage("collect") 112 | end) 113 | end 114 | 115 | -- Emit info 116 | -- emit_player_status() 117 | -- emit_player_info() 118 | 119 | local enable = function(args) 120 | interval = (args and args.interval) or interval 121 | emit_player_status() 122 | emit_player_info() 123 | end 124 | 125 | local disable = function() 126 | awful.spawn.with_shell("pkill --full --uid " .. os.getenv("USER") .. 127 | " '^playerctl status -F'") 128 | 129 | awful.spawn.with_shell("pkill --full --uid " .. os.getenv("USER") .. 130 | " '^playerctl metadata --format'") 131 | end 132 | 133 | return {enable = enable, disable = disable} 134 | -------------------------------------------------------------------------------- /awesome/lib/playerctl/playerctl_lib.lua: -------------------------------------------------------------------------------- 1 | -- Playerctl signals 2 | -- 3 | -- Provides: 4 | -- bling::playerctl::status 5 | -- playing (boolean) 6 | -- player_name (string) 7 | -- bling::playerctl::title_artist_album 8 | -- title (string) 9 | -- artist (string) 10 | -- album_path (string) 11 | -- player_name (string) 12 | -- bling::playerctl::position 13 | -- interval_sec (number) 14 | -- length_sec (number) 15 | -- player_name (string) 16 | -- bling::playerctl::no_players 17 | -- (No parameters) 18 | 19 | local gears = require("gears") 20 | local awful = require("awful") 21 | local beautiful = require("beautiful") 22 | local Playerctl = nil 23 | 24 | local manager = nil 25 | local metadata_timer = nil 26 | local position_timer = nil 27 | 28 | local ignore = {} 29 | local priority = {} 30 | local update_on_activity = true 31 | local interval = 1 32 | 33 | -- Track position callback 34 | local last_position = -1 35 | local last_length = -1 36 | local function position_cb() 37 | local player = manager.players[1] 38 | if player then 39 | local position = player:get_position() / 1000000 40 | local length = (player.metadata.value["mpris:length"] or 0) / 1000000 41 | if position ~= last_position or length ~= last_length then 42 | awesome.emit_signal("bling::playerctl::position", 43 | position, 44 | length, 45 | player.player_name) 46 | last_position = position 47 | last_length = length 48 | end 49 | end 50 | end 51 | 52 | local function get_album_art(url) 53 | return awful.util.shell .. [[ -c ' 54 | 55 | tmp_dir="$XDG_CACHE_HOME/awesome/" 56 | 57 | if [ -z "$XDG_CACHE_HOME" ]; then 58 | tmp_dir="$HOME/.cache/awesome/" 59 | fi 60 | 61 | tmp_cover_path="${tmp_dir}cover.png" 62 | 63 | if [ ! -d "$tmp_dir" ]; then 64 | mkdir -p $tmp_dir 65 | fi 66 | 67 | curl -s ']] .. url .. [[' --output $tmp_cover_path 68 | 69 | echo "$tmp_cover_path" 70 | ']] 71 | end 72 | 73 | -- Metadata callback for title, artist, and album art 74 | local last_player = nil 75 | local last_title = "" 76 | local last_artist = "" 77 | local last_artUrl = "" 78 | local function metadata_cb(player, metadata) 79 | if update_on_activity then 80 | manager:move_player_to_top(player) 81 | end 82 | 83 | local data = metadata.value 84 | 85 | local title = data["xesam:title"] or "" 86 | local artist = data["xesam:artist"][1] or "" 87 | for i = 2, #data["xesam:artist"] do 88 | artist = artist .. ", " .. data["xesam:artist"][i] 89 | end 90 | local artUrl = data["mpris:artUrl"] or "" 91 | -- Spotify client doesn't report its art URL's correctly... 92 | if player.player_name == "spotify" then 93 | artUrl = artUrl:gsub("open.spotify.com", "i.scdn.co") 94 | end 95 | 96 | if player == manager.players[1] then 97 | -- Callback can be called even though values we care about haven't 98 | -- changed, so check to see if they have 99 | if player ~= last_player or title ~= last_title or 100 | artist ~= last_artist or artUrl ~= last_artUrl 101 | then 102 | if (title == "" and artist == "" and artUrl == "") then return end 103 | 104 | if metadata_timer ~= nil then 105 | if metadata_timer.started then 106 | metadata_timer:stop() 107 | end 108 | end 109 | 110 | metadata_timer = gears.timer { 111 | timeout = 0.3, 112 | autostart = true, 113 | single_shot = true, 114 | callback = function() 115 | if artUrl ~= "" then 116 | awful.spawn.with_line_callback(get_album_art(artUrl), { 117 | stdout = function(line) 118 | awesome.emit_signal( 119 | "bling::playerctl::title_artist_album", 120 | title, 121 | artist, 122 | line, 123 | player.player_name 124 | ) 125 | end 126 | }) 127 | else 128 | awesome.emit_signal( 129 | "bling::playerctl::title_artist_album", 130 | title, 131 | artist, 132 | "", 133 | player.player_name 134 | ) 135 | end 136 | end 137 | } 138 | 139 | -- Re-sync with position timer when track changes 140 | position_timer:again() 141 | last_player = player 142 | last_title = title 143 | last_artist = artist 144 | last_artUrl = artUrl 145 | end 146 | end 147 | end 148 | 149 | -- Playback status callback 150 | -- Reported as PLAYING, PAUSED, or STOPPED 151 | local function playback_status_cb(player, status) 152 | if update_on_activity then 153 | manager:move_player_to_top(player) 154 | end 155 | 156 | if player == manager.players[1] then 157 | if status == "PLAYING" then 158 | awesome.emit_signal("bling::playerctl::status", true, player.player_name) 159 | else 160 | awesome.emit_signal("bling::playerctl::status", false, player.player_name) 161 | end 162 | end 163 | end 164 | 165 | -- Determine if player should be managed 166 | local function name_is_selected(name) 167 | if ignore[name.name] then 168 | return false 169 | end 170 | 171 | if #priority > 0 then 172 | for _, arg in pairs(priority) do 173 | if arg == name.name or arg == "%any" then 174 | return true 175 | end 176 | end 177 | return false 178 | end 179 | 180 | return true 181 | end 182 | 183 | -- Create new player and connect it to callbacks 184 | local function init_player(name) 185 | if name_is_selected(name) then 186 | local player = Playerctl.Player.new_from_name(name) 187 | manager:manage_player(player) 188 | player.on_playback_status = playback_status_cb 189 | player.on_metadata = metadata_cb 190 | 191 | -- Start position timer if its not already running 192 | if not position_timer.started then 193 | position_timer:again() 194 | end 195 | end 196 | end 197 | 198 | -- Determine if a player name comes before or after another according to the 199 | -- priority order 200 | local function player_compare_name(name_a, name_b) 201 | local any_index = math.huge 202 | local a_match_index = nil 203 | local b_match_index = nil 204 | 205 | if name_a == name_b then 206 | return 0 207 | end 208 | 209 | for index, name in ipairs(priority) do 210 | if name == "%any" then 211 | any_index = (any_index == math.huge) and index or any_index 212 | elseif name == name_a then 213 | a_match_index = a_match_index or index 214 | elseif name == name_b then 215 | b_match_index = b_match_index or index 216 | end 217 | end 218 | 219 | if not a_match_index and not b_match_index then 220 | return 0 221 | elseif not a_match_index then 222 | return (b_match_index < any_index) and 1 or -1 223 | elseif not b_match_index then 224 | return (a_match_index < any_index) and -1 or 1 225 | elseif a_match_index == b_match_index then 226 | return 0 227 | else 228 | return (a_match_index < b_match_index) and -1 or 1 229 | end 230 | end 231 | 232 | -- Sorting function used by manager if a priority order is specified 233 | local function player_compare(a, b) 234 | local player_a = Playerctl.Player(a) 235 | local player_b = Playerctl.Player(b) 236 | return player_compare_name(player_a.player_name, player_b.player_name) 237 | end 238 | 239 | local function start_manager() 240 | manager = Playerctl.PlayerManager() 241 | if #priority > 0 then 242 | manager:set_sort_func(player_compare) 243 | end 244 | 245 | -- Timer to update track position at specified interval 246 | position_timer = gears.timer { 247 | timeout = interval, 248 | callback = position_cb 249 | } 250 | 251 | -- Manage existing players on startup 252 | for _, name in ipairs(manager.player_names) do 253 | init_player(name) 254 | end 255 | 256 | -- Callback to manage new players 257 | function manager:on_name_appeared(name) 258 | init_player(name) 259 | end 260 | 261 | -- Callback to check if all players have exited 262 | function manager:on_name_vanished(name) 263 | if #manager.players == 0 then 264 | metadata_timer:stop() 265 | position_timer:stop() 266 | awesome.emit_signal("bling::playerctl::no_players") 267 | end 268 | end 269 | end 270 | 271 | -- Parse arguments 272 | local function parse_args(args) 273 | if args then 274 | update_on_activity = args.update_on_activity or update_on_activity 275 | interval = args.interval or interval 276 | 277 | if type(args.ignore) == "string" then 278 | ignore[args.ignore] = true 279 | elseif type(args.ignore) == "table" then 280 | for _, name in pairs(args.ignore) do 281 | ignore[name] = true 282 | end 283 | end 284 | 285 | if type(args.player) == "string" then 286 | priority[1] = args.player 287 | elseif type(args.player) == "table" then 288 | priority = args.player 289 | end 290 | end 291 | end 292 | 293 | local function playerctl_enable(args) 294 | args = args or {} 295 | -- Grab settings from beautiful variables if not set explicitly 296 | args.ignore = args.ignore or beautiful.playerctl_ignore 297 | args.player = args.player or beautiful.playerctl_player 298 | args.update_on_activity = args.update_on_activity or 299 | beautiful.playerctl_update_on_activity 300 | args.interval = args.interval or beautiful.playerctl_position_update_interval 301 | parse_args(args) 302 | 303 | -- Grab playerctl library 304 | Playerctl = require("lgi").Playerctl 305 | 306 | -- Ensure main event loop has started before starting player manager 307 | gears.timer.delayed_call(start_manager) 308 | end 309 | 310 | local function playerctl_disable() 311 | -- Remove manager and timer 312 | manager = nil 313 | metadata_timer:stop() 314 | metadata_timer = nil 315 | position_timer:stop() 316 | position_timer = nil 317 | -- Restore default settings 318 | ignore = {} 319 | priority = {} 320 | update_on_activity = true 321 | interval = 1 322 | -- Reset default values 323 | last_position = -1 324 | last_length = -1 325 | last_player = nil 326 | last_title = "" 327 | last_artist = "" 328 | last_artUrl = "" 329 | end 330 | 331 | return {enable = playerctl_enable, disable = playerctl_disable} 332 | -------------------------------------------------------------------------------- /awesome/lib/ram.lua: -------------------------------------------------------------------------------- 1 | -- Thanks JavaCafe 2 | -- Provides: 3 | -- signal::ram 4 | -- used (integer - mega bytes) 5 | -- total (integer - mega bytes) 6 | local awful = require("awful") 7 | 8 | local update_interval = 20 9 | -- Returns the used amount of ram in percentage 10 | -- TODO output of free is affected by system language. The following command 11 | -- works for any language: 12 | -- free -m | sed -n '2p' | awk '{printf "%d available out of %d\n", $7, $2}' 13 | local ram_script = [[ 14 | sh -c " 15 | free -m | grep 'Mem:' | awk '{printf \"%d@@%d@\", $7, $2}' 16 | "]] 17 | 18 | -- Periodically get ram info 19 | awful.widget.watch(ram_script, update_interval, function(widget, stdout) 20 | local available = stdout:match('(.*)@@') 21 | local total = stdout:match('@@(.*)@') 22 | local used = tonumber(total) - tonumber(available) 23 | awesome.emit_signal("signal::ram", used, total) 24 | end) 25 | -------------------------------------------------------------------------------- /awesome/lib/volume.lua: -------------------------------------------------------------------------------- 1 | -- Grabbed from JavaCafe01's awesome dots, thanks dude 2 | -- Provides: 3 | -- signal::volume 4 | -- percentage (integer) 5 | -- muted (boolean) 6 | local awful = require("awful") 7 | 8 | local volume_old = -1 9 | local muted_old = -1 10 | local function emit_volume_info() 11 | -- Get volume info of the currently active sink 12 | -- The currently active sink has a star `*` in front of its index 13 | -- In the output of `pacmd list-sinks`, lines +7 and +11 after "* index:" 14 | -- contain the volume level and muted state respectively 15 | -- This is why we are using `awk` to print them. 16 | awful.spawn.easy_async_with_shell( 17 | "pacmd list-sinks | awk '/\\* index: /{nr[NR+7];nr[NR+11]}; NR in nr'", 18 | function(stdout) 19 | local volume = stdout:match('(%d+)%% /') 20 | local muted = stdout:match('muted:(%s+)[yes]') 21 | local muted_int = muted and 1 or 0 22 | local volume_int = tonumber(volume) 23 | -- Only send signal if there was a change 24 | -- We need this since we use `pactl subscribe` to detect 25 | -- volume events. These are not only triggered when the 26 | -- user adjusts the volume through a keybind, but also 27 | -- through `pavucontrol` or even without user intervention, 28 | -- when a media file starts playing. 29 | if volume_int ~= volume_old or muted_int ~= muted_old then 30 | awesome.emit_signal("signal::volume", volume_int, muted) 31 | volume_old = volume_int 32 | muted_old = muted_int 33 | end 34 | end) 35 | end 36 | 37 | -- Run once to initialize widgets 38 | emit_volume_info() 39 | 40 | -- Sleeps until pactl detects an event (volume up/down/toggle mute) 41 | local volume_script = [[ 42 | bash -c " 43 | LANG=C pactl subscribe 2> /dev/null | grep --line-buffered \"Event 'change' on sink #\" 44 | "]] 45 | 46 | -- Kill old pactl subscribe processes 47 | awful.spawn.easy_async({ 48 | "pkill", "--full", "--uid", os.getenv("USER"), "^pactl subscribe" 49 | }, function() 50 | -- Run emit_volume_info() with each line printed 51 | awful.spawn.with_line_callback(volume_script, { 52 | stdout = function(line) emit_volume_info() end 53 | }) 54 | end) 55 | -------------------------------------------------------------------------------- /awesome/main/error-handling.lua: -------------------------------------------------------------------------------- 1 | -- Error Handling: {{{ 2 | -- Check if awesome encountered an error during startup and fell back to 3 | -- another config (This code will only ever execute for the fallback config) 4 | 5 | local naughty = require("naughty") --notifications 6 | 7 | if awesome.startup_errors then 8 | naughty.notify({ preset = naughty.config.presets.critical, 9 | title = "Oops, there were errors during startup!", 10 | text = awesome.startup_errors }) 11 | end 12 | 13 | -- Handle runtime errors after startup 14 | do 15 | local in_error = false 16 | awesome.connect_signal("debug::error", function (err) 17 | -- Make sure we don't go into an endless error loop 18 | if in_error then return end 19 | in_error = true 20 | 21 | naughty.notify({ preset = naughty.config.presets.critical, 22 | title = "Oops, an error happened!", 23 | text = tostring(err) }) 24 | in_error = false 25 | end) 26 | end 27 | -- }}} 28 | 29 | -------------------------------------------------------------------------------- /awesome/main/variables.lua: -------------------------------------------------------------------------------- 1 | local awful = require "awful" 2 | local dpi = require("beautiful.xresources").apply_dpi 3 | 4 | -- Variable Definitions: {{{ 5 | local _M = { 6 | theme = "suncolors", 7 | terminal = "kitty", 8 | editor = os.getenv("EDITOR") or "nvim", 9 | modkey = "Mod4", 10 | top_navbar_height = dpi(40), 11 | top_navbar_padding = dpi(5), 12 | left_navbar_width = dpi(38), 13 | taglist_padding_sides = dpi(10), 14 | window_padding = dpi(5) 15 | } 16 | _M.editor_cmd = _M.terminal .. " -e " .. _M.editor 17 | awful.layout.layouts = { 18 | awful.layout.suit.floating, 19 | awful.layout.suit.tile, 20 | awful.layout.suit.tile.left, 21 | awful.layout.suit.tile.bottom, 22 | awful.layout.suit.tile.top, 23 | awful.layout.suit.fair, 24 | awful.layout.suit.fair.horizontal, 25 | awful.layout.suit.spiral, 26 | awful.layout.suit.spiral.dwindle, 27 | awful.layout.suit.max, 28 | awful.layout.suit.max.fullscreen, 29 | awful.layout.suit.magnifier, 30 | awful.layout.suit.corner.nw, 31 | -- awful.layout.suit.corner.ne, 32 | -- awful.layout.suit.corner.sw, 33 | -- awful.layout.suit.corner.se, 34 | } 35 | return _M 36 | -------------------------------------------------------------------------------- /awesome/rc.lua: -------------------------------------------------------------------------------- 1 | -- If LuaRocks is installed, make sure that packages installed through it are 2 | -- found (e.g. lgi). If LuaRocks is not installed, do nothing. 3 | pcall(require, "luarocks.loader") 4 | 5 | 6 | -- Important libraries 7 | local awful = require "awful" 8 | local beautiful = require "beautiful" 9 | local menubar = require "menubar" --TODO: remove 10 | local vars = require "main.variables" 11 | 12 | -- Reloaded config message 13 | awful.spawn "notify-send 'reloaded config' nice" 14 | 15 | -- Set up awful stuff 16 | require "awful.hotkeys_popup" 17 | require "awful.hotkeys_popup.keys" 18 | require "awful.autofocus" 19 | 20 | -- Set up error handling 21 | require "main.error-handling" 22 | 23 | -- Set up a bunch of signals (thanks JavaCafe01) 24 | require "lib.battery" 25 | require "lib.volume" 26 | require("lib.playerctl").enable { backend = "playerctl_lib" } 27 | require "lib.cpu" 28 | require "lib.ram" 29 | require "lib.disk" 30 | 31 | -- Register some xproperties 32 | awesome.register_xproperty("WM_CLASS", "string") 33 | 34 | -- Initializes theme 35 | beautiful.init(require("gears").filesystem.get_xdg_config_home() .. 36 | "awesome/themes/" .. vars.theme .. "/theme.lua") 37 | 38 | -- Shitty menu TODO: remove 39 | local mymainmenu = require("deco.menu") 40 | 41 | -- Does the thing for the menubar (still remove) 42 | menubar.utils.terminal = vars.terminal 43 | 44 | -- Sets up deco stuff 45 | require "deco.screens" 46 | require "deco.titlebar" 47 | 48 | -- Sets up binding stuff 49 | require "binding.bindings_mouse" 50 | require "binding.bindings_key" 51 | 52 | -- picom 53 | awful.spawn.once "picom" 54 | 55 | 56 | awful.rules.rules = { 57 | --normal 58 | { 59 | rule = {}, 60 | properties = { 61 | border_width = beautiful.border_width, 62 | border_color = beautiful.border_normal, 63 | focus = awful.client.focus.filter, 64 | raise = true, 65 | keys = clientkeys, 66 | buttons = clientbuttons, 67 | screen = awful.screen.preferred, 68 | }, 69 | }, 70 | 71 | --placement 72 | { 73 | rule = {}, 74 | properties = { placement = awful.placement.no_overlap+awful.placement.no_offscreen }, 75 | except_any = { 76 | class = { "jetbrains-studio" } 77 | } 78 | }, 79 | 80 | --titlebars 81 | { 82 | rule_any = { 83 | type = { 84 | "normal", 85 | "dialog" 86 | } 87 | }, 88 | properties = { titlebars_enabled = true }, 89 | }, 90 | 91 | 92 | -- Floating clients. 93 | { 94 | rule_any = { 95 | instance = { 96 | "DTA", -- Firefox addon DownThemAll. 97 | "pinentry", 98 | }, 99 | class = { 100 | "Blueman-manager", 101 | "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. 102 | "Wpa_gui", 103 | "sun-awt-X11-XWindowPeer" 104 | }, 105 | 106 | role = { 107 | "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. 108 | } 109 | }, 110 | properties = { floating = true }, 111 | }, 112 | 113 | -- Android Studio 114 | --[[{ 115 | rule = { 116 | instance = 'sun-awt-X11-XFramePeer', 117 | class = 'jetbrains-studio' 118 | }, 119 | properties = { 120 | --titlebars_enabled = false, 121 | floating = false 122 | } 123 | },]] 124 | { 125 | rule = { 126 | instance = 'sun-awt-X11-XWindowPeer', 127 | class = 'jetbrains-studio', 128 | type = 'dialog' 129 | }, 130 | properties = { 131 | titlebars_enabled = false, 132 | border_width = 0, 133 | floating = true, 134 | focus = true, 135 | placement = nil 136 | } 137 | }, 138 | { 139 | rule = { 140 | instance = 'sun-awt-X11-XFramePeer', 141 | class = 'jetbrains-studio', 142 | name = 'Android Virtual Device Manager' 143 | }, 144 | rule_any = { 145 | name = { 146 | 'Android Virtual Device Manager', 147 | 'Welcome to Android Studio', 148 | 'win0' 149 | } 150 | }, 151 | properties = { 152 | titlebars_enabled = true, 153 | floating = true, 154 | focus = true, 155 | placement = awful.placement.centered 156 | } 157 | }, 158 | } 159 | 160 | 161 | client.connect_signal("manage", function (c) 162 | -- Set the windows at the slave, 163 | -- i.e. put it at the end of others instead of setting it master. 164 | -- if not awesome.startup then awful.client.setslave(c) end 165 | 166 | if awesome.startup 167 | and not c.size_hints.user_position 168 | and not c.size_hints.program_position then 169 | -- Prevent clients from being unreachable after screen count changes. 170 | awful.placement.no_offscreen(c) 171 | end 172 | end) 173 | 174 | 175 | client.connect_signal("mouse::enter", function(c) 176 | c:emit_signal("request::activate", "mouse_enter", {raise = false}) 177 | end) 178 | 179 | client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) 180 | client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) 181 | 182 | 183 | local timed = require("lib.rubato").timed { 184 | intro = 0.2, 185 | duration = 0.25, 186 | prop_intro = true 187 | } 188 | 189 | local naughty = require 'naughty' 190 | timed:subscribe(function(pos) 191 | --naughty.notify {text=tostring(pos)} 192 | print(pos) 193 | end) 194 | 195 | --timed.target = 1 196 | --naughty.notify {text="target: "..tostring(timed.target)} 197 | 198 | -------------------------------------------------------------------------------- /awesome/themes/alena-aenami-cold-1k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/alena-aenami-cold-1k.jpg -------------------------------------------------------------------------------- /awesome/themes/alena-aenami-endless-1k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/alena-aenami-endless-1k.jpg -------------------------------------------------------------------------------- /awesome/themes/alena-aenami-mountains2k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/alena-aenami-mountains2k.jpg -------------------------------------------------------------------------------- /awesome/themes/alena-aenami-reflect1k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/alena-aenami-reflect1k.jpg -------------------------------------------------------------------------------- /awesome/themes/alena-aenami-sky1k.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/alena-aenami-sky1k.jpg -------------------------------------------------------------------------------- /awesome/themes/images/battery_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_0.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_10.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_20.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_30.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_40.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_50.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_60.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_70.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_80.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_90.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_charging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_charging.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_full.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_low.png -------------------------------------------------------------------------------- /awesome/themes/images/battery_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/battery_unknown.png -------------------------------------------------------------------------------- /awesome/themes/images/brightness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/brightness.png -------------------------------------------------------------------------------- /awesome/themes/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/calendar.png -------------------------------------------------------------------------------- /awesome/themes/images/cool_question_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/cool_question_mark.png -------------------------------------------------------------------------------- /awesome/themes/images/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/cpu.png -------------------------------------------------------------------------------- /awesome/themes/images/init.lua: -------------------------------------------------------------------------------- 1 | local dir = require("gears.filesystem").get_dir("config").."themes/images/" 2 | local icons = { 3 | battery_10 = dir.."battery_10.png", 4 | battery_20 = dir.."battery_20.png", 5 | battery_30 = dir.."battery_30.png", 6 | battery_40 = dir.."battery_40.png", 7 | battery_50 = dir.."battery_50.png", 8 | battery_60 = dir.."battery_60.png", 9 | battery_70 = dir.."battery_70.png", 10 | battery_80 = dir.."battery_80.png", 11 | battery_90 = dir.."battery_90.png", 12 | battery_charging = dir.."battery_charging.png", 13 | battery_full = dir.."battery_full.png", 14 | battery_low = dir.."battery_low.png", 15 | battery_unknown = dir.."battery_unknown.png", 16 | volume_high = dir.."volume_high.png", 17 | volume_mid = dir.."volume_mid.png", 18 | volume_low = dir.."volume_low.png", 19 | volume_mute = dir.."volume_mute.png", 20 | cool_question_mark = dir.."cool_question_mark.png", 21 | calendar = dir.."calendar.png", 22 | lightbulb = dir.."lightbulb.png", 23 | lock = dir.."lock.png", 24 | scissors = dir.."scissors.png", 25 | theme = dir.."theme.png", 26 | wifi_0 = dir.."wifi_0.png", 27 | wifi_1 = dir.."wifi_1.png", 28 | wifi_2 = dir.."wifi_2.png", 29 | wifi_3 = dir.."wifi_3.png", 30 | brightness = dir.."brightness.png", 31 | cpu = dir.."cpu.png", 32 | ram = dir.."ram.png", 33 | ssd = dir.."ssd.png", 34 | pause = dir.."pause.png", 35 | skip_next = dir.."skip_next.png", 36 | skip_prev = dir.."skip_prev.png", 37 | } 38 | 39 | return function(table) 40 | for k, v in pairs(icons) do 41 | table[k] = v 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /awesome/themes/images/lightbulb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/lightbulb.png -------------------------------------------------------------------------------- /awesome/themes/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/lock.png -------------------------------------------------------------------------------- /awesome/themes/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/pause.png -------------------------------------------------------------------------------- /awesome/themes/images/ram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/ram.png -------------------------------------------------------------------------------- /awesome/themes/images/scissors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/scissors.png -------------------------------------------------------------------------------- /awesome/themes/images/skip_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/skip_next.png -------------------------------------------------------------------------------- /awesome/themes/images/skip_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/skip_prev.png -------------------------------------------------------------------------------- /awesome/themes/images/ssd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/ssd.png -------------------------------------------------------------------------------- /awesome/themes/images/theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/theme.png -------------------------------------------------------------------------------- /awesome/themes/images/volume_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/volume_high.png -------------------------------------------------------------------------------- /awesome/themes/images/volume_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/volume_low.png -------------------------------------------------------------------------------- /awesome/themes/images/volume_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/volume_mid.png -------------------------------------------------------------------------------- /awesome/themes/images/volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/volume_mute.png -------------------------------------------------------------------------------- /awesome/themes/images/wifi_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/wifi_0.png -------------------------------------------------------------------------------- /awesome/themes/images/wifi_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/wifi_1.png -------------------------------------------------------------------------------- /awesome/themes/images/wifi_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/wifi_2.png -------------------------------------------------------------------------------- /awesome/themes/images/wifi_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/images/wifi_3.png -------------------------------------------------------------------------------- /awesome/themes/k58mn95834y41.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/k58mn95834y41.jpg -------------------------------------------------------------------------------- /awesome/themes/light/theme.lua: -------------------------------------------------------------------------------- 1 | --------------------------- 2 | -- Default awesome theme -- 3 | --------------------------- 4 | 5 | local theme_assets = require "beautiful.theme_assets" 6 | local dpi = require("beautiful.xresources").apply_dpi 7 | 8 | local gfs = require "gears.filesystem" 9 | local themes_path = gfs.get_themes_dir() 10 | 11 | local theme = {} 12 | 13 | theme.font = "Segoe UI" 14 | 15 | theme.bg_normal = "#13151C" 16 | theme.bg_normal_1 = "#282C39" 17 | theme.bg_normal_2 = "#373C4B" 18 | 19 | theme.bg_focus = "#13151C" 20 | theme.bg_urgent = "#AC93F6" 21 | theme.bg_minimize = "#3D4465" 22 | theme.bg_systray = theme.bg_normal 23 | 24 | theme.fg_normal = "#aaaaaa" 25 | theme.fg_focus = "#ffffff" 26 | theme.fg_urgent = "#ffffff" 27 | theme.fg_minimize = "#ffffff" 28 | 29 | theme.useless_gap = dpi(0) 30 | theme.border_width = dpi(0) 31 | theme.border_normal = theme.bg_normal 32 | theme.border_focus = theme.bg_focus 33 | theme.border_marked = "#8CCA24" 34 | 35 | theme.gray = "#535966" 36 | theme.light_gray = "#737B8F" 37 | theme.light_blue = "#3B8AE4" 38 | 39 | -- There are other variable sets 40 | -- overriding the default one when 41 | -- defined, the sets are: 42 | -- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] 43 | -- tasklist_[bg|fg]_[focus|urgent] 44 | -- titlebar_[bg|fg]_[normal|focus] 45 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] 46 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor] 47 | -- prompt_[fg|bg|fg_cursor|bg_cursor|font] 48 | -- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] 49 | -- Example: 50 | --theme.taglist_bg_focus = "#ff0000" 51 | 52 | -- Generate taglist squares: 53 | local taglist_square_size = dpi(4) 54 | theme.taglist_squares_sel = theme_assets.taglist_squares_sel( 55 | taglist_square_size, theme.fg_normal 56 | ) 57 | theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( 58 | taglist_square_size, theme.fg_normal 59 | ) 60 | 61 | -- Variables set for theming notifications: 62 | -- notification_font 63 | -- notification_[bg|fg] 64 | -- notification_[width|height|margin] 65 | -- notification_[border_color|border_width|shape|opacity] 66 | 67 | -- Variables set for theming the menu: 68 | -- menu_[bg|fg]_[normal|focus] 69 | -- menu_[border_color|border_width] 70 | theme.menu_submenu_icon = themes_path.."default/submenu.png" 71 | theme.menu_height = dpi(15) 72 | theme.menu_width = dpi(100) 73 | 74 | -- You can add as many variables as 75 | -- you wish and access them by using 76 | -- beautiful.variable in your rc.lua 77 | --theme.bg_widget = "#cc0000" 78 | 79 | -- Define the image to load 80 | theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png" 81 | theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png" 82 | 83 | theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png" 84 | theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png" 85 | 86 | theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png" 87 | theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png" 88 | theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png" 89 | theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png" 90 | 91 | theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png" 92 | theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png" 93 | theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png" 94 | theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png" 95 | 96 | theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png" 97 | theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png" 98 | theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png" 99 | theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png" 100 | 101 | theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png" 102 | theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png" 103 | theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png" 104 | theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png" 105 | 106 | theme.wallpaper = gfs.get_xdg_config_home().."awesome/themes/suncolors/alena-aenami-sky1k.jpg" 107 | 108 | 109 | -- You can use your own layout icons like this: 110 | theme.layout_fairh = themes_path.."default/layouts/fairhw.png" 111 | theme.layout_fairv = themes_path.."default/layouts/fairvw.png" 112 | theme.layout_floating = themes_path.."default/layouts/floatingw.png" 113 | theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" 114 | theme.layout_max = themes_path.."default/layouts/maxw.png" 115 | theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" 116 | theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" 117 | theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" 118 | theme.layout_tile = themes_path.."default/layouts/tilew.png" 119 | theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" 120 | theme.layout_spiral = themes_path.."default/layouts/spiralw.png" 121 | theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" 122 | theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" 123 | theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" 124 | theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" 125 | theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" 126 | 127 | -- Generate Awesome icon: 128 | theme.awesome_icon = theme_assets.awesome_icon( 129 | theme.menu_height, theme.bg_focus, theme.fg_focus 130 | ) 131 | 132 | -- Define the icon theme for application icons. If not set then the icons 133 | -- from /usr/share/icons and /usr/share/icons/hicolor will be used. 134 | theme.icon_theme = nil 135 | 136 | return theme 137 | 138 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 139 | -------------------------------------------------------------------------------- /awesome/themes/suncolors/theme.lua: -------------------------------------------------------------------------------- 1 | --------------------------- 2 | -- Default awesome theme -- 3 | --------------------------- 4 | 5 | --TODO: This theme sucks, make a better one with color api 6 | 7 | local theme_assets = require "beautiful.theme_assets" --cut this 8 | local dpi = require("beautiful.xresources").apply_dpi 9 | local theme_dir = require("gears.filesystem").get_dir("config") 10 | local color = require "lib.color" 11 | 12 | local gfs = require "gears.filesystem" 13 | local themes_path = gfs.get_themes_dir() 14 | 15 | local theme = {} 16 | 17 | -- Add icons 18 | require("themes.images")(theme) 19 | 20 | theme.font = "Segoe UI" 21 | 22 | theme.bg_normal = "#13151C" 23 | theme.bg_normal_1 = "#282C39" 24 | theme.bg_normal_2 = "#373C4B" 25 | 26 | theme.bg_focus = "#13151C" 27 | theme.bg_urgent = "#AC93F6" 28 | theme.bg_minimize = "#3D4465" 29 | theme.bg_systray = theme.bg_normal 30 | 31 | theme.fg_normal = "#aaaaaa" 32 | theme.fg_focus = "#ffffff" 33 | theme.fg_urgent = "#ffffff" 34 | theme.fg_minimize = "#ffffff" 35 | 36 | theme.useless_gap = dpi(0) 37 | theme.border_width = dpi(0) 38 | theme.border_normal = theme.bg_normal 39 | theme.border_focus = theme.bg_focus 40 | theme.border_marked = "#8CCA24" 41 | 42 | theme.gray = "#535966" 43 | theme.light_gray = "#737B8F" 44 | theme.light_blue = "#3B8AE4" 45 | 46 | -- There are other variable sets 47 | -- overriding the default one when 48 | -- defined, the sets are: 49 | -- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] 50 | -- tasklist_[bg|fg]_[focus|urgent] 51 | -- titlebar_[bg|fg]_[normal|focus] 52 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] 53 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor] 54 | -- prompt_[fg|bg|fg_cursor|bg_cursor|font] 55 | -- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] 56 | -- Example: 57 | --theme.taglist_bg_focus = "#ff0000" 58 | 59 | -- Generate taglist squares: 60 | local taglist_square_size = dpi(4) 61 | theme.taglist_squares_sel = theme_assets.taglist_squares_sel( 62 | taglist_square_size, theme.fg_normal 63 | ) 64 | theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( 65 | taglist_square_size, theme.fg_normal 66 | ) 67 | 68 | -- Variables set for theming notifications: 69 | -- notification_font 70 | -- notification_[bg|fg] 71 | -- notification_[width|height|margin] 72 | -- notification_[border_color|border_width|shape|opacity] 73 | 74 | -- Variables set for theming the menu: 75 | -- menu_[bg|fg]_[normal|focus] 76 | -- menu_[border_color|border_width] 77 | theme.menu_submenu_icon = themes_path.."default/submenu.png" 78 | theme.menu_height = dpi(15) 79 | theme.menu_width = dpi(100) 80 | 81 | -- You can add as many variables as 82 | -- you wish and access them by using 83 | -- beautiful.variable in your rc.lua 84 | --theme.bg_widget = "#cc0000" 85 | 86 | -- Define the image to load 87 | theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png" 88 | theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png" 89 | 90 | theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png" 91 | theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png" 92 | 93 | theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png" 94 | theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png" 95 | theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png" 96 | theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png" 97 | 98 | theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png" 99 | theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png" 100 | theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png" 101 | theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png" 102 | 103 | theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png" 104 | theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png" 105 | theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png" 106 | theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png" 107 | 108 | theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png" 109 | theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png" 110 | theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png" 111 | theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png" 112 | 113 | theme.wallpaper = gfs.get_xdg_config_home().."awesome/themes/alena-aenami-sky1k.jpg" 114 | 115 | 116 | -- You can use your own layout icons like this: 117 | theme.layout_fairh = themes_path.."default/layouts/fairhw.png" 118 | theme.layout_fairv = themes_path.."default/layouts/fairvw.png" 119 | theme.layout_floating = themes_path.."default/layouts/floatingw.png" 120 | theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" 121 | theme.layout_max = themes_path.."default/layouts/maxw.png" 122 | theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" 123 | theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" 124 | theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" 125 | theme.layout_tile = themes_path.."default/layouts/tilew.png" 126 | theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" 127 | theme.layout_spiral = themes_path.."default/layouts/spiralw.png" 128 | theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" 129 | theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" 130 | theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" 131 | theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" 132 | theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" 133 | 134 | -- Generate Awesome icon: 135 | theme.awesome_icon = theme_assets.awesome_icon( 136 | theme.menu_height, theme.bg_focus, theme.fg_focus 137 | ) 138 | 139 | -- Define the icon theme for application icons. If not set then the icons 140 | -- from /usr/share/icons and /usr/share/icons/hicolor will be used. 141 | theme.icon_theme = nil 142 | 143 | return theme 144 | 145 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 146 | -------------------------------------------------------------------------------- /awesome/themes/thing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/thing.png -------------------------------------------------------------------------------- /awesome/themes/zurich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andOrlando/dotfiles/1a71f7a389b8eb1956fee545914be2503ef3e2bc/awesome/themes/zurich.png -------------------------------------------------------------------------------- /i3/config: -------------------------------------------------------------------------------- 1 | set $mod Mod4 2 | 3 | font pango:monospace 8 4 | #font pango:DejaVu Sans Mono 8 5 | 6 | # Use pactl to adjust volume in PulseAudio. 7 | bindsym XF86AudioRaiseVolume exec --no-startup-id \ 8 | pactl set-sink-volume @DEFAULT_SINK@ +5% 9 | 10 | bindsym XF86AudioLowerVolume exec --no-startup-id \ 11 | pactl set-sink-volume @DEFAULT_SINK@ -5% 12 | #bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle 13 | 14 | #picom and polybar 15 | exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch.sh 16 | exec --no-startup-id nm-applet 17 | 18 | 19 | # Use Mouse+$mod to drag floating windows to their wanted position 20 | floating_modifier $mod 21 | 22 | # start a terminal 23 | bindsym $mod+Return exec kitty 24 | bindsym $mod+shift+Return exec kitty --class "no_fade" 25 | 26 | # kill focused window 27 | bindsym $mod+Shift+q kill 28 | 29 | #rofi and flameshot 30 | bindsym $mod+d exec "rofi -modi drun,run -show drun" 31 | bindsym Print exec flameshot gui 32 | 33 | 34 | bindsym $mod+h focus left 35 | bindsym $mod+j focus down 36 | bindsym $mod+k focus up 37 | bindsym $mod+l focus right 38 | bindsym $mod+Left focus left 39 | bindsym $mod+Down focus down 40 | bindsym $mod+Up focus up 41 | bindsym $mod+Right focus right 42 | 43 | bindsym $mod+Shift+h move left 44 | bindsym $mod+Shift+j move down 45 | bindsym $mod+Shift+k move up 46 | bindsym $mod+Shift+l move right 47 | bindsym $mod+Shift+Left move left 48 | bindsym $mod+Shift+Down move down 49 | bindsym $mod+Shift+Up move up 50 | bindsym $mod+Shift+Right move right 51 | 52 | bindsym $mod+shift+v split h 53 | bindsym $mod+v split v 54 | 55 | bindsym $mod+f fullscreen toggle 56 | 57 | bindsym $mod+s layout stacking 58 | bindsym $mod+w layout tabbed 59 | bindsym $mod+e layout toggle split 60 | 61 | bindsym $mod+Shift+space floating toggle 62 | bindsym $mod+space focus mode_toggle 63 | 64 | bindsym $mod+a focus parent 65 | bindsym $mod+shift+a focus child 66 | 67 | set $ws1 "1" 68 | set $ws2 "2" 69 | set $ws3 "3" 70 | set $ws4 "4" 71 | set $ws5 "5" 72 | set $ws6 "6" 73 | set $ws7 "7" 74 | set $ws8 "8" 75 | set $ws9 "9" 76 | set $ws10 "10" 77 | 78 | bindsym $mod+1 workspace number $ws1 79 | bindsym $mod+2 workspace number $ws2 80 | bindsym $mod+3 workspace number $ws3 81 | bindsym $mod+4 workspace number $ws4 82 | bindsym $mod+5 workspace number $ws5 83 | bindsym $mod+6 workspace number $ws6 84 | bindsym $mod+7 workspace number $ws7 85 | bindsym $mod+8 workspace number $ws8 86 | bindsym $mod+9 workspace number $ws9 87 | bindsym $mod+0 workspace number $ws10 88 | 89 | bindsym $mod+Shift+1 move container to workspace number $ws1 90 | bindsym $mod+Shift+2 move container to workspace number $ws2 91 | bindsym $mod+Shift+3 move container to workspace number $ws3 92 | bindsym $mod+Shift+4 move container to workspace number $ws4 93 | bindsym $mod+Shift+5 move container to workspace number $ws5 94 | bindsym $mod+Shift+6 move container to workspace number $ws6 95 | bindsym $mod+Shift+7 move container to workspace number $ws7 96 | bindsym $mod+Shift+8 move container to workspace number $ws8 97 | bindsym $mod+Shift+9 move container to workspace number $ws9 98 | bindsym $mod+Shift+0 move container to workspace number $ws10 99 | 100 | bindsym $mod+shift+e mode "meta" 101 | 102 | mode "meta" { 103 | bindsym e exit 104 | bindsym l exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork 105 | bindsym r restart && mode "default" 106 | bindsym p exec killall picom && exec picom && mode "default" 107 | 108 | bindsym Escape mode "default" 109 | bindsym $mod+e mode "default" 110 | } 111 | 112 | bindsym $mod+r mode "resize" 113 | 114 | mode "resize" { 115 | bindsym h resize shrink width 10 px or 10 ppt 116 | bindsym j resize grow height 10 px or 10 ppt 117 | bindsym k resize shrink height 10 px or 10 ppt 118 | bindsym l resize grow width 10 px or 10 ppt 119 | 120 | bindsym shift+h resize shrink width 2 px or 2 ppt 121 | bindsym shift+j resize grow height 2 px or 2 ppt 122 | bindsym shift+k resize shrink height 2 px or 2 ppt 123 | bindsym shift+l resize grow width 2 px or 2 ppt 124 | 125 | bindsym Left resize shrink width 10 px or 10 ppt 126 | bindsym Down resize grow height 10 px or 10 ppt 127 | bindsym Up resize shrink height 10 px or 10 ppt 128 | bindsym Right resize grow width 10 px or 10 ppt 129 | 130 | bindsym shift+Left resize shrink width 2 px or 2 ppt 131 | bindsym shift+Down resize grow height 2 px or 2 ppt 132 | bindsym shift+Up resize shrink height 2 px or 2 ppt 133 | bindsym shift+Right resize grow width 2 px or 2 ppt 134 | 135 | #gaps keybinds 136 | #bindsym p exec i3-msg gaps inner all plus 5 137 | #bindsym o exec i3-msg gaps inner all minus 5 138 | 139 | #back to normal: Enter or Escape or $mod+r 140 | bindsym $mod+r mode "default" 141 | bindsym Escape mode "default" 142 | } 143 | 144 | 145 | #tab colors 146 | #client.focused #4c7899 #285577 #ffffff #2e9ef4 #285577 147 | #client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a 148 | #client.unfocused #333333 #222222 #888888 #292d2e #222222 149 | #client.urgent #2f343a #900000 #ffffff #900000 #900000 150 | #client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c 151 | 152 | #client.background #ffffff 153 | 154 | 155 | #removes border 156 | for_window [class=".*"] border pixel 0 157 | exec_always i3-msg gaps inner all set 15 158 | exec_always i3-msg gaps top all set 40 159 | exec_always i3-msg gaps bottom all set 40 160 | 161 | #dunst 162 | exec_always $XDG_CONFIG_HOME/dunst/launch.sh 163 | 164 | exec picom 165 | -------------------------------------------------------------------------------- /kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf:tabstop=4 2 | include ./suntheme.conf 3 | 4 | #font_family CaskaydiaCove Nerd Font Mono 5 | #bold_font CaskaydiaCove Nerd Font Mono Bold 6 | #font_family CodeNewRoman Nerd Font Mono 7 | #bold_font CodeNewRoman Nerd Font Mono Bold 8 | #italic_font CodeNewRoman Nerd Font Mono Italic 9 | font_family Code New Roman Nerd Font Complete Mono 10 | bold_font Code New Roman Bold Nerd Font Complete Mono 11 | italic_font Code New Roman Italic Nerd Font Complete Mono 12 | #bold_italic_font CodeNewRoman Nerd Font Mono Bold Italic 13 | font_size 13.0 14 | window_margin_width 5.0 15 | 16 | 17 | url_color #35A9FF 18 | url_style single 19 | 20 | enable_audio_bell no 21 | -------------------------------------------------------------------------------- /kitty/suntheme.conf: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:ft=conf 2 | ############################# 3 | # COLORS # 4 | ############################# 5 | 6 | foreground #E9EBF3 7 | background #252936 8 | #background_opacity 0.8 9 | dynamic_background_opacity yes 10 | 11 | #black 12 | color0 #13151C 13 | color8 #3D4465 14 | #red 15 | color1 #F46765 16 | color9 #FF6292 17 | #green 18 | color2 #8CCA24 19 | color10 #A4FF36 20 | #yellow 21 | color3 #FFDF3B 22 | color11 #F8F583 23 | #blue 24 | color4 #7753DD 25 | color12 #AC93F6 26 | #magenta 27 | color5 #BA3FAC 28 | color13 #E480D9 29 | #cyan 30 | color6 #3D9BD7 31 | color14 #7FC0E9 32 | #white 33 | color7 #C3D1D6 34 | color15 #E9EBF3 35 | 36 | selection_background #3D4465 37 | selection_foreground #E9EBF3 38 | 39 | #active_tab_background #252935 40 | active_tab_font_style bold 41 | inactive_tab_font_style normal 42 | tab_bar_edge bottom 43 | 44 | tab_bar_style separator 45 | tab_separator "" 46 | tab_title_template "{fmt.fg._3D4465}{fmt.bg._252936} {title} " 47 | active_tab_title_template "{fmt.fg._3D4465}{fmt.bg._252936} {fmt.bg._383F56}{fmt.fg._C3D1D6}{title}{fmt.fg._383F56}{fmt.bg._252936}" 48 | 49 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | require 'opts' 2 | require 'plugins' 3 | -------------------------------------------------------------------------------- /nvim/lua/lsp.lua: -------------------------------------------------------------------------------- 1 | local lspconfig = require("lspconfig") 2 | local lspinstall = require("lspinstall") 3 | local coq = require("coq") 4 | 5 | ---@diagnostic disable-next-line: unused-local 6 | local function common_on_attach(client, bufnr) 7 | 8 | --lsp keybinds 9 | local keymap = vim.api.nvim_set_keymap 10 | local opts = {silent=true, noremap=true} 11 | 12 | keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) 13 | keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) 14 | keymap("n", "gr", "lua vim.lsp.buf.references()", opts) 15 | keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) 16 | keymap("n", "ca", "Lspsaga code_action", opts) 17 | keymap("n", "K", "Lspsaga hover_doc", opts) 18 | keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) 19 | --keymap("n", "", "Lspsaga diagnostic_jump_prev", opts) 20 | --keymap("n", "", "Lspsaga diagnostic_jump_next", opts) 21 | 22 | keymap("n", "", "lua require('lspsaga.action').smart_scroll_with_saga(1)", opts) 23 | keymap("n", "", "lua require('lspsaga.action').smart_scroll_with_saga(-1)", opts) 24 | 25 | vim.cmd('command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()') 26 | 27 | local function lspSymbol(name, icon) 28 | vim.fn.sign_define("LspDiagnosticsSign" .. name, { text = icon, numhl = "LspDiagnosticsDefaul" .. name }) 29 | end 30 | 31 | lspSymbol("Error", "") 32 | lspSymbol("Information", "") 33 | lspSymbol("Hint", "") 34 | lspSymbol("Warning", "") 35 | 36 | vim.cmd('COQnow') 37 | 38 | end 39 | 40 | local function setup_servers() 41 | lspinstall.setup() 42 | local servers = lspinstall.installed_servers() 43 | 44 | for _, lang in pairs(servers) do 45 | if lang ~= "lua" then 46 | lspconfig[lang].setup(coq.lsp_ensure_capabilities { 47 | on_attach = common_on_attach, 48 | --capabilities = capabilities, 49 | -- root_dir = vim.loop.cwd, 50 | }) 51 | elseif lang == "lua" then 52 | lspconfig[lang].setup(coq.lsp_ensure_capabilities { 53 | on_attach = common_on_attach, 54 | --capabilities = capabilities, 55 | settings = { 56 | Lua = { 57 | diagnostics = { 58 | globals = { "vim" }, 59 | }, 60 | workspace = { 61 | library = { 62 | [vim.fn.expand "$VIMRUNTIME/lua"] = true, 63 | [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, 64 | }, 65 | maxPreload = 100000, 66 | preloadFileSize = 10000, 67 | }, 68 | telemetry = { 69 | enable = false, 70 | }, 71 | }, 72 | }, 73 | }) 74 | end 75 | end 76 | end 77 | 78 | setup_servers() 79 | 80 | -------------------------------------------------------------------------------- /nvim/lua/opts.lua: -------------------------------------------------------------------------------- 1 | local cmd = vim.cmd 2 | 3 | local scopes = {o = vim.o, b = vim.bo, w = vim.wo} 4 | 5 | local function opt(scope, key, value) 6 | scopes[scope][key] = value 7 | if scope ~= 'o' then scopes['o'][key] = value end 8 | end 9 | 10 | cmd 'syntax enable' 11 | cmd 'filetype plugin indent on' 12 | 13 | opt('b', 'smartindent', true) 14 | opt('b', 'shiftwidth', 4) 15 | opt('b', 'tabstop', 4) 16 | opt('b', 'autoindent', true) 17 | opt('b', 'expandtab', false) 18 | opt('o', 'ignorecase', true) 19 | opt('o', 'smartcase', true) 20 | opt('o', 'splitbelow', true) 21 | opt('o', 'splitright', true) 22 | opt('o', 'termguicolors', true) 23 | opt('o', 'showmode', false) 24 | opt('o', 'showmatch', true) 25 | opt('o', 'ruler', true) 26 | opt('o', 'laststatus', 2) 27 | opt('o', 'showtabline', 2) 28 | opt('o', 'startofline', false) 29 | opt('o', 'hidden', true) 30 | opt('o', 'backup', false) 31 | opt('o', 'writebackup', false) 32 | opt('o', 'cmdheight', 1) 33 | opt('o', 'updatetime', 300) 34 | opt('o', 'completeopt', "menuone,noinsert,noselect") 35 | opt('o', 'shortmess', "c") 36 | opt('w', 'number', true) 37 | opt('w', 'cursorline', true) 38 | opt('w', 'signcolumn', 'number') 39 | 40 | --opt('w', 'foldlevel', 20) 41 | --opt('w', 'foldmethod', 'expr') 42 | --opt('o', 'foldexpr', 'nvim_treesitter#foldexpr()') 43 | -------------------------------------------------------------------------------- /nvim/lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local Plug = vim.fn['plug#'] 2 | local keymap = vim.api.nvim_set_keymap 3 | local scopes = {o = vim.o, b = vim.bo, w = vim.wo} 4 | local function opt(scope, key, value) 5 | scopes[scope][key] = value 6 | if scope ~= 'o' then scopes['o'][key] = value end 7 | end 8 | 9 | 10 | vim.call('plug#begin', '~/.config/nvim/plugged') 11 | 12 | Plug 'ms-jpq/chadtree' 13 | Plug 'lervag/vimtex' 14 | Plug 'kaicataldo/material.vim' 15 | Plug 'norcalli/nvim-colorizer.lua' 16 | Plug 'AndrewRadev/bufferize.vim' 17 | Plug 'terrortylor/nvim-comment' 18 | Plug 'gpanders/editorconfig.nvim' 19 | 20 | Plug 'kabouzeid/nvim-lspinstall' 21 | Plug 'neovim/nvim-lspconfig' 22 | 23 | Plug 'glepnir/lspsaga.nvim' 24 | Plug 'ms-jpq/coq_nvim' 25 | Plug 'nvim-treesitter/nvim-treesitter' 26 | 27 | vim.call('plug#end') 28 | 29 | --chadtree config 30 | keymap("n", "", "CHADopen", {noremap=true}) 31 | vim.g.chadtree_settings = { 32 | ["view.width"] = 30, 33 | ["keymap.tertiary"] = {"t"}, 34 | ["keymap.trash"] = {""} 35 | } 36 | 37 | --colorscheme config 38 | vim.g.material_theme_style = 'palenight' 39 | vim.g.material_terminal_italics = 1 40 | vim.cmd 'colorscheme material' 41 | 42 | --vimtex config 43 | vim.g.vimtex_view_general_viewer = 'zathura' 44 | vim.g.vimtex_vold_enabled = 1 45 | vim.g.vimtex_compiler_progname = 'nvr' 46 | vim.cmd "au BufNewFile,BufRead *.tex exec 'setl indentexpr= | setl tw=80'" 47 | 48 | --colorizer config 49 | require('colorizer').setup() 50 | 51 | --lspconfig config 52 | require 'lsp' 53 | 54 | --lspsaga config 55 | require('lspsaga').init_lsp_saga() 56 | 57 | --treesitter config 58 | require("nvim-treesitter.configs").setup { 59 | ensure_installed = "maintained", 60 | highlight = { 61 | enable = true, 62 | use_languagetree = true 63 | }, 64 | autotag = {enable = true}, 65 | rainbow = {enable = true}, 66 | } 67 | 68 | --opt('w', 'foldlevel', 20) 69 | opt('w', 'foldmethod', 'expr') 70 | opt('o', 'foldexpr', 'nvim_treesitter#foldexpr()') 71 | 72 | ---@diagnostic disable: undefined-global 73 | --[[require('packer').startup(function() 74 | use 'wbthomason/packer.nvim' 75 | 76 | use {'ms-jpq/chadtree', config=function() 77 | vim.api.nvim_set_keymap("n", "", "CHADopen", {noremap=true}) 78 | vim.g.chadtree_settings = { 79 | ["view.width"] = 30, 80 | ["keymap.tertiary"] = {"t"}, 81 | ["keymap.trash"] = {""} 82 | } 83 | end 84 | } 85 | 86 | use {'lervag/vimtex', config=function() 87 | vim.g.vimtex_view_general_viewer = 'zathura' 88 | vim.g.vimtex_vold_enabled = 1 89 | vim.g.vimtex_compiler_progname = 'nvr' 90 | vim.cmd "au BufNewFile,BufRead *.tex exec 'setl indentexpr= | setl tw=80'" 91 | end 92 | } 93 | 94 | use {'kaicataldo/material.vim', 95 | config=function() 96 | vim.g.material_theme_style = 'palenight' 97 | vim.g.material_terminal_italics = 1 98 | vim.cmd 'colorscheme material' 99 | end, 100 | disable=false 101 | } 102 | use {'haishanh/night-owl.vim', 103 | config=function() 104 | vim.cmd 'colorscheme night-owl' 105 | end, 106 | disable=true 107 | } 108 | 109 | use {'norcalli/nvim-colorizer.lua', config=function() require('colorizer').setup() end} 110 | 111 | 112 | use 'AndrewRadev/bufferize.vim' 113 | use 'craigemery/vim-autotag' 114 | use 'terrortylor/nvim-comment' 115 | use 'gpanders/editorconfig.nvim' 116 | 117 | use "kabouzeid/nvim-lspinstall" 118 | use {'neovim/nvim-lspconfig', 119 | config=function() require 'lsp' end, 120 | --after="kabouzeid/nvim-lspinstall" 121 | } 122 | 123 | use {'glepnir/lspsaga.nvim', config=function() require('lspsaga').init_lsp_saga() end} 124 | use 'ms-jpq/coq_nvim' 125 | 126 | use {'nvim-treesitter/nvim-treesitter', 127 | run=':TSUpdate', 128 | config=function() 129 | require("nvim-treesitter.configs").setup { 130 | ensure_installed = "maintained", 131 | highlight = { 132 | enable = true, 133 | use_languagetree = true 134 | }, 135 | autotag = {enable = true}, 136 | rainbow = {enable = true}, 137 | } 138 | end 139 | } 140 | 141 | use {'nvim-telescope/telescope.nvim', 142 | requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}}, 143 | config=function() 144 | --keymap("n", "", "Telescope find_file", {silent=true, noremap=true}) 145 | --keymap("n", "", "Telescope live_grep", {silent=true, noremap=true}) 146 | end 147 | } 148 | end)]] 149 | 150 | -------------------------------------------------------------------------------- /picom/picom.conf: -------------------------------------------------------------------------------- 1 | ### Shadow ### 2 | 3 | shadow = true; 4 | shadow-radius = 20; 5 | shadow-opacity = 0.5; 6 | # shadow-offset-x = -5; 7 | # shadow-offset-y = -5; 8 | 9 | shadow-exclude = [ 10 | "class_g = 'Rofi'", 11 | "name = 'Awesome drawin'", 12 | "name = 'polybar-memory_eDP1'", 13 | "class_g *= 'shadow-exclude'" 14 | ]; 15 | 16 | ### Fade ### 17 | 18 | fading = true; 19 | fade-in-step = 0.04; 20 | fade-out-step = 0.04; 21 | 22 | transition-length = 100; 23 | transition-pow-x = 0.3; 24 | transition-pow-y = 0.3; 25 | transition-pow-w = 0.3; 26 | transition-pow-h = 0.3; 27 | size-transition = true; 28 | 29 | ### Opacity ### 30 | #inactive-opacity = 0.5; 31 | #frame-opacity = 1; 32 | #inactive-opacity-override = false; 33 | #active-opacity = 1; 34 | 35 | #opacity-rule = [ 36 | # "100:class_g *= 'Rofi'", 37 | # "100:class_g *= 'Polybar'", 38 | # "100:class_g *= 'i3lock'", 39 | # "100:class_g *= 'zoom'", 40 | # "100:class_g *= 'Evince'", 41 | # "100:class_g *= 'Polybar'", 42 | # "100:class_g *= 'no_fade'" 43 | #]; 44 | 45 | ### Blur ### 46 | #inactive-dim = 0.3; 47 | blur-background = true; 48 | blur-method = "dual_kawase"; 49 | blur-strength = 9; 50 | 51 | blur-background-exclude = [ 52 | "class_g ~= '^(?!blur).*'" 53 | ]; 54 | 55 | ### Corners ### 56 | 57 | corner-radius = 7 58 | rounded-corners-exclude = [ 59 | # "class_g = 'jgmenu'", 60 | # "class_g = 'Screenkey'", 61 | # "class_g = 'Rofi'", 62 | "class_g = 'Dunst'", 63 | # "window_type = 'tooltip'", 64 | "window_type = 'menu'", 65 | "window_type = 'dropdown_menu'", 66 | "window_type = 'popup_menu'", 67 | "window_type = 'dock'", 68 | # "name = 'polybar-memory_eDP1'" 69 | ]; 70 | 71 | ### Misc ### 72 | 73 | backend = "glx"; 74 | mark-ovredir-focused = false; 75 | vsync = true; 76 | use-damage = true; 77 | 78 | wintypes: 79 | { 80 | normal = { full-shadow = true; }; 81 | menu = { shadow = false; }; 82 | dropdown_menu = { shadow = false; }; 83 | popup_menu = { shadow = false; }; 84 | utility = { shadow = false; }; 85 | # dock = { 86 | # blur-background = true; 87 | # blur-method = "dual_kawase"; 88 | # blur-strength = 9; 89 | # }; 90 | }; 91 | -------------------------------------------------------------------------------- /picom/picom2.conf: -------------------------------------------------------------------------------- 1 | ### Shadow ### 2 | 3 | shadow = true; 4 | shadow-radius = 20; 5 | shadow-opacity = 0.7; 6 | shadow-offset-x = -9; 7 | shadow-offset-y = -9; 8 | 9 | shadow-exclude = [ 10 | "class_g = 'Rofi'", 11 | "name = 'polybar-memory_eDP1'" 12 | ]; 13 | 14 | ### Fade ### 15 | 16 | fading = true; 17 | fade-in-step = 0.04; 18 | fade-out-step = 0.04; 19 | 20 | transition-length = 200; 21 | transition-pow-x = 0.3; 22 | transition-pow-y = 0.3; 23 | transition-pow-w = 0.3; 24 | transition-pow-h = 0.3; 25 | size-transition = true; 26 | 27 | ### Opacity ### 28 | inactive-opacity = 0.5; 29 | frame-opacity = 1; 30 | inactive-opacity-override = false; 31 | active-opacity = 1; 32 | 33 | opacity-rule = [ 34 | "100:class_g *= 'Rofi'", 35 | "100:class_g *= 'Polybar'", 36 | "100:class_g *= 'i3lock'", 37 | "100:class_g *= 'zoom'", 38 | "100:class_g *= 'Evince'", 39 | "100:class_g *= 'Polybar'", 40 | "100:class_g *= 'no_fade'" 41 | ]; 42 | 43 | ### Blur ### 44 | #inactive-dim = 0.3; 45 | blur-background = true; 46 | blur-method = "dual_kawase"; 47 | blur-strength = 9; 48 | 49 | blur-background-exclude = [ 50 | "class_g = 'slop'", 51 | "class_g = 'xob'", 52 | "class_g = 'Polybar'", 53 | ]; 54 | 55 | ### Corners ### 56 | 57 | corner-radius = 7 58 | rounded-corners-exclude = [ 59 | "class_g = 'jgmenu'", 60 | "class_g = 'Screenkey'", 61 | # "class_g = 'Rofi'", 62 | "class_g = 'Dunst'", 63 | "window_type = 'tooltip'", 64 | "window_type = 'menu'", 65 | "window_type = 'dropdown_menu'", 66 | "window_type = 'popup_menu'", 67 | # "window_type = 'dock'", 68 | "name = 'polybar-memory_eDP1'" 69 | ]; 70 | 71 | ### Misc ### 72 | 73 | backend = "glx"; 74 | mark-ovredir-focused = false; 75 | vsync = true; 76 | use-damage = true; 77 | 78 | wintypes: 79 | { 80 | normal = {full-shadow = true;}; 81 | menu = { shadow = false; }; 82 | dropdown_menu = { shadow = false; }; 83 | popup_menu = { shadow = false; }; 84 | utility = { shadow = false; }; 85 | }; 86 | -------------------------------------------------------------------------------- /polybar/config: -------------------------------------------------------------------------------- 1 | [colors] 2 | blc4 = #141421 3 | blc3 = #282a2e 4 | blc2 = #4A4B4D 5 | blc1 = #62697C 6 | fg1 = #f5fbff 7 | fg2 = #d5dade 8 | fg3 = #babfc2 9 | fg4 = #a0a5a8 10 | fg5 = #81868a 11 | fg6 = #6d7275 12 | blu5 = #2D41EA 13 | blu4 = #5464EA 14 | blu3 = #7F8BF4 15 | blu2 = #B0B8FF 16 | blu1 = #CBD0FF 17 | red = #E35462 18 | 19 | [bar/base] 20 | font-0 = Source Code Pro:size=11;3 21 | font-1 = Source Code Pro:size=11:weight=bold;3 22 | font-2 = Font Awesome 5 Free Solid:size=12;3 23 | font-3 = Font Awesome 5 Free Solid:size=12;2 24 | font-4 = Font Awesome 5 Free Solid:size=8;1 25 | 26 | override-redirect = true 27 | wm-restack = i3 28 | scroll-up = i3wm-wsnext 29 | scroll-down = i3wm-wsprev 30 | ;radius = 16.0 31 | ;overline-size = 2 32 | ;underline-size = 2 33 | line-size = 3 34 | 35 | padding-left = 2 36 | padding-right = 2 37 | module-margin-left = 0 38 | module-margin-right = 0 39 | 40 | 41 | 42 | [bar/main] 43 | inherit = bar/base 44 | width = 100%:-30 45 | height = 32 46 | offset-x = 15 47 | offset-y = 8 48 | background = ${colors.blc4} 49 | 50 | modules-left = i3 51 | modules-right = audio date battery 52 | 53 | [bar/memory] 54 | inherit = bar/base 55 | width = 28 56 | height = 32 57 | offset-x = 100%:-61 58 | offset-y = 8 59 | background = ${colors.blc4} 60 | line-size = 6 61 | 62 | modules-center = cpu memory 63 | 64 | 65 | [bar/bottomleft] 66 | inherit = bar/base 67 | width = 1% 68 | height = 32 69 | offset-x = 99%:-15 70 | offset-y = 100%:-40 71 | background = #00ffffff 72 | 73 | tray-position = right 74 | tray-background = ${colors.blc4} 75 | modules-left = empty 76 | 77 | 78 | [module/date] 79 | type = internal/date 80 | date = "%{u#FF6292}%{+u} %{T2}%H:%M %{T-}%{F#b9c3c9}%S%{-u} %{u#7753DD}%{+u}%{F-}%{T4} %{T-}%d%{-u} " 81 | 82 | [module/i3] 83 | type = internal/i3 84 | pin-workspaces = true 85 | 86 | label-mode-padding=2 87 | 88 | label-focused = "%{u#5464EA}%{+u} %name% %{-u}" 89 | label-unfocused = " %name% " 90 | label-urgent= "%{u#B0B8FF}%{+u} %name% %{-u}" 91 | label-focused-background = ${colors.blc3} 92 | label-mode-background = ${colors.blc4} 93 | 94 | [module/audio] 95 | type = internal/pulseaudio 96 | format-volume = 97 | 98 | ramp-volume-0 = "%{F#6d7275}%{u#6d7275}%{+u}%{F-}" 99 | ramp-volume-1 = "%{F#81868a}%{u#81868a}%{+u}%{F-}" 100 | ramp-volume-2 = "%{F#a0a5a8}%{u#a0a5a8}%{+u}%{F-}" 101 | ramp-volume-3 = "%{F#babfc2}%{u#a0a5a8}%{+u}%{F-}" 102 | ramp-volume-4 = "%{F#d5dade}%{u#a0a5a8}%{+u}%{F-}" 103 | ramp-volume-5 = "%{F#F5FBFF}%{u#F5FBFF}%{+u}%{F-}" 104 | 105 | label-muted = "%{F#ff5959}%{u#ff5959}%{+u} %{F-} mtd " 106 | label-muted-minlen = 30 107 | label-volume = "%percentage:3%%%{-u} " 108 | 109 | [module/network] 110 | type = internal/network 111 | interface = wlp1s0 112 | interval = 1.0 113 | format-connected = 114 | 115 | ramp-signal-0 = "%{u#2D41EA}%{+u}%{T5}%{F#86818a}" 116 | ramp-signal-1 = "%{u#2D41EA}%{+u}%{T5}%{F#86818a}" 117 | ramp-signal-2 = "%{u#2D41EA}%{+u}%{T5}%{F#86818a}" 118 | ramp-signal-3 = "%{u#2D41EA}%{+u}%{T5}%{F#86818a}" 119 | ramp-signal-4 = "%{u#2D41EA}%{+u}%{T5}%" 120 | 121 | label-connected = "" 122 | 123 | [module/battery] 124 | type = internal/battery 125 | full-at = 99 126 | format-charging = 127 | format-discharging = 128 | format-full = 129 | 130 | battery = BAT0 131 | adapter = AC0 132 | 133 | label-charging = "%{u#3AF196}%{+u}%percentage:3%%%{-u} " 134 | label-discharging = "%{u#3AF196}%{+u}%percentage:3%%%{-u} " 135 | label-full = "%{u#3AF196}%{+u} 100%%{-u} " 136 | 137 | ramp-capacity-0 = "" 138 | ramp-capacity-1 = "" 139 | ramp-capacity-2 = "" 140 | ramp-capacity-3 = "" 141 | ramp-capacity-4 = "" 142 | 143 | [module/cpu] 144 | type = internal/cpu 145 | format =