more laptop config
This commit is contained in:
parent
95f5b94468
commit
1b21c0234d
6 changed files with 92 additions and 48 deletions
|
@ -1,7 +1,6 @@
|
|||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [
|
||||
eww-wayland
|
||||
brightnessctl
|
||||
pamixer
|
||||
lua
|
||||
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||
|
|
|
@ -1,26 +1,17 @@
|
|||
#!/usr/bin/env lua
|
||||
|
||||
function trim(s)
|
||||
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
||||
active_workspace = aw:read("*a")
|
||||
aw:close()
|
||||
|
||||
ew = io.popen("hyprctl workspaces | grep ID | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
||||
existing_workspaces = ew:read("*a")
|
||||
ew:close()
|
||||
|
||||
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
|
||||
|
||||
for i = 1, #existing_workspaces do
|
||||
local c = existing_workspaces:sub(i,i)
|
||||
if tonumber(c) == tonumber(active_workspace) then
|
||||
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..c.." \" \"\")"
|
||||
for i = 1,10 do
|
||||
if i == tonumber(active_workspace) then
|
||||
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"\")"
|
||||
box = box .. btn
|
||||
elseif c ~= "\n" then
|
||||
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..c.."\" \"\")"
|
||||
else
|
||||
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"\")"
|
||||
box = box .. btn
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue