do some more
All checks were successful
Hydra nixosConfigurations.oracle-installer Hydra build #27473 of nixos-config:pr618:nixosConfigurations.oracle-installer
Hydra nixosConfigurations.pc-installer Hydra build #27474 of nixos-config:pr618:nixosConfigurations.pc-installer
Hydra nixosConfigurations.rainbow-resort Hydra build #27475 of nixos-config:pr618:nixosConfigurations.rainbow-resort
Hydra nixosConfigurations.thinkrac Hydra build #27476 of nixos-config:pr618:nixosConfigurations.thinkrac

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-24 17:30:01 +01:00
parent 05fe6204bb
commit ff82939650
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
5 changed files with 86 additions and 26 deletions

4
config/sway/cliphist.nix Normal file
View file

@ -0,0 +1,4 @@
{ ... }:
{
services.cliphist.enable = true;
}

View file

@ -65,13 +65,14 @@ in
'';
imports = [
./wl-clipboard.nix
./cliphist.nix
./mako.nix
./swayidle.nix
./rofi.nix
./mpd.nix
];
wayland.windowManager.sway = {
systemd.enable = true;
enable = true;
config = {
modifier = "Mod4";
@ -171,5 +172,20 @@ in
exec_always ${pkgs.xorg.xrandr}/bin/xrandr --output DP-1 --primary
'';
};
qt = {
enable = true;
platformTheme.name = "qtct";
};
systemd.user.services.transparency = {
Unit = {
Description = "transparency";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
ExecStart = "${pkgs.python3.withPackages (ps: with ps; [ i3ipc ])}/bin/python ${./transparency.py}";
};
};
}

View file

@ -4,15 +4,4 @@
enable = true;
defaultTimeout = 30000;
};
systemd.user.services.mako = {
Unit = {
Description = "mako";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
ExecStart = "mako";
};
};
}

View file

@ -0,0 +1,65 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 python3Packages.i3ipc
import i3ipc
import signal
import sys
from functools import partial
foreground_transparency = "0.9"
background_transparency = "0.7"
def on_window_focus(ipc, event):
global prev_focused
focused = event.container
if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
if focused.fullscreen_mode > 0:
focused.command("opacity 1")
else:
focused.command("opacity " + foreground_transparency)
if prev_focused.fullscreen_mode == 0:
prev_focused.command("opacity " + background_transparency)
prev_focused = focused
def on_fullscreen_mode(ipc, event):
global prev_focused
if event.container.id == prev_focused.id:
prev_focused = event.container
if event.container.fullscreen_mode > 0:
event.container.command("opacity 1")
elif event.container.focused:
event.container.command("opacity " + foreground_transparency)
else:
event.container.command("opacity " + background_transparency)
def remove_opacity(ipc):
for workspace in ipc.get_tree().workspaces():
for w in workspace:
w.command("opacity 1")
ipc.main_quit()
sys.exit(0)
if __name__ == '__main__':
ipc = i3ipc.Connection()
prev_args = None
for window in ipc.get_tree():
if window.fullscreen_mode > 0:
window.command("opacity 1")
elif window.focused:
prev_focused = window
window.command("opacity " + foreground_transparency)
else:
window.command("opacity " + background_transparency)
for sig in [signal.SIGINT, signal.SIGTERM]:
signal.signal(sig, lambda signal, frame: remove_opacity(ipc))
ipc.on("window::focus", on_window_focus)
ipc.on("window::fullscreen_mode", on_fullscreen_mode)
ipc.main()

View file

@ -1,14 +0,0 @@
{ pkgs, ... }:
{
systemd.user.services.wl-clipboard = {
Unit = {
Description = "wl-clipboard";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
ExecStart = "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.clipman}/bin/clipman store --no-persist";
};
};
}