swayidle under control
This commit is contained in:
parent
1e0c12efb5
commit
41241710fa
2 changed files with 202 additions and 187 deletions
|
|
@ -4,11 +4,11 @@ set $snd_sink alsa_output.usb-Corsair_CORSAIR_VOID_ELITE_Wireless_Gaming_Dongle-
|
||||||
|
|
||||||
set $lock /home/don/bin/lock.sh
|
set $lock /home/don/bin/lock.sh
|
||||||
#set $lock 'swaylock -f -c 000000'
|
#set $lock 'swaylock -f -c 000000'
|
||||||
exec swayidle -w \
|
#exec swayidle -w \
|
||||||
timeout 300 $lock \
|
# timeout 300 $lock \
|
||||||
timeout 360 'swaymsg "output * dpms off"' \
|
# timeout 360 'swaymsg "output * dpms off"' \
|
||||||
resume 'swaymsg "output * dpms on"' \
|
# resume 'swaymsg "output * dpms on"' \
|
||||||
before-sleep $lock
|
# before-sleep $lock
|
||||||
|
|
||||||
floating_modifier $mod
|
floating_modifier $mod
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,7 @@
|
||||||
{ inputs, outputs, ... }:
|
{ inputs, pkgs, outputs, ... }:
|
||||||
{
|
{
|
||||||
# xdg.configFile."sway/config".source = files/sway/${inputs.networking.hostName};
|
# xdg.configFile."sway/config".source = files/sway/${inputs.networking.hostName};
|
||||||
xdg.configFile."sway/config".source = files/sway/default;
|
xdg.configFile."sway/config".source = files/sway/default;
|
||||||
programs.swaylock = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
ignore-empty-password = true;
|
|
||||||
daemonize = true;
|
|
||||||
indicator-radius = "100";
|
|
||||||
scaling = "fill";
|
|
||||||
#fade-in = "3";
|
|
||||||
#effect-blur = "3x10";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# services.wayland-pipewire-idle-inhibit = {
|
# services.wayland-pipewire-idle-inhibit = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# systemdTarget = "sway-session.target";
|
# systemdTarget = "sway-session.target";
|
||||||
|
|
@ -26,177 +15,203 @@
|
||||||
# ];
|
# ];
|
||||||
# };
|
# };
|
||||||
# };
|
# };
|
||||||
programs.waybar = {
|
services = {
|
||||||
enable = true;
|
swayidle = {
|
||||||
settings = {
|
enable = true;
|
||||||
mainBar = {
|
timeouts = [
|
||||||
ipc = true;
|
{ timeout = 300; command = "/home/bin/don/lock.sh"; }
|
||||||
position = "bottom";
|
{ timeout = 360; command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; }
|
||||||
height = 10;
|
];
|
||||||
spacing = 0;
|
events = [
|
||||||
modules-left = ["sway/workspaces" "sway/mode" "wlr/workspaces" "custom/mycal"];
|
{ event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; }
|
||||||
modules-center = [];
|
{ event = "before-sleep"; command = "/home/bin/don/lock.sh"; }
|
||||||
modules-right = ["idle_inhibitor" "custom/mytimew" "pulseaudio" "custom/mymusic" "bluetooth" "network" "backlight" "battery" "battery#bat2" "tray" "custom/mycal" "clock"];
|
];
|
||||||
bluetooth = {
|
};
|
||||||
format-alt = "bt: {status}";
|
};
|
||||||
format-on = "bt";
|
programs = {
|
||||||
format-connected = "^bt";
|
swaylock = {
|
||||||
format-off = "!bt";
|
enable = true;
|
||||||
format-disabled = "xbt";
|
settings = {
|
||||||
on-click = "bluetoogle";
|
ignore-empty-password = true;
|
||||||
tooltip-format = "{status}";
|
daemonize = true;
|
||||||
};
|
indicator-radius = "100";
|
||||||
backlight = {
|
scaling = "fill";
|
||||||
device = "intel_backlight";
|
#fade-in = "3";
|
||||||
format = "{icon} {percent}%";
|
#effect-blur = "3x10";
|
||||||
format-alt-click = "click-right";
|
|
||||||
on-scroll-down = "light -A 1";
|
|
||||||
on-scroll-up = "light -U 1";
|
|
||||||
};
|
|
||||||
"custom/mytimew" = {
|
|
||||||
exec = "~/bin/timebar";
|
|
||||||
interval = 30;
|
|
||||||
on-click = "alacritty -e ~/bin/ttmenu";
|
|
||||||
};
|
|
||||||
"custom/mycal" = {
|
|
||||||
exec = "~/bin/show-next-event";
|
|
||||||
interval = 300;
|
|
||||||
on-click = "~/bin/mynewterm -e ikhal";
|
|
||||||
};
|
|
||||||
"custom/mymusic" = {
|
|
||||||
exec = "~/bin/show-playing";
|
|
||||||
on-click = "~/bin/control-music --pause";
|
|
||||||
interval = 5;
|
|
||||||
};
|
|
||||||
"sway/window" = {
|
|
||||||
icon-size = 10;
|
|
||||||
};
|
|
||||||
"sway/mode" = {
|
|
||||||
format = "<span style=\"italic\">{}</span>";
|
|
||||||
};
|
|
||||||
"idle_inhibitor" = {
|
|
||||||
format = "{icon}";
|
|
||||||
format-icons = {
|
|
||||||
activated = "";
|
|
||||||
deactivated = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tray = {
|
|
||||||
icon-size = 16;
|
|
||||||
spacing = 10;
|
|
||||||
};
|
|
||||||
clock = {
|
|
||||||
tooltip-format = "<big>{:%Y %B %d}</big>\n<tt><small>{calendar}</small></tt>";
|
|
||||||
format = "{:%I:%M %p}";
|
|
||||||
format-alt = "{:%Y-%m-%d}";
|
|
||||||
on-click = "~/bin/mynewterm -e ikhal";
|
|
||||||
};
|
|
||||||
cpu = {
|
|
||||||
format = "cpu: {usage}%";
|
|
||||||
tooltip = false;
|
|
||||||
};
|
|
||||||
memory = {
|
|
||||||
format = "mem: {}%";
|
|
||||||
};
|
|
||||||
temperature = {
|
|
||||||
critical-threshold = 80;
|
|
||||||
format = "{temperatureC}°C {icon}";
|
|
||||||
};
|
|
||||||
battery = {
|
|
||||||
states = {
|
|
||||||
good = 75;
|
|
||||||
warning = 20;
|
|
||||||
critical = 10;
|
|
||||||
};
|
|
||||||
format = "{capacity}% {time}";
|
|
||||||
format-charging = "c:{capacity}% {time}";
|
|
||||||
format-plugged = "p:{capacity}% {time}";
|
|
||||||
format-discharging = "d:{capacity}% {time}";
|
|
||||||
format-alt = "{time} {icon}";
|
|
||||||
};
|
|
||||||
"battery#bat2" = {
|
|
||||||
bat = "BAT2";
|
|
||||||
};
|
|
||||||
network = {
|
|
||||||
format-wifi = "{essid} ({signalStrength}%)";
|
|
||||||
format-ethernet = "{ipaddr}/{cidr}";
|
|
||||||
tooltip-format = "{ifname} via {gwaddr}";
|
|
||||||
format-linked = "{ifname} (No IP)";
|
|
||||||
format-disconnected = "Disconnected";
|
|
||||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
|
||||||
};
|
|
||||||
pulseaudio = {
|
|
||||||
format = "v:{volume}%";
|
|
||||||
format-bluetooth = "{volume}% {icon} {format_source}";
|
|
||||||
format-bluetooth-muted = " {icon} {format_source}";
|
|
||||||
format-muted = "muted";
|
|
||||||
format-source = "v:{volume}% ";
|
|
||||||
format-source-muted = "";
|
|
||||||
format-icons = {
|
|
||||||
headphone = "hp";
|
|
||||||
hands-free = "hf";
|
|
||||||
headset = "hs";
|
|
||||||
phone = "p";
|
|
||||||
};
|
|
||||||
on-click = "pavucontrol";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
style =
|
waybar = {
|
||||||
''
|
enable = true;
|
||||||
* {
|
settings = {
|
||||||
border: none; border-radius: 0;
|
mainBar = {
|
||||||
font-family: "JetBrains Mono", FontAwesome6Free, SymbolsNerdFont, Roboto, Helvetica, Arial, sans-serif;
|
ipc = true;
|
||||||
font-size: 10px; min-height: 0;
|
position = "bottom";
|
||||||
|
height = 10;
|
||||||
|
spacing = 0;
|
||||||
|
modules-left = ["sway/workspaces" "sway/mode" "wlr/workspaces" "custom/mycal"];
|
||||||
|
modules-center = [];
|
||||||
|
modules-right = ["idle_inhibitor" "custom/mytimew" "pulseaudio" "custom/mymusic" "bluetooth" "network" "backlight" "battery" "battery#bat2" "tray" "custom/mycal" "clock"];
|
||||||
|
bluetooth = {
|
||||||
|
format-alt = "bt: {status}";
|
||||||
|
format-on = "bt";
|
||||||
|
format-connected = "^bt";
|
||||||
|
format-off = "!bt";
|
||||||
|
format-disabled = "xbt";
|
||||||
|
on-click = "bluetoogle";
|
||||||
|
tooltip-format = "{status}";
|
||||||
|
};
|
||||||
|
backlight = {
|
||||||
|
device = "intel_backlight";
|
||||||
|
format = "{icon} {percent}%";
|
||||||
|
format-alt-click = "click-right";
|
||||||
|
on-scroll-down = "light -A 1";
|
||||||
|
on-scroll-up = "light -U 1";
|
||||||
|
};
|
||||||
|
"custom/mytimew" = {
|
||||||
|
exec = "~/bin/timebar";
|
||||||
|
interval = 30;
|
||||||
|
on-click = "alacritty -e ~/bin/ttmenu";
|
||||||
|
};
|
||||||
|
"custom/mycal" = {
|
||||||
|
exec = "~/bin/show-next-event";
|
||||||
|
interval = 300;
|
||||||
|
on-click = "~/bin/mynewterm -e ikhal";
|
||||||
|
};
|
||||||
|
"custom/mymusic" = {
|
||||||
|
exec = "~/bin/show-playing";
|
||||||
|
on-click = "~/bin/control-music --pause";
|
||||||
|
interval = 5;
|
||||||
|
};
|
||||||
|
"sway/window" = {
|
||||||
|
icon-size = 10;
|
||||||
|
};
|
||||||
|
"sway/mode" = {
|
||||||
|
format = "<span style=\"italic\">{}</span>";
|
||||||
|
};
|
||||||
|
"idle_inhibitor" = {
|
||||||
|
format = "{icon}";
|
||||||
|
format-icons = {
|
||||||
|
activated = "";
|
||||||
|
deactivated = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tray = {
|
||||||
|
icon-size = 16;
|
||||||
|
spacing = 10;
|
||||||
|
};
|
||||||
|
clock = {
|
||||||
|
tooltip-format = "<big>{:%Y %B %d}</big>\n<tt><small>{calendar}</small></tt>";
|
||||||
|
format = "{:%I:%M %p}";
|
||||||
|
format-alt = "{:%Y-%m-%d}";
|
||||||
|
on-click = "~/bin/mynewterm -e ikhal";
|
||||||
|
};
|
||||||
|
cpu = {
|
||||||
|
format = "cpu: {usage}%";
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
memory = {
|
||||||
|
format = "mem: {}%";
|
||||||
|
};
|
||||||
|
temperature = {
|
||||||
|
critical-threshold = 80;
|
||||||
|
format = "{temperatureC}°C {icon}";
|
||||||
|
};
|
||||||
|
battery = {
|
||||||
|
states = {
|
||||||
|
good = 75;
|
||||||
|
warning = 20;
|
||||||
|
critical = 10;
|
||||||
|
};
|
||||||
|
format = "{capacity}% {time}";
|
||||||
|
format-charging = "c:{capacity}% {time}";
|
||||||
|
format-plugged = "p:{capacity}% {time}";
|
||||||
|
format-discharging = "d:{capacity}% {time}";
|
||||||
|
format-alt = "{time} {icon}";
|
||||||
|
};
|
||||||
|
"battery#bat2" = {
|
||||||
|
bat = "BAT2";
|
||||||
|
};
|
||||||
|
network = {
|
||||||
|
format-wifi = "{essid} ({signalStrength}%)";
|
||||||
|
format-ethernet = "{ipaddr}/{cidr}";
|
||||||
|
tooltip-format = "{ifname} via {gwaddr}";
|
||||||
|
format-linked = "{ifname} (No IP)";
|
||||||
|
format-disconnected = "Disconnected";
|
||||||
|
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||||
|
};
|
||||||
|
pulseaudio = {
|
||||||
|
format = "v:{volume}%";
|
||||||
|
format-bluetooth = "{volume}% {icon} {format_source}";
|
||||||
|
format-bluetooth-muted = " {icon} {format_source}";
|
||||||
|
format-muted = "muted";
|
||||||
|
format-source = "v:{volume}% ";
|
||||||
|
format-source-muted = "";
|
||||||
|
format-icons = {
|
||||||
|
headphone = "hp";
|
||||||
|
hands-free = "hf";
|
||||||
|
headset = "hs";
|
||||||
|
phone = "p";
|
||||||
|
};
|
||||||
|
on-click = "pavucontrol";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
style =
|
||||||
|
''
|
||||||
|
* {
|
||||||
|
border: none; border-radius: 0;
|
||||||
|
font-family: "JetBrains Mono", FontAwesome6Free, SymbolsNerdFont, Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 10px; min-height: 0;
|
||||||
}
|
}
|
||||||
window#waybar {
|
window#waybar {
|
||||||
background: rgba(43, 48, 59, 0.5);
|
background: rgba(43, 48, 59, 0.5);
|
||||||
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
window#waybar.hidden { opacity: 0.0; }
|
window#waybar.hidden { opacity: 0.0; }
|
||||||
#workspaces button {
|
#workspaces button {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
border-bottom: 3px solid transparent;
|
border-bottom: 3px solid transparent;
|
||||||
}
|
}
|
||||||
#workspaces button.focused { background: #64727D; border-bottom: 3px solid #ffffff; }
|
#workspaces button.focused { background: #64727D; border-bottom: 3px solid #ffffff; }
|
||||||
#workspaces button.urgent { background-color: #eb4d4b; }
|
#workspaces button.urgent { background-color: #eb4d4b; }
|
||||||
#mode { background: #64727D; border-bottom: 3px solid #ffffff; }
|
#mode { background: #64727D; border-bottom: 3px solid #ffffff; }
|
||||||
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mymusic, #tray, #mode, #idle_inhibitor, #bluetooth {
|
#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mymusic, #tray, #mode, #idle_inhibitor, #bluetooth {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
margin: 0 0px;
|
margin: 0 0px;
|
||||||
}
|
}
|
||||||
#clock { background-color: #64727D; color: #f1fa8c; }
|
#clock { background-color: #64727D; color: #f1fa8c; }
|
||||||
#battery { color: #000000; background-color: #50fa7b; }
|
#battery { color: #000000; background-color: #50fa7b; }
|
||||||
#battery.warning { color: #000000; background-color: #ff79c6; }
|
#battery.warning { color: #000000; background-color: #ff79c6; }
|
||||||
#battery.critical { color: #ffffff; background-color: #ff5555; }
|
#battery.critical { color: #ffffff; background-color: #ff5555; }
|
||||||
#battery.charging { color: #44475a; background-color: #50fa7b; }
|
#battery.charging { color: #44475a; background-color: #50fa7b; }
|
||||||
@keyframes blink { to { background-color: #ffffff; color: #000000; } }
|
@keyframes blink { to { background-color: #ffffff; color: #000000; } }
|
||||||
#battery.critical:not(.charging) {
|
#battery.critical:not(.charging) {
|
||||||
background: #f53c3c; color: #ffffff;
|
background: #f53c3c; color: #ffffff;
|
||||||
animation-name: blink; animation-duration: 0.5s;
|
animation-name: blink; animation-duration: 0.5s;
|
||||||
animation-timing-function: linear;
|
animation-timing-function: linear;
|
||||||
animation-iteration-count: infinite;
|
animation-iteration-count: infinite;
|
||||||
animation-direction: alternate;
|
animation-direction: alternate;
|
||||||
}
|
}
|
||||||
#cpu { background: #2ecc71; color: #000000; }
|
#cpu { background: #2ecc71; color: #000000; }
|
||||||
#memory { background: #9b59b6; }
|
#memory { background: #9b59b6; }
|
||||||
#backlight { color: #000000; background: #90b1b1; }
|
#backlight { color: #000000; background: #90b1b1; }
|
||||||
#bluetooth { background: #ffb86c; color: #000000; }
|
#bluetooth { background: #ffb86c; color: #000000; }
|
||||||
#network { background: #bd93f9; color: #000000; }
|
#network { background: #bd93f9; color: #000000; }
|
||||||
#network.disconnected { background: #ff5555; }
|
#network.disconnected { background: #ff5555; }
|
||||||
#pulseaudio { background: #ffb86c; color: #000000; }
|
#pulseaudio { background: #ffb86c; color: #000000; }
|
||||||
#pulseaudio.muted { background: #90b1b1; color: #2a5c45; }
|
#pulseaudio.muted { background: #90b1b1; color: #2a5c45; }
|
||||||
#custom-mytimew { background: #bd93f9; color: #000000; }
|
#custom-mytimew { background: #bd93f9; color: #000000; }
|
||||||
#custom-mymusic { background: #8be9fd; color: #000000; }
|
#custom-mymusic { background: #8be9fd; color: #000000; }
|
||||||
#custom-mycal { background: #cccc99; color: #2a5c45; }
|
#custom-mycal { background: #cccc99; color: #2a5c45; }
|
||||||
#temperature { background: #f0932b; }
|
#temperature { background: #f0932b; }
|
||||||
#temperature.critical { background: #eb4d4b; }
|
#temperature.critical { background: #eb4d4b; }
|
||||||
#tray { background-color: #64727D; }
|
#tray { background-color: #64727D; }
|
||||||
#idle_inhibitor { background-color: #2d3436; }
|
#idle_inhibitor { background-color: #2d3436; }
|
||||||
#idle_inhibitor.activated { background-color: #ecf0f1; color: #2d3436; }
|
#idle_inhibitor.activated { background-color: #ecf0f1; color: #2d3436; }
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue