From 146d85af8b54d8e346adcde9eb02917138172145 Mon Sep 17 00:00:00 2001 From: Michal Zielonka Date: Mon, 2 Jun 2025 15:36:29 +0200 Subject: swap_enabled is not accessable in FreeBSD 15/Current instead of swap_enabled in top program currently checking number of swap devices is used. --- src/Xmobar/Plugins/Monitors/Swap/FreeBSD.hsc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Xmobar/Plugins/Monitors/Swap/FreeBSD.hsc b/src/Xmobar/Plugins/Monitors/Swap/FreeBSD.hsc index 9c74e36..90c58c1 100644 --- a/src/Xmobar/Plugins/Monitors/Swap/FreeBSD.hsc +++ b/src/Xmobar/Plugins/Monitors/Swap/FreeBSD.hsc @@ -71,11 +71,10 @@ instance Storable SwapData where poke _ _ = pure () - isEnabled :: IO Bool isEnabled = do - enabled <- sysctlReadUInt "vm.swap_enabled" - return $ enabled == 1 + nswapdev <- sysctlReadUInt "vm.nswapdev" + return $ nswapdev > 0 parseMEM' :: Bool -> IO [Float] parseMEM' False = return [] -- cgit v1.2.3