update: dotfiles

This commit is contained in:
rxyhn 2022-03-09 17:11:37 +07:00
parent a03dd3ad40
commit 7197ba0f43
6 changed files with 59 additions and 23 deletions

View file

@ -23,17 +23,15 @@ local powermenu = {
{"Lock Screen", function() lock_screen_show() end}
}
local appmenu = {
{"Terminal", terminal},
{"Editor", vscode},
{"File Manager", filemanager},
{"Browser", browser},
{"Discord", discord}
}
local mymainmenu = awful.menu({
items = {
{"AwesomeWM", awesomemenu, beautiful.awesome_logo}, {"Apps", appmenu}, {"Powermenu", powermenu}
{"Terminal", terminal, beautiful.awesome_logo},
{"Code Editor", vscode},
{"File Manager", filemanager},
{"Web Browser", browser},
{"Discord", discord},
{"AwesomeWM", awesomemenu},
{"Power Menu", powermenu}
}
})

View file

@ -6,4 +6,5 @@ require("signal.ram")
require("signal.todo")
require("signal.weather")
require("signal.playerctl")
require("signal.network")
require("signal.network")
require("signal.uptime")

View file

@ -0,0 +1,38 @@
-- Provides:
-- signal::uptime
-- up (string)
local awful = require("awful")
local naughty = require("naughty")
local uptime_script = [[
sh -c "
cmd=$(uptime)
hr=$( echo $cmd | cut -d \":\" -f3 | awk '{print $NF}')
mt=$( echo $cmd | cut -d \":\" -f4 | cut -c1-2 )
day=$(echo $cmd | grep day)
if [ -z \"$day\" ]; then
hour=$(uptime -p | grep hour)
if [ -z \"$hour\" ]; then
uptime -p | awk '{print $2$3}' | cut -c1-3
else
echo \"${hr}h ${mt}m\"
fi
else
day=$(echo $day | cut -d \" \" -f3)
echo \"${day}d ${hr}h ${mt}m\"
fi
"]]
local update_interval = 60
-- Periodically get uptime info
awful.widget.watch(uptime_script, update_interval, function(_, stdout)
local uptime_value = stdout
uptime_value = string.gsub(uptime_value, '^%s*(.-)%s*$', '%1')
awesome.emit_signal("signal::uptime", uptime_value)
end)

View file

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d9d7d6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevrons-right"><polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline></svg>

Before

Width:  |  Height:  |  Size: 313 B

View file

@ -191,16 +191,17 @@ theme.tooltip_opacity = 1
theme.tooltip_align = "top"
-- Menu
theme.menu_font = theme.font
theme.menu_height = dpi(30)
theme.menu_width = dpi(140)
theme.menu_font = theme.font_name .. "medium 9"
theme.menu_bg_focus = theme.lighter_bg
theme.menu_fg_focus = theme.xforeground
theme.menu_bg_normal = theme.xbackground
theme.menu_fg_focus = theme.xforeground
theme.menu_fg_normal = theme.xforeground
theme.menu_submenu_icon = gears.filesystem.get_configuration_dir() .. "theme/assets/icons/submenu.svg"
theme.menu_height = dpi(20)
theme.menu_width = dpi(130)
theme.menu_border_color = theme.xcolor8
theme.menu_border_width = theme.border_width / 2
theme.menu_submenu = "» "
theme.menu_submenu_icon = nil
-- Hotkeys Pop Up
theme.hotkeys_font = theme.font

View file

@ -251,18 +251,17 @@ local uptime_label = wibox.widget{
widget = wibox.widget.textbox
}
local uptime_value = wibox.widget.textbox()
awful.widget.watch("sh -c 'uptime -p | sed 's/^...//' | sed 's/.d..../d/' | sed 's/.h...../h/' | sed 's/.m....../m/''", 60, function(_, stdout)
local out = stdout:gsub("^%s*(.-)%s*$", "%1")
uptime_value.text = out
end)
local uptime_text = wibox.widget {
font = beautiful.font_name .. "bold 13",
markup = helpers.colorize_text("-", beautiful.xcolor5),
valign = "center",
widget = uptime_value
widget = wibox.widget.textbox
}
awesome.connect_signal("signal::uptime", function(uptime_value)
uptime_text.markup = uptime_value
end)
local uptime_container = wibox.widget{
separator,
{