You are not logged in.
Hi,
I just added some basic prompts to my config but for some reason they do not support utf-8.
When I use the shell prompt to execute a command that has unicode character ('Ü' for example) then they are wrong encoded.
Example in shellPrompt:
echo "Ü" > foo gives wrong encoded characters in the file 'foo'.
I am using xmonad and xmonad-contrib from official repos.
Do I have to add something to my config to enable unicode? I didn't find anything related to this in the docs though. Except that xmonad supports utf-8.
thanks
I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do. (Gune | Titan A.E.)
Offline
You use the word "prompt" many times, and it sounds like you may be using it to refer to different things.
When you say you added basic prompts do your config, what does this mean? What do you mean by 'prompts' and which config did you add it to?
Then you describe entering characters in a shell - this will have nothing to do with your window manager. If characters don't show up properly in the shell, the only relevant variables are from your terminal. What terminal are you using? What font is set? What is the output of `locale`?
Please clarify what you are actually trying to do and what parts aren't working as desired.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm sorry that I didn't make this clear enough.
In XMonad there is a module XMonad.Prompt which can be used to display some kind of little window where you can enter something. In case of the shellPrompt it is quite similar to dmenu.
I can type a command with auto completion into an input field (the prompt) and it gets executed.
Thats what I was referring to as 'Prompts'.
When I said I added it to my config I meant I added
import XMonad.Prompt
import XMonad.Prompt.Shellto my xmonad.hs which is the config file for XMonad.
Additionally I added a keybinding which invokes the shellPrompt.
Therefore this has to do with my window manager. Anywhere else in terminals etc unicode works fine.
For completeness this my xmonad.hs:
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run
import XMonad.Util.EZConfig(additionalKeys)
import qualified XMonad.StackSet as W
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.NoBorders
import XMonad.Layout.Grid
import XMonad.Layout.Fullscreen
import XMonad.Layout.Tabbed
import Graphics.X11.ExtraTypes.XF86
import System.IO
import XMonad.Actions.CycleWS
import XMonad.Actions.WindowGo
import XMonad.Layout.PerWorkspace
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.AppendFile
import XMonad.Prompt.AppLauncher as AL
import XMonad.Prompt.RunOrRaise
import XMonad.Layout.LayoutHints
modm = mod4Mask
myManageHook = composeAll. concat $
[ [ className =? c --> doCenterFloat| c <- floats]
, [ resource =? r --> doIgnore | r <- ignore]
, [ resource =? "gecko" --> doF (W.shift "net") ]
--, [ isFullscreen --> doFullFloat]
, [ isDialog --> doCenterFloat]
, [className =? "Firefox" --> doShift "3"]
, [className =? "Thunderbird" --> doShift "2"]]
where floats = ["Dia", "Xchat"]
ignore = []
tall = (Tall nmaster delta ratio) --define tall layout sizes
where
nmaster = 1 --number of windows in master pane
ratio = 1/2 --ratio of master pane size
delta = 2/100
startup :: X ()
startup = do
runOrRaise "thunderbird" (className =? "Thunderbird")
--runOrRaise "firefox" (className =? "Firefox")
--runOrRaise "terminator" (className =? "Terminator")
--runInTerm "" "sh -c 'journalctl -f'"
myXPConfig = amberXPConfig
{ font = "xft:Droid Sans Mono:bold:size=11:antialias=true"
, position = Top
, height = 30
}
main = do
xmproc <- spawnPipe "xmobar ~/.xmobarrc"
-- xmproc2 <- spawnPipe "/usr/bin/xmobar ~/.xmobarrc2"
spawn "trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 137 --widthtype pixel --transparent true --alpha 0 --tint 0x000000 --height 19"
--spawn "xcompmgr -c -C -r 0 -f -D 3"
spawn "compton --config ~/.config/compton.conf"
xmonad $ defaultConfig
{ manageHook = manageDocks <+> fullscreenManageHook <+> myManageHook <+> manageHook defaultConfig
, layoutHook = (fullscreenFocus $ avoidStruts ( onWorkspace "1" Grid (noBorders Full) ||| tall ||| Mirror tall ||| noBorders simpleTabbed ) )
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, handleEventHook = fullscreenEventHook <+> handleEventHook defaultConfig
, focusedBorderColor = "yellow"
, normalBorderColor = "black"
, borderWidth = 1
, terminal = "terminator"
, modMask = modm
, startupHook = startup
}`additionalKeys`
[ ((modm , xK_f), spawn "nemo")
, ((modm , xK_b), spawn "firefox")
, ((modm .|. shiftMask, xK_e), spawn "thunderbird")
, ((modm , xK_m), spawn "clementine")
, ((modm , xK_c), kill)
, ((modm , xK_Right), nextWS)
, ((modm , xK_Left), prevWS)
, ((modm .|. shiftMask, xK_l), spawn "dm-tool lock")
, ((modm .|. shiftMask, xK_F5), spawn "~/hdmi.sh")
, ((modm .|. shiftMask, xK_h), spawn "dm-tool lock && sleep 2 && sudo systemctl hibernate")
, ((modm .|. shiftMask, xK_s), spawn "dm-tool lock && sleep 2 && sudo systemctl suspend")
, ((modm .|. controlMask, xK_s), spawn "sudo systemctl suspend")
, ((modm .|. controlMask, xK_h), spawn "sudo systemctl hibernate")
, ((0 , xF86XK_AudioRaiseVolume), spawn "amixer sset Master unmute 4%+")
, ((0 , xF86XK_AudioLowerVolume), spawn "amixer sset Master 4%-")
, ((0 , xF86XK_AudioMute), spawn "amixer sset Master toggle")
, ((0 , xF86XK_AudioPlay), spawn " clementine -t")
, ((0 , xF86XK_Sleep), spawn "sudo systemctl suspend")
--, ((0 , xF86XK_PowerOff), spawn "sudo systemctl hibernate")
, ((0 , xF86XK_Display), spawn "~/hdmi.sh")
, ((shiftMask, xK_Print), spawn "scrot -q 85 /scratch/%Y-%m-%d-%T-screenshot.png")
, ((modm, xK_p), shellPrompt myXPConfig)
, ((modm, xK_n), appendFilePrompt myXPConfig "/home/arch/lukas/notes")
, ((modm, xK_r), prompt ("terminator" ++ " -e") myXPConfig )
, ((modm .|. shiftMask, xK_t), AL.launchApp myXPConfig "task add" )
]I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do. (Gune | Titan A.E.)
Offline
Thanks - that's much more clear. While I did use Xmonad for a bit, I never used the Prompts ability/module - so I may not be able to help further.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline