Update wob config

This commit is contained in:
Kiana Sheibani 2023-01-07 20:52:23 -05:00
parent 84c8f5097d
commit 5c30019fc3
9 changed files with 37 additions and 19 deletions

View file

@ -1,5 +1,5 @@
{ config, lib, ... }:
lib.mkIf (config.custom.platform == "laptop") {
lib.mkIf (config.platform == "laptop") {
services.upower = {
enable = true;

View file

@ -1,5 +1,5 @@
{ config, lib, pkgs, tokyo-night-sddm-src, ... }:
lib.mkIf (config.custom.platform != "mobile")
lib.mkIf (config.platform != "mobile")
(let
tokyo-night-sddm = with pkgs.libsForQt5; pkgs.stdenv.mkDerivation {
name = "tokyo-night-sddm";

View file

@ -22,10 +22,6 @@ in {
(aspellWithDicts (ps: with ps; [ en en-computers en-science ]))
gcc
wob
grim
slurp
imv
direnv
nix-direnv-with-flakes

View file

@ -32,14 +32,14 @@ outputs = { self,
./platform.nix
./hardware-configuration/desktop.nix
{ _module.args = moduleArgs;
custom.platform = "desktop"; }
platform = "desktop"; }
home-manager.nixosModules.home-manager
{
home-manager.users.${username} = import ./home-manager;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [ ./platform.nix { custom.platform = "desktop"; } ];
home-manager.sharedModules = [ ./platform.nix { platform = "desktop"; } ];
home-manager.extraSpecialArgs = moduleArgs;
}
];
@ -51,7 +51,7 @@ outputs = { self,
./config
{ _module.args = moduleArgs;
custom.platform = "laptop"; }
platform = "laptop"; }
./platform.nix
./hardware-configuration/laptop.nix
home-manager.nixosModules.home-manager
@ -61,7 +61,7 @@ outputs = { self,
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [ ./platform.nix { custom.platform = "laptop"; } ];
home-manager.sharedModules = [ ./platform.nix { platform = "laptop"; } ];
home-manager.extraSpecialArgs = moduleArgs;
}
];

View file

@ -11,5 +11,6 @@
./mako.nix
./rofi.nix
./waybar.nix
./wob.nix
];
}

View file

@ -3,7 +3,14 @@ let
modifier = "Mod4";
terminal = "alacritty";
in {
home.packages = with pkgs; [ swayidle wl-clipboard wlroots ];
home.packages = with pkgs; [
swayidle
wl-clipboard
wlroots
grim
slurp
imv
];
wayland.windowManager.sway = {
enable = true;
@ -53,9 +60,10 @@ in {
startup = map (x: { command = x; }) [
# Make wob channels
''mkfifo $SWAYSOCK.volume.wob && tail -f $SWAYSOCK.volume.wob | wob''
''mkfifo $SWAYSOCK.brightness.wob && tail -f $SWAYSOCK.brightness.wob | wob \
--border-color "#FFFF00FF" --bar-color "#FFFF00FF"''
''mkfifo $XDG_RUNTIME_DIR/wob_volume.sock && tail -f $XDG_RUNTIME_DIR/wob_volume.sock \
| wob -c ~/.config/wob/volume.ini''
''mkfifo $XDG_RUNTIME_DIR/wob_brightness.sock && tail -f $XDG_RUNTIME_DIR/wob_brightness.sock \
| wob -c ~/.config/wob/brightness.ini''
''swayidle timeout 120 'swaylock -f --grace=180' \
timeout 600 'systemctl suspend' \
before-sleep 'swaylock -f' ''
@ -65,10 +73,10 @@ in {
keybindings = let
# Volume using pamixer and wob
audio-disp = ''pamixer --get-volume > $SWAYSOCK.volume.wob'';
audio-disp = ''pamixer --get-volume > $XDG_RUNTIME_DIR/wob_volume.sock'';
audio = cmd: "exec pamixer ${cmd} && ${audio-disp}";
# Brightness using brightnessctl and wob
brightness-disp = ''brightnessctl -e -m | cut -d "," -f4 | tr -d "%" > $SWAYSOCK.brightness.wob'';
brightness-disp = ''brightnessctl -e -m | cut -d "," -f4 | tr -d "%" > $XDG_RUNTIME_DIR/wob_brightness.sock'';
brightness = x: "exec brightnessctl -e set ${x} && ${brightness-disp}";
# Play controls using playerctl
playerctl = cmd: "exec playerctl ${cmd}";

View file

@ -14,7 +14,7 @@
modules-center = [ "sway/window" ];
modules-right =
if config.custom.platform == "laptop" then
if config.platform == "laptop" then
[ "battery" "pulseaudio" "backlight" "network" "clock" "idle_inhibitor" ]
else
[ "pulseaudio" "network" "clock" "idle_inhibitor" ];
@ -243,7 +243,7 @@
#pulseaudio {
background-color: @altblend;
${
if config.custom.platform == "laptop" then
if config.platform == "laptop" then
''
margin: 3px 0px 3px 2px;
padding-right: 5px;

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
home.packages = [ pkgs.wob ];
xdg.configFile = rec {
"wob/volume.ini".text = "";
"wob/brightness.ini".text = "wob/volume.ini".text + ''
border_color = #FFFF00FF
bar_color = #FFFF00FF
'';
}
}

View file

@ -1,6 +1,6 @@
{ lib, ... }:
{
options.custom.platform = lib.mkOption {
options.platform = lib.mkOption {
description = "The platform to configure for";
type = lib.types.enum [ "desktop" "laptop" "mobile" ];
};