Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
2
answers
2275
views
Toggle fullscreen in Xmonad?
#### I'm new around Xmonad WM and haskell is completely new to me, so be patient. Running the almost stock ArcoLinux Xmonad. I'm trying to setup Xmonad WM to be able to go full screen at anytime and in all apps I want, and bind that to `(modMask, xK_f)` - Basically use that binding as a toggle to go...
#### I'm new around Xmonad WM and haskell is completely new to me, so be patient.
Running the almost stock ArcoLinux Xmonad.
I'm trying to setup Xmonad WM to be able to go full screen at anytime and in all apps I want, and bind that to
(modMask, xK_f)
- Basically use that binding as a toggle to go full screen in some of the apps that I need, especially the browser. while hiding the polybar
completely.
This is my ~/.xmonad/xmonad.sh
import System.IO
import System.Exit
import XMonad
import XMonad.Hooks.SetWMName
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageHelpers(doFullFloat, doCenterFloat, isFullscreen, isDialog)
import XMonad.Config.Desktop
import XMonad.Config.Azerty
import XMonad.Util.Run(spawnPipe)
import XMonad.Actions.SpawnOn
import XMonad.Util.EZConfig (additionalKeys, additionalMouseBindings)
import XMonad.Actions.CycleWS
import XMonad.Hooks.UrgencyHook
import qualified Codec.Binary.UTF8.String as UTF8
import XMonad.Layout.Spacing
import XMonad.Layout.Gaps
import XMonad.Layout.ResizableTile
---import XMonad.Layout.NoBorders
import XMonad.Layout.Fullscreen (fullscreenFull)
import XMonad.Layout.Cross(simpleCross)
import XMonad.Layout.Spiral(spiral)
import XMonad.Layout.ThreeColumns
import XMonad.Layout.MultiToggle
import XMonad.Layout.MultiToggle.Instances
import XMonad.Layout.IndependentScreens
import XMonad.Layout.CenteredMaster(centerMaster)
import Graphics.X11.ExtraTypes.XF86
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import qualified Data.ByteString as B
import Control.Monad (liftM2)
import qualified DBus as D
import qualified DBus.Client as D
myStartupHook = do
spawn "$HOME/.xmonad/scripts/autostart.sh"
setWMName "LG3D"
-- colours
normBord = "#4c566a"
focdBord = "#5e81ac"
fore = "#DEE3E0"
back = "#282c34"
winType = "#c678dd"
--mod4Mask= super key
--mod1Mask= alt key
--controlMask= ctrl key
--shiftMask= shift key
myModMask = mod4Mask
encodeCChar = map fromIntegral . B.unpack
myFocusFollowsMouse = True
myBorderWidth = 2
myWorkspaces = ["\61612","\61899","\61947","\61635","\61502","\61501","\61705","\61564","\62150","\61872"]
--myWorkspaces = ["1","2","3","4","5","6","7","8","9","10"]
--myWorkspaces = ["I","II","III","IV","V","VI","VII","VIII","IX","X"]
myBaseConfig = desktopConfig
-- window manipulations
myManageHook = composeAll . concat $
[ [isDialog --> doCenterFloat]
, [className =? c --> doCenterFloat | c doFloat | t doFloat | r doIgnore | i title =? x resource =? x) --> doShiftAndGo "\61612" | x title =? x resource =? x) --> doShiftAndGo "\61899" | x title =? x resource =? x) --> doShiftAndGo "\61947" | x title =? x resource =? x) --> doShiftAndGo "\61635" | x title =? x resource =? x) --> doShiftAndGo "\61502" | x title =? x resource =? x) --> doShiftAndGo "\61501" | x title =? x resource =? x) --> doShiftAndGo "\61705" | x title =? x resource =? x) --> doShiftAndGo "\61564" | x title =? x resource =? x) --> doShiftAndGo "\62150" | x title =? x resource =? x) --> doShiftAndGo "\61872" | x focus w >> mouseMoveWindow w >> windows W.shiftMaster))
-- mod-button2, Raise the window to the top of the stack
, ((modMask, 2), (\w -> focus w >> windows W.shiftMaster))
-- mod-button3, Set the window to floating mode and resize by dragging
, ((modMask, 3), (\w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster))
]
-- keys config
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
----------------------------------------------------------------------
-- SUPER + FUNCTION KEYS
[ ((modMask, xK_d ), spawn $ "dmenu_run -i -nb '#191919' -nf '#fea63c' -sb '#fea63c' -sf '#191919' -fn 'NotoMonoRegular:bold:pixelsize=15'")
, ((modMask, xK_f), sendMessage $ Toggle NBFULL)
, ((modMask, xK_Return), spawn $ "alacritty" )
, ((modMask, xK_q), kill )
, ((modMask, xK_t), spawn $ "termite" )
, ((modMask, xK_r), spawn $ "rofi -show drun" )
, ((modMask, xK_v), spawn $ "pavucontrol" )
, ((modMask, xK_x), spawn $ "arcolinux-logout" )
, ((modMask, xK_l), spawn $ "betterlockscreen -l" )
, ((modMask, xK_Escape), spawn $ "xkill" )
, ((modMask, xK_e), spawn $ "thunar" )
, ((modMask, xK_s ), spawn $ "xfce4-settings-manager")
--, ((modMask, xK_c), spawn $ "conky-toggle" )
--, ((modMask, xK_y), spawn $ "polybar-msg cmd toggle" )
-- FUNCTION KEYS
, ((0, xK_F12), spawn $ "xfce4-terminal --drop-down" )
-- SUPER + SHIFT KEYS
, ((modMask .|. shiftMask , xK_r ), spawn $ "xmonad --recompile && xmonad --restart")
, ((modMask .|. shiftMask , xK_q ), kill)
-- , ((modMask .|. shiftMask , xK_x ), io (exitWith ExitSuccess))
-- CONTROL + KEYS
-- CONTROL + ALT KEYS
, ((controlMask .|. mod1Mask , xK_v ), spawn $ "virt-manager")
, ((controlMask .|. mod1Mask , xK_Prior ), spawn $ "conky-rotate -p")
, ((controlMask .|. mod1Mask , xK_a ), spawn $ "xfce4-appfinder")
, ((controlMask .|. mod1Mask , xK_b ), spawn $ "thunar")
, ((controlMask .|. mod1Mask , xK_c ), spawn $ "catfish")
, ((controlMask .|. mod1Mask , xK_e ), spawn $ "arcolinux-tweak-tool")
, ((controlMask .|. mod1Mask , xK_f ), spawn $ "firefox")
, ((controlMask .|. mod1Mask , xK_i ), spawn $ "nitrogen")
, ((controlMask .|. mod1Mask , xK_o ), spawn $ "$HOME/.xmonad/scripts/picom-toggle.sh")
, ((controlMask .|. mod1Mask , xK_t ), spawn $ "urxvt")
, ((controlMask .|. mod1Mask , xK_u ), spawn $ "pavucontrol")
--, ((controlMask .|. mod1Mask , xK_r ), spawn $ "rofi-theme-selector")
--, ((controlMask .|. mod1Mask , xK_k ), spawn $ "arcolinux-logout")
--, ((controlMask .|. mod1Mask , xK_l ), spawn $ "arcolinux-logout")
--, ((controlMask .|. mod1Mask , xK_Next ), spawn $ "conky-rotate -n")
-- ALT + ... KEYS
, ((mod1Mask, xK_n), spawn $ "variety -n" )
, ((mod1Mask, xK_F3), spawn $ "xfce4-appfinder" )
, ((mod1Mask, xK_p), spawn $ "variety -p" )
, ((mod1Mask, xK_r), spawn $ "xmonad --restart" )
--, ((mod1Mask, xK_f), spawn $ "variety -f" )
--, ((mod1Mask, xK_t), spawn $ "variety -t" )
--, ((mod1Mask, xK_Up), spawn $ "variety --pause" )
--, ((mod1Mask, xK_Down), spawn $ "variety --resume" )
--, ((mod1Mask, xK_Left), spawn $ "variety -p" )
--, ((mod1Mask, xK_Right), spawn $ "variety -n" )
--, ((mod1Mask, xK_F2), spawn $ "xfce4-appfinder --collapsed" )
--VARIETY KEYS WITH PYWAL
--, ((mod1Mask .|. shiftMask , xK_f ), spawn $ "variety -f && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
--, ((mod1Mask .|. shiftMask , xK_n ), spawn $ "variety -n && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
--, ((mod1Mask .|. shiftMask , xK_p ), spawn $ "variety -p && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
--, ((mod1Mask .|. shiftMask , xK_t ), spawn $ "variety -t && wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
--, ((mod1Mask .|. shiftMask , xK_u ), spawn $ "wal -i $(cat $HOME/.config/variety/wallpaper/wallpaper.jpg.txt)&")
--CONTROL + SHIFT KEYS
--SCREENSHOTS
, ((0, xK_Print), spawn $ "flameshot gui")
--, ((0, xK_Print), spawn $ "scrot 'ArcoLinux-%Y-%m-%d-%s_screenshot_$wx$h.jpg' -e 'mv $f $$(xdg-user-dir PICTURES)'")
, ((controlMask, xK_Print), spawn $ "xfce4-screenshooter" )
, ((controlMask .|. shiftMask , xK_Print ), spawn $ "gnome-screenshot -a -c")
--MULTIMEDIA KEYS
-- Mute volume
, ((0, xF86XK_AudioMute), spawn $ "amixer -q set Master toggle")
-- Decrease volume
, ((0, xF86XK_AudioLowerVolume), spawn $ "amixer -q set Master 5%-")
-- Increase volume
, ((0, xF86XK_AudioRaiseVolume), spawn $ "amixer -q set Master 5%+")
-- Increase brightness
, ((0, xF86XK_MonBrightnessUp), spawn $ "light -A 5")
-- Decrease brightness
, ((0, xF86XK_MonBrightnessDown), spawn $ "light -U 5")
-- , ((0, xF86XK_AudioPlay), spawn $ "mpc toggle")
-- , ((0, xF86XK_AudioNext), spawn $ "mpc next")
-- , ((0, xF86XK_AudioPrev), spawn $ "mpc prev")
-- , ((0, xF86XK_AudioStop), spawn $ "mpc stop")
, ((0, xF86XK_AudioPlay), spawn $ "playerctl play-pause")
, ((0, xF86XK_AudioNext), spawn $ "playerctl next")
, ((0, xF86XK_AudioPrev), spawn $ "playerctl previous")
, ((0, xF86XK_AudioStop), spawn $ "playerctl stop")
--------------------------------------------------------------------
-- XMONAD LAYOUT KEYS
-- Cycle through the available layout algorithms.
, ((modMask, xK_space), sendMessage NextLayout)
--Focus selected desktop
, ((mod1Mask, xK_Tab), nextWS)
--Focus selected desktop
, ((modMask, xK_Tab), nextWS)
--Focus selected desktop
, ((controlMask .|. mod1Mask , xK_Left ), prevWS)
--Focus selected desktop
, ((controlMask .|. mod1Mask , xK_Right ), nextWS)
-- Reset the layouts on the current workspace to default.
, ((modMask .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf)
-- Move focus to the next window.
, ((modMask, xK_j), windows W.focusDown)
-- Move focus to the previous window.
, ((modMask, xK_k), windows W.focusUp )
-- Move focus to the master window.
, ((modMask .|. shiftMask, xK_m), windows W.focusMaster )
-- Swap the focused window with the next window.
, ((modMask .|. shiftMask, xK_j), windows W.swapDown )
-- Swap the focused window with the next window.
, ((controlMask .|. modMask, xK_Down), windows W.swapDown )
-- Swap the focused window with the previous window.
, ((modMask .|. shiftMask, xK_k), windows W.swapUp )
-- Swap the focused window with the previous window.
, ((controlMask .|. modMask, xK_Up), windows W.swapUp )
-- Shrink the master area.
, ((controlMask .|. shiftMask , xK_h), sendMessage Shrink)
-- Expand the master area.
, ((controlMask .|. shiftMask , xK_l), sendMessage Expand)
-- Push window back into tiling.
, ((controlMask .|. shiftMask , xK_t), withFocused $ windows . W.sink)
-- Increment the number of windows in the master area.
, ((controlMask .|. modMask, xK_Left), sendMessage (IncMasterN 1))
-- Decrement the number of windows in the master area.
, ((controlMask .|. modMask, xK_Right), sendMessage (IncMasterN (-1)))
]
++
-- mod-[1..9], Switch to workspace N
-- mod-shift-[1..9], Move client to workspace N
[((m .|. modMask, k), windows $ f i)
--Keyboard layouts
--qwerty users use this line
| (i, k) W.greedyView i . W.shift i, shiftMask)]]
++
-- ctrl-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
-- ctrl-shift-{w,e,r}, Move client to screen 1, 2, or 3
[((m .|. controlMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
| (key, sc) keys azertyConfig }
--Belgian Azerty users use this line
--myBaseConfig { keys = belgianKeys keys belgianConfig }
{startupHook = myStartupHook
, layoutHook = gaps [(U,35), (D,5), (R,5), (L,5)] $ myLayout ||| layoutHook myBaseConfig
, manageHook = manageSpawn myManageHook manageHook myBaseConfig
, modMask = myModMask
, borderWidth = myBorderWidth
, handleEventHook = handleEventHook myBaseConfig fullscreenEventHook
, focusFollowsMouse = myFocusFollowsMouse
, workspaces = myWorkspaces
, focusedBorderColor = focdBord
, normalBorderColor = normBord
, keys = myKeys
, mouseBindings = myMouseBindings
}
techsk8
(703 rep)
Nov 29, 2021, 11:45 AM
• Last activity: Jul 2, 2023, 05:16 PM
3
votes
0
answers
74
views
Minimizing disk usage with parallel calls to GCC
I am experimenting with testing GCC in parallel. My setup will run 96 tests before giving me the test report. If I run these tests sequentially it will invoke GCC once, run the executable, gather diagnostics and then repeat. However, when I try to run these tests in parallel the call to GCC takes mu...
I am experimenting with testing GCC in parallel. My setup will run 96 tests before giving me the test report.
If I run these tests sequentially it will invoke GCC once, run the executable, gather diagnostics and then repeat. However, when I try to run these tests in parallel the call to GCC takes much more time.
My profiler tells me that (when averaged over the 96 tests) the calls to GCC account for 2% of total execution time when running the 96 tests in sequence. My machine has 8 cores, and when I run the same profiler over my program, but with 8 available threads (12 tests on each thread), the calls to GCC account for 12% of the total time.
I theorized that perhaps the OS in this case is a shared resource, and tried to tell GCC to output the executable to a tmpfs location, but that only got me down to 11% of total time spent there. Can anyone help guide me a bit here? I am not too familiar with how the file system and IO writes work on Linux (Ubuntu 20).
I don't think my testing code is necessarily erroneous, but I'll include it anyway. It is written in Haskell. This is the function that takes 2% of all time when the tests are run sequentially, but (now) 11% when the tests are run in parallel on 8 threads (I do have 8 available cores).
create_test_executable :: String -> State -> String -> IO ()
create_test_executable p s path = do -- p = the c program, s = unused here, path = where to write executable
let process = proc "gcc" ["-xc", "-"]
x@(Just sin, Just sout, Just serr, _) <-
createProcess process { std_in = CreatePipe
, std_err = CreatePipe
, std_out = CreatePipe
, cwd = Just path
}
hPutStr sin p
hFlush sin
hClose sin
o <- hGetContents sout
if o == "" then return () else return () -- force read from output pipe
cleanupProcess x
To clarify: My suspicion is that GCC will write the executable to the disk, and that this contention for the disk IO is what is making each individual test slower. I tried to remedy this by writing the executable to a tmpfs location, but that barely made any difference. The write to this location is specified by the path I am passing in as a parameter to the function above,
Rewbert
(131 rep)
Oct 19, 2022, 11:13 AM
5
votes
2
answers
2330
views
How can I override a broken Haskell package in nix?
I use NixOS, and I'm trying to set up a Nix Haskell environment for my Haskell project. I have [this Haskell package](https://github.com/open-editions/open-editions.org/blob/master/open-editions.nix) written in Nix that I'm trying to get working via `nix-shell`, but the dependent Haskell package Cla...
I use NixOS, and I'm trying to set up a Nix Haskell environment for my Haskell project. I have [this Haskell package](https://github.com/open-editions/open-editions.org/blob/master/open-editions.nix) written in Nix that I'm trying to get working via
nix-shell
, but the dependent Haskell package Clay [won't build, as described in this bug report I just opened](https://github.com/NixOS/nixpkgs/issues/54958) . How can I override this package with a different (older or newer, I guess it doesn't matter) version of this Haskell package that works?
Jonathan
(1330 rep)
Jan 30, 2019, 10:17 PM
• Last activity: Aug 5, 2021, 10:25 PM
1
votes
1
answers
2170
views
How do I source in "/Users/<usr>/.ghcup/env" to $PATH in .zshrc after installing Haskell?
I cannot seem to get the `$PATH` variable sourced in via `/Users/chris/.ghcup/env` so that I can directly use the `ghc` or `ghci` binary in `zsh`. I installed ghc & cabal-install via ghcup: `curl https://get-ghcup.haskell.org -sSf | sh` as described on https://www.haskell.org/platform/mac.html / htt...
I cannot seem to get the
$PATH
variable sourced in via /Users/chris/.ghcup/env
so that I can directly use the ghc
or ghci
binary in zsh
.
I installed ghc & cabal-install via ghcup: curl https://get-ghcup.haskell.org -sSf | sh
as described on https://www.haskell.org/platform/mac.html / https://www.haskell.org/ghcup/
Hint during installation process:
> It will add the 'cabal', 'ghc', and 'ghcup' executables to bin directory
located at:
> /Users/chris/.ghcup/bin
>and create the environment file /Users/chris/.ghcup/env
which you should source in your ~/.bashrc or similar to get the required
PATH components.
> ...
> In order to run ghc and cabal, you need to adjust your PATH variable.
You may want to source '/Users/chris/.ghcup/env'
in your shell
configuration to do so (e.g. ~/.bashrc).
I can get the binaries to run after adding export PATH=/Users/chris/.ghcup/bin:$PATH
to ~/.zshrc
. However, from the hints during installation I am assuming that I should rather use the $PATH
information automatically provided in /Users/chris/.ghcup/env
.
Content of cat /Users/chris/.ghcup/env
:
> export PATH="$HOME/.cabal/bin:${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/bin:$PATH"
How do I incorporate that into my .zshrc
?
Christopher Graf
(113 rep)
Nov 9, 2019, 04:38 PM
• Last activity: Mar 30, 2021, 04:38 PM
1
votes
1
answers
844
views
Getting current workspace name as a string in xmonad
I want to get the currently active tag in xmonad as a string. I've imported the stackset with import qualified XMonad.StackSet as W I can get get the tag of the currently focused workspace with `W.currentTag`, but it's type is `StackSet i0 l0 a0 s0 sd0 -> i0` How do I convert this to a string?
I want to get the currently active tag in xmonad as a string. I've imported the stackset with
import qualified XMonad.StackSet as W
I can get get the tag of the currently focused workspace with
W.currentTag
, but it's type is StackSet i0 l0 a0 s0 sd0 -> i0
How do I convert this to a string?
Keith Osterheld
(11 rep)
Jan 23, 2019, 07:12 PM
• Last activity: Jul 15, 2020, 03:08 PM
0
votes
1
answers
468
views
Error compiling xmonad.hs
I was trying to make different workspace have different layout, I found this module - https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/XMonad-Layout-PerWorkspace.html I imported `XMonad.Layout.PerWorkspace` in my `xmonad.hs` and added these lines - ``` onWorkspace ["2"] noBorders monocle...
I was trying to make different workspace have different layout, I found this module - https://hackage.haskell.org/package/xmonad-contrib-0.15/docs/XMonad-Layout-PerWorkspace.html
I imported
XMonad.Layout.PerWorkspace
in my xmonad.hs
and added these lines -
onWorkspace ["2"] noBorders monocle $ -- layout l1 will be used on workspace "2".
onWorkspace ["9"] smartBorders Full $ -- layout l2 will be used on workspace "6".
in myLayoutHook
-- The layout hook
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats $
mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
onWorkspace ["2"] noBorders monocle $ -- layout l1 will be used on workspace "2".
onWorkspace ["9"] smartBorders Full $ -- layout l2 will be used on workspace "6".
where
-- I've commented out the layouts I don't use.
myDefaultLayout = tall
||| noBorders monocle
||| floats
||| grid
||| smartBorders Full
but I'm getting an error while recompiling xmonad
> xmonad --recompile
XMonad will use ghc to recompile, because "/home/apoorv/.xmonad/build" does not exist.
Error detected while loading xmonad configuration file: /home/apoorv/.xmonad/xmonad.hs
xmonad.hs:620:14: error: parse error on input ‘where’
|
620 | where
| ^^^^^
Please check the file for errors.
Warning: Missing charsets in String to FontSet conversion
apoorv569
(51 rep)
Jul 4, 2020, 09:04 PM
• Last activity: Jul 8, 2020, 11:24 AM
1
votes
1
answers
988
views
How to debug XMonad.Layout.NoBorders.smartBorders not working?
Since resetting my xorg.conf to use a second monitor, [`XMonad.Layout.NoBorders.smartBorders`](https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Layout-NoBorders.html) no longer works: Even if there is only one window open on either monitor, and no docks, the main window still has...
Since resetting my xorg.conf to use a second monitor, [
XMonad.Layout.NoBorders.smartBorders
](https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Layout-NoBorders.html) no longer works: Even if there is only one window open on either monitor, and no docks, the main window still has a border.
Might anyone have an idea of how to proceed debugging? Such as by dumping the XMonad stackset to stdout? Thank you.
edit: Alternatively, assuming the implementation of smartBorders is incorrect or is having a strange interaction with other layoutHooks or I'm making an error, is there a quick-and-easy way to write a layoutHook which checks the XMonad stackset, checks if length the_current_stack
(windows in the current screen) is 1, and then dynamically switches the layout to fullscreen (and vice versa if a new window is opened)?
edit: noBorders
seems to work. Other modules such as the smartBorder
flag in XMonad.Layout.Spacing.smartBorder
have no trouble working in multi-screen mode. There seems to be a section in the code above at the bottom involving an 'Ambiguity' combinator.
ninjagecko
(199 rep)
Mar 5, 2020, 01:45 AM
• Last activity: Mar 8, 2020, 06:26 PM
1
votes
0
answers
192
views
Error when updating "cabal-install" from cabal cli
I was following [this](https://www.haskell.org/cabal/) tutorial on how to install `cabal` on linux. So far, I successfully installed `cabal-install` from `apt`: ```zsh sudo apt install cabal-install ``` However, at the step where they upgrade `cabal` with `cabal` itself, I encounter this error: ```l...
I was following [this](https://www.haskell.org/cabal/) tutorial on how to install
cabal
on linux.
So far, I successfully installed cabal-install
from apt
:
sudo apt install cabal-install
However, at the step where they upgrade cabal
with cabal
itself, I encounter this error:
$ cabal install cabal-install Cabal
Resolving dependencies...
Configuring Cabal-3.0.0.0...
Failed to install Cabal-3.0.0.0
Build log ( /home/abstrack/.cabal/logs/Cabal-3.0.0.0.log ):
cabal: Error: some packages failed to install:
Cabal-3.0.0.0 failed during the configure step. The exception was:
user error ('/usr/bin/ghc' exited with an error:
/tmp/cabal-tmp-25404/Cabal-3.0.0.0/Distribution/Parsec.hs:134:0:
error: missing binary operator before token "("
#if !(MIN_VERSION_base(4,13,0))
^
)
cabal-install-3.0.0.0 depends on Cabal-3.0.0.0 which failed to install.
hackage-security-0.5.3.0 depends on Cabal-3.0.0.0 which failed to install.
I couldn't find exactly
Cabal-3.0.0.0/Distribution/Parsec.hs:134:0:
(line 9 of the log) on google.
I tried to install only cabal-install
and Cabal
separately with the cabal
cli, but I got the exact same error each time.
How do I work around this error and successfully update cabal
?
ljleb
(113 rep)
Nov 19, 2019, 12:41 AM
1
votes
0
answers
30
views
Why the package haskell-platform does not follow the proper version number?
The package `haskell-platform` is a metapackage providing tools for developing in Haskell. It is [self-distributed](https://www.haskell.org/platform/prior.html) with a versioning system using a version number, the release year and month. It is as well distributed on different distributions such as [...
The package
haskell-platform
is a metapackage providing tools for developing in Haskell.
It is [self-distributed](https://www.haskell.org/platform/prior.html) with a versioning system using a version number, the release year and month. It is as well distributed on different distributions such as [Debian](https://packages.debian.org/en/buster/haskell-platform) .
I could not gather how the Debian package number was made, since the latest on Buster is labeled as 2014.2.0.0.debian8
, which comes, e.g. with ghc
>= 8.4.3. The problem is this ghc
version is from 2018.
I was wondering if it was a deliberate choice from the packaging team or mislabeled from the website/documentation, since it seems that the packages provided by this metapackage.
I might have missed something, but I do not see the consistency here.
Paradox
(1517 rep)
Aug 17, 2019, 03:58 PM
6
votes
1
answers
2343
views
How do I enable a three column layout in XMonad?
I'm a Haskell and XMonad beginner. I'm trying to set up my tiling layout to allow three side by side columns (so that I can have three simultaneous tall and thin Vim instances for coding, per workspace). In the docs, I've found [a three-column layout function][1], and even managed to import it and d...
I'm a Haskell and XMonad beginner. I'm trying to set up my tiling layout to allow three side by side columns (so that I can have three simultaneous tall and thin Vim instances for coding, per workspace).
In the docs, I've found a three-column layout function , and even managed to import it and define a custom layout, but I'm not sure how to add it to my
layoutHook
, which already has some stuff defined from a tutorial I read, to keep my xmobar
safe from window covering.
The relevant lines of my xmonad.hs
:
import XMonad.Layout.ThreeColumns
threeLayout = ThreeCol 1 (3/100) (1/2)
...
main = do
xmonad $ defaultConfig
{ manageHook = manageDocks manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
...
How do I change the layoutHook
line to keep the existing configs, while also adding my three-column tile layout?
ire_and_curses
(12502 rep)
Sep 20, 2012, 09:55 AM
• Last activity: Dec 7, 2018, 11:33 PM
1
votes
1
answers
510
views
"Right" way to deal with adding packages to path
I downloaded and installed the Haskell Platform. And It got installed (default) to `/usr/local/haskell/` I want to add the binarys inside `/usr/local/haskell/bin/` to my path. But I dont want (if possible) to change my path.. What would be the best course of action here? Should i move the `haskell/b...
I downloaded and installed the Haskell Platform. And It got installed (default) to
/usr/local/haskell/
I want to add the binarys inside /usr/local/haskell/bin/
to my path. But I dont want (if possible) to change my path..
What would be the best course of action here? Should i move the haskell/bin/*
to local/bin
or is it the best practice to add the haskell folder to path as?
mrfr
(135 rep)
Nov 24, 2018, 12:00 PM
• Last activity: Nov 24, 2018, 03:37 PM
0
votes
1
answers
773
views
GHC Haskell Compiler for AARCH64
I recently bought a Odroid C2 (AARCH64), but I need o execute Haskell programs on it. There is no GHC (Haskell-Compiler) binary for this architecture on the web. But I also failed to cross compile GHC Maybe someone can CrossCompile GHC for AARCH64 for me or know an other, easier way?
I recently bought a Odroid C2 (AARCH64), but I need o execute Haskell programs on it.
There is no GHC (Haskell-Compiler) binary for this architecture on the web.
But I also failed to cross compile GHC
Maybe someone can CrossCompile GHC for AARCH64 for me or know an other, easier way?
Martin Fischer
(163 rep)
May 25, 2016, 07:16 AM
• Last activity: Nov 21, 2018, 09:22 PM
3
votes
1
answers
456
views
In NixOS, is there any way to create a package that has pandoc, pandoc-citeproc, and pandoc-crossref?
I'm very new to NixOS. I use Pandoc a lot, often with `pandoc-citeproc`, but I can't find a NixOS package for `pandoc-citeproc`. I see that there's a Haskell library for pandoc-citeproc in `HaskellPackages`. How can I combine a Pandoc binary which is installed system-wide with a Haskell library?
I'm very new to NixOS. I use Pandoc a lot, often with
pandoc-citeproc
, but I can't find a NixOS package for pandoc-citeproc
. I see that there's a Haskell library for pandoc-citeproc in HaskellPackages
. How can I combine a Pandoc binary which is installed system-wide with a Haskell library?
Jonathan
(1330 rep)
Sep 18, 2018, 12:31 AM
• Last activity: Sep 18, 2018, 03:57 PM
0
votes
1
answers
1678
views
Rendering window border on a specific side in XMonad
XMobar allows configuring border position, as well as width: { border = BottomB , borderColor = "#4F5B66" , borderWidth = 1 } I'm hoping to do the same in XMonad, but it seems borders are only configurable via the following properties: { borderWidth = 1 , normalBorderColor = "#4F5B66" , focusedBorde...
XMobar allows configuring border position, as well as width:
{ border = BottomB
, borderColor = "#4F5B66"
, borderWidth = 1 }
I'm hoping to do the same in XMonad, but it seems borders are only configurable via the following properties:
{ borderWidth = 1
, normalBorderColor = "#4F5B66"
, focusedBorderColor = "#96B5B4" }
Even with
XMonad.Layout.NoBorders
, it seems this is not an option (or not a straightforward one).
In the end I would like to have a bottom border of one pixel which is always drawn and changes colour depending on focus. Is this currently possible, and how would I go about setting it up like that?
Avaq
(161 rep)
Dec 26, 2017, 11:04 AM
• Last activity: Jun 17, 2018, 09:00 AM
9
votes
3
answers
5012
views
Nix: Skipping unit tests when installing a Haskell package
I'm using Nix to install packages under my home (so no binary packages) on a shared host with limited resources. I'm trying to install git-annex. When building one of its dependencies, haskell-lens, the unit tests consume so much memory that they get killed and the installation fails. Is there a way...
I'm using Nix to install packages under my home (so no binary packages) on a shared host with limited resources. I'm trying to install git-annex. When building one of its dependencies, haskell-lens, the unit tests consume so much memory that they get killed and the installation fails.
Is there a way to skip the unit tests to get the package installed? I looked at the Cabal builder and
haskell-packages.nix
and it seems to me that you could disable the tests by setting enableCheckPhase
to false. I tried the following in ~/.nixpkgs/config.nix
, but the tests are still run:
{
packageOverrides = pkgs: with pkgs; {
# ...other customizations...
haskellPackages = haskellPackages.override {
extension = self : super : {
self.lens = self.disableTest self.lens;
};
};
};
}
Miikka
(525 rep)
Nov 8, 2014, 01:24 PM
• Last activity: Jan 28, 2018, 04:29 PM
7
votes
1
answers
9765
views
Configure xmobar to show workspaces
What should my xmonad.hs file look like to correctly give workspace info to xmobar?
What should my xmonad.hs file look like to correctly give workspace info to xmobar?
user66261
(71 rep)
Apr 26, 2014, 11:40 PM
• Last activity: Nov 23, 2017, 11:34 PM
0
votes
2
answers
912
views
How to remove the bottom edges and sides of the Xmonad windows, left the upper one?
I'm new to Xmonad and I want to customize the layout of the windows, I did not find anything to take as an example of how to edit the windows, so far I can change the color and width of the border. Follow my xmonad.hs module Main (main) where ---------------------------------------------------------...
I'm new to Xmonad and I want to customize the layout of the windows, I did not find anything to take as an example of how to edit the windows, so far I can change the color and width of the border.
Follow my xmonad.hs
module Main (main) where
--------------------------------------------------------------------------------
import System.Exit
import XMonad
import XMonad.Config.Desktop
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.BinarySpacePartition (emptyBSP)
import XMonad.Layout.NoBorders (noBorders)
import XMonad.Layout.ResizableTile (ResizableTall(..))
import XMonad.Layout.ToggleLayouts (ToggleLayout(..), toggleLayouts)
import XMonad.Prompt
import XMonad.Prompt.ConfirmPrompt
import XMonad.Prompt.Shell
import XMonad.Util.EZConfig
------------------------------------------------------------------------- -------
main = do
spawn "xmobar" -- Start a task bar such as xmobar.
spawn "wmname LG3D"
-- Start xmonad using the main desktop configuration with a few
-- simple overrides:
xmonad $ desktopConfig
{ modMask = mod4Mask -- Use the "Win" key for the mod key
, manageHook = myManageHook manageHook desktopConfig
, layoutHook = desktopLayoutModifiers myLayouts
, logHook = dynamicLogString def >>= xmonadPropLog
, focusedBorderColor = "cyan"
, borderWidth = 1
}
additionalKeysP
-- Add some extra key bindings:
[ ("M-S-q", confirmPrompt myXPConfig "exit" (io exitSuccess))
, ("M-p", shellPrompt myXPConfig)
, ("M-", sendMessage (Toggle "Full"))
, ("", spawn "amixer -q sset 'Master' mute") --Muta o som
, ("", spawn "amixer -q sset 'Master' 1%-") - -Diminui o volume em 1%
, ("", spawn "amixer -q sset 'Master' 1%+ unmute") --Aumenta o volume em 1%
, ("", spawn "sh ~/OneDrive/Documentos/xmonad/brightness.sh -s -1") --Diminui o brilho da tela em 1%
, ("", spawn "sh ~/OneDrive/Documentos/xmonad/brightness.sh -s +1") --Aumenta o Brilho da tela em 1%
, ("C-", spawn "chromium") --Abre o google chrome
, ("M-g", spawn "gedit") --Abre o gedit
, ("M-r", spawn "nautilus") --Abre o nautilus
, ("M-c", spawn "code") --Abre o MS Code
]
------------------------------------------------------------------------- -------
-- | Customize layouts.
--
-- This layout configuration uses two primary layouts, 'ResizableTall'
-- and 'BinarySpacePartition'. You can also use the 'M-' key
-- binding defined above to toggle between the current layout and a
-- full screen layout.
myLayouts = toggleLayouts (noBorders Full) others
where
others = ResizableTall 1 (1.5/100) (3/5) [] ||| emptyBSP
--------------------------------------------------------------------------------
-- | Customize the way 'XMonad.Prompt' looks and behaves. It's a
-- great replacement for dzen.
myXPConfig = def
{ position = Top
, alwaysHighlight = True
, promptBorderWidth = 0
, font = "xft:monospace:size=9"
}
myManageHook = composeOne
[ className =? "Pidgin" -?> doFloat
, className =? "XCalc" -?> doFloat
, className =? "mpv" -?> doFloat
, className =? "vlc" -?> doFloat
, isDialog -?> doCenterFloat
, isFullscreen -?> doFullFloat
-- Move transient windows to their parent:
, transience
]
Matheus Toniolli
(131 rep)
Oct 21, 2017, 02:48 AM
• Last activity: Nov 21, 2017, 10:49 AM
2
votes
1
answers
2408
views
How to recursively downgrade a package and its dependencies in Arch
I need to downgrade xmonad because after the latest upgrade it crashes when I run a specific program (fldigi specifically). Contrary to question [How do you downgrade multiple packages in arch linux?][1], I need to downgrade packages recursively with their dependencies. In order to downgrade xmonad...
I need to downgrade xmonad because after the latest upgrade it crashes when I run a specific program (fldigi specifically). Contrary to question How do you downgrade multiple packages in arch linux? , I need to downgrade packages recursively with their dependencies.
In order to downgrade xmonad I need to downgrade haskell-x11
which depends on haskell-... which depends on ~20 other packages, but only ~20.
In this case the set of packages does not spiral out of control, though it's enough that working through it one at a time is going to be tedious.
Once I have verified that downgrading fixes the problem I intend to roll forward again and help the people who actually know Haskell to debug this problem.
Arthur Ulfeldt
(1542 rep)
Jan 15, 2017, 10:33 PM
• Last activity: Sep 25, 2017, 09:28 PM
2
votes
1
answers
958
views
Renaming workspaces interactively using DynamicWorkspaces does not work
I have been trying to find a way to rename workspaces while working. I'm currently using up to 4 workspaces at the time and I would like to assign the workspaces new names as needed. I came across `XMonad.Actions.DynamicWorkspaces`, and I am able to create and remove workspaces, however not rename....
I have been trying to find a way to rename workspaces while working. I'm currently using up to 4 workspaces at the time and I would like to assign the workspaces new names as needed.
I came across
XMonad.Actions.DynamicWorkspaces
, and I am able to create and remove workspaces, however not rename. I have the current binding
((modM .|. shiftMask, xK_r), renameWorkspace defaultXPConfig)
However when I enter something into the defaultXPConfig, nothing happens (and by nothing happens I mean, the name of the workspace doesn't change in my xmobar). I am able to create and delete workspaces, these changes appear in my xmobar.
The method renameWorkspaceByName works as expected, therefore I believe I am using the xpconfig wrong?
I have posted my xmonad.hs [here](https://pastebin.com/ZPF70Kgi )
user89423
(21 rep)
Aug 9, 2017, 06:02 PM
• Last activity: Aug 20, 2017, 05:23 PM
3
votes
0
answers
465
views
Keep same width of middle column in ThreeColMid layout in xmonad
For my large screen I want to have one window in the middle of the screen and the other (slave) windows on the side of it, like in https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Layout-ThreeColumns.html#g:1. If I have >= 3 windows opened this is as I want it. Suppose I have 3 wi...
For my large screen I want to have one window in the middle of the screen and the other (slave) windows on the side of it, like in https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Layout-ThreeColumns.html#g:1 .
If I have >= 3 windows opened this is as I want it. Suppose I have 3 windows open. Then one occupies a large fraction in the middle of the screen while the other two are symmetrically on the left and right of the middle window.
However when closing one or two windows the master window changes size and position (for example with only one window it occupies all space).
How can I configure xmonad such that the master window always has the same position and size when in ThreeColMid layout as in the case of >= 3 windows?
I.e. for one ore two windows the remaining space should be padded.
Maybe this would help: https://github.com/brianshourd/xmonad-layout-padding . However using this I can only add another layout which does what I want for one window (not for two). However I don't want to change the layout to make happen what I described above.
student
(18865 rep)
May 27, 2017, 09:01 PM
• Last activity: May 27, 2017, 09:26 PM
Showing page 1 of 20 total questions