├── config ├── eww │ ├── scripts │ │ ├── getart │ │ ├── getpkgs │ │ ├── getker │ │ ├── setvol │ │ ├── getmemcur │ │ ├── getmemtot │ │ ├── getbatper │ │ ├── getcpu │ │ ├── getos │ │ ├── getuptime │ │ ├── musicart │ │ ├── getday │ │ ├── reboot │ │ ├── logout │ │ ├── shutdown │ │ ├── getwm │ │ ├── getbat │ │ ├── spotat │ │ └── getstitle │ ├── images │ │ ├── pic.png │ │ ├── pic2.png │ │ └── pengus-hi.png │ ├── eww.scss │ └── eww.xml ├── awesome │ ├── icons │ │ ├── bat.png │ │ ├── cpu.png │ │ ├── mem.png │ │ ├── spkr.png │ │ ├── temp.png │ │ ├── xhandy.png │ │ ├── no_music.png │ │ ├── note_on.png │ │ ├── xhandler.jpg │ │ ├── ghosts │ │ │ ├── dot.png │ │ │ ├── awesome.png │ │ │ ├── battery.png │ │ │ ├── discord.png │ │ │ ├── ghost.png │ │ │ ├── pacman.png │ │ │ ├── terminal.png │ │ │ ├── purple_dot.png │ │ │ ├── battery_charging.png │ │ │ ├── pacman.svg │ │ │ ├── dot.svg │ │ │ └── ghost.svg │ │ ├── sidebar │ │ │ ├── bat.png │ │ │ ├── cpu.png │ │ │ ├── me.png │ │ │ ├── mem.png │ │ │ └── vol.png │ │ └── notif-center │ │ │ ├── clear.png │ │ │ ├── delete.png │ │ │ ├── clear_grey.png │ │ │ ├── delete_grey.png │ │ │ └── notification.png │ ├── tots │ │ ├── init.lua │ │ ├── battery.lua │ │ ├── cpu.lua │ │ ├── ram.lua │ │ ├── weather.lua │ │ ├── volume.lua │ │ └── modbat.lua │ ├── scratchpads │ │ ├── kitty.lua │ │ ├── discord.lua │ │ └── spotify.lua │ ├── widgets │ │ ├── slider │ │ │ ├── datewid.lua │ │ │ ├── damewid.lua │ │ │ ├── cpubar.lua │ │ │ ├── batbar.lua │ │ │ ├── rambar.lua │ │ │ ├── timedate.lua │ │ │ ├── init.lua │ │ │ ├── volbar.lua │ │ │ ├── info.lua │ │ │ ├── weather.lua │ │ │ ├── slide.lua │ │ │ ├── player.lua │ │ │ └── spoter │ │ │ │ ├── utils.lua │ │ │ │ └── spawtify.lua │ │ ├── popdown.lua │ │ ├── laylist.lua │ │ ├── rebootpop.lua │ │ ├── shutdown.lua │ │ └── init.lua │ ├── bar │ │ ├── systraybox.lua │ │ ├── powerbox.lua │ │ ├── datebox.lua │ │ ├── init.lua │ │ ├── utilbox.lua │ │ ├── taskbox.lua │ │ ├── spotibox.lua │ │ └── tagbox.lua │ ├── modules │ │ └── awestore.lua │ ├── deftheme.lua │ └── helpers.lua ├── kitty │ └── kitty.conf ├── starship.toml └── picom.conf ├── img ├── 0x01.png ├── 0x02.png ├── 0x03.png ├── 0x04.png ├── 0x05.png └── 0x06.png ├── README.md ├── LICENSE └── firefox └── user.js /config/eww/scripts/getart: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "/tmp/awesome/art/cover.png" 4 | -------------------------------------------------------------------------------- /config/eww/scripts/getpkgs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo $(xbps-query -l | wc -l) 4 | -------------------------------------------------------------------------------- /config/eww/scripts/getker: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ker=$(uname -r) 4 | 5 | echo $ker 6 | -------------------------------------------------------------------------------- /img/0x01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x01.png -------------------------------------------------------------------------------- /img/0x02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x02.png -------------------------------------------------------------------------------- /img/0x03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x03.png -------------------------------------------------------------------------------- /img/0x04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x04.png -------------------------------------------------------------------------------- /img/0x05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x05.png -------------------------------------------------------------------------------- /img/0x06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/img/0x06.png -------------------------------------------------------------------------------- /config/eww/images/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/eww/images/pic.png -------------------------------------------------------------------------------- /config/eww/images/pic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/eww/images/pic2.png -------------------------------------------------------------------------------- /config/eww/scripts/setvol: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | vol=$(printf "%.0f" $1) 4 | set=$(pamixer --set-volume $vol) 5 | -------------------------------------------------------------------------------- /config/awesome/icons/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/bat.png -------------------------------------------------------------------------------- /config/awesome/icons/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/cpu.png -------------------------------------------------------------------------------- /config/awesome/icons/mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/mem.png -------------------------------------------------------------------------------- /config/awesome/icons/spkr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/spkr.png -------------------------------------------------------------------------------- /config/awesome/icons/temp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/temp.png -------------------------------------------------------------------------------- /config/awesome/icons/xhandy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/xhandy.png -------------------------------------------------------------------------------- /config/eww/images/pengus-hi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/eww/images/pengus-hi.png -------------------------------------------------------------------------------- /config/eww/scripts/getmemcur: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}') 4 | -------------------------------------------------------------------------------- /config/eww/scripts/getmemtot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mem=$(free -m | awk 'NR==2{printf "%s", $2 }') 4 | 5 | echo $mem 6 | -------------------------------------------------------------------------------- /config/awesome/icons/no_music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/no_music.png -------------------------------------------------------------------------------- /config/awesome/icons/note_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/note_on.png -------------------------------------------------------------------------------- /config/awesome/icons/xhandler.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/xhandler.jpg -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/dot.png -------------------------------------------------------------------------------- /config/awesome/icons/sidebar/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/sidebar/bat.png -------------------------------------------------------------------------------- /config/awesome/icons/sidebar/cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/sidebar/cpu.png -------------------------------------------------------------------------------- /config/awesome/icons/sidebar/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/sidebar/me.png -------------------------------------------------------------------------------- /config/awesome/icons/sidebar/mem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/sidebar/mem.png -------------------------------------------------------------------------------- /config/awesome/icons/sidebar/vol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/sidebar/vol.png -------------------------------------------------------------------------------- /config/awesome/tots/init.lua: -------------------------------------------------------------------------------- 1 | require('tots.cpu') 2 | require('tots.ram') 3 | require('tots.volume') 4 | require('tots.battery') 5 | -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/awesome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/awesome.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/battery.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/discord.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/ghost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/ghost.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/pacman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/pacman.png -------------------------------------------------------------------------------- /config/eww/scripts/getbatper: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bat_per=$(cat /sys/class/power_supply/BAT0/capacity) 4 | 5 | printf "%.0f" $bat_per 6 | -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/terminal.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/purple_dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/purple_dot.png -------------------------------------------------------------------------------- /config/awesome/icons/notif-center/clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/notif-center/clear.png -------------------------------------------------------------------------------- /config/awesome/icons/notif-center/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/notif-center/delete.png -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/battery_charging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/ghosts/battery_charging.png -------------------------------------------------------------------------------- /config/awesome/icons/notif-center/clear_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/notif-center/clear_grey.png -------------------------------------------------------------------------------- /config/awesome/icons/notif-center/delete_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/notif-center/delete_grey.png -------------------------------------------------------------------------------- /config/awesome/icons/notif-center/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mustard-parfait/dotfiles/HEAD/config/awesome/icons/notif-center/notification.png -------------------------------------------------------------------------------- /config/eww/scripts/getcpu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cpu=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{printf "%.0f", 100 - $1}') 4 | 5 | echo $cpu 6 | -------------------------------------------------------------------------------- /config/eww/scripts/getos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | os_norm=$(lsb_release -sd) 4 | 5 | if [[ $os_norm == "\"Void Linux\"" ]]; then 6 | os="Void" 7 | else 8 | os="unknown" 9 | fi 10 | 11 | echo $os 12 | -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/pacman.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /config/eww/scripts/getuptime: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uptime=$(uptime -p | awk '{for (I=1;I /dev/null | grep --line-buffered \"Event 'change' on sink #\" 26 | "]] 27 | 28 | 29 | awful.spawn.easy_async({"pkill", "--full", "--uid", os.getenv("USER"), "^pactl subscribe"}, function () 30 | awful.spawn.with_line_callback(volume_script, { 31 | stdout = function(line) 32 | emit_volume_info() 33 | end 34 | }) 35 | end) 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | 26 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/datewid.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | 11 | local date_text = wibox.widget { 12 | font = "Sarasa UI HC 11", 13 | format = "%a %b %d, %Y", 14 | align = 'center', 15 | valign = 'center', 16 | widget = wibox.widget.textclock 17 | } 18 | 19 | date_text.markup = "" .. 20 | date_text.text .. "" 21 | 22 | date_text:connect_signal("widget::redraw_needed", function() 23 | date_text.markup = "" .. 24 | date_text.text .. "" 25 | end) 26 | 27 | local date_widget = wibox.widget { 28 | { 29 | date_text, 30 | layout = wibox.layout.fixed.horizontal 31 | }, 32 | top = dpi(5), 33 | left = dpi(5), 34 | bottom = dpi(5), 35 | right = dpi(5), 36 | widget = wibox.container.margin 37 | } 38 | 39 | local clock_widget = wibox.widget { 40 | layout = wibox.layout.align.horizontal, 41 | expand = "none", 42 | nil, 43 | { 44 | date_widget, 45 | top = dpi(1), 46 | left = dpi(2), 47 | bottom = dpi(1), 48 | right = dpi(2), 49 | widget = wibox.container.margin 50 | }, 51 | nil, 52 | } 53 | 54 | return clock_widget 55 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/damewid.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | 11 | local time_text = wibox.widget { 12 | font = "Sarasa UI HC 45", 13 | format = "%H%M", 14 | timezone = "Z", 15 | align = 'center', 16 | valign = 'center', 17 | widget = wibox.widget.textclock 18 | } 19 | 20 | time_text.markup = helpers.colorize_text(time_text.text, "#FFFFFF") 21 | 22 | time_text:connect_signal("widget::redraw_needed", function() 23 | time_text.markup = helpers.colorize_text(time_text.text:sub(1, 2), "#FFFFFF") .. 24 | helpers.colorize_text(time_text.text:sub(3, 4), "#B8C6EC") 25 | end) 26 | 27 | local time_widget = wibox.widget { 28 | { 29 | time_text, 30 | layout = wibox.layout.fixed.horizontal 31 | }, 32 | top = dpi(5), 33 | left = dpi(5), 34 | bottom = dpi(5), 35 | right = dpi(5), 36 | widget = wibox.container.margin 37 | } 38 | 39 | local clock_widget = wibox.widget { 40 | layout = wibox.layout.align.horizontal, 41 | expand = "none", 42 | nil, 43 | { 44 | time_widget, 45 | top = dpi(1), 46 | left = dpi(2), 47 | bottom = dpi(1), 48 | right = dpi(2), 49 | widget = wibox.container.margin 50 | }, 51 | nil, 52 | } 53 | 54 | return clock_widget 55 | -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/dot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/cpubar.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | require('tots.cpu') 10 | 11 | local icon_size = dpi(34) 12 | local bar_size = dpi(200) 13 | 14 | local cpu_icon = wibox.widget.imagebox(beautiful.widget_cpu) 15 | cpu_icon.forced_height = icon_size 16 | cpu_icon.forced_width = icon_size 17 | cpu_icon.resize = true 18 | 19 | local cpu_bar = wibox.widget { 20 | max_value = 100, 21 | forced_height = dpi(10), 22 | margins = { 23 | top = dpi(8), 24 | bottom = dpi(8), 25 | }, 26 | forced_width = dpi(200), 27 | shape = gears.shape.rounded_bar, 28 | bar_shape = gears.shape.rounded_bar, 29 | color = "#FF837D", 30 | background_color = beautiful.stats_bg_color, 31 | border_width = 0, 32 | border_color = beautiful.border_color, 33 | widget = wibox.widget.progressbar, 34 | } 35 | cpu_bar.forced_width = bar_size 36 | cpu_bar.shape = gears.shape.rounded_bar 37 | cpu_bar.bar_shape = gears.shape.rounded_bar 38 | 39 | awesome.connect_signal("tots::cpu", function(value) 40 | cpu_bar.value = tonumber(value) 41 | end) 42 | 43 | local cpu = wibox.widget { 44 | nil, 45 | { 46 | cpu_icon, 47 | cpu_bar, 48 | spacing = dpi(10), 49 | layout = wibox.layout.fixed.horizontal 50 | }, 51 | expand = "none", 52 | layout = wibox.layout.align.horizontal 53 | } 54 | 55 | return cpu 56 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/batbar.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | require('tots.battery') 10 | 11 | local icon_size = dpi(34) 12 | local bar_size = dpi(200) 13 | 14 | local bat_icon = wibox.widget.imagebox(beautiful.widget_bat) 15 | bat_icon.forced_height = icon_size 16 | bat_icon.forced_width = icon_size 17 | bat_icon.resize = true 18 | 19 | local bat_bar = wibox.widget { 20 | max_value = 100, 21 | forced_height = dpi(10), 22 | margins = { 23 | top = dpi(8), 24 | bottom = dpi(8), 25 | }, 26 | forced_width = dpi(200), 27 | shape = gears.shape.rounded_bar, 28 | bar_shape = gears.shape.rounded_bar, 29 | color = "#F8C18C", 30 | background_color = beautiful.stats_bg_color, 31 | border_width = 0, 32 | border_color = beautiful.border_color, 33 | widget = wibox.widget.progressbar 34 | } 35 | bat_bar.forced_width = bar_size 36 | bat_bar.shape = gears.shape.rounded_bar 37 | bat_bar.bar_shape = gears.shape.rounded_bar 38 | 39 | awesome.connect_signal("tots::battery", function(value, status) 40 | bat_bar.value = value 41 | end) 42 | 43 | local bat = wibox.widget { 44 | nil, 45 | { 46 | bat_icon, 47 | bat_bar, 48 | spacing = dpi(10), 49 | layout = wibox.layout.fixed.horizontal 50 | }, 51 | expand = "none", 52 | layout = wibox.layout.align.horizontal 53 | } 54 | 55 | return bat 56 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/rambar.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | require('tots.ram') 10 | 11 | local icon_size = dpi(34) 12 | local bar_size = dpi(200) 13 | 14 | local ram_icon = wibox.widget.imagebox(beautiful.widget_mem) 15 | ram_icon.forced_height = icon_size 16 | ram_icon.forced_width = icon_size 17 | ram_icon.resize = true 18 | 19 | local ram_bar = wibox.widget { 20 | max_value = 100, 21 | forced_height = dpi(10), 22 | margins = { 23 | top = dpi(8), 24 | bottom = dpi(8), 25 | }, 26 | forced_width = dpi(200), 27 | shape = gears.shape.rounded_bar, 28 | bar_shape = gears.shape.rounded_bar, 29 | color = "#E0DA37", 30 | background_color = beautiful.stats_bg_color, 31 | border_width = 0, 32 | border_color = beautiful.border_color, 33 | widget = wibox.widget.progressbar 34 | } 35 | ram_bar.forced_width = bar_size 36 | ram_bar.shape = gears.shape.rounded_bar 37 | ram_bar.bar_shape = gears.shape.rounded_bar 38 | 39 | awesome.connect_signal("tots::ram", function(used, total) 40 | local ram_usage = (used/total) * 100 41 | ram_bar.value = ram_usage 42 | end) 43 | 44 | local ram = wibox.widget { 45 | nil, 46 | { 47 | ram_icon, 48 | ram_bar, 49 | spacing = dpi(10), 50 | layout = wibox.layout.fixed.horizontal 51 | }, 52 | expand = "none", 53 | layout = wibox.layout.align.horizontal 54 | } 55 | 56 | return ram 57 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/timedate.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | local time = require('widgets.slider.damewid') 11 | local date = require('widgets.slider.datewid') 12 | 13 | local clock_widget = wibox.widget { 14 | helpers.vertical_pad(dpi(20)), 15 | { 16 | { 17 | { 18 | { 19 | { 20 | time, 21 | date, 22 | helpers.vertical_pad(dpi(12)), 23 | layout = wibox.layout.fixed.vertical 24 | }, 25 | forced_width = helpers.rrect(beautiful.border_radius), 26 | bg = "#1e1c24"; 27 | widget = wibox.container.background 28 | }, 29 | margins = 5, 30 | widget = wibox.container.margin 31 | }, 32 | id = "border", 33 | bg = "#121018", 34 | shape = helpers.rrect(beautiful.border_radius + 2), 35 | widget = wibox.container.background 36 | }, 37 | forced_width = dpi(400) * 0.85, 38 | left = dpi(20), 39 | right = dpi(20), 40 | bottom = dpi(20), 41 | widget = wibox.container.margin, 42 | }, 43 | layout = wibox.layout.fixed.vertical 44 | } 45 | 46 | clock_widget:connect_signal("mouse::enter", function() 47 | temp_wid:get_children_by_id("border")[1].bg = "#1e1c2f" 48 | end) 49 | clock_widget:connect_signal("mouse::leave", function() 50 | temp_wid:get_children_by_id("border")[1].bg = "#121018" 51 | end) 52 | 53 | return clock_widget 54 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | local slide = require('widgets.slider.slide') 10 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 11 | 12 | slide.x = -380 13 | slide.y = 0 14 | 15 | local panel_anim = awestore.tweened(-395, { 16 | duration = 350, 17 | easing = awestore.easing.circ_in_out 18 | }) 19 | 20 | local strut_anim = awestore.tweened(0, { 21 | duration = 300, 22 | easing = awestore.easing.circ_in_out 23 | }) 24 | 25 | panel_anim:subscribe(function(x) slide.x = x end) 26 | strut_anim:subscribe(function(width) 27 | slide:struts{left = width, right = 0, bottom = 0, top = 0} 28 | end) 29 | 30 | awesome.connect_signal("widgets::slide::toggle", function() 31 | if not slide.visible then 32 | slide.visible = true 33 | strut_anim:set(395) 34 | panel_anim:set(-1 * beautiful.widget_border_width) 35 | else 36 | strut_anim:set(0) 37 | panel_anim:set(-395) 38 | local unsub_strut 39 | unsub_strut = strut_anim.ended:subscribe(function() unsub_strut() end) 40 | local unsub_panel 41 | unsub_panel = panel_anim.ended:subscribe( 42 | function() 43 | slide.visible = false 44 | unsub_panel() 45 | end) 46 | end 47 | 48 | awesome.emit_signal("widgets::slide::status", slide.visible) 49 | end) 50 | -------------------------------------------------------------------------------- /config/eww/scripts/spotat: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function that shows the current artist, track, duration, and status from Spotify using playerctl 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Dependencies: spotify/spotifyd, playerctl 8 | 9 | # NOTE: The official spotify client does not provide the track position or shuffle status through playerctl. This does work through spotifyd however. 10 | 11 | if ps -C spotify > /dev/null; then 12 | PLAYER="spotify" 13 | elif ps -C spotifyd > /dev/null; then 14 | PLAYER="spotifyd" 15 | fi 16 | 17 | if [ "$PLAYER" = "spotify" ] || [ "$PLAYER" = "spotifyd" ]; then 18 | ARTIST=$(playerctl metadata artist) 19 | TRACK=$(playerctl metadata title) 20 | POSITION=$(playerctl position | sed 's/..\{6\}$//') 21 | DURATION=$(playerctl metadata mpris:length | sed 's/.\{6\}$//') 22 | STATUS=$(playerctl -p spotify status) 23 | SHUFFLE=$(playerctl shuffle) 24 | 25 | if [ "$STATUS" = "Playing" ]; then 26 | STATUS="" 27 | else 28 | STATUS="" 29 | fi 30 | 31 | if [ "$SHUFFLE" = "On" ]; then 32 | SHUFFLE=" " 33 | else 34 | SHUFFLE="" 35 | fi 36 | 37 | 38 | if [ "$PLAYER" = "spotify" ]; then 39 | printf "$STATUS" 40 | else 41 | printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" 42 | printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60)) 43 | printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) 44 | printf "%s%s" "$SHUFFLE" "$SEP2" 45 | fi 46 | fi 47 | -------------------------------------------------------------------------------- /config/eww/scripts/getstitle: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function that shows the current artist, track, duration, and status from Spotify using playerctl 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Dependencies: spotify/spotifyd, playerctl 8 | 9 | # NOTE: The official spotify client does not provide the track position or shuffle status through playerctl. This does work through spotifyd however. 10 | 11 | if ps -C spotify > /dev/null; then 12 | PLAYER="spotify" 13 | elif ps -C spotifyd > /dev/null; then 14 | PLAYER="spotifyd" 15 | fi 16 | 17 | if [ "$PLAYER" = "spotify" ] || [ "$PLAYER" = "spotifyd" ]; then 18 | ARTIST=$(playerctl metadata artist) 19 | TRACK=$(playerctl metadata title) 20 | POSITION=$(playerctl position | sed 's/..\{6\}$//') 21 | DURATION=$(playerctl metadata mpris:length | sed 's/.\{6\}$//') 22 | STATUS=$(playerctl -p spotify status) 23 | SHUFFLE=$(playerctl shuffle) 24 | 25 | if [ "$STATUS" = "Playing" ]; then 26 | STATUS="" 27 | else 28 | STATUS="" 29 | fi 30 | 31 | if [ "$SHUFFLE" = "On" ]; then 32 | SHUFFLE=" " 33 | else 34 | SHUFFLE="" 35 | fi 36 | 37 | 38 | if [ "$PLAYER" = "spotify" ]; then 39 | printf "$STATUS" 40 | else 41 | printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" 42 | printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60)) 43 | printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) 44 | printf "%s%s" "$SHUFFLE" "$SEP2" 45 | fi 46 | fi 47 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/volbar.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | require('tots.volume') 10 | 11 | local icon_size = dpi(34) 12 | local bar_size = dpi(200) 13 | 14 | local vol_icon = wibox.widget.imagebox(beautiful.widget_vol) 15 | vol_icon.forced_height = icon_size 16 | vol_icon.forced_width = icon_size 17 | vol_icon.resize = true 18 | 19 | local vol_bar = wibox.widget { 20 | max_value = 100, 21 | forced_height = dpi(10), 22 | margins = { 23 | top = dpi(8), 24 | bottom = dpi(8), 25 | }, 26 | forced_width = dpi(200), 27 | shape = gears.shape.rounded_bar, 28 | bar_shape = gears.shape.rounded_bar, 29 | color = "#9ABEFF", 30 | background_color = beautiful.stats_bg_color, 31 | border_width = 0, 32 | border_color = beautiful.border_color, 33 | widget = wibox.widget.progressbar 34 | } 35 | vol_bar.forced_width = bar_size 36 | vol_bar.shape = gears.shape.rounded_bar 37 | vol_bar.bar_shape = gears.shape.rounded_bar 38 | 39 | awesome.connect_signal("tots::volume", function(volume, muted) 40 | if muted then 41 | fill_color = "#666666" 42 | bg_color = beautiful.stats_bg_color 43 | else 44 | fill_color = "#17C6FF" 45 | bg_color = beautiful.stats_bg_color 46 | end 47 | vol_bar.value = volume 48 | vol_bar.color = fill_color 49 | vol_bar.background_color = bg_color 50 | end) 51 | 52 | local volume = wibox.widget { 53 | nil, 54 | { 55 | vol_icon, 56 | vol_bar, 57 | spacing = dpi(10), 58 | layout = wibox.layout.fixed.horizontal 59 | }, 60 | expand = "none", 61 | layout = wibox.layout.align.horizontal 62 | } 63 | 64 | return volume 65 | -------------------------------------------------------------------------------- /config/awesome/icons/ghosts/ghost.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /config/awesome/bar/systraybox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local mysystray = wibox.widget.systray() 11 | mysystray:set_base_size(beautiful.systray_icon_size) 12 | 13 | local mysystray_container = { 14 | mysystray, 15 | top = dpi(1), 16 | left = dpi(3), 17 | bottom = dpi(3), 18 | right = dpi(1), 19 | widget = wibox.container.margin 20 | } 21 | 22 | local systray_box = function(s, offset) 23 | local offsetx = 0 24 | 25 | if offset == true then 26 | offsetx = dpi(128) 27 | offsety = dpi(5) 28 | end 29 | 30 | local final_systray = wibox.widget { 31 | {mysystray_container, top = dpi(1), layout = wibox.container.margin}, 32 | bg = beautiful.xcolor0, 33 | shape = helpers.rrect(beautiful.border_radius - 3), 34 | widget = wibox.container.background 35 | } 36 | 37 | local systray_flex = { 38 | layout = wibox.layout.flex.horizontal, 39 | max_widget_size = 150, 40 | } 41 | 42 | local panel = wibox ( 43 | { 44 | ontop = false, 45 | screen = s, 46 | height = dpi(24) + beautiful.widget_border_width, 47 | width = dpi(42), 48 | x = dpi(70), 49 | y = s.geometry.y + offsety, 50 | stretch = false, 51 | bg = beautiful.xbackground, 52 | fg = beautiful.xforeground, 53 | opacity = 0.9, 54 | struts = { 55 | top = dpi(24) 56 | } 57 | } 58 | ) 59 | 60 | panel:struts ( 61 | { 62 | top = dpi(0) 63 | } 64 | ) 65 | 66 | panel:setup { 67 | layout = wibox.layout.stack, 68 | nil, 69 | { 70 | awful.widget.only_on_screen(final_systray, screen[1]), 71 | top = dpi(3), 72 | left = dpi(2), 73 | bottom = dpi(3), 74 | right = dpi(2), 75 | widget = wibox.container.margin 76 | }, 77 | nil, 78 | } 79 | 80 | return panel 81 | end 82 | 83 | return systray_box 84 | -------------------------------------------------------------------------------- /config/starship.toml: -------------------------------------------------------------------------------- 1 | # make no new line 2 | add_newline = false 3 | 4 | [battery] 5 | full_symbol = "🔋" 6 | charging_symbol = "🔌" 7 | discharging_symbol = "⚡" 8 | 9 | [[battery.display]] 10 | threshold = 50 11 | style = "bold red" 12 | 13 | [character] 14 | error_symbol = "[✖](bold red) " 15 | 16 | [cmd_duration] 17 | min_time = 10_000 # Show command duration over 10,000 milliseconds (=10 sec) 18 | format = " took [$duration]($style)" 19 | 20 | [directory] 21 | truncation_length = 5 22 | format = "[$path]($style)[$lock_symbol]($lock_style) " 23 | 24 | [git_branch] 25 | format = " [$symbol$branch]($style) " 26 | symbol = "🍣 " 27 | style = "bold yellow" 28 | 29 | [git_commit] 30 | commit_hash_length = 8 31 | style = "bold white" 32 | 33 | [git_state] 34 | progress_divider = " of " 35 | 36 | [git_status] 37 | conflicted = "⚔️ " 38 | ahead = "🏎️ 💨 ×${count}" 39 | behind = "🐢 ×${count}" 40 | diverged = "🔱 🏎️ 💨 ×${ahead_count} 🐢 ×${behind_count}" 41 | untracked = "🛤️ ×${count}" 42 | stashed = "📦 " 43 | modified = "📝 ×${count}" 44 | staged = "🗃️ ×${count}" 45 | renamed = "📛 ×${count}" 46 | deleted = "🗑️ ×${count}" 47 | style = "bright-white" 48 | format = "$all_status$ahead_behind" 49 | 50 | [hostname] 51 | ssh_only = false 52 | format = "<[$hostname]($style)>" 53 | trim_at = "-" 54 | style = "bold dimmed white" 55 | disabled = true 56 | 57 | [julia] 58 | format = "[$symbol$version]($style) " 59 | symbol = "ஃ " 60 | style = "bold green" 61 | 62 | [memory_usage] 63 | format = "$symbol[${ram}( | ${swap})]($style) " 64 | show_percentage = true 65 | show_swap = true 66 | threshold = 70 67 | style = "bold dimmed white" 68 | disabled = false 69 | 70 | [package] 71 | disabled = true 72 | 73 | [python] 74 | format = "[$symbol$version]($style) " 75 | style = "bold green" 76 | 77 | [rust] 78 | format = "[$symbol$version]($style) " 79 | style = "bold green" 80 | 81 | [time] 82 | time_format = "%T" 83 | format = "🕙 $time($style) " 84 | style = "bright-white" 85 | disabled = true 86 | 87 | [username] 88 | style_user = "bold dimmed blue" 89 | show_always = false 90 | -------------------------------------------------------------------------------- /config/awesome/bar/powerbox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require("helpers") 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local power_button = wibox.widget { 11 | { 12 | { 13 | font = beautiful.icon_font, 14 | text = "", 15 | widget = wibox.widget.textbox 16 | }, 17 | left = dpi(7), 18 | right = dpi(7), 19 | widget = wibox.container.margin 20 | }, 21 | bg = beautiful.xbackground, 22 | fg = "#9F59E1", 23 | shape = helpers.rrect(beautiful.border_radius - 3), 24 | widget = wibox.container.background 25 | } 26 | 27 | local power_box = function(s, offset) 28 | local offsetx = 0 29 | 30 | if offset == true then 31 | offsetx = dpi(128) 32 | offsety = dpi(5) 33 | end 34 | 35 | local panel = wibox ( 36 | { 37 | ontop = false, 38 | screen = s, 39 | height = dpi(24) + beautiful.widget_border_width, 40 | width = dpi(30), 41 | x = dpi(30), 42 | y = s.geometry.y + offsety, 43 | strech = false, 44 | bg = beautiful.xbackground .. "0", 45 | opacity = 0.9, 46 | struts = { 47 | top = dpi(24), 48 | bottom = dpi(24) 49 | } 50 | } 51 | ) 52 | 53 | panel:struts ( 54 | { 55 | top = dpi(0) 56 | } 57 | ) 58 | 59 | panel:setup { 60 | layout = wibox.layout.fixed.horizontal, 61 | { 62 | { 63 | power_button, 64 | bg = beautiful.xbackground, 65 | shape = helpers.prrect(dpi(10), true, false, true, false), 66 | widget = wibox.container.background 67 | }, 68 | top = dpi(1), 69 | left = dpi(2), 70 | bottom = dpi(1), 71 | right = dpi(2), 72 | widget = wibox.container.margin 73 | } 74 | } 75 | 76 | return panel 77 | end 78 | 79 | power_button:connect_signal("button::press", function(c, _, _, button) 80 | if button == 1 then 81 | awesome.emit_signal("widgets::down::toggle", mouse.screen) 82 | end 83 | end) 84 | 85 | return power_box 86 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/info.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | 11 | local me = wibox.widget.imagebox(beautiful.info_me) 12 | me.resize = true 13 | me.forced_height = dpi(91) 14 | me.forced_width = dpi(91) 15 | 16 | local information = wibox.widget { 17 | font = "Sarasa UI HC 10", 18 | markup = helpers.colorize_text("A database can't draw conclusions\n - Satoshi", "#8661bc"), 19 | align = 'center', 20 | valign = 'center', 21 | widget = wibox.widget.textbox() 22 | } 23 | 24 | local info = wibox.widget { 25 | { 26 | { 27 | { 28 | me, 29 | information, 30 | widget = wibox.layout.align.horizontal 31 | }, 32 | { 33 | left = dpi(25), 34 | right = dpi(25), 35 | top = dpi(5), 36 | bottom = dpi(5), 37 | widget = wibox.container.margin 38 | }, 39 | widget = wibox.container.background 40 | }, 41 | top = dpi(20), 42 | left = dpi(20), 43 | bottom = dpi(0), 44 | right = dpi(20), 45 | widget = wibox.container.margin 46 | }, 47 | halign = "left", 48 | valign = "left", 49 | widget = wibox.container.place 50 | } 51 | 52 | local info_widget = wibox.widget { 53 | { 54 | { 55 | me, 56 | widget = wibox.container.background 57 | }, 58 | top = dpi(10), 59 | left = dpi(20), 60 | bottom = dpi(1), 61 | widget = wibox.container.margin 62 | }, 63 | { 64 | { 65 | information, 66 | widget = wibox.container.background 67 | }, 68 | top = dpi(1), 69 | bottom = dpi(1), 70 | right = dpi(10), 71 | widget = wibox.container.margin 72 | }, 73 | widget = wibox.layout.fixed.horizontal 74 | } 75 | 76 | return info_widget 77 | -------------------------------------------------------------------------------- /config/awesome/widgets/popdown.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local width = 100 11 | local height = 100 12 | 13 | local time_text = wibox.widget { 14 | font = beautiful.font, 15 | format = "%a %b %d, %H:%M ", 16 | timezone = "Z", 17 | align = 'center', 18 | valign = 'center', 19 | widget = wibox.widget.textclock 20 | } 21 | 22 | time_text.markup = "" .. 23 | time_text.text .. "" 24 | 25 | time_text:connect_signal("widget::redraw_needed", function() 26 | time_text.markup = "" .. 27 | time_text.text .. "" 28 | end) 29 | 30 | local date_widget = {time_text, layout = wibox.layout.fixed.vertical} 31 | date_widget.font = beautiful.font_name .. "55" 32 | 33 | local clock = wibox.widget { 34 | { 35 | date_widget, 36 | layout = wibox.layout.align.vertical 37 | }, 38 | top = dpi(5), 39 | left = dpi(5), 40 | bottom = dpi(5), 41 | right = dpi(5), 42 | widget = wibox.container.margin 43 | } 44 | 45 | local widget_container = wibox.widget { 46 | { 47 | clock, 48 | left = dpi(15), 49 | right = dpi(15), 50 | top = dpi(10), 51 | bottom = dpi(10), 52 | widget = wibox.container.margin 53 | }, 54 | forced_height = height, 55 | forced_width = width, 56 | layout = wibox.layout.fixed.vertical 57 | } 58 | 59 | local widget_bg = wibox.widget { 60 | widget_container, 61 | bg = beautiful.xbackground, 62 | border_color = beautiful.xcolor4, 63 | border_with = dpi(beautiful.widget_border_width), 64 | shape = helpers.prrect(dpi(25), false, false, false, false), 65 | widget = wibox.container.background 66 | } 67 | 68 | local popup_widget = awful.popup({ 69 | widget = {widget_bg, widget = wibox.container.margin}, 70 | visible = false, 71 | ontop = true, 72 | type = "dock", 73 | bg = beautiful.xbackground .. "00" 74 | }) 75 | 76 | return popup_widget 77 | -------------------------------------------------------------------------------- /config/awesome/bar/datebox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require("helpers") 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local time_text = wibox.widget { 11 | font = beautiful.font, 12 | format = "%a %b %d, %H:%M ", 13 | timezone = "Z", 14 | align = 'center', 15 | valign = 'center', 16 | widget = wibox.widget.textclock 17 | } 18 | 19 | time_text.markup = "" .. 20 | time_text.text .. "" 21 | 22 | time_text:connect_signal("widget::redraw_needed", function() 23 | time_text.markup = "" .. 24 | time_text.text .. "" 25 | end) 26 | 27 | local time_pill = wibox.widget { 28 | { 29 | helpers.horizontal_pad(5), 30 | {time_text, top = dpi(1), widget = wibox.container.margin}, 31 | layout = wibox.layout.fixed.horizontal 32 | }, 33 | left = dpi(6), 34 | right = dpi(5), 35 | widget = wibox.container.margin 36 | } 37 | 38 | local date_box = function(s, offset) 39 | local offsetx = 0 40 | 41 | if offset == true then 42 | offsetx = dpi(128) 43 | offsety = dpi(5) 44 | end 45 | 46 | local panel = wibox ( 47 | { 48 | ontop = false, 49 | type = "desktop", 50 | screen = s, 51 | height = dpi(24) + beautiful.widget_border_width, 52 | width = dpi(130), 53 | x = s.geometry.width - dpi(160), 54 | y = s.geometry.y + offsety, 55 | strech = false, 56 | bg = beautiful.xbackground .. "1", 57 | fg = beautiful.xforeground, 58 | opacity = 0.9 59 | } 60 | ) 61 | 62 | panel:struts ( 63 | { 64 | top = dpi(0) 65 | } 66 | ) 67 | 68 | panel:setup { 69 | layout = wibox.layout.fixed.horizontal, 70 | widget = wibox.container.background, 71 | { 72 | { 73 | time_pill, 74 | bg = beautiful.xbackground, 75 | shape = helpers.prrect(dpi(10), true, false, true, false), 76 | widget = wibox.container.background 77 | }, 78 | top = dpi(1), 79 | left = dpi(2), 80 | bottom = dpi(1), 81 | right = dpi(2), 82 | widget = wibox.container.margin 83 | } 84 | } 85 | 86 | return panel 87 | end 88 | 89 | return date_box 90 | -------------------------------------------------------------------------------- /config/awesome/bar/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local bling = require('bling') 6 | local date_box = require('bar.datebox') 7 | local tag_box = require('bar.tagbox') 8 | local util_box = require('bar.utilbox') 9 | local systray_box = require('bar.systraybox') 10 | local task_box = require('bar.taskbox') 11 | local spoti_box = require('bar.spotibox') 12 | 13 | awful.screen.connect_for_each_screen ( 14 | function(s) 15 | if s.index == 1 then 16 | s.date_box = date_box(s, true) 17 | s.tag_box = tag_box(s, true) 18 | s.util_box = util_box(s, true) 19 | s.task_box = task_box(s, true) 20 | s.spoti_box = spoti_box(s, true) 21 | else 22 | s.date_box = date_box(s, false) 23 | s.tag_box = tag_box(s, false) 24 | s.util_box = util_box(s, false) 25 | s.task_box = task_box(s, false) 26 | s.spoti_box = spoti_box(s, false) 27 | end 28 | end 29 | ) 30 | 31 | for s in screen do 32 | screen[s]:connect_signal("arrange", function () 33 | local clients = awful.client.visible(s) 34 | local layout = awful.layout.getname(awful.layout.get(s)) 35 | 36 | if #clients <= 0 then 37 | s.task_box.visible = false 38 | else 39 | s.task_box.visible = true 40 | end 41 | end) 42 | end 43 | 44 | function updateBarsVisibility() 45 | for s in screen do 46 | if s.selected_tag then 47 | local fullscreen = s.selected_tag.fullscreenMode 48 | 49 | s.date_box.visible = not fullscreen 50 | s.tag_box.visible = not fullscreen 51 | s.util_box.visible = not fullscreen 52 | s.task_box.visible = not fullscreen 53 | s.spoti_box.visible = not fullscreen 54 | 55 | end 56 | end 57 | end 58 | 59 | _G.tag.connect_signal( 60 | 'property::selected', 61 | function(t) 62 | updateBarsVisibility() 63 | end 64 | ) 65 | 66 | _G.client.connect_signal( 67 | 'property::fullscreen', 68 | function(c) 69 | c.screen.selected_tag.fullscreenMode = c.fullscreen 70 | updateBarsVisibility() 71 | end 72 | ) 73 | 74 | _G.client.connect_signal( 75 | 'unmanage', 76 | function(c) 77 | if c.fullscreen then 78 | c.screen.selected_tag.fullscreenMode = false 79 | updateBarsVisibility() 80 | end 81 | end 82 | ) 83 | -------------------------------------------------------------------------------- /config/awesome/widgets/laylist.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local width = 280 11 | local height = 200 12 | 13 | local layout_box = awful.widget.layoutlist { 14 | source = awful.widget.layoutlist.source.default_layouts, -- DOC_HIDE 15 | spacing = dpi(20), 16 | base_layout = wibox.widget { 17 | spacing = dpi(20), 18 | forced_num_cols = 3, 19 | layout = wibox.layout.grid.vertical 20 | }, 21 | widget_template = { 22 | { 23 | { 24 | id = 'icon_role', 25 | forced_height = dpi(60), 26 | forced_width = dpi(60), 27 | widget = wibox.widget.imagebox 28 | }, 29 | margins = dpi(20), 30 | widget = wibox.container.margin 31 | }, 32 | id = 'background_role', 33 | forced_width = dpi(60), 34 | forced_height = dpi(60), 35 | widget = wibox.container.background 36 | } 37 | } 38 | 39 | local opt_widget = wibox.widget { 40 | { 41 | layout_box, 42 | layout = wibox.layout.align.horizontal 43 | }, 44 | top = dpi(5), 45 | left = dpi(10), 46 | bottom = dpi(5), 47 | right = dpi(10), 48 | widget = wibox.container.margin 49 | } 50 | 51 | local widget_container = wibox.widget { 52 | { 53 | { 54 | sym_widget, 55 | fg = beautiful.xcolor0, 56 | widget = wibox.container.background 57 | }, 58 | top = dpi(10), 59 | bottom = dpi(10), 60 | widget = wibox.container.margin 61 | }, 62 | { 63 | { 64 | opt_widget, 65 | fg = "#D5BAB3", 66 | bg = beautiful.xcolor0, 67 | shape = helpers.prrect(beautiful.border_radius - 3, true, false, true, false), 68 | widget = wibox.container.background 69 | }, 70 | left = dpi(35), 71 | right = dpi(40), 72 | top = dpi(10), 73 | bottom = dpi(10), 74 | widget = wibox.container.margin 75 | }, 76 | forced_height = height, 77 | forced_width = width, 78 | widget = wibox.layout.fixed.vertical 79 | } 80 | 81 | local widget_bg = wibox.widget { 82 | { 83 | { 84 | widget_container, 85 | fg = beautiful.xcolor10, 86 | bg = "#47526C", 87 | shape = helpers.rrect(beautiful.border_radius - 3), 88 | widget = wibox.container.background 89 | }, 90 | top = dpi(15), 91 | left = dpi(15), 92 | bottom = dpi(15), 93 | right = dpi(15), 94 | widget = wibox.container.margin 95 | }, 96 | bg = beautiful.xbackground, 97 | border_color = beautiful.xcolor4, 98 | border_with = dpi(beautiful.widget_border_width), 99 | shape = helpers.prrect(dpi(25), false, true, true, false), 100 | widget = wibox.container.background 101 | } 102 | 103 | local popup_widget = awful.popup ({ 104 | widget = {widget_bg, widget = wibox.container.margin}, 105 | visible = false, 106 | ontop = true, 107 | type = "dock", 108 | bg = beautiful.xbackground .. "00" 109 | }) 110 | 111 | return popup_widget 112 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/weather.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | require("tots.weather") 11 | 12 | local weather_fg = "#F8C18C" 13 | local temp_fg = "#F8C18C" 14 | local dashboard_width = dpi(400) 15 | local dashboard_border_width = 5 16 | 17 | local function create_half_box(heading, body) 18 | local temp_wid = wibox.widget { 19 | { 20 | { 21 | { 22 | { 23 | nil, 24 | { 25 | helpers.vertical_pad(dpi(10)), 26 | heading, 27 | body, 28 | helpers.vertical_pad(dpi(13)), 29 | layout = wibox.layout.fixed.vertical 30 | }, 31 | nil, 32 | layout = wibox.layout.align.vertical 33 | }, 34 | bg = secondary_bg, 35 | shape = helpers.rrect(beautiful.corner_radius), 36 | forced_width = (dashboard_width * 0.85 - dpi(10) - 4 * dashboard_border_width) / 2, 37 | widget = wibox.container.background 38 | }, 39 | margins = dashboard_border_width, 40 | widget = wibox.container.margin 41 | }, 42 | id = "border", 43 | bg = "#1e1c24", 44 | shape = helpers.rrect(beautiful.border_radius + dashboard_border_width / 2), 45 | widget = wibox.container.background 46 | }, 47 | left = dpi(20), 48 | bottom = dpi(20), 49 | widget = wibox.container.margin 50 | } 51 | return temp_wid 52 | end 53 | 54 | local weather_heading = wibox.widget({ 55 | align = "center", 56 | valign = "center", 57 | font = small_font, 58 | markup = helpers.colorize_text("?", temp_fg), 59 | widget = wibox.widget.textbox() 60 | }) 61 | 62 | local weather_info = wibox.widget({ 63 | align = "center", 64 | valign = "center", 65 | font = "Sarasa UI HC 20", 66 | markup = helpers.colorize_text(" Temperature\nIRL", weather_fg), 67 | widget = wibox.widget.textbox() 68 | }) 69 | 70 | awesome.connect_signal("tots::weather", function(temp, wind, emoji) 71 | weather_heading.markup = helpers.colorize_text(tostring(temp) .. "°C", weather_fg) 72 | weather_info.markup = helpers.colorize_text(" Temperature\nIRL (" .. tostring(wind) .. "km/h wind)", weather_fg) 73 | end) 74 | 75 | local weather_widget = wibox.widget { 76 | layout = wibox.layout.align.horizontal, 77 | expand = "none", 78 | nil, 79 | { 80 | create_half_box(weather_heading, weather_widget), 81 | top = dpi(1), 82 | left = dpi(2), 83 | bottom = dpi(1), 84 | right = dpi(2), 85 | widget = wibox.container.margin 86 | }, 87 | nil, 88 | } 89 | 90 | return weather_widget 91 | -------------------------------------------------------------------------------- /config/picom.conf: -------------------------------------------------------------------------------- 1 | ################################# 2 | # Shadows # 3 | ################################# 4 | 5 | shadow = true; 6 | shadow-radius = 35; 7 | shadow-opacity = .75; 8 | shadow-offset-x = -40; 9 | shadow-offset-y = -20; 10 | shadow-ignore-shaped = false; 11 | shadow-exclude = [ 12 | "name = 'cpt_frame_window'", 13 | "class_g = 'zoom'", 14 | "class_g = 'Peek'", 15 | "class_g = 'awesome'", 16 | "_NET_WM_WINDOW_TYPE:a = '_NET_WM_WINDOW_TYPE_NOTIFICATION'", 17 | "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", 18 | "_GTK_FRAME_EXTENTS@:c" 19 | ]; 20 | 21 | 22 | ################################# 23 | # Fading # 24 | ################################# 25 | 26 | fading = false 27 | fade-in-step = 0.03; 28 | fade-out-step = 0.03; 29 | fade-delta = 3 30 | 31 | fade-exclude = [] 32 | 33 | 34 | ################################# 35 | # Transparency / Opacity # 36 | ################################# 37 | 38 | inactive-opacity = 1; 39 | frame-opacity = 1; 40 | inactive-opacity-override = false; 41 | focus-exclude = [ "class_g = 'Cairo-clock'" ]; 42 | opacity-rule = [ 43 | "10:class_g = 'eww-blur_full'" 44 | ]; 45 | 46 | 47 | ################################# 48 | # Background-Blurring # 49 | ################################# 50 | 51 | blur: { 52 | method = "dual_kawase"; 53 | strength = 5.0; 54 | deviation = 1.0; 55 | kernel = "11x11gaussian"; 56 | } 57 | 58 | blur-background = true; 59 | blur-background-frame = true; 60 | blur-background-fixed = true; 61 | 62 | blur-background-exclude = [ 63 | "class_g = 'slop'", 64 | "class_g = 'Firefox' && argb", 65 | "class_g = 'brave-browser'", 66 | "class_g = 'zoom'", 67 | "class_g = 'Peek'", 68 | "class_g = 'awesome'", 69 | "class_g = 'kitty'", 70 | "_GTK_FRAME_EXTENTS@:c" 71 | ]; 72 | 73 | ################################# 74 | # Corners # 75 | ################################# 76 | # corner-radius = 7; 77 | rounded-corners-exclude = [ 78 | #"window_type = 'normal'", 79 | "class_g = 'Rofi'", 80 | "name = 'Notification area'", 81 | "class_g = 'Polybar'", 82 | "class_g = 'code-oss'", 83 | "class_g = 'firefox'", 84 | "class_g = 'Thunderbird'", 85 | "class_g = 'awesome'", 86 | "class_g = 'dwm'" 87 | ]; 88 | round-borders = 1; 89 | round-borders-exclude = [ 90 | "class_g = 'awesome'", 91 | ]; 92 | 93 | round-borders-rule = [ 94 | "3:class_g = 'XTerm'", 95 | "3:class_g = 'URxvt'", 96 | "3:class_g = 'Alacritty'", 97 | "3:class_g = 'kitty'", 98 | "3:class_g = 'brave-browser'", 99 | "15:class_g = 'Signal'" 100 | ]; 101 | 102 | 103 | ################################# 104 | # General Settings # 105 | ################################# 106 | 107 | backend = "glx"; 108 | vsync = true; 109 | 110 | mark-wmwin-focused = true; 111 | mark-ovredir-focused = true; 112 | detect-rounded-corners = true; 113 | detect-client-opacity = true; 114 | refresh-rate = 0; 115 | detect-transient = true; 116 | detect-client-leader = true; 117 | use-damage = true; 118 | 119 | log-level = "warn"; 120 | 121 | wintypes: 122 | { 123 | tooltip = { fade = true; shadow = true; focus = true; }; 124 | menu = { full-shadow = true;}; 125 | popup_menu = { full-shadow = true;}; 126 | utility = {full-shadow = true;}; 127 | toolbar = {full-shadow = true;}; 128 | normal = {full-shadow = true;}; 129 | notification = {full-shadow = true;}; 130 | dialog = {full-shadow = true}; 131 | dock = {shadow = false;}; 132 | }; 133 | -------------------------------------------------------------------------------- /config/awesome/bar/utilbox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require("helpers") 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local power_button = wibox.widget { 11 | { 12 | { 13 | font = beautiful.icon_font, 14 | text = "", 15 | widget = wibox.widget.textbox 16 | }, 17 | left = dpi(3), 18 | right = dpi(3), 19 | widget = wibox.container.margin 20 | }, 21 | bg = beautiful.xbackground, 22 | fg = "#D6D8DC", 23 | shape = helpers.rrect(beautiful.border_radius - 3), 24 | widget = wibox.container.background 25 | } 26 | 27 | local reboot_button = wibox.widget { 28 | { 29 | { 30 | font = beautiful.icon_font, 31 | text = "", 32 | widget = wibox.widget.textbox 33 | }, 34 | left = dpi(3), 35 | right = dpi(3), 36 | widget = wibox.container.margin 37 | }, 38 | bg = beautiful.xbackground, 39 | fg = "#D6D8DC", 40 | shape = helpers.rrect(beautiful.border_radius - 3), 41 | widget = wibox.container.background 42 | } 43 | 44 | local lay_rrent = wibox.widget { 45 | { 46 | { 47 | awful.widget.layoutbox(s), 48 | layout = wibox.layout.fixed.horizontal 49 | }, 50 | top = dpi(1), 51 | left = dpi(3), 52 | bottom = dpi(1), 53 | right = dpi(3), 54 | widget = wibox.container.margin 55 | }, 56 | bg = beautiful.xbackground, 57 | fg = "#9F59E1", 58 | shape = helpers.rrect(beautiful.border_radius - 3), 59 | widget = wibox.container.background 60 | } 61 | 62 | lay_rrent:buttons(gears.table.join( 63 | awful.button({ }, 1, function () awful.layout.inc( 1) end), 64 | awful.button({ }, 3, function () awesome.emit_signal("widgets::ll::toggle", mouse.screen) end))) 65 | 66 | power_widget = wibox.widget{ power_button, layout = wibox.layout.align.horizontal } 67 | reboot_widget = wibox.widget{ reboot_button, layout = wibox.layout.align.horizontal } 68 | layout_widget = wibox.widget{ lay_rrent, layout = wibox.layout.align.horizontal } 69 | 70 | local sym_widget = wibox.widget { 71 | { 72 | power_widget, 73 | reboot_widget, 74 | layout_widget, 75 | layout = wibox.layout.align.horizontal 76 | }, 77 | top = dpi(5), 78 | left = dpi(5), 79 | bottom = dpi(5), 80 | right = dpi(5), 81 | widget = wibox.container.margin 82 | } 83 | 84 | local util_box = function(s, offset) 85 | local offsetx = 0 86 | 87 | if offset == true then 88 | offsetx = dpi(128) 89 | offsety = dpi(5) 90 | end 91 | 92 | local panel = wibox ( 93 | { 94 | ontop = false, 95 | screen = s, 96 | height = dpi(24) + beautiful.widget_border_width, 97 | width = dpi(70), 98 | x = dpi(30), 99 | y = s.geometry.y + offsety, 100 | strech = false, 101 | bg = beautiful.xbackground .. "0", 102 | opacity = 0.9, 103 | struts = { 104 | top = dpi(24), 105 | bottom = dpi(24) 106 | } 107 | } 108 | ) 109 | 110 | panel:struts ( 111 | { 112 | top = dpi(0) 113 | } 114 | ) 115 | 116 | panel:setup { 117 | layout = wibox.layout.fixed.horizontal, 118 | { 119 | { 120 | sym_widget, 121 | bg = beautiful.xbackground, 122 | shape = helpers.prrect(dpi(10), true, false, true, false), 123 | widget = wibox.container.background 124 | }, 125 | top = dpi(1), 126 | left = dpi(2), 127 | bottom = dpi(1), 128 | right = dpi(2), 129 | widget = wibox.container.margin 130 | } 131 | } 132 | 133 | return panel 134 | end 135 | 136 | power_button:connect_signal("button::press", function(c, _, _, button) 137 | if button == 1 then 138 | awesome.emit_signal("widgets::down::toggle", mouse.screen) 139 | end 140 | end) 141 | 142 | reboot_button:connect_signal("button::press", function(c, _, _, button) 143 | if button == 1 then 144 | awesome.emit_signal("widgets::boot::toggle", mouse.screen) 145 | end 146 | end) 147 | 148 | return util_box 149 | -------------------------------------------------------------------------------- /config/awesome/bar/taskbox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local tasklist_buttons = gears.table.join( 11 | awful.button({ }, 1, function (c) 12 | if c == client.focus then 13 | c.minimized = true 14 | else 15 | c:emit_signal( 16 | "request::activate", 17 | "tasklist", 18 | {raise = true} 19 | ) 20 | end 21 | end), 22 | awful.button({ }, 3, function() 23 | awful.menu.client_list({ theme = { width = 250 } }) 24 | end), 25 | awful.button({ }, 4, function () 26 | awful.client.focus.byidx(1) 27 | end), 28 | awful.button({ }, 5, function () 29 | awful.client.focus.byidx(-1) 30 | end)) 31 | 32 | local task_box = function(s, offset) 33 | local offsetx = 0 34 | 35 | if offset == true then 36 | offsetx = dpi(128) 37 | offsety = dpi(5) 38 | end 39 | 40 | local mytasklist = awful.widget.tasklist { 41 | screen = s, 42 | filter = awful.widget.tasklist.filter.focused, 43 | buttons = tasklist_buttons, 44 | style = { 45 | shape_border_width = 1, 46 | shape = empty, 47 | fg_normal = "#EDA59B", 48 | fg_focus = "#EDA59B", 49 | }, 50 | layout = { 51 | spacing = 10, 52 | spacing_widget = { 53 | { 54 | forced_width = 5, 55 | shape = gears.shape.circle, 56 | widget = wibox.widget.separator 57 | }, 58 | valign = 'center', 59 | halign = 'center', 60 | widget = wibox.container.place, 61 | }, 62 | layout = wibox.layout.flex.horizontal 63 | }, 64 | } 65 | 66 | local task_pill = wibox.widget { 67 | { 68 | {mytasklist, top = dpi(1), widget = wibox.container.margin}, 69 | layout = wibox.layout.fixed.horizontal 70 | }, 71 | left = dpi(5), 72 | right = dpi(5), 73 | widget = wibox.container.margin 74 | } 75 | 76 | local panel = wibox ( 77 | { 78 | ontop = false, 79 | screen = s, 80 | height = dpi(24) + beautiful.widget_border_width, 81 | width = dpi(400), 82 | x = s.geometry.width - dpi(1150), 83 | y = s.geometry.y + offsety, 84 | strech = false, 85 | bg = beautiful.xbackground .. "0", 86 | fg = beautiful.xforeground, 87 | opacity = 0.9, 88 | struts = { 89 | top = dpi(24) 90 | } 91 | } 92 | ) 93 | 94 | panel:struts ( 95 | { 96 | top = dpi(0) 97 | } 98 | ) 99 | 100 | panel:setup { 101 | layout = wibox.layout.align.horizontal, 102 | expand = "none", 103 | { 104 | layout = wibox.layout.fixed.horizontal, 105 | nil, 106 | }, 107 | { 108 | { 109 | task_pill, 110 | bg = "#121018", 111 | shape = helpers.prrect(dpi(10), true, false, true, false), 112 | widget = wibox.container.background 113 | }, 114 | top = dpi(1), 115 | left = dpi(2), 116 | bottom = dpi(1), 117 | right = dpi(2), 118 | widget = wibox.container.margin 119 | }, 120 | { 121 | layout = wibox.layout.fixed.horizontal, 122 | nil, 123 | } 124 | } 125 | 126 | return panel 127 | end 128 | 129 | return task_box 130 | -------------------------------------------------------------------------------- /config/awesome/widgets/rebootpop.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local dpi = require('beautiful').xresources.apply_dpi 8 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 9 | 10 | local width = 200 11 | local height = 150 12 | 13 | local power_button = wibox.widget ({ 14 | align = 'center', 15 | valign = 'center', 16 | font = beautiful.wid_font, 17 | text = "", 18 | widget = wibox.widget.textbox() 19 | }) 20 | 21 | power_button.markup = "".. 22 | power_button.text .. "".. 22 | power_button.text .. "' 94 | 95 | song_artist.markup = '' .. 96 | artist .. '' 97 | end) 98 | 99 | local spoti_pill = wibox.widget { 100 | { 101 | {playerctl_bar, top = dpi(1), widget = wibox.container.margin}, 102 | layout = wibox.layout.fixed.horizontal 103 | }, 104 | left = dpi(5), 105 | right = dpi(5), 106 | widget = wibox.container.margin 107 | } 108 | 109 | local spoti_box = function(s, offset) 110 | local offsetx = 0 111 | 112 | if offset == true then 113 | offsetx = dpi(128) 114 | offsety = dpi(5) 115 | end 116 | 117 | local panel = wibox ( 118 | { 119 | ontop = false, 120 | screen = s, 121 | height = dpi(24) + beautiful.widget_border_width, 122 | width = dpi(300), 123 | x = dpi(100), 124 | y = s.geometry.y + offsety, 125 | strech = false, 126 | bg = beautiful.xbackground .. "0", 127 | fg = beautiful.xforeground, 128 | opacity = 0.9, 129 | struts = { 130 | top = dpi(24) 131 | } 132 | } 133 | ) 134 | 135 | panel:struts ( 136 | { 137 | top = dpi(0) 138 | } 139 | ) 140 | 141 | panel:setup { 142 | layout = wibox.layout.fixed.horizontal, 143 | { 144 | { 145 | spoti_pill, 146 | bg = beautiful.xbackground, 147 | shape = helpers.prrect(dpi(10), true, false, true, false), 148 | widget = wibox.container.background 149 | }, 150 | top = dpi(1), 151 | left = dpi(2), 152 | bottom = dpi(1), 153 | right = dpi(2), 154 | widget = wibox.container.margin 155 | }, 156 | } 157 | 158 | return panel 159 | end 160 | 161 | return spoti_box 162 | -------------------------------------------------------------------------------- /config/awesome/tots/modbat.lua: -------------------------------------------------------------------------------- 1 | local upower = require("lgi").require("UPowerGlib") 2 | 3 | local gtable = require "gears.table" 4 | local gtimer = require "gears.timer" 5 | local wbase = require "wibox.widget.base" 6 | 7 | local setmetatable = setmetatable -- luacheck: ignore setmetatable 8 | local screen = screen -- luacheck: ignore screen 9 | 10 | local battery_widget = {} 11 | local mt = {} 12 | 13 | --- Helper to get the path of all connected power devices. 14 | -- @treturn table The list of all power devices path. 15 | -- @staticfct battery_widget.list_devices 16 | function battery_widget.list_devices() 17 | local ret = {} 18 | local devices = upower.Client():get_devices() 19 | 20 | for _, d in ipairs(devices) do 21 | table.insert(ret, d:get_object_path()) 22 | end 23 | 24 | return ret 25 | end 26 | 27 | --- Helper function to get a device instance from its path. 28 | -- @tparam string path The path of the device to get. 29 | -- @treturn UPowerGlib.Device|nil The device if it was found, `nil` otherwise. 30 | -- @staticfct battery_widget.get_device 31 | function battery_widget.get_device(path) 32 | local devices = upower.Client():get_devices() 33 | 34 | for _, d in ipairs(devices) do 35 | if d:get_object_path() == path then 36 | return d 37 | end 38 | end 39 | 40 | return nil 41 | end 42 | 43 | --- Helper function to easily get the default BAT0 device path without. 44 | -- @treturn string The BAT0 device path. 45 | -- @staticfct battery_widget.get_BAT0_device_path 46 | function battery_widget.get_BAT0_device_path() 47 | local bat0_path = "/org/freedesktop/UPower/devices/battery_BAT0" 48 | return bat0_path 49 | end 50 | 51 | --- Helper function to convert seconds into a human readable clock string. 52 | -- 53 | -- This translates the given seconds parameter into a human readable string 54 | -- following the notation `HH:MM` (where HH is the number of hours and MM the 55 | -- number of minutes). 56 | -- @tparam number seconds The umber of seconds to translate. 57 | -- @treturn string The human readable generated clock string. 58 | -- @staticfct battery_widget.to_clock 59 | function battery_widget.to_clock(seconds) 60 | if seconds <= 0 then 61 | return "00:00" 62 | else 63 | local hours = string.format("%02.f", math.floor(seconds / 3600)) 64 | local mins = string.format("%02.f", math.floor(seconds / 60 - hours * 60)) 65 | return hours .. ":" .. mins 66 | end 67 | end 68 | 69 | --- Gives the default widget to use if user didn't specify one. 70 | -- The default widget used is an `empty_widget` instance. 71 | -- @treturn widget The default widget to use. 72 | local function default_template() 73 | return wbase.empty_widget() 74 | end 75 | 76 | --- The device monitored by the widget. 77 | -- @property device 78 | -- @tparam UPowerGlib.Device device 79 | 80 | --- Emited when the UPower device notify an update. 81 | -- @signal upower::update 82 | -- @tparam battery_widget widget The widget. 83 | -- @tparam UPowerGlib.Device device The Upower device. 84 | 85 | --- battery_widget constructor. 86 | -- 87 | -- This function creates a new `battery_widget` instance. This widget watches 88 | -- the `display_device` status and report. 89 | -- @tparam table args The arguments table. 90 | -- @tparam[opt=1] screen|number args.screen the widget's screen. 91 | -- @tparam[opt] widget args.widget_template The widget template to use to 92 | -- create the widget instance. 93 | -- @tparam[opt] function args.create_callback User defined callback for the 94 | -- widget initialization. 95 | -- @tparam[opt] string args.device_path Path of the device to monitor. 96 | -- @tparam[opt=false] boolean args.use_display_device Should the widget monitor 97 | -- the _display device_? 98 | -- @tparam[opt] boolean args.instant_update Call an update cycle right after the 99 | -- widget creation. 100 | -- @treturn battery_widget The battery_widget instance build. 101 | -- @constructorfct battery_widget.new 102 | function battery_widget.new(args) 103 | args = 104 | gtable.crush( 105 | { 106 | widget_template = default_template(), 107 | create_callback = nil, 108 | device_path = "", 109 | use_display_device = false 110 | }, 111 | args or {} 112 | ) 113 | args.screen = screen[args.screen or 1] 114 | 115 | local widget = wbase.make_widget_from_value(args.widget_template) 116 | 117 | widget.device = 118 | args.use_display_device and upower.Client():get_display_device() or battery_widget.get_device(args.device_path) 119 | 120 | if type(args.create_callback) == "function" then 121 | args.create_callback(widget, widget.device) 122 | end 123 | 124 | -- Attach signals: 125 | widget.device.on_notify = function(d) 126 | widget:emit_signal("upower::update", d) 127 | end 128 | 129 | -- Call an update cycle if the user asked to instan update the widget. 130 | if args.instant_update then 131 | gtimer.delayed_call(widget.emit_signal, widget, "upower::update", widget.device) 132 | end 133 | 134 | return widget 135 | end 136 | 137 | function mt.__call(self, ...) 138 | return battery_widget.new(...) 139 | end 140 | 141 | return setmetatable(battery_widget, mt) 142 | 143 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/slide.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | 7 | local time = require('widgets.slider.damewid') 8 | local date = require('widgets.slider.datewid') 9 | local player = require('widgets.slider.player') 10 | local cpu = require('widgets.slider.cpubar') 11 | local ram = require('widgets.slider.rambar') 12 | local volume = require('widgets.slider.volbar') 13 | local battery = require('widgets.slider.batbar') 14 | local info = require('widgets.slider.info') 15 | 16 | local dpi = require('beautiful').xresources.apply_dpi 17 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 18 | 19 | local width = 380 20 | local height = 1080 21 | 22 | local clock_widget = wibox.widget { 23 | { 24 | { 25 | time, 26 | align = "center", 27 | valign = "center", 28 | widget = wibox.container.background 29 | }, 30 | top = dpi(15), 31 | bottom = dpi(1), 32 | widget = wibox.container.margin 33 | }, 34 | { 35 | { 36 | date, 37 | align = "center", 38 | valign = "center", 39 | widget = wibox.container.background 40 | }, 41 | top = dpi(1), 42 | bottom = dpi(1), 43 | widget = wibox.container.margin 44 | }, 45 | forced_height = 150, 46 | widget = wibox.layout.fixed.vertical 47 | } 48 | 49 | local info_widget = wibox.widget { 50 | { 51 | { 52 | info, 53 | widget = wibox.container.background 54 | }, 55 | top = dpi(1), 56 | bottom = dpi(1), 57 | widget = wibox.container.margin 58 | }, 59 | widget = wibox.layout.fixed.vertical 60 | } 61 | 62 | local empty_widget = wibox.widget { 63 | { 64 | { 65 | widget = wibox.container.background 66 | }, 67 | top = dpi(1), 68 | bottom = dpi(1), 69 | widget = wibox.container.margin 70 | }, 71 | forced_height = dpi(2); 72 | widget = wibox.layout.fixed.vertical 73 | } 74 | 75 | local ress = wibox.widget { 76 | { 77 | { 78 | cpu, 79 | align = "center", 80 | valign = "center", 81 | widget = wibox.container.background 82 | }, 83 | top = dpi(15), 84 | bottom = dpi(1), 85 | widget = wibox.container.margin 86 | }, 87 | { 88 | { 89 | ram, 90 | align = "center", 91 | valign = "center", 92 | widget = wibox.container.background 93 | }, 94 | top = dpi(1), 95 | bottom = dpi(1), 96 | widget = wibox.container.margin 97 | }, 98 | { 99 | { 100 | volume, 101 | align = "center", 102 | valign = "center", 103 | widget = wibox.container.background 104 | }, 105 | top = dpi(1), 106 | bottom = dpi(1), 107 | widget = wibox.container.margin 108 | }, 109 | { 110 | { 111 | battery, 112 | align = "center", 113 | valign = "center", 114 | widget = wibox.container.background 115 | }, 116 | top = dpi(1), 117 | bottom = dpi(1), 118 | widget = wibox.container.margin 119 | }, 120 | forced_height = dpi(170), 121 | widget = wibox.layout.fixed.vertical 122 | } 123 | 124 | local widget_container = wibox.widget { 125 | { 126 | { 127 | clock_widget, 128 | bg = "#1e1c24", 129 | shape = helpers.rrect(dpi(5)), 130 | widget = wibox.container.background 131 | }, 132 | top = dpi(250), 133 | left = dpi(15), 134 | bottom = dpi(10), 135 | right = dpi(15), 136 | widget = wibox.container.margin 137 | }, 138 | { 139 | { 140 | empty_widget, 141 | bg = "#1e1c24", 142 | shape = helpers.rrect(dpi(5)), 143 | widget = wibox.container.background 144 | }, 145 | top = dpi(10), 146 | left = dpi(15), 147 | bottom = dpi(10), 148 | right = dpi(15), 149 | widget = wibox.container.margin 150 | }, 151 | { 152 | { 153 | ress, 154 | bg = "#1e1c24", 155 | shape = helpers.rrect(dpi(5)), 156 | widget = wibox.container.background 157 | }, 158 | top = dpi(10), 159 | left = dpi(15), 160 | bottom = dpi(10), 161 | right = dpi(15), 162 | widget = wibox.container.margin 163 | }, 164 | { 165 | { 166 | empty_widget, 167 | bg = "#1e1c24", 168 | shape = helpers.rrect(dpi(5)), 169 | widget = wibox.container.background 170 | }, 171 | top = dpi(10), 172 | left = dpi(15), 173 | bottom = dpi(10), 174 | right = dpi(15), 175 | widget = wibox.container.margin 176 | }, 177 | { 178 | { 179 | info_widget, 180 | bg = "#1e1c24", 181 | shape = helpers.rrect(dpi(5)), 182 | widget = wibox.container.background 183 | }, 184 | top = dpi(10), 185 | left = dpi(15), 186 | bottom = dpi(10), 187 | right = dpi(15), 188 | widget = wibox.container.margin 189 | }, 190 | forced_height = height, 191 | forced_width = width, 192 | widget = wibox.layout.fixed.vertical 193 | } 194 | 195 | local widget_bg = wibox.widget { 196 | { 197 | { 198 | widget_container, 199 | bg = "#121018", 200 | border_color = beautiful.xcolor4, 201 | border_width = dpi(beautiful.widget_border_width), 202 | shape = helpers.rrect(dpi(15)), 203 | widget = wibox.container.background 204 | }, 205 | top = dpi(20), 206 | widget = wibox.container.margin 207 | }, 208 | bg = beautiful.xbackground, 209 | shape = helpers.prrect(dpi(25), false, false, false, false), 210 | widget = wibox.container.background 211 | } 212 | 213 | local popup_widget = awful.popup ({ 214 | widget = {widget_bg, widget = wibox.container.margin}, 215 | visible = false, 216 | ontop = true, 217 | type = "dock", 218 | bg = beautiful.xbackground .. "00" 219 | }) 220 | 221 | return popup_widget 222 | -------------------------------------------------------------------------------- /config/awesome/widgets/init.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local gears = require('gears') 4 | local wibox = require('wibox') 5 | local helpers = require('helpers') 6 | local awestore = require('modules.awestore') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | local start = require('widgets.popdown') 10 | local down = require('widgets.shutdown') 11 | local boot = require('widgets.rebootpop') 12 | local ll = require('widgets.laylist') 13 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 14 | 15 | start.x = -100 16 | start.y = 300 17 | 18 | local panel_anim = awestore.tweened(-101, { 19 | duration = 350, 20 | easing = awestore.easing.circ_in_out 21 | }) 22 | 23 | local strut_anim = awestore.tweened(0, { 24 | duration = 300, 25 | easing = awestore.easing.circ_in_out 26 | }) 27 | 28 | panel_anim:subscribe(function(x) start.x = x end) 29 | strut_anim:subscribe(function(width) 30 | start:struts{left = width, right = 0, bottom = 0, top = 0} 31 | end) 32 | 33 | awesome.connect_signal("widgets::start::toggle", function() 34 | if not start.visible then 35 | start.visible = true 36 | strut_anim:set(101) 37 | panel_anim:set(-1 * beautiful.widget_border_width) 38 | else 39 | strut_anim:set(0) 40 | panel_anim:set(-451) 41 | local unsub_strut 42 | unsub_strut = strut_anim.ended:subscribe(function() unsub_strut() end) 43 | local unsub_panel 44 | unsub_panel = panel_anim.ended:subscribe( 45 | function() 46 | start.visible = false 47 | unsub_panel() 48 | end) 49 | end 50 | 51 | awesome.emit_signal("widgets::start::status", start.visible) 52 | end) 53 | 54 | down.x = -200 55 | down.y = 40 56 | 57 | local shutdown_anim = awestore.tweened(-201, { 58 | duration = 350, 59 | easing = awestore.easing.circ_in_out 60 | }) 61 | 62 | local down_strut_anim = awestore.tweened(0, { 63 | duration = 300, 64 | easing = awestore.easing.circ_in_out 65 | }) 66 | 67 | shutdown_anim:subscribe(function(x) down.x = x end) 68 | down_strut_anim:subscribe(function(width) 69 | down:struts{left = width, right = 0, bottom = 0, top = 0} 70 | end) 71 | 72 | awesome.connect_signal("widgets::down::toggle", function() 73 | if not down.visible then 74 | down.visible = true 75 | boot.visible = false 76 | ll.visible = false 77 | down_strut_anim:set(201) 78 | shutdown_anim:set(-1 * beautiful.widget_border_width) 79 | else 80 | down_strut_anim:set(0) 81 | shutdown_anim:set(-201) 82 | local unsub_strut 83 | unsub_strut = down_strut_anim.ended:subscribe(function() unsub_strut() end) 84 | local unsub_panel 85 | unsub_panel = shutdown_anim.ended:subscribe( 86 | function() 87 | down.visible = false 88 | unsub_panel() 89 | end) 90 | end 91 | 92 | awesome.emit_signal("widgets::down::status", down.visible) 93 | end) 94 | 95 | boot.x = -200 96 | boot.y = 40 97 | 98 | local reboot_anim = awestore.tweened(-201, { 99 | duration = 350, 100 | easing = awestore.easing.circ_in_out 101 | }) 102 | 103 | local boot_strut_anim = awestore.tweened(0, { 104 | duration = 300, 105 | easing = awestore.easing.circ_in_out 106 | }) 107 | 108 | reboot_anim:subscribe(function(x) boot.x = x end) 109 | boot_strut_anim:subscribe(function(width) 110 | boot:struts{left = width, right = 0, bottom = 0, top = 0} 111 | end) 112 | 113 | awesome.connect_signal("widgets::boot::toggle", function() 114 | if not boot.visible then 115 | boot.visible = true 116 | down.visible = false 117 | ll.visible = false 118 | boot_strut_anim:set(201) 119 | reboot_anim:set(-1 * beautiful.widget_border_width) 120 | else 121 | boot_strut_anim:set(0) 122 | reboot_anim:set(-201) 123 | local unsub_strut 124 | unsub_strut = down_strut_anim.ended:subscribe(function() unsub_strut() end) 125 | local unsub_panel 126 | unsub_panel = reboot_anim.ended:subscribe( 127 | function() 128 | boot.visible = false 129 | unsub_panel() 130 | end) 131 | end 132 | 133 | awesome.emit_signal("widgets::boot::status", boot.visible) 134 | end) 135 | 136 | ll.x = -280 137 | ll.y = 40 138 | 139 | local ll_anim = awestore.tweened(-281, { 140 | duration = 350, 141 | easing = awestore.easing.circ_in_out 142 | }) 143 | 144 | local ll_strut_anim = awestore.tweened(0, { 145 | duration = 300, 146 | easing = awestore.easing.circ_in_out 147 | }) 148 | 149 | ll_anim:subscribe(function(x) ll.x = x end) 150 | ll_strut_anim:subscribe(function(width) 151 | ll:struts{left = width, right = 0, bottom = 0, top = 0} 152 | end) 153 | 154 | awesome.connect_signal("widgets::ll::toggle", function() 155 | if not ll.visible then 156 | boot.visible = false 157 | down.visible = false 158 | ll.visible = true 159 | ll_strut_anim:set(281) 160 | ll_anim:set(-1 * beautiful.widget_border_width) 161 | else 162 | ll_strut_anim:set(0) 163 | ll_anim:set(-281) 164 | local unsub_strut 165 | unsub_strut = ll_strut_anim.ended:subscribe(function() unsub_strut() end) 166 | local unsub_panel 167 | unsub_panel = ll_anim.ended:subscribe( 168 | function() 169 | ll.visible = false 170 | unsub_panel() 171 | end) 172 | end 173 | 174 | awesome.emit_signal("widgets:ll::status", ll.visible) 175 | end) 176 | -------------------------------------------------------------------------------- /config/eww/eww.scss: -------------------------------------------------------------------------------- 1 | * { 2 | all: unset; 3 | } 4 | 5 | window { 6 | background-color: #0D1119; 7 | color: #ffd5cd; 8 | font-family: Sarasa Fixed K; 9 | border-radius: 10px; 10 | } 11 | 12 | .time-side { 13 | margin: 20px 65px 0px 65px; 14 | font-size: 60px; 15 | } 16 | 17 | .day-side { 18 | font-size: 16px; 19 | font-weight: bold; 20 | color: #90c861; 21 | } 22 | 23 | .min-side { 24 | color: #d35d6e; 25 | } 26 | 27 | .sliders-info slider { 28 | all: unset; 29 | color: #ffd5cd; 30 | } 31 | 32 | .slide-vol { 33 | margin-top: 10px; 34 | } 35 | 36 | .slide-vol scale trough highlight { 37 | all: unset; 38 | background-color: #752FAD; 39 | color: #000000; 40 | border-radius: 10px; 41 | } 42 | 43 | .slider-mem scale trough highlight { 44 | all: unset; 45 | background-color: #2F6CAD; 46 | color: #000000; 47 | border-radius: 10px; 48 | } 49 | 50 | .slider-cpu scale trough highlight { 51 | all: unset; 52 | background-color: #2F9AAD; 53 | color: #000000; 54 | border-radius: 10px; 55 | } 56 | 57 | .slider-bat scale trough highlight { 58 | all: unset; 59 | background-color: #2FAD8E; 60 | color: #000000; 61 | border-radius: 10px; 62 | } 63 | 64 | .slide-vol scale trough { 65 | all: unset; 66 | background-color: #4e4e4e; 67 | border-radius: 50px; 68 | min-height: 5px; 69 | min-width: 200px; 70 | margin-top: 10px; 71 | margin-left: 20px; 72 | } 73 | 74 | .slider-mem scale trough { 75 | all: unset; 76 | background-color: #4e4e4e; 77 | border-radius: 50px; 78 | min-height: 5px; 79 | min-width: 200px; 80 | margin-top: 10px; 81 | margin-left: 17px; 82 | } 83 | 84 | .slider-cpu scale trough { 85 | all: unset; 86 | background-color: #4e4e4e; 87 | border-radius: 50px; 88 | min-height: 5px; 89 | min-width: 200px; 90 | margin-top: 10px; 91 | margin-left: 17px; 92 | } 93 | 94 | .slider-bat scale trough { 95 | all: unset; 96 | background-color: #4e4e4e; 97 | border-radius: 50px; 98 | min-height: 5px; 99 | min-width: 200px; 100 | margin-top: 10px; 101 | margin-left: 17px; 102 | } 103 | 104 | .label-vol { 105 | color: #5F76AB; 106 | } 107 | 108 | .label-mem { 109 | color: #4F6BAD; 110 | } 111 | 112 | .label-cpu { 113 | color: #3F5FAD; 114 | } 115 | 116 | .label-bat { 117 | color: #2F55AD; 118 | } 119 | 120 | .label-vol, .label-mem, .label-cpu, .label-bat { 121 | margin-top: 10px; 122 | font-family: Iosevka FT; 123 | margin-left: 35px; 124 | font-size: 35px; 125 | } 126 | 127 | .slider-bat { 128 | margin-bottom: 10px; 129 | } 130 | 131 | .pic { 132 | background-image: url("/home/xhandler/.config/eww/images/pic2.png"); 133 | background-repeat: no-repeat; 134 | background-size: 200px; 135 | min-height: 200px; 136 | min-width: 200px; 137 | margin: 40px 10px 0px 30px; 138 | border-radius: 500px; 139 | } 140 | 141 | .pictext { 142 | margin: 20px 10px 0px 30px; 143 | color: #9F03CF; 144 | font-size: 36px; 145 | } 146 | 147 | .subpictext { 148 | margin: 0px 10px 0px 35px; 149 | color: #844E94; 150 | font-size: 24px; 151 | } 152 | 153 | .fetch-info { 154 | margin-top: 40px; 155 | font-size: 30px; 156 | } 157 | 158 | .fetch-info box { 159 | padding-bottom: 12px; 160 | } 161 | 162 | .os-title { 163 | color: #7633D7; 164 | } 165 | 166 | .os-val { 167 | color: #4D425E; 168 | } 169 | 170 | .ker-title { 171 | color: #672DBD; 172 | } 173 | 174 | .ker-val { 175 | color: #5F5073; 176 | } 177 | 178 | .uptime-title { 179 | color: #57269E; 180 | } 181 | 182 | .uptime-val { 183 | color: #6A5A82; 184 | } 185 | 186 | .pkgs-title { 187 | color: #4A2188; 188 | } 189 | 190 | .pkgs-val { 191 | color: #7B6896; 192 | } 193 | 194 | .wm-title { 195 | color: #391968; 196 | } 197 | 198 | .wm-val { 199 | color: #836FA0; 200 | } 201 | 202 | .power-off { 203 | font-size: 60px; 204 | color: #9314CC; 205 | } 206 | 207 | .reboot { 208 | font-size: 60px; 209 | color: #A348CC; 210 | } 211 | 212 | .logout { 213 | font-size: 60px; 214 | color: #B071CC; 215 | } 216 | 217 | .power-off:hover, .reboot:hover, .logout:hover { 218 | background-color: #2E3135; 219 | } 220 | 221 | .closeall { 222 | font-size: 60px; 223 | color: #823A93; 224 | } 225 | 226 | .closeall:hover { 227 | background-color: #2E3135 228 | } 229 | 230 | .reload { 231 | font-size: 60px; 232 | color: #d35d6e; 233 | } 234 | 235 | .reload:hover { 236 | color: #ffd5cd; 237 | } 238 | 239 | .b1, .b2, .b3, .b4, .b5, .b6, .b7 { 240 | margin: 10px 30px 0px 30px; 241 | font-size: 50px; 242 | font-weight: 600; 243 | } 244 | 245 | .sep { 246 | margin: 10px 5px 0px 5px; 247 | font-size: 12px; 248 | color: #ffd5cd; 249 | } 250 | 251 | .b1 { 252 | color: #B08DCF; 253 | } 254 | 255 | .b2 { 256 | color: #A26FCF; 257 | } 258 | 259 | .b3 { 260 | color: #9551CF; 261 | } 262 | 263 | .b4 { 264 | color: #8A3ACF; 265 | } 266 | 267 | .b5 { 268 | color: #7E20CF; 269 | } 270 | 271 | .b6 { 272 | color: #7915CF; 273 | } 274 | 275 | .b7 { 276 | color: #7103CF; 277 | } 278 | 279 | .title { 280 | color: #AB6DCF; 281 | font-size: 16px; 282 | margin-top: 25px; 283 | font-weight: bold; 284 | border-radius: 10px; 285 | min-width: 40px; 286 | } 287 | 288 | .artist { 289 | color: #935EB2; 290 | font-size: 14px; 291 | margin-top: 5px; 292 | font-weight: bold; 293 | border-radius: 10px; 294 | min-width: 40px; 295 | } 296 | 297 | .musicbtn { 298 | margin-top: 5px; 299 | margin-left: 30px; 300 | } 301 | 302 | .musicbtn button { 303 | font-size: 20px; 304 | margin-right: 30px; 305 | } 306 | 307 | .pause-play { 308 | color: #4E619D; 309 | } 310 | 311 | .prev, .next { 312 | color: #4E619D; 313 | } 314 | 315 | .pause-play:hover, .prev:hover, .next:hover { 316 | color: #933A83; 317 | } 318 | 319 | .art { 320 | background-repeat: no-repeat; 321 | background-size: 80px; 322 | min-height: 70px; 323 | min-width: 80px; 324 | margin: 15px; 325 | border-radius: 6px; 326 | } 327 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/player.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local wibox = require('wibox') 3 | local beautiful = require('beautiful') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | local bling = require('bling') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | 11 | local img = wibox.widget { 12 | image = gears.surface.load_uncached(gears.filesystem.get_configuration_dir() .. "icons/no_music.png"), 13 | resize = true, 14 | forced_height = dpi(100), 15 | widget = wibox.widget.imagebox 16 | } 17 | 18 | local title_widget = wibox.widget { 19 | font = "Sarasa Fixed K 15", 20 | markup = 'No Title', 21 | align = 'center', 22 | valign = 'center', 23 | ellipsize = 'middle', 24 | forced_height = dpi(25), 25 | widget = wibox.widget.textbox 26 | } 27 | 28 | local artist_widget = wibox.widget { 29 | font = "Sarasa Fixed K 10", 30 | markup = 'No Artist', 31 | align = 'center', 32 | valign = 'center', 33 | ellipsize = 'center', 34 | forced_height = dpi(20), 35 | widget = wibox.widget.textbox 36 | } 37 | 38 | bling.signal.playerctl.enable() 39 | awesome.connect_signal("bling::playerctl::title_artist_album", 40 | function(title, artist, image) 41 | title_widget:set_markup_silently('' .. title .. '') 42 | artist_widget:set_markup_silently('' .. artist .. '') 43 | img:set_image(gears.surface.load_uncached(image)) 44 | end) 45 | 46 | local play_cmd = function() awful.spawn.with_shell("playerctl play-pause") end 47 | local prev_cmd = function() awful.spawn.with_shell("playerctl previous") end 48 | local next_cmd = function() awful.spawn.with_shell("playerctl next") end 49 | 50 | local play_icon = wibox.widget { 51 | markup = helpers.colorize_text("", beautiful.xcolor4), 52 | font = beautiful.icon_font_name .. "15", 53 | align = 'center', 54 | valign = 'center', 55 | widget = wibox.widget.textbox() 56 | } 57 | 58 | local play_sym = wibox.widget { 59 | play_icon, 60 | forced_height = dpi(15), 61 | forced_width = dpi(15), 62 | widget = wibox.container.background 63 | } 64 | 65 | awesome.connect_signal("bling::playerctl::status", function(playing) 66 | if playing then 67 | play_icon.markup = helpers.colorize_text("", beautiful.xcolor4) 68 | else 69 | play_icon.markup = helpers.colorize_text("", beautiful.xcolor4) 70 | end 71 | end) 72 | 73 | play_sym:buttons(gears.table.join( 74 | awful.button({}, 1, function() play_cmd() end))) 75 | play_sym:connect_signal("mouse::enter", function() 76 | play_icon.markup = helpers.colorize_text(play_icon.text, beautiful.xforeground) 77 | end) 78 | play_sym:connect_signal("mouse::leave", function() 79 | play_icon.markup = helpers.colorize_text(play_icon.text, beautiful.xcolor4) 80 | end) 81 | 82 | local prev_icon = wibox.widget { 83 | markup = helpers.colorize_text("", beautiful.xcolor4), 84 | font = beautiful.icon_font_name .. "15", 85 | align = 'center', 86 | valign = 'center', 87 | widget = wibox.widget.textbox() 88 | } 89 | 90 | local prev_sym = wibox.widget { 91 | prev_icon, 92 | forced_height = dpi(15), 93 | forced_width = dpi(15), 94 | widget = wibox.container.background 95 | } 96 | 97 | prev_sym:buttons(gears.table.join( 98 | awful.button({}, 1, function() prev_cmd() end))) 99 | prev_sym:connect_signal("mouse::enter", function() 100 | prev_icon.markup = helpers.colorize_text(prev_icon.text, beautiful.xforeground) 101 | end) 102 | prev_sym:connect_signal("mouse::leave", function() 103 | prev_icon.markup = helpers.colorize_text(prev_icon.text, beautiful.xcolor4) 104 | end) 105 | 106 | local next_icon = wibox.widget { 107 | markup = helpers.colorize_text("", beautiful.xcolor4), 108 | font = beautiful.icon_font_name .. "15", 109 | align = 'center', 110 | valign = 'center', 111 | widget = wibox.widget.textbox() 112 | } 113 | 114 | local next_sym = wibox.widget { 115 | next_icon, 116 | forced_height = dpi(15), 117 | forced_width = dpi(15), 118 | widget = wibox.container.background 119 | } 120 | 121 | next_sym:buttons(gears.table.join( 122 | awful.button({}, 1, function() next_cmd() end))) 123 | next_sym:connect_signal("mouse::enter", function() 124 | next_icon.markup = helpers.colorize_text(next_icon.text, beautiful.xforeground) 125 | end) 126 | next_sym:connect_signal("mouse::leave", function() 127 | next_icon.markup = helpers.colorize_text(next_icon.text, beautiful.xcolor4) 128 | end) 129 | 130 | local slider = wibox.widget { 131 | forced_height = dpi(10), 132 | bar_shape = gears.shape.rounded_bar, 133 | shape = gears.shape.rounded_bar, 134 | background_color = beautiful.stats_bg_color, 135 | color = "#AE9895", 136 | value = 25, 137 | max_value = 100, 138 | widget = wibox.widget.progressbar 139 | } 140 | 141 | awesome.connect_signal("bling::playerctl::position", function(pos, length) 142 | slider.value = (pos/length) * 100 143 | end) 144 | 145 | local player = wibox.widget { 146 | layout = wibox.layout.align.horizontal, 147 | expand = "none", 148 | nil, 149 | { 150 | { 151 | { 152 | { 153 | { 154 | title_widget, 155 | artist_widget, 156 | layout = wibox.layout.fixed.vertical 157 | }, 158 | top = 10, 159 | left = 25, 160 | right = 25, 161 | widget = wibox.container.margin 162 | }, 163 | { 164 | nil, 165 | { 166 | { 167 | prev_sym, 168 | play_sym, 169 | next_sym, 170 | spacing = dpi(40), 171 | layout = wibox.layout.fixed.horizontal 172 | }, 173 | top = dpi(10), 174 | left = 25, 175 | right = 25, 176 | widget = wibox.container.margin 177 | }, 178 | nil, 179 | expand = "none", 180 | layout = wibox.layout.align.horizontal 181 | }, 182 | layout = wibox.layout.align.vertical 183 | }, 184 | top = dpi(0), 185 | bottom = dpi(10), 186 | widget = wibox.container.margin 187 | }, 188 | forced_height = 100, 189 | layout = wibox.layout.align.vertical 190 | }, 191 | nil 192 | } 193 | 194 | return { 195 | player, 196 | shape = helpers.rrect(beautiful.client_radius), 197 | widget = wibox.container.background 198 | } 199 | -------------------------------------------------------------------------------- /config/awesome/bar/tagbox.lua: -------------------------------------------------------------------------------- 1 | local awful = require('awful') 2 | local beautiful = require('beautiful') 3 | local wibox = require('wibox') 4 | local gears = require('gears') 5 | local helpers = require('helpers') 6 | local bling = require('bling') 7 | 8 | local dpi = require('beautiful').xresources.apply_dpi 9 | beautiful.init(gears.filesystem.get_configuration_dir() .. "deftheme.lua") 10 | 11 | local taglist_buttons = gears.table.join( 12 | awful.button({ }, 1, function(t) t:view_only() end), 13 | awful.button({ modkey }, 1, function(t) 14 | if client.focus then 15 | client.focus:move_to_tag(t) 16 | end 17 | end), 18 | awful.button({ }, 3, awful.tag.viewtoggle), 19 | awful.button({ modkey }, 3, function(t) 20 | if client.focus then 21 | client.focus:toggle_tag(t) 22 | end 23 | end), 24 | awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), 25 | awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) 26 | ) 27 | 28 | local tag_box = function(s, offset) 29 | local offsetx = 0 30 | 31 | if offset == true then 32 | offsetx = dpi(128) 33 | offsety = dpi(5) 34 | end 35 | 36 | local gfs = gears.filesystem 37 | local ghost = gears.surface.load_uncached( 38 | gfs.get_configuration_dir() .. "icons/ghosts/ghost.png") 39 | local ghost_icon = gears.color.recolor_image(ghost, "#F8C18C") 40 | local dot = gears.surface.load_uncached( 41 | gfs.get_configuration_dir() .. "icons/ghosts/dot.png") 42 | local dot_icon = gears.color.recolor_image(dot, "#2c2c4b") 43 | local pacman = gears.surface.load_uncached( 44 | gfs.get_configuration_dir() .. "icons/ghosts/pacman.png") 45 | local pacman_icon = gears.color.recolor_image(pacman, "#97DB99") 46 | 47 | local update_tags = function(self, c3) 48 | local imgbox = self:get_children_by_id('icon_role')[1] 49 | if c3.selected then 50 | imgbox.image = pacman_icon 51 | elseif #c3:clients() == 0 then 52 | imgbox.image = dot_icon 53 | else 54 | imgbox.image = ghost_icon 55 | end 56 | end 57 | 58 | local taglist = awful.widget.taglist { 59 | screen = s, 60 | filter = awful.widget.taglist.filter.all, 61 | buttons = taglist_buttons, 62 | shape = {shape = gears.shape.rectangle}, 63 | style = { 64 | shape = empty, 65 | fg_normal = "#a5c1d1", 66 | fg_focus = "#5068A2", 67 | bg_normal = beautiful.xbackground, 68 | bg_focus = beautiful.xbackground, 69 | }, 70 | widget_template = { 71 | { 72 | {id = 'icon_role', widget = wibox.widget.imagebox}, 73 | id = 'margin_role', 74 | top = dpi(7), 75 | bottom = dpi(7), 76 | left = dpi(5), 77 | right = dpi(5), 78 | widget = wibox.container.margin 79 | }, 80 | id = 'background_role', 81 | widget = wibox.container.background, 82 | create_callback = function(self, c3, index, objects) 83 | update_tags(self, c3) 84 | self:connect_signal('mouse::enter', function() 85 | if #c3:clients() > 0 then 86 | awesome.emit_signal("bling::tag_preview::update", c3) 87 | awesome.emit_signal("bling::tag_preview::visibility", s, 88 | true) 89 | end 90 | if self.bg ~= beautiful.xbackground .. "60" then 91 | self.backup = self.bg 92 | self.has_backup = true 93 | end 94 | self.bg = beautiful.xbackground .. "60" 95 | end) 96 | self:connect_signal('mouse::leave', function() 97 | awesome.emit_signal("bling::tag_preview::visibility", s, 98 | false) 99 | if self.has_backup then 100 | self.bg = self.backup 101 | end 102 | end) 103 | end, 104 | update_callback = function(self, c3, index, objects) 105 | update_tags(self, c3) 106 | end 107 | }, 108 | } 109 | 110 | local taglist_pill = wibox.widget { 111 | { 112 | {taglist, top = dpi(1), widget = wibox.container.margin}, 113 | layout = wibox.layout.fixed.horizontal 114 | }, 115 | left = dpi(5), 116 | right = dpi(5), 117 | widget = wibox.container.margin 118 | } 119 | 120 | local panel = wibox ( 121 | { 122 | ontop = false, 123 | screen = s, 124 | height = dpi(24) + beautiful.widget_border_width, 125 | width = dpi(130), 126 | x = s.geometry.width - dpi(300), 127 | y = s.geometry.y + offsety, 128 | strech = false, 129 | bg = beautiful.xbackground .. "0", 130 | fg = beautiful.xforeground, 131 | opacity = 0.9, 132 | struts = { 133 | top = dpi(24), 134 | bottom = dpi(24) 135 | } 136 | } 137 | ) 138 | 139 | panel:struts ( 140 | { 141 | top = dpi(0) 142 | } 143 | ) 144 | 145 | panel:setup { 146 | layout = wibox.layout.fixed.horizontal, 147 | widget = wibox.container.background, 148 | { 149 | { 150 | taglist_pill, 151 | bg = beautiful.xbackground, 152 | shape = helpers.prrect(dpi(10), true, false, true, false), 153 | widget = wibox.container.background 154 | }, 155 | top = dpi(1), 156 | widget = wibox.container.margin 157 | } 158 | } 159 | 160 | return panel 161 | end 162 | 163 | return tag_box 164 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/spoter/utils.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local gears = require("gears") 3 | local beautiful = require("beautiful") 4 | local wibox = require("wibox") 5 | local padding_font = beautiful.padding_font 6 | local lfs_exists, lfs = pcall(require, "lfs") -- let's not crash like crazy if there's no `luafilesystem` module 7 | local naughty = require("naughty") 8 | 9 | local utils = {} 10 | 11 | -- TODO: actually separate this file. The name is garbage, it's not specific, 12 | -- and a bunch of this stuff should be separate files. 13 | 14 | -- Create rounded rectangle shape 15 | utils.rrect = function(radius) 16 | return function(cr, width, height) 17 | gears.shape.rounded_rect(cr, width, height, radius) 18 | --gears.shape.octogon(cr, width, height, radius) 19 | --gears.shape.rounded_bar(cr, width, height) 20 | end 21 | end 22 | 23 | utils.rounded_bar = function(width, height) 24 | return function(cr, width, height) 25 | gears.shape.rounded_bar(cr, width, height) 26 | end 27 | end 28 | 29 | utils.bubble = function(radius) 30 | return function(cr, width, height) 31 | gears.shape.circle(cr, radius, radius) 32 | end 33 | end 34 | 35 | utils.prrect = function(radius, tl, tr, br, bl) 36 | return function(cr, width, height) 37 | gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, radius) 38 | end 39 | end 40 | 41 | utils.center_layout = function(widget, valign) 42 | valign = "center" or valign 43 | return { 44 | layout = wibox.container.place, 45 | { 46 | widget = widget, 47 | }, 48 | } 49 | end 50 | 51 | -- Create info bubble shape 52 | -- TODO 53 | -- utils.infobubble = function(radius) 54 | -- return function(cr, width, height) 55 | -- gears.shape.infobubble(cr, width, height, radius) 56 | -- end 57 | -- end 58 | 59 | -- Create rectangle shape 60 | utils.rect = function() 61 | return function(cr, width, height) 62 | gears.shape.rectangle(cr, width, height) 63 | end 64 | end 65 | 66 | function utils.colorize_text(txt, fg) 67 | return "" .. txt .. "" 68 | end 69 | 70 | function utils.client_menu_toggle() 71 | local instance = nil 72 | 73 | return function () 74 | if instance and instance.wibox.visible then 75 | instance:hide() 76 | instance = nil 77 | else 78 | instance = awful.menu.clients({ theme = { width = 250 } }) 79 | end 80 | end 81 | end 82 | 83 | function utils.pad_height(size) 84 | local str = "" 85 | for i=1, size do 86 | str = str .. " \n" 87 | end 88 | local pad = wibox.widget({ 89 | font = beautiful.padding_font, 90 | widget = wibox.widget.textbox(str) 91 | }) 92 | return pad 93 | end 94 | 95 | function utils.pad_width(size) 96 | local str = "" 97 | for i = 1, size do 98 | str = str .. " " 99 | end 100 | local pad = wibox.widget({ 101 | font = beautiful.padding_font, 102 | widget = wibox.widget.textbox(str), 103 | }) 104 | return pad 105 | end 106 | 107 | function utils.relative_position(c, direction, margin) 108 | local workarea = awful.screen.focused().workarea 109 | local client_geometry = c:geometry() 110 | if direction == "top" then 111 | c:geometry({ nil, y = workarea.y + margin * 2, nil, nil }) 112 | elseif direction == "bottom" then 113 | c:geometry({ nil, y = workarea.height + workarea.y - client_geometry.height - margin * 2 - beautiful.border_width * 2, nil, nil }) 114 | elseif direction == "left" then 115 | c:geometry({ x = workarea.x + margin * 2, nil, nil, nil }) 116 | elseif direction == "right" then 117 | c:geometry({ x = workarea.width + workarea.x - client_geometry.width - margin * 2 - beautiful.border_width * 2, nil, nil, nil }) 118 | end 119 | collectgarbage() 120 | end 121 | 122 | function utils.create_titlebar(c, titlebar_buttons, titlebar_position, titlebar_size) 123 | awful.titlebar(c, {font = beautiful.titlebar_font, position = titlebar_position, size = titlebar_size}) : setup { 124 | { 125 | buttons = titlebar_buttons, 126 | layout = wibox.layout.fixed.horizontal 127 | }, 128 | { 129 | buttons = titlebar_buttons, 130 | layout = wibox.layout.fixed.horizontal 131 | }, 132 | { 133 | buttons = titlebar_buttons, 134 | layout = wibox.layout.fixed.horizontal 135 | }, 136 | layout = wibox.layout.align.horizontal 137 | } 138 | end 139 | 140 | 141 | local double_tap_timer = nil 142 | function utils.check_double_tap(double_tap_function) 143 | if double_tap_timer then 144 | ouble_tap_timer:stop() 145 | double_tap_timer = nil 146 | double_tap_function() 147 | -- naughty.notify({text = "We got a double tap"}) 148 | return 149 | end 150 | 151 | double_tap_timer = gears.timer.start_new(0.20, function() 152 | double_tap_timer = nil 153 | return false -- false so the timer doesn't restart automatically 154 | end) 155 | end 156 | 157 | -- @DESCRIPTION: 158 | -- recursively get all filenames that are not directories from a specified path, 159 | -- and put them in `storage_place` 160 | -- @param `storage_place`, table: the table in which to store the found filenames 161 | -- @param `path`, the path from which to begin the search 162 | if lfs_exists then 163 | function utils.get_files_recursively(storage_place, path) 164 | 165 | local path = path 166 | 167 | -- lets make sure we have a separator at the end 168 | if string.sub(path, -1, -1) ~= "/" then 169 | path = path .. '/' 170 | end 171 | 172 | -- now let's recursively get all of the files in this diretory 173 | for file in lfs.dir(path) do 174 | if file ~= '.' and file ~= '..' then 175 | local full_path_entity = path .. tostring(file) 176 | 177 | -- if it's a dir, recursively go in it 178 | if lfs.attributes(full_path_entity, "mode") == "directory" then 179 | utils.get_files_recursively(storage_place, full_path_entity) 180 | 181 | -- if it's a file, put its name in the `files` table 182 | elseif lfs.attributes(full_path_entity, "mode") == "file" then 183 | table.insert(storage_place, tostring(file)) 184 | end 185 | end 186 | end 187 | end 188 | end 189 | 190 | return utils 191 | d 192 | -------------------------------------------------------------------------------- /config/awesome/modules/awestore.lua: -------------------------------------------------------------------------------- 1 | package.preload["awestore.easing"]=function()local a;local b,c,d;local e,f,g;local h,i,j;local k,l,m;local n,o,p;local q,r,s;local t,u,v;local w,x,y;local z,A,B;local C,D,E;a=function(F)return F end;b=function(F)local G=1.70158*1.525;F=F*2;if F<1 then return 0.5*F*F*((G+1)*F-G)end;F=F-2;return 0.5*(F*F*((G+1)*F+G)+2)end;c=function(F)local G=1.70158;return F*F*((G+1)*F-G)end;d=function(F)local G=1.70158;F=F-1;return F*F*((G+1)*F+G)+1 end;e=function(F)return F<0.5 and 0.5*(1.0-g(1.0-F*2.0))or 0.5*g(F*2.0-1.0)+0.5 end;f=function(F)return 1.0-g(1.0-F)end;g=function(F)local H=4.0/11.0;local I=8.0/11.0;local J=9.0/10.0;local K=4356.0/361.0;local L=35442.0/1805.0;local M=16061.0/1805.0;local N=F*F;return Far.duration then Z=a2;W:set(a2)av:fire()ax:stop()ax=nil;return end;Z=a5(ar.easing(aC/ar.duration))W:set(Z)end}end;function self:subscribe(a5)return W:subscribe(a5)end;function self:subscribe_next(a5)return W:subscribe_next(a5)end;function self:subscribe_once(a5)return W:subscribe_once(a5)end;function self:get()return W:get()end;function self:initial()return as end;function self:last()return at end;function self:monitor(a5)return ag.monitor(self,a5)end;function self:derive(a5)return ag.derived(self,a5)end;function self:filter(a5)return ag.filtered(self,a5)end;return self end;return ak end;local ag=require("awestore.core")local ah=require("awestore.easing")local ak=require("awestore.tweened")return{derived=ag.derived,easing=ah,filtered=ag.filtered,monitored=ag.monitored,readable=ag.readable,signal=ag.signal,store=ag.store,subscribe=ag.subscribe,tweened=ak,writable=ag.writable} 2 | -------------------------------------------------------------------------------- /config/awesome/deftheme.lua: -------------------------------------------------------------------------------- 1 | --------------------------- 2 | -- Default awesome theme -- 3 | --------------------------- 4 | 5 | local theme_assets = require("beautiful.theme_assets") 6 | local xresources = require("beautiful.xresources") 7 | local dpi = xresources.apply_dpi 8 | 9 | local gfs = require("gears.filesystem") 10 | local themes_path = gfs.get_themes_dir() 11 | 12 | local theme = {} 13 | 14 | theme.font_name = "Sarasa Fixed K" 15 | theme.font = "Sarasa Fixed K 9" 16 | 17 | theme.useless_gap = dpi(20) 18 | theme.border_width = dpi(2) 19 | theme.border_normal = "#0E0D15" 20 | theme.border_focus = "#0E0D15" 21 | theme.border_marked = "#a5c1d1" 22 | theme.border_radius = dpi(12) 23 | theme.client_radius = dpi(12) 24 | theme.widget_border_raidus = dpi(12) 25 | theme.widget_border_width = dpi(2) 26 | theme.fade_duration = 250 27 | theme.cubic_duration = 500 28 | 29 | theme.icon_font = "FontAwesome 9" 30 | theme.icon_font_name = "FontAwesome" 31 | theme.wid_font = "FontAwesome 55" 32 | theme.icon_color = "#5068A2" 33 | theme.playerctl_position_update_interval = 1 34 | 35 | theme.systray_icon_size = dpi(15) 36 | 37 | theme.confdir = os.getenv("HOME") .. "/.config/awesome/" 38 | theme.widget_note_on = theme.confdir .. "/icons/note_on.png" 39 | theme.widget_bat = theme.confdir .. "/icons/sidebar/bat.png" 40 | theme.widget_cpu = theme.confdir .. "/icons/sidebar/cpu.png" 41 | theme.widget_mem = theme.confdir .. "/icons/sidebar/mem.png" 42 | theme.widget_vol = theme.confdir .. "/icons/sidebar/vol.png" 43 | theme.widget_temp = theme.confdir .. "/icons/temp.png" 44 | theme.info_me = theme.confdir .. "/icons/xhandy.png" 45 | 46 | -- colors 47 | theme.xbackground = "#121018" 48 | theme.xforeground = "#c3afc0" 49 | theme.xcolor0 = "#121018" 50 | theme.xcolor1 = "#3D436A" 51 | theme.xcolor2 = "#5A5068" 52 | theme.xcolor3 = "#434E7A" 53 | theme.xcolor4 = "#495888" 54 | theme.xcolor5 = "#4E6294" 55 | theme.xcolor6 = "#6C628D" 56 | theme.xcolor7 = "#c3afc0" 57 | theme.xcolor8 = "#887a86" 58 | theme.xcolor9 = "#3D436A" 59 | theme.xcolor10 = "#5A5068" 60 | theme.xcolor11 = "#434E7A" 61 | theme.xcolor12 = "#495888" 62 | theme.xcolor13 = "#4E6294" 63 | theme.xcolor14 = "#6C628D" 64 | theme.xcolor15 = "#c3afc0" 65 | 66 | -- Background Colors 67 | 68 | theme.bg_dark = theme.xcolor0 69 | theme.bg_normal = theme.xbackground 70 | theme.bg_focus = theme.xcolor0 71 | theme.bg_urgent = theme.xcolor8 72 | theme.bg_minimize = theme.xcolor8 73 | 74 | -- Foreground Colors 75 | 76 | theme.fg_normal = theme.xcolor7 77 | theme.fg_focus = theme.xcolor4 78 | theme.fg_urgent = theme.xcolor3 79 | theme.fg_minimize = theme.xcolor8 80 | 81 | theme.button_close = theme.xcolor1 82 | 83 | theme.stats_bg_color = "#313037" 84 | 85 | -- There are other variable sets 86 | -- overriding the default one when 87 | -- defined, the sets are: 88 | -- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] 89 | -- tasklist_[bg|fg]_[focus|urgent] 90 | -- titlebar_[bg|fg]_[normal|focus] 91 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] 92 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor] 93 | -- prompt_[fg|bg|fg_cursor|bg_cursor|font] 94 | -- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] 95 | -- Example: 96 | --theme.taglist_bg_focus = "#ff0000" 97 | theme.tasklist_disable_icon = true 98 | 99 | -- Variables set for theming notifications: 100 | -- notification_font 101 | -- notification_[bg|fg] 102 | -- notification_[width|height|margin] 103 | -- notification_[border_color|border_width|shape|opacity] 104 | 105 | -- Variables set for theming the menu: 106 | -- menu_[bg|fg]_[normal|focus] 107 | -- menu_[border_color|border_width] 108 | theme.menu_submenu_icon = themes_path.."default/submenu.png" 109 | theme.menu_height = dpi(15) 110 | theme.menu_width = dpi(100) 111 | 112 | -- You can add as many variables as 113 | -- you wish and access them by using 114 | -- beautiful.variable in your rc.lua 115 | --theme.bg_widget = "#cc0000" 116 | 117 | -- titlebar 118 | theme.titlebar_bg = "#2C2C4A" 119 | 120 | -- Define the image to load 121 | theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png" 122 | theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png" 123 | 124 | theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png" 125 | theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png" 126 | 127 | theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png" 128 | theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png" 129 | theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png" 130 | theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png" 131 | 132 | theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png" 133 | theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png" 134 | theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png" 135 | theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png" 136 | 137 | theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png" 138 | theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png" 139 | theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png" 140 | theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png" 141 | 142 | theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png" 143 | theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png" 144 | theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png" 145 | theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png" 146 | 147 | theme.wallpaper = "~/Pictures/Wallas/Scapes/030.png" 148 | 149 | -- Bling Stuff -- 150 | theme.flash_focus_start_opacity = 1.0 151 | theme.flash_focus_step = 1 152 | 153 | -- For tabbar 154 | theme.tabbar_ontop = false 155 | theme.tabbar_bg_focus = theme.xbackground 156 | theme.tabbar_bg_normal = theme.xcolor0 157 | theme.tabbar_fg_focus = theme.xcolor8 158 | theme.tabbar_fg_normal = theme.xcolor15 .. "55" 159 | theme.tabbar_position = "bottom" 160 | theme.tabber_style = "boxes" 161 | 162 | -- For mstab 163 | theme.mstab_bar_ontop = false 164 | theme.mstab_dont_resize_slaves = true 165 | theme.mstab_bar_padding = "default" 166 | theme.mstab_border_radius = dpi(5) 167 | theme.mstab_bar_height = dpi(60) 168 | theme.mstab_tabbar_position = "bottom" 169 | theme.mstab_tabbar_style = "boxes" 170 | 171 | -- Layout Machi 172 | theme.machi_switcher_border_color = theme.xcolor4 173 | theme.machi_switcher_border_opacity = 0.25 174 | theme.machi_editor_border_color = theme.xcolor1 175 | theme.machi_editor_border_opacity = 0.25 176 | theme.machi_editor_active_opacity = 0.25 177 | 178 | -- You can use your own layout icons like this: 179 | theme.layout_fairh = themes_path.."default/layouts/fairhw.png" 180 | theme.layout_fairv = themes_path.."default/layouts/fairvw.png" 181 | theme.layout_floating = themes_path.."default/layouts/floatingw.png" 182 | theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" 183 | theme.layout_max = themes_path.."default/layouts/maxw.png" 184 | theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" 185 | theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" 186 | theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" 187 | theme.layout_tile = themes_path.."default/layouts/tilew.png" 188 | theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" 189 | theme.layout_spiral = themes_path.."default/layouts/spiralw.png" 190 | theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" 191 | theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" 192 | theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" 193 | theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" 194 | theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" 195 | 196 | -- Generate Awesome icon: 197 | theme.awesome_icon = theme_assets.awesome_icon( 198 | theme.menu_height, theme.bg_focus, theme.fg_focus 199 | ) 200 | 201 | -- Define the icon theme for application icons. If not set then the icons 202 | -- from /usr/share/icons and /usr/share/icons/hicolor will be used. 203 | theme.icon_theme = nil 204 | 205 | return theme 206 | 207 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 208 | -------------------------------------------------------------------------------- /firefox/user.js: -------------------------------------------------------------------------------- 1 | // Settings for FlyingFox 2 | user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); 3 | user_pref("layers.acceleration.force-enabled", true); 4 | user_pref("gfx.webrender.all", true); 5 | user_pref("gfx.webrender.enabled", true); 6 | user_pref("svg.context-properties.content.enabled", true); 7 | user_pref("layout.css.backdrop-filter.enabled", true); 8 | user_pref("browser.compactmode.show", true); 9 | user_pref("browser.proton.contextmenus.enabled", false); 10 | user_pref("browser.proton.doorhangers.enabled", false); 11 | user_pref("browser.proton.enabled", false); 12 | user_pref("browser.proton.modals.enabled", false); 13 | user_pref("browser.proton.places-tooltip.enabled", false); 14 | 15 | // ** Useful Options *********************************************************** 16 | // Integrated calculator at urlbar 17 | user_pref("browser.urlbar.suggest.calculator", true); 18 | 19 | // For performance 20 | user_perf("dom.image-lazy-loading.enabled", true); 21 | user_perf("browser.sessionstore.restore_tabs_lazily", true); 22 | user_perf("browser.sessionstore.restore_on_demand", true); 23 | user_perf("browser.startup.preXulSkeletonUI", false); 24 | 25 | // Startup Settings 26 | 27 | user_pref("browser.newtab.preload", false); 28 | 29 | // disable Activity Stream Telemetry 30 | user_pref("browser-newtabpage.activity-stream.feeds.telemetry", false); 31 | user_pref("browser-newtabpage.activity-stream.telemetry", false); 32 | 33 | // disable Activity Stream Snippets 34 | // A part code retrived from the server after a specific time. 35 | user_perf("browser.newtabpage.activity-stream-feeds.snippets", false); 36 | 37 | // disable Activity Stream Top Stories, Pocket-based and/or sponsored content 38 | user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); 39 | user_pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false); 40 | user_pref("browser.newtabpage.activity-stream.showSponsored", false); 41 | user_pref("browser.newtabpage.activity-stream.feeds.discoverystreamfeed", false); 42 | 43 | // 0105e: clear default topsites 44 | user_pref("browser.newtabpage.activity-stream.default.sites", ""); 45 | 46 | // disable Location-Aware Browsing 47 | user_pref("geo.enabled", false); 48 | 49 | // set a default permission for Location 50 | user_pref("permissions.default.geo", 2); 51 | 52 | // use Mozilla geolocation service instead of Google when geolocation is enabled 53 | user_pref("geo.provider.network.url", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"); 54 | user_pref("geo.provider.network.logging.enabled", false); 55 | 56 | // disable using the OS's geolocation service 57 | user_pref("geo.provider.ms-windows-location", false); // [WINDOWS] 58 | user_pref("geo.provider.use_corelocation", false); // [MAC] 59 | user_pref("geo.provider.use_gpsd", false); // [LINUX] 60 | 61 | // disable region updates 62 | user_pref("browser.region.network.url", ""); // [FF78+] 63 | user_pref("browser.region.update.enabled", false); // [[FF79+] 64 | 65 | // preferred language for displaying web pages 66 | user_pref("intl.accept_languages", "en-US, en"); 67 | 68 | // disable auto-INSTALLING Firefox updates 69 | user_pref("app.update.auto", false); 70 | 71 | // disable search engine updates 72 | user_pref("browser.search.update", false) 73 | 74 | // disable "about:addons" Recommendations pane - use Google Analytics 75 | user_perf("extensions.getAddons.showPane", false); 76 | 77 | // disable "about:addons" recommendations for Extensions and Themes 78 | user_perf("extensions.htmlaboutaddons.recommendations.enabled", false); 79 | 80 | // disable telemetry 81 | user_perf("toolkit.telemetry.unified", false); 82 | user_perf("toolkit.telemetry.enabled", false); 83 | user_perf("toolkit.telemetry.server", "data:,"); 84 | user_perf("toolkit.telemetry.archive.enabled", false); 85 | ser_pref("toolkit.telemetry.newProfilePing.enabled", false); // [FF55+] 86 | user_pref("toolkit.telemetry.shutdownPingSender.enabled", false); // [FF55+] 87 | user_pref("toolkit.telemetry.updatePing.enabled", false); // [FF56+] 88 | user_pref("toolkit.telemetry.bhrPing.enabled", false); // [FF57+] Background Hang Reporter 89 | user_pref("toolkit.telemetry.firstShutdownPing.enabled", false); // [FF57+] 90 | 91 | // disable Telemetry Coverage 92 | user_pref("toolkit.telemetry.coverage.opt-out", true); // [HIDDEN PREF] 93 | user_pref("toolkit.coverage.opt-out", true); // [FF64+] [HIDDEN PREF] 94 | user_pref("toolkit.coverage.endpoint.base", ""); 95 | 96 | // disable Health Reports 97 | user_pref("datareporting.healthreport.uploadEnabled", false); 98 | 99 | // disable new data submission, master kill switch [FF41+] 100 | user_pref("datareporting.policy.dataSubmissionEnabled", false); 101 | 102 | // disable Studies (see 0503) 103 | user_pref("app.shield.optoutstudies.enabled", false); 104 | 105 | // disable personalized Extension Recommendations in about:addons and AMO [FF65+] 106 | user_pref("browser.discovery.enabled", false); 107 | 108 | // disable Crash Reports 109 | user_pref("breakpad.reportURL", ""); 110 | user_pref("browser.tabs.crashReporting.sendReport", false); // [FF44+] 111 | 112 | // enforce no submission of backlogged Crash Reports [FF58+] 113 | user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); 114 | 115 | // disable Captive Portal detection 116 | user_pref("captivedetect.canonicalURL", ""); 117 | user_pref("network.captive-portal-service.enabled", false); // [FF52+] 118 | 119 | // disable Network Connectivity checks [FF65+] 120 | user_pref("network.connectivity-service.enabled", false); 121 | 122 | // BLOCKLISTS 123 | 124 | // enforce Firefox blocklist 125 | user_pref("extensions.blocklist.enabled", true); 126 | 127 | // disable SB checks for downloads (remote) 128 | user_pref("browser.safebrowsing.downloads.remote.enabled", false); 129 | user_pref("browser.safebrowsing.downloads.remote.url", ""); 130 | 131 | // SYSTEM ADD-ONS / EXPERIMENTS 132 | 133 | // disable Normandy/Shield [FF60+] 134 | user_pref("app.normandy.enabled", false); 135 | user_pref("app.normandy.api_url", ""); 136 | 137 | // disable System Add-on updates 138 | user_pref("extensions.systemAddon.update.enabled", false); 139 | user_pref("extensions.systemAddon.update.url", ""); 140 | 141 | // disable PingCentre telemetry (used in several System Add-ons) [FF57+] 142 | user_pref("browser.ping-centre.telemetry", false); 143 | 144 | // disable Form Autofill 145 | user_pref("extensions.formautofill.addresses.enabled", false); // [FF55+] 146 | user_pref("extensions.formautofill.available", "off"); // [FF56+] 147 | user_pref("extensions.formautofill.creditCards.available", false); // [FF57+] 148 | user_pref("extensions.formautofill.creditCards.enabled", false); // [FF56+] 149 | user_pref("extensions.formautofill.heuristics.enabled", false); // [FF55+] 150 | 151 | // enforce disabling of Web Compatibility Reporter [FF56+] 152 | user_pref("extensions.webcompat-reporter.enabled", false); 153 | 154 | // BLOCK IMPLICIT OUTBOUND 155 | 156 | // disable link prefetching 157 | user_pref("network.prefetch-next", false); 158 | 159 | // disable DNS prefetching 160 | user_pref("network.dns.disablePrefetch", true); 161 | 162 | // disable predictor / prefetching 163 | user_pref("network.predictor.enabled", false); 164 | 165 | // disable HTTP Alternative Services 166 | user_pref("network.http.altsvc.enabled", false); 167 | user_pref("network.http.altsvc.oe", false); 168 | 169 | // disable GIO as a potential proxy bypass vector 170 | user_pref("network.gio.supported-protocols", ""); 171 | 172 | // LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS 173 | 174 | // disable location bar using search 175 | user_pref("keyword.enabled", false); 176 | 177 | // disable location bar domain guessing 178 | user_pref("browser.fixup.alternate.enabled", false); 179 | 180 | // display all parts of the url in the location bar 181 | user_pref("browser.urlbar.trimURLs", false); 182 | 183 | // disable coloring of visited links - CSS history leak 184 | user_pref("layout.css.visited_links_enabled", false); 185 | 186 | // disable location bar making speculative connections 187 | user_pref("browser.urlbar.speculativeConnect.enabled", false); 188 | 189 | // disable location bar leaking single words to a DNS provider **after searching** 190 | user_pref("browser.urlbar.dnsResolveSingleWordsAfterSearch", 0); 191 | 192 | // disable location bar suggestion types 193 | user_pref("browser.urlbar.suggest.bookmark", false); 194 | user_pref("browser.urlbar.suggest.openpage", false); 195 | user_pref("browser.urlbar.suggest.topsites", false); 196 | 197 | // disable search and form history 198 | user_pref("browser.formfill.enable", false); 199 | 200 | // FAVICONS 201 | 202 | // disable favicons in shortcuts 203 | user_pref("browser.shell.shortcutFavicons", false); 204 | 205 | // disable favicons in history and bookmarks 206 | user_pref("browser.chrome.site_icons", false); 207 | 208 | // disable favicons in web notifications 209 | user_pref("alerts.showFavicons", false); 210 | 211 | // HTTPS (SSL/TLS / OCSP / CERTS / HPKP / CIPHERS) 212 | 213 | // require safe negotiation 214 | user_pref("security.ssl.require_safe_negotiation", true); 215 | 216 | // enforce TLS 1.0 and 1.1 downgrades as session only 217 | user_pref("security.tls.version.enable-deprecated", false); 218 | 219 | // user_pref("security.tls.version.enable-deprecated", false); 220 | user_pref("security.ssl.disable_session_identifiers", true); 221 | 222 | // disable TLS1.3 0-RTT 223 | user_pref("security.tls.enable_0rtt_data", false); 224 | -------------------------------------------------------------------------------- /config/eww/eww.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{hour}} 9 | {{min}} 10 | 11 | 12 | {{day}} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | {{bat}} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 70xH 51 | error 52 | 53 | 54 | 55 | 56 | 57 | OS: 58 | {{os}} 59 | 60 | 61 | KER: 62 | {{ker}} 63 | 64 | 65 | UPT: 66 | {{uptime}} 67 | 68 | 69 | PKGS: 70 | {{pkgs}} 71 | 72 | 73 | WM: 74 | {{wm}} 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | {{title}} 85 | {{artist}} 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | {{art}} 98 | 99 | 100 | 101 | 102 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | ~/.config/eww/scripts/getday 169 | date "+%H" 170 | date "+%M" 171 | 172 | 173 | ~/.config/eww/scripts/getbat 174 | ~/.config/eww/scripts/getbatper 175 | 176 | 177 | pamixer --get-volume 178 | 179 | 180 | ~/.config/eww/scripts/getmemcur 181 | 182 | 183 | ~/.config/eww/scripts/getcpu 184 | 185 | 186 | ~/.config/eww/scripts/getos 187 | ~/.config/eww/scripts/getker 188 | ~/.config/eww/scripts/getuptime 189 | ~/.config/eww/scripts/getpkgs 190 | ~/.config/eww/scripts/getwm 191 | 192 | 193 | /tmp/aweseome/art/cover.png 194 | ~/.config/eww/scripts/musicart 195 | ~/.config/eww/scripts/spotat 196 | playerctl --player=spotify metadata --format '{{ title }}' 197 | playerctl --player=spotify metadata --format '{{ artist }}' 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | -------------------------------------------------------------------------------- /config/awesome/widgets/slider/spoter/spawtify.lua: -------------------------------------------------------------------------------- 1 | local awful = require("awful") 2 | local watch = require("awful.widget.watch") 3 | local wibox = require("wibox") 4 | local beautiful = require("beautiful") 5 | local utils = require("widgets.slider.spoter.utils") 6 | local gears = require("gears") 7 | local xresources = require("beautiful.xresources") 8 | local dpi = xresources.apply_dpi 9 | local spotify = {} 10 | local dir = gears.filesystem.get_configuration_dir () 11 | 12 | local icons = {} 13 | icons.spotify_play_button_icon = dir.."spawtify/icons/play-spotify.png" or beautiful.spotify_play_button_icon 14 | icons.spotify_pause_button_icon = dir.."spawtify/icons/pause-spotify.png" or beautiful.spotify_pause_button_icon 15 | icons.spotify_prev_button_icon = dir.."spawtify/icons/previous-spotify.png" or beautiful.spotify_prev_button_icon 16 | icons.spotify_next_button_icon = dir.."spawtify/icons/next-spotify.png" or beautiful.spotify_next_button_icon 17 | icons.spotify_icon = dir.."spawtify/icons/spotify-spotify.png" or beautiful.spotify_icon 18 | icons.error_icon = dir.."spawtify/icons/ghost.png" or beautiful.spotify_error_icon 19 | 20 | local spotify_commands = {} 21 | spotify_commands.status = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|egrep -A 1 \"string\"|cut -b 26-|cut -d '\"' -f 1|egrep -v ^$" 22 | spotify_commands.toggle = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" 23 | spotify_commands.prev = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" 24 | spotify_commands.next = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" 25 | spotify_commands.song = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 \"title\"|egrep -v \"title\"|cut -b 44-|cut -d '\"' -f 1|egrep -v ^$" 26 | spotify_commands.album = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 \"album\"|egrep -v \"album\"|cut -b 44-|cut -d '\"' -f 1|egrep -v ^$" 27 | spotify_commands.artist = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 \"artist\"|egrep -v \"artist\"|egrep -v \"array\"|cut -b 27-|cut -d '\"' -f 1|egrep -v ^$" 28 | spotify_commands.artwork = "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 \"artUrl\"|egrep -v \"artUrl\"|cut -b 44-|cut -d '\"' -f 1|egrep -v ^$" 29 | 30 | local button_size 31 | local width 32 | local height 33 | local old_title 34 | local changed = false 35 | local playing = false 36 | local art = false 37 | local art_path = dir .."spawtify/.cache/artwork" 38 | local widget_geometry = {} 39 | 40 | local artwork = wibox.widget.imagebox() 41 | artwork.clip_shape = utils.rrect(beautiful.border_radius or 5) 42 | 43 | local spotify_icon = wibox.widget.imagebox() 44 | spotify_icon.forced_width = dpi(30) 45 | spotify_icon.forced_height = dpi(30) 46 | 47 | local spotify_icon_onclick = gears.table.join( 48 | awful.button({ }, 1, 49 | function() 50 | awful.spawn("killall lightdm") 51 | awesome.restart() 52 | check_for_updates() 53 | end 54 | ) 55 | ) 56 | spotify_icon:buttons(spotify_icon_onclick) 57 | 58 | local title = wibox.widget.textbox("Title") 59 | title.align = center 60 | 61 | local album = wibox.widget.textbox("Album") 62 | album.align = center 63 | 64 | local artist = wibox.widget.textbox("Artist") 65 | artist.align = center 66 | 67 | local toggle_button = wibox.widget.imagebox() 68 | 69 | function addSongData() 70 | local song_data = wibox.widget({ 71 | { 72 | title, 73 | halign = 'center', 74 | widget = wibox.container.place, 75 | }, 76 | --utils.pad_heigh(2), 77 | { 78 | album, 79 | halign = 'center', 80 | widget = wibox.container.place, 81 | }, 82 | { 83 | artist, 84 | halign = 'center', 85 | widget = wibox.container.place, 86 | }, 87 | layout = wibox.layout.fixed.vertical, 88 | }) 89 | return song_data 90 | end 91 | 92 | function set_toggle_image(toggle) 93 | playing = not playing 94 | if playing then 95 | toggle.image = icons.spotify_pause_button_icon 96 | else 97 | toggle.image = icons.spotify_play_button_icon 98 | end 99 | end 100 | function addButtons() 101 | -- make the toggle button 102 | toggle_button.forced_height = button_size 103 | toggle_button.forced_width = button_size 104 | 105 | -- make the next button 106 | local next_button = wibox.widget.imagebox(icons.spotify_next_button_icon) 107 | next_button.forced_height = button_size 108 | next_button.forced_width = button_size 109 | 110 | -- make the prev button 111 | local prev_button = wibox.widget.imagebox(icons.spotify_prev_button_icon) 112 | prev_button.forced_height = button_size 113 | prev_button.forced_width = button_size 114 | 115 | local toggle_onclick = gears.table.join( 116 | awful.button({ }, 1, 117 | function() 118 | awful.spawn(spotify_commands.toggle) 119 | set_toggle_image(toggle_button) 120 | end 121 | ) 122 | ) 123 | toggle_button:buttons(toggle_onclick) 124 | 125 | local next_onclick = gears.table.join( 126 | awful.button({ }, 1, 127 | function() 128 | awful.spawn(spotify_commands.next) 129 | check_for_updates() 130 | end 131 | ) 132 | ) 133 | next_button:buttons(next_onclick) 134 | 135 | local prev_onclick = gears.table.join( 136 | awful.button({ }, 1, 137 | function() 138 | awful.spawn(spotify_commands.prev) 139 | check_for_updates() 140 | end 141 | ) 142 | ) 143 | prev_button:buttons(prev_onclick) 144 | 145 | local put_buttons_together = wibox.widget({ 146 | { 147 | prev_button, 148 | toggle_button, 149 | next_button, 150 | layout = wibox.layout.flex.horizontal, 151 | spacing = button_size, 152 | }, 153 | halign = 'center', 154 | widget = wibox.container.place, 155 | }) 156 | return put_buttons_together 157 | end 158 | 159 | --[[----------------------------------------- 160 | Artwork Functions 161 | ]]------------------------------------------- 162 | function initArtwork() 163 | artwork.image = icons.error_icon 164 | artwork.forced_height = height*0.4 165 | artwork.forced_width = width*0.6 166 | artwork.opacity = 0.3 167 | artwork.resize = true 168 | end 169 | 170 | function getArtwork() 171 | if art then 172 | return artwork 173 | else 174 | return nil 175 | end 176 | end 177 | 178 | function setArtwork(empty) 179 | if empty then 180 | artwork.opacity = 0.3 181 | artwork.resize = true 182 | artwork.image = icons.error_icon 183 | else 184 | artwork.opacity = 1 185 | artwork.resize = false 186 | artwork.image = art_path 187 | end 188 | end 189 | --[[-----------------------------------------]] 190 | 191 | spotify.widget = function(o) 192 | awful.spawn("mkdir -p"..dir.."spawtify/.cache") 193 | 194 | local s = o.screen 195 | width = dpi(360) or o.width 196 | height = dpi(280) or o.height 197 | button_size = width * 0.1 198 | art = o.artwork or false 199 | 200 | if art then 201 | initArtwork() 202 | height = dpi(440) or o.height 203 | end 204 | local song_data = addSongData() 205 | local buttons = addButtons() 206 | 207 | title.font = beautiful.titlefont.." "..dpi(13) or beautiful.font 208 | title.forced_height = dpi(45) 209 | --title.ellipsize = "end" 210 | album.font = beautiful.fontname.." "..dpi(7) or beautiful.font 211 | artist.font = beautiful.fontname.." "..dpi(8) or beautiful.font 212 | 213 | spotify_icon.image = icons.spotify_icon 214 | 215 | s.spotify_widget = wibox({ 216 | screen = s, 217 | visible = true, 218 | width = width, 219 | height = height, 220 | bg = "#00000000", -- make the wibox itself fully transparent (and then we'll draw the widget inside it) 221 | shape = gears.shape.rectangle, -- make the `wibox` a rectangle 222 | type = "dock", -- this should tell compton (or the compositor you're using, that it doesn't want shadows around it. 223 | -- if you still see the transparent rectangle with the shadows and it looks weird, you should configure compton to 224 | -- not draw shadows on windows of type "dock" 225 | ontop = true, 226 | }) 227 | 228 | s.spotify_widget:setup({ 229 | { 230 | { 231 | spotify_icon, 232 | left = dpi(12), 233 | top = dpi(12), 234 | bottom = dpi(3), 235 | layout = wibox.container.margin, 236 | }, 237 | --utils.pad_height(8), 238 | { 239 | getArtwork(), 240 | halign = 'center', 241 | widget = wibox.container.place, 242 | }, 243 | utils.pad_height(dpi(4)), 244 | song_data, 245 | utils.pad_height(dpi(4)), 246 | buttons, 247 | layout = wibox.layout.fixed.vertical, 248 | }, 249 | widget = wibox.container.background, 250 | bg = "#000000" or o.fg, 251 | -- and we do rounded corners here. 252 | -- This way AwesomeWM can apply anti-aliasing, since it's between two of its own shapes: 253 | -- the transparent rectangular wibox 254 | -- and this rounded rectangle on top of it 255 | shape = utils.rrect(beautiful.borderradius), 256 | }) 257 | 258 | local bottom_margin = o.bottom_margin or dpi(180) 259 | utils.relative_position(s.spotify_widget, "bottom", bottom_margin) 260 | utils.relative_position(s.spotify_widget, "right", -10) 261 | widget_geometry.x = s.spotify_widget.x 262 | widget_geometry.y = s.spotify_widget.y 263 | -- init_status() 264 | force_update_widget() 265 | end 266 | 267 | -- check continously every 'artwork_callback_count' seconds for 'artwork_callback_count' * 'artwork_callback_timer' seconds 268 | local artwork_callback_timer = 1 269 | local artwork_callback_count = 3 270 | 271 | --local artwork_timer = gears.timer.start_new(2.5, artworkCallback) 272 | 273 | -- check pauseplay status has changed, and change icon accordingly. 274 | function pause_play_check() 275 | awful.spawn.easy_async_with_shell(command, function() 276 | awful.spawn.easy_async_with_shell(spotify_commands.status, function(out) 277 | if string.match(out, "Playing") then 278 | playing = true 279 | toggle_button.image = icons.spotify_pause_button_icon 280 | elseif string.match(out, "Paused") then 281 | playing = false 282 | toggle_button.image = icons.spotify_play_button_icon 283 | else 284 | playing = -1 285 | return 286 | end 287 | end) 288 | end) 289 | end 290 | 291 | -- force update 292 | function force_update_widget() 293 | pause_play_check() 294 | 295 | -- spotify not running/dbus error 296 | if playing==-1 then return end 297 | 298 | awful.spawn.easy_async_with_shell(command, function() 299 | awful.spawn.easy_async_with_shell(spotify_commands.song, function(out) 300 | old_title = out 301 | title:set_markup (utils.colorize_text(out,"#ffffff")) 302 | data_changed() 303 | end) 304 | end) 305 | end 306 | 307 | --update if changes 308 | function check_for_updates() 309 | pause_play_check() 310 | 311 | -- spotify not running/dbus error 312 | if playing==-1 then return end 313 | 314 | -- function called before widget was completely initialized. 315 | -- the assumption is that force_update_widget MUST be called at least once before this function can be called 316 | if not old_title then return end 317 | 318 | awful.spawn.easy_async_with_shell(command, function() 319 | awful.spawn.easy_async_with_shell(spotify_commands.song, function(out) 320 | -- if previously saved title is not same as output, then song has changed. 321 | if old_title ~= out then 322 | old_title = out 323 | title:set_markup (utils.colorize_text(out,"#ffffff")) 324 | setArtwork(true) 325 | data_changed() 326 | end 327 | end) 328 | end) 329 | end 330 | 331 | function data_changed() 332 | awful.spawn.easy_async_with_shell(command, function() 333 | awful.spawn.easy_async_with_shell(spotify_commands.album, function(out) 334 | album:set_markup ("" .. out .. "") 335 | end) 336 | end) 337 | 338 | awful.spawn.easy_async_with_shell(command, function() 339 | awful.spawn.easy_async_with_shell(spotify_commands.artist, function(out) 340 | artist:set_markup ("by " .. out .. "") 341 | naughty.noVtify({text="cmd: "..TOP_CMD}) 342 | end) 343 | end) 344 | 345 | if art then 346 | awful.spawn.easy_async_with_shell(command, function() 347 | awful.spawn.easy_async_with_shell(spotify_commands.artwork, function(out) 348 | local cmd = "wget -O "..dir.."spawtify/.cache/artwork "..out 349 | awful.spawn(cmd) 350 | --gears.timer.weak_start_new(artwork_callback_timer, artworkCallback):stop() 351 | gears.timer.weak_start_new(artwork_callback_timer, artworkCallback):start() 352 | end) 353 | end) 354 | end 355 | collectgarbage() 356 | end 357 | 358 | function artworkCallback() 359 | artwork_callback_count = artwork_callback_count-1 360 | if artwork_callback_count > 0 then 361 | setArtwork(false) 362 | return true 363 | else 364 | artwork_callback_count = 3 365 | collectgarbage() 366 | return false 367 | end 368 | end 369 | 370 | 371 | --watch(spotify_commands.song, 5, check_for_updates, artwork) 372 | local widget_update = gears.timer{ 373 | timeout = 5, 374 | call_now = false, 375 | callback = function() 376 | check_for_updates() 377 | end 378 | } 379 | 380 | widget_update:start() 381 | 382 | spotify.toggle = function() 383 | for s in screen do 384 | if s.spotify_widget then 385 | s.spotify_widget.visible = not s.spotify_widget.visible 386 | end 387 | if s.spotify_widget.visible then 388 | check_for_updates() 389 | widget_update:start() 390 | awful.spawn("glava") 391 | else 392 | awful.spawn("killall glava") 393 | widget_update:stop() 394 | end 395 | end 396 | end 397 | 398 | spotify.setVisualizer = function(client) 399 | client.x = widget_geometry.x +5 400 | client.width = dpi(345) 401 | client.y = widget_geometry.y - 190 402 | gears.timer.delayed_call(function() 403 | gears.surface.apply_shape_bounding(client, gears.shape.rectangle) 404 | end) 405 | client.floating = true 406 | client.focusable = false 407 | client.ontop = true 408 | client.sticky = true 409 | end 410 | 411 | return spotify 412 | -------------------------------------------------------------------------------- /config/awesome/helpers.lua: -------------------------------------------------------------------------------- 1 | -- helpers.lua 2 | -- Functions that you use more than once and in different files would 3 | -- be nice to define here. 4 | local awful = require("awful") 5 | local gears = require("gears") 6 | local beautiful = require("beautiful") 7 | local xresources = require("beautiful.xresources") 8 | local dpi = xresources.apply_dpi 9 | local wibox = require("wibox") 10 | local naughty = require("naughty") 11 | local lgi = require("lgi") 12 | local Rsvg = lgi.Rsvg 13 | local cairo = lgi.cairo 14 | local helpers = {} 15 | 16 | function helpers.volume_control(step) 17 | local cmd 18 | if step == 0 then 19 | cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle" 20 | else 21 | sign = step > 0 and "+" or "" 22 | cmd = 23 | "pactl set-sink-mute @DEFAULT_SINK@ 0 && pactl set-sink-volume @DEFAULT_SINK@ " .. 24 | sign .. tostring(step) .. "%" 25 | end 26 | awful.spawn.with_shell(cmd) 27 | end 28 | 29 | -- Adds a maximized mask to a screen 30 | function helpers.screen_mask(s, bg) 31 | local mask = wibox({ 32 | visible = false, 33 | ontop = true, 34 | type = "splash", 35 | screen = s 36 | }) 37 | awful.placement.maximize(mask) 38 | mask.bg = bg 39 | return mask 40 | end 41 | 42 | function helpers.custom_shape(cr, width, height) 43 | cr:move_to(0, height / 25) 44 | cr:line_to(height / 25, 0) 45 | cr:line_to(width, 0) 46 | cr:line_to(width, height - height / 25) 47 | cr:line_to(width - height / 25, height) 48 | cr:line_to(0, height) 49 | cr:close_path() 50 | end 51 | 52 | -- Resize gaps on the fly 53 | 54 | helpers.resize_gaps = function(amt) 55 | local t = awful.screen.focused().selected_tag 56 | t.gap = t.gap + tonumber(amt) 57 | awful.layout.arrange(awful.screen.focused()) 58 | end 59 | 60 | -- Create rounded rectangle shape (in one line) 61 | 62 | helpers.rrect = function(radius) 63 | return function(cr, width, height) 64 | gears.shape.rounded_rect(cr, width, height, radius) 65 | end 66 | end 67 | 68 | -- Create pi 69 | 70 | helpers.pie = function(width, height, start_angle, end_angle, radius) 71 | return function(cr) 72 | gears.shape.pie(cr, width, height, start_angle, end_angle, radius) 73 | end 74 | end 75 | 76 | -- Create parallelogram 77 | 78 | helpers.prgram = function(height, base) 79 | return function(cr, width) 80 | gears.shape.parallelogram(cr, width, height, base) 81 | end 82 | end 83 | 84 | -- Create partially rounded rect 85 | 86 | helpers.prrect = function(radius, tl, tr, br, bl) 87 | return function(cr, width, height) 88 | gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, 89 | radius) 90 | end 91 | end 92 | 93 | -- Markup helper 94 | 95 | function helpers.colorize_text(txt, fg) 96 | return "" .. txt .. "" 97 | end 98 | 99 | function helpers.client_menu_toggle() 100 | local instance = nil 101 | 102 | return function() 103 | if instance and instance.wibox.visible then 104 | instance:hide() 105 | instance = nil 106 | else 107 | instance = awful.menu.clients({theme = {width = dpi(250)}}) 108 | end 109 | end 110 | end 111 | 112 | -- Escapes a string so that it can be displayed inside pango markup 113 | -- tags. Modified from: 114 | -- https://github.com/kernelsauce/turbo/blob/master/turbo/escape.lua 115 | function helpers.pango_escape(s) 116 | return (string.gsub(s, "[&<>]", 117 | {["&"] = "&", ["<"] = "<", [">"] = ">"})) 118 | end 119 | 120 | function helpers.vertical_pad(height) 121 | return wibox.widget { 122 | forced_height = height, 123 | layout = wibox.layout.fixed.vertical 124 | } 125 | end 126 | 127 | function helpers.horizontal_pad(width) 128 | return wibox.widget { 129 | forced_width = width, 130 | layout = wibox.layout.fixed.horizontal 131 | } 132 | end 133 | 134 | -- Maximizes client and also respects gaps 135 | function helpers.maximize(c) 136 | c.maximized = not c.maximized 137 | if c.maximized then 138 | awful.placement.maximize(c, { 139 | honor_padding = true, 140 | honor_workarea = true, 141 | margins = beautiful.useless_gap * 2 142 | }) 143 | 144 | end 145 | c:raise() 146 | end 147 | 148 | function helpers.move_to_edge(c, direction) 149 | -- local workarea = awful.screen.focused().workarea 150 | -- local client_geometry = c:geometry() 151 | if direction == "up" then 152 | local old_x = c:geometry().x 153 | awful.placement.top(c, { 154 | honor_padding = true, 155 | honor_workarea = true, 156 | honor_padding = true 157 | }) 158 | c.x = old_x 159 | -- c:geometry({ nil, y = workarea.y + beautiful.screen_margin * 2, nil, nil }) 160 | elseif direction == "down" then 161 | local old_x = c:geometry().x 162 | awful.placement.bottom(c, { 163 | honor_padding = true, 164 | honor_workarea = true, 165 | honor_padding = true 166 | }) 167 | c.x = old_x 168 | -- c:geometry({ nil, y = workarea.height + workarea.y - client_geometry.height - beautiful.screen_margin * 2 - beautiful.border_width * 2, nil, nil }) 169 | elseif direction == "left" then 170 | local old_y = c:geometry().y 171 | awful.placement.left(c, { 172 | honor_padding = true, 173 | honor_workarea = true, 174 | honor_padding = true 175 | }) 176 | c.y = old_y 177 | -- c:geometry({ x = workarea.x + beautiful.screen_margin * 2, nil, nil, nil }) 178 | elseif direction == "right" then 179 | local old_y = c:geometry().y 180 | awful.placement.right(c, { 181 | honor_padding = true, 182 | honor_workarea = true, 183 | honor_padding = true 184 | }) 185 | c.y = old_y 186 | -- c:geometry({ x = workarea.width + workarea.x - client_geometry.width - beautiful.screen_margin * 2 - beautiful.border_width * 2, nil, nil, nil }) 187 | end 188 | end 189 | 190 | local double_tap_timer = nil 191 | function helpers.single_double_tap(single_tap_function, double_tap_function) 192 | if double_tap_timer then 193 | double_tap_timer:stop() 194 | double_tap_timer = nil 195 | double_tap_function() 196 | -- naughty.notify({text = "We got a double tap"}) 197 | return 198 | end 199 | 200 | double_tap_timer = gears.timer.start_new(0.20, function() 201 | double_tap_timer = nil 202 | -- naughty.notify({text = "We got a single tap"}) 203 | if single_tap_function then single_tap_function() end 204 | return false 205 | end) 206 | end 207 | 208 | -- Used as a custom command in rofi to move a window into the current tag 209 | -- instead of following it. 210 | -- Rofi has access to the X window id of the client. 211 | function helpers.rofi_move_client_here(window) 212 | local win = function(c) return awful.rules.match(c, {window = window}) end 213 | 214 | for c in awful.client.iterate(win) do 215 | c.minimized = false 216 | c:move_to_tag(mouse.screen.selected_tag) 217 | client.focus = c 218 | c:raise() 219 | end 220 | end 221 | 222 | -- Add a hover cursor to a widget by changing the cursor on 223 | -- mouse::enter and mouse::leave 224 | -- You can find the names of the available cursors by opening any 225 | -- cursor theme and looking in the "cursors folder" 226 | -- For example: "hand1" is the cursor that appears when hovering over 227 | -- links 228 | function helpers.add_hover_cursor(w, hover_cursor) 229 | local original_cursor = "left_ptr" 230 | 231 | w:connect_signal("mouse::enter", function() 232 | local w = _G.mouse.current_wibox 233 | if w then w.cursor = hover_cursor end 234 | end) 235 | 236 | w:connect_signal("mouse::leave", function() 237 | local w = _G.mouse.current_wibox 238 | if w then w.cursor = original_cursor end 239 | end) 240 | end 241 | 242 | -- Tag back and forth: 243 | -- If you try to focus the tag you are already at, go back to the previous tag. 244 | -- Useful for quick switching after for example checking an incoming chat 245 | -- message at tag 2 and coming back to your work at tag 1 with the same 246 | -- keypress. 247 | -- Also focuses urgent clients if they exist in the tag. This fixes the issue 248 | -- (visual mismatch) where after switching to a tag which includes an urgent 249 | -- client, the urgent client is unfocused but still covers all other windows 250 | -- (even the currently focused window). 251 | function helpers.tag_back_and_forth(tag_index) 252 | local s = mouse.screen 253 | local tag = s.tags[tag_index] 254 | if tag then 255 | if tag == s.selected_tag then 256 | awful.tag.history.restore() 257 | else 258 | tag:view_only() 259 | end 260 | 261 | local urgent_clients = function(c) 262 | return awful.rules.match(c, {urgent = true, first_tag = tag}) 263 | end 264 | 265 | for c in awful.client.iterate(urgent_clients) do 266 | client.focus = c 267 | c:raise() 268 | end 269 | end 270 | end 271 | 272 | -- Resize DWIM (Do What I Mean) 273 | -- Resize client or factor 274 | -- Constants -- 275 | local floating_resize_amount = dpi(20) 276 | local tiling_resize_factor = 0.05 277 | --------------- 278 | function helpers.resize_dwim(c, direction) 279 | if awful.layout.get(mouse.screen) == awful.layout.suit.floating or 280 | (c and c.floating) then 281 | if direction == "up" then 282 | c:relative_move(0, 0, 0, -floating_resize_amount) 283 | elseif direction == "down" then 284 | c:relative_move(0, 0, 0, floating_resize_amount) 285 | elseif direction == "left" then 286 | c:relative_move(0, 0, -floating_resize_amount, 0) 287 | elseif direction == "right" then 288 | c:relative_move(0, 0, floating_resize_amount, 0) 289 | end 290 | else 291 | if direction == "up" then 292 | awful.client.incwfact(-tiling_resize_factor) 293 | elseif direction == "down" then 294 | awful.client.incwfact(tiling_resize_factor) 295 | elseif direction == "left" then 296 | awful.tag.incmwfact(-tiling_resize_factor) 297 | elseif direction == "right" then 298 | awful.tag.incmwfact(tiling_resize_factor) 299 | end 300 | end 301 | end 302 | 303 | -- Move client to screen edge, respecting the screen workarea 304 | function helpers.move_to_edge(c, direction) 305 | local workarea = awful.screen.focused().workarea 306 | if direction == "up" then 307 | c:geometry({nil, y = workarea.y + beautiful.useless_gap * 2, nil, nil}) 308 | elseif direction == "down" then 309 | c:geometry({ 310 | nil, 311 | y = workarea.height + workarea.y - c:geometry().height - 312 | beautiful.useless_gap * 2 - beautiful.border_width * 2, 313 | nil, 314 | nil 315 | }) 316 | elseif direction == "left" then 317 | c:geometry({x = workarea.x + beautiful.useless_gap * 2, nil, nil, nil}) 318 | elseif direction == "right" then 319 | c:geometry({ 320 | x = workarea.width + workarea.x - c:geometry().width - 321 | beautiful.useless_gap * 2 - beautiful.border_width * 2, 322 | nil, 323 | nil, 324 | nil 325 | }) 326 | end 327 | end 328 | 329 | -- Move client DWIM (Do What I Mean) 330 | -- Move to edge if the client / layout is floating 331 | -- Swap by index if maximized 332 | -- Else swap client by direction 333 | function helpers.move_client_dwim(c, direction) 334 | if c.floating or 335 | (awful.layout.get(mouse.screen) == awful.layout.suit.floating) then 336 | helpers.move_to_edge(c, direction) 337 | elseif awful.layout.get(mouse.screen) == awful.layout.suit.max then 338 | if direction == "up" or direction == "left" then 339 | awful.client.swap.byidx(-1, c) 340 | elseif direction == "down" or direction == "right" then 341 | awful.client.swap.byidx(1, c) 342 | end 343 | else 344 | awful.client.swap.bydirection(direction, c, nil) 345 | end 346 | end 347 | 348 | -- Make client floating and snap to the desired edge 349 | function helpers.float_and_edge_snap(c, direction) 350 | -- if not c.floating then 351 | -- c.floating = true 352 | -- end 353 | naughty.notify({text = "double tap"}) 354 | c.floating = true 355 | local workarea = awful.screen.focused().workarea 356 | if direction == "up" then 357 | local axis = 'horizontally' 358 | local f = awful.placement.scale + awful.placement.top + 359 | (axis and awful.placement['maximize_' .. axis] or nil) 360 | local geo = f(client.focus, { 361 | honor_padding = true, 362 | honor_workarea = true, 363 | to_percent = 0.5 364 | }) 365 | elseif direction == "down" then 366 | local axis = 'horizontally' 367 | local f = awful.placement.scale + awful.placement.bottom + 368 | (axis and awful.placement['maximize_' .. axis] or nil) 369 | local geo = f(client.focus, { 370 | honor_padding = true, 371 | honor_workarea = true, 372 | to_percent = 0.5 373 | }) 374 | elseif direction == "left" then 375 | local axis = 'vertically' 376 | local f = awful.placement.scale + awful.placement.left + 377 | (axis and awful.placement['maximize_' .. axis] or nil) 378 | local geo = f(client.focus, { 379 | honor_padding = true, 380 | honor_workarea = true, 381 | to_percent = 0.5 382 | }) 383 | elseif direction == "right" then 384 | local axis = 'vertically' 385 | local f = awful.placement.scale + awful.placement.right + 386 | (axis and awful.placement['maximize_' .. axis] or nil) 387 | local geo = f(client.focus, { 388 | honor_padding = true, 389 | honor_workarea = true, 390 | to_percent = 0.5 391 | }) 392 | end 393 | end 394 | 395 | -- Rounds a number to any number of decimals 396 | function helpers.round(number, decimals) 397 | local power = 10 ^ decimals 398 | return math.floor(number * power) / power 399 | end 400 | 401 | function helpers.fake_escape() 402 | root.fake_input('key_press', "Escape") 403 | root.fake_input('key_release', "Escape") 404 | end 405 | 406 | function helpers.run_or_raise(match, move, spawn_cmd, spawn_args) 407 | local matcher = function(c) return awful.rules.match(c, match) end 408 | 409 | -- Find and raise 410 | local found = false 411 | for c in awful.client.iterate(matcher) do 412 | found = true 413 | c.minimized = false 414 | if move then 415 | c:move_to_tag(mouse.screen.selected_tag) 416 | client.focus = c 417 | c:raise() 418 | else 419 | c:jump_to() 420 | end 421 | break 422 | end 423 | 424 | -- Spawn if not found 425 | if not found then awful.spawn(spawn_cmd, spawn_args) end 426 | end 427 | 428 | function helpers.pad(size) 429 | local str = "" 430 | for i = 1, size do str = str .. " " end 431 | local pad = wibox.widget.textbox(str) 432 | return pad 433 | end 434 | 435 | function helpers.float_and_resize(c, width, height) 436 | c.width = width 437 | c.height = height 438 | awful.placement.centered(c, {honor_workarea = true, honor_padding = true}) 439 | awful.client.property.set(c, 'floating_geometry', c:geometry()) 440 | c.floating = true 441 | c:raise() 442 | end 443 | 444 | return helpers 445 | 446 | -- EOF ------------------------------------------------------------------------ 447 | --------------------------------------------------------------------------------