go back to a more elegant and consistent look, while merging some of the ideas of the previous one
This commit is contained in:
parent
5a600d1cdc
commit
2b59f0f44d
3 changed files with 83 additions and 23 deletions
|
@ -14,7 +14,7 @@
|
|||
"output": "DP-2",
|
||||
"layer": "top",
|
||||
"modules-left": ["hyprland/workspaces", "hyprland/mode"],
|
||||
"modules-center": ["group/statistics", "group/status", "group/networks", "group/audio-player"],
|
||||
"modules-center": ["group/statistics", "group/status", "custom/pacman", "group/networks", "bluetooth", "group/audio-player"],
|
||||
/* "modules-right": ["tray", "custom/scratchpad-indicator", "pulseaudio",], */
|
||||
"modules-right": ["group/taskbar", "group/group-power"],
|
||||
|
||||
|
@ -120,7 +120,7 @@
|
|||
]
|
||||
},
|
||||
"custom/pacman": {
|
||||
"format": "<span color=\"#8BE9FD\"> </span>{} | ",
|
||||
"format": "<span color=\"#8BE9FD\"> </span>{}",
|
||||
"tooltip": true,
|
||||
"tooltip-format": "Available updates",
|
||||
"interval": 60,
|
||||
|
@ -159,10 +159,8 @@
|
|||
"group/networks": {
|
||||
"orientation": "inherit",
|
||||
"modules": [
|
||||
"custom/pacman",
|
||||
"network",
|
||||
"custom/vpn",
|
||||
"bluetooth"
|
||||
]
|
||||
},
|
||||
"network": {
|
||||
|
@ -214,11 +212,11 @@
|
|||
},
|
||||
"cpu": {
|
||||
"interval": 10,
|
||||
"format": "<span color=\"#cf7cac\">{icon}</span> {usage}% | ",
|
||||
"format": "<span color=\"#cf7cac\">{icon}</span> {usage}%",
|
||||
"format-icons": [""]
|
||||
},
|
||||
"memory": {
|
||||
"format": "<span color=\"#8BE9FD\">{icon}</span> {percentage}% | ",
|
||||
"format": "<span color=\"#8BE9FD\">{icon}</span> {percentage}%",
|
||||
"format-icons": [""]
|
||||
},
|
||||
"temperature": {
|
||||
|
@ -245,22 +243,22 @@
|
|||
},
|
||||
"disk": {
|
||||
"interval": 30,
|
||||
"format": " <span color=\"#8694c0\"></span><span color=\"#50FA7B\"> </span>/: {percentage_used}% | ",
|
||||
"format": " <span color=\"#8694c0\"></span><span color=\"#50FA7B\"> </span>/: {percentage_used}%",
|
||||
"path": "/"
|
||||
},
|
||||
"disk#disk2": {
|
||||
"interval": 30,
|
||||
"format": " <span color=\"#ff79c6\"> </span>SSD: {percentage_used}% | ",
|
||||
"format": " <span color=\"#ff79c6\"> </span>SSD: {percentage_used}%",
|
||||
"path": "/mnt/SSD"
|
||||
},
|
||||
"disk#disk3": {
|
||||
"interval": 30,
|
||||
"format": " <span color=\"#8BE9FD\"> </span>Games: {percentage_used}% | ",
|
||||
"format": " <span color=\"#8BE9FD\"> </span>Games: {percentage_used}%",
|
||||
"path": "/media/Games"
|
||||
},
|
||||
"disk#disk4": {
|
||||
"interval": 30,
|
||||
"format": " <span color=\"#ffb86c\"> </span>Backups: {percentage_used}% | ",
|
||||
"format": " <span color=\"#ffb86c\"> </span>Backups: {percentage_used}%",
|
||||
"path": "/mnt/Backups"
|
||||
},"pulseaudio": {
|
||||
"format": "{volume}% {icon}",
|
||||
|
@ -296,7 +294,7 @@
|
|||
"tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%"
|
||||
},
|
||||
"custom/vpn": {
|
||||
"format": "<span color=\"#ff5555\"> </span> | ",
|
||||
"format": "<span color=\"#ff5555\"> </span>",
|
||||
"tooltip": true,
|
||||
"tooltip-format": "Connected to VPN",
|
||||
"exec": "echo '{\"class\": \"connected\"}'",
|
||||
|
@ -315,7 +313,7 @@
|
|||
},
|
||||
"custom/gpu-usage": {
|
||||
"exec": "cat /sys/class/hwmon/hwmon1/device/gpu_busy_percent",
|
||||
"format": "<span color=\"#8694c0\"></span><span color=\"#bd93f9\"> </span>{}% | ",
|
||||
"format": "<span color=\"#8694c0\"></span><span color=\"#bd93f9\"> </span>{}% ",
|
||||
"return-type": "",
|
||||
"interval": 1,
|
||||
"tooltip": false
|
||||
|
|
|
@ -70,6 +70,17 @@ window#waybar.hidden {
|
|||
|
||||
#bluetooth {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #f8f8f2;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
#battery {
|
||||
|
@ -133,7 +144,8 @@ window#waybar.hidden {
|
|||
#clock {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
#statistics {
|
||||
#custom-gpu-usage {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
|
@ -143,14 +155,34 @@ window#waybar.hidden {
|
|||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
color: #f8f8f2;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: #282a36;
|
||||
}
|
||||
#cpu {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
#taskbar {
|
||||
|
@ -167,10 +199,30 @@ window#waybar.hidden {
|
|||
|
||||
#disk {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
color: #f8f8f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
|
@ -280,5 +332,15 @@ window#waybar.hidden {
|
|||
}
|
||||
#custom-pacman {
|
||||
color: #f8f2f2;
|
||||
margin-top: 6px;
|
||||
margin-left: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
margin-bottom: 0px;
|
||||
border-radius: 10px;
|
||||
transition: none;
|
||||
background: #282a36;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ local M = {}
|
|||
|
||||
function M:peek(job)
|
||||
local child = Command("ouch")
|
||||
:args({ "l", "-t", "-y", tostring(job.file.url) })
|
||||
:arg({ "l", "-t", "-y", tostring(job.file.url) })
|
||||
:stdout(Command.PIPED)
|
||||
:stderr(Command.PIPED)
|
||||
:spawn()
|
||||
local limit = job.area.h
|
||||
local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)")
|
||||
local lines = string.format("📁 \x1b[2m%s\x1b[0m\n", file_name)
|
||||
local lines = string.format("\u{1f4c1} %s\n", file_name)
|
||||
local num_lines = 1
|
||||
local num_skip = 0
|
||||
repeat
|
||||
|
@ -31,12 +31,12 @@ function M:peek(job)
|
|||
|
||||
child:start_kill()
|
||||
if job.skip > 0 and num_lines < limit then
|
||||
ya.manager_emit(
|
||||
ya.emit(
|
||||
"peek",
|
||||
{ tostring(math.max(0, job.skip - (limit - num_lines))), only_if = tostring(job.file.url), upper_bound = "" }
|
||||
)
|
||||
else
|
||||
ya.preview_widgets(job, { ui.Text(lines):area(job.area) })
|
||||
ya.preview_widget(job, { ui.Text(lines):area(job.area) })
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -44,7 +44,7 @@ function M:seek(job)
|
|||
local h = cx.active.current.hovered
|
||||
if h and h.url == job.file.url then
|
||||
local step = math.floor(job.units * job.area.h / 10)
|
||||
ya.manager_emit("peek", {
|
||||
ya.emit("peek", {
|
||||
math.max(0, cx.active.preview.skip + step),
|
||||
only_if = tostring(job.file.url),
|
||||
})
|
||||
|
@ -81,15 +81,15 @@ local get_compression_target = ya.sync(function()
|
|||
table.insert(paths, tostring(url))
|
||||
end
|
||||
-- The compression targets are aquired, now unselect them
|
||||
ya.manager_emit("escape", {})
|
||||
ya.emit("escape", {})
|
||||
end
|
||||
return paths, default_name
|
||||
end)
|
||||
|
||||
local function invoke_compress_command(paths, name)
|
||||
local cmd_output, err_code = Command("ouch")
|
||||
:args({ "c", "-y" })
|
||||
:args(paths)
|
||||
:arg({ "c", "-y" })
|
||||
:arg(paths)
|
||||
:arg(name)
|
||||
:stderr(Command.PIPED)
|
||||
:output()
|
||||
|
@ -116,7 +116,7 @@ function M:entry(job)
|
|||
default_fmt = "zip"
|
||||
end
|
||||
|
||||
ya.manager_emit("escape", { visual = true })
|
||||
ya.emit("escape", { visual = true })
|
||||
|
||||
-- Get the files that need to be compressed and infer a default archive name
|
||||
local paths, default_name = get_compression_target()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue