[xmonad] workspaces conditional on host name
Ramon Diaz-Uriarte
rdiaz02 at gmail.com
Tue Sep 20 09:13:22 UTC 2022
Thanks! I'll give that a try (what I found interesting of using getEnv, though, is that it seems simple to use arbitrary variables I set for ad-hoc needs in .profile, even if it is kind of a kludge).
Best,
R.
On Tue, 20-September-2022, at 06:58:14, Platon Pronko <platon7pronko at gmail.com> wrote:
> Using environment variables to get hostname feels a bit unstable. I personally
> read /etc/hostname to determine the hostname, like this:
>
> hostname <- fmap trimString (readFile "/etc/hostname")
>
> where `trimString` is:
>
> trimString :: String -> String
> trimString = f . f
> where f = reverse . dropWhile isSpace
>
> There's also `hostname` package, which uses proper library functions to determine
> hostname: https://hackage.haskell.org/package/hostname
--
Ramon Diaz-Uriarte
Department of Biochemistry, Lab B-31
Facultad de Medicina
Universidad Autónoma de Madrid
Arzobispo Morcillo, 4
28029 Madrid
Spain
Phone: +34-91-497-2412
Email: rdiaz02 at gmail.com
r.diaz at uam.es
https://ligarto.org/rdiaz
More information about the xmonad
mailing list