From 3fabfaaec116f9098ae8294eeea3b677cbb696b0 Mon Sep 17 00:00:00 2001 From: Dmitriy Holkin Date: Wed, 12 Feb 2020 02:35:54 +0400 Subject: [PATCH] wip --- modules/applications.nix | 4 ---- modules/power.nix | 18 ++++++++++++++---- modules/workspace/i3/default.nix | 9 ++++----- modules/workspace/i3status-rust/default.nix | 17 ++++++++++++----- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/modules/applications.nix b/modules/applications.nix index ed5cfde..092363c 100644 --- a/modules/applications.nix +++ b/modules/applications.nix @@ -30,10 +30,6 @@ with import ../support.nix { inherit lib config; }; { cmd = "${pkgs.xfce4-14.xfce4-taskmanager}/bin/xfce4-taskmanager"; desktop = "taskmanager"; }; - # monitor = { - # cmd = "${pkgs.ksysguard}/bin/ksysguard"; - # desktop = "ksysguard"; - # }; torrent = { cmd = "${pkgs.qbittorrent}/bin/qbittorrent"; desktop = "qbittorrent"; diff --git a/modules/power.nix b/modules/power.nix index 28b2eeb..1c4eb97 100644 --- a/modules/power.nix +++ b/modules/power.nix @@ -7,8 +7,6 @@ with deviceSpecific; { services.tlp = { enable = isLaptop; extraConfig = '' - # To avoid filesystem corruption on btrfs formatted partitions - # SATA_LINKPWR_ON_BAT=max_performance # Recommended CPU_SCALING_GOVERNOR_ON_AC=powersave CPU_SCALING_GOVERNOR_ON_BAT=powersave @@ -16,10 +14,22 @@ with deviceSpecific; { CPU_HWP_ON_BAT=balance_power CPU_BOOST_ON_AC=1 CPU_BOOST_ON_BAT=0 - DISK_DEVICES="sda nvme0n1" + SCHED_POWERSAVE_ON_AC=0 + SCHED_POWERSAVE_ON_BAT=1 + DISK_DEVICES="nvme0n1 sda" DISK_APM_LEVEL_ON_AC="255 254" - DISK_APM_LEVEL_ON_BAT="128 128" + DISK_APM_LEVEL_ON_BAT="255 254" + # To avoid filesystem corruption on btrfs formatted partitions + SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" + SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" ''; + # TLP >1.3 + # tlp1_3 = '' + # # instead CPU_ENERGY_PERF_POLICY_ON_* + # CPU_ENERGY_PERF_POLICY_ON_AC=balance_performance + # CPU_ENERGY_PERF_POLICY_ON_BAT=balance_power + # ''; + }; services.undervolt = { enable = (device == "Dell-Laptop"); diff --git a/modules/workspace/i3/default.nix b/modules/workspace/i3/default.nix index bb5aa3b..c28bb1a 100644 --- a/modules/workspace/i3/default.nix +++ b/modules/workspace/i3/default.nix @@ -10,10 +10,10 @@ in { package = pkgs.i3-gaps; config = rec { assigns = { - # "" = [ { class = "Chromium"; } { class = "Firefox"; } ]; "" = [ { class = "Spotify"; } - # { class = "PulseEffects"; } + { class = "PulseEffects"; } + { class = "spt"; } ]; "" = [ { class = "^Telegram"; } @@ -26,8 +26,6 @@ in { }; fonts = [ "RobotoMono 9" ]; - bars = [ ]; - # colors = rec { # background = thm.bg; # unfocused = { @@ -94,7 +92,8 @@ in { startup = map (a: { notification = false; } // a) [ { command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; } { command = "${pkgs.pywal}/bin/wal -R"; } - # { command = "${pkgs.spotifywm}/bin/spotifywm"; } + { command = "${pkgs.tdesktop}/bin/telegram-desktop"; } + { command = "${apps.term.cmd} -e spt"; } { command = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"; diff --git a/modules/workspace/i3status-rust/default.nix b/modules/workspace/i3status-rust/default.nix index 32046c3..650ddf6 100644 --- a/modules/workspace/i3status-rust/default.nix +++ b/modules/workspace/i3status-rust/default.nix @@ -30,15 +30,21 @@ in { } ''; - home-manager.users.alukard.xdg.configFile."i3status-rust/config.toml".text = '' + # TODO: rewrite concat + home-manager.users.alukard.xdg.configFile."i3status-rust/config.toml".text = lib.concatStrings ['' theme = "slick" icons = "awesome" [[block]] block = "net" - '' + lib.optionals (device == "Dell-Laptop") '' + '' + (if device == "Dell-Laptop" then '' device = "wlo1" - '' + lib.optionals (isLaptop) '' + '' else "") + (if device == "AMD-Workstation" then '' + device = "enp9s0" + '' else "") + (if isLaptop then '' [[block]] block = "battery" interval = 10 @@ -46,7 +52,8 @@ in { [[block]] block = "backlight" - '' + '' + '' else "") + '' [[block]] block = "custom" command = "${scripts.weather}" @@ -85,5 +92,5 @@ in { block = "time" interval = 1 format = "%a %Y/%m/%d %T" - ''; + '']; } \ No newline at end of file