You are not logged in.
I've been having trouble getting Caps Lock to be Escape and having it stick.
For a long time I used the xmodmap method (all the variations I find out there), but it seems randomly I have to go and "xmodmap .Xmodmap". I just tolerated it after trying every permutation I could think of.
So recently I am trying 'setxkbmap -option caps:escape' but just the same it seems to stop and I have to go into a terminal and do it again.
Linux xpschris 6.3.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 21 May 2023 16:15:22 +0000 x86_64 GNU/Linux
i3wm
Alacritty
Would really like to have this done with once and for all. Suggestions?? Thanks!
Offline
Add to your shell profile (or equivalent if you use a DM):
export XKB_DEFAULT_OPTIONS=caps:escape"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks.
I've been doing all this xmodmap and setxkbbdmap stuff in my .xinitrc.
I switched to fish shell for main shell these days but so I'm still not that fish savvy.
Given that, do you suggest I should put in .xinitrc, or I should work with fish_config maybe?
Offline
That all depends on how you start fish. Have you actually set fish as your user's login shell via chsh? If so, I have no idea how to help - you'll need to learn to use the shell you selected. Though if you've actually set fish as your default with chsh but you don't know how to set environment variables you'd have much bigger problems (e.g., how did you port all the /etc/profile.d/ content?)
If you've just configured your login shell to exec fish, then just export the variable right before the exec.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Offline
Thanks but I got myself into a hole I'm trying to get out of.
1. I read up on how fish uses "set" instead of bash's "export".
1.a. I made that change in the fish_config, but it wasn't seeming to take, so I dug into the arch wiki about keymaps.
2. I attempted to create a keymap to map Caps Lock (key 66) to Escape, and I attempted to make it permanent as described by telling vconsole.conf to use my new keymap.
3. I did mkinitcpio and so I got to the point where I could use neither internal nor external keyboard.
4. Point I'm at now is I'm booted into my Arch USB flash drive, and I mounted my internal SSD, but
5. I do not have arch-root, nor wifi to get it.
6. I try to use just regular chroot but that doesn't work because I don't have zsh, only bash and fish.
At this point I'll be very glad if I can get back to where I started, even if I have to run xmodmap 1000 times / day.
I'm typing all this on my backup laptop which only has windoze, not making my life any easier.
Offline
1. don't use fish
2. chrooting has NOTHING to do w/ zsh
3. vconsole.conf has nothing to do w/ your GUI session
4. how do you not "have" arch-chroot" on "Arch USB flash drive" (nor wifi)
https://wiki.archlinux.org/title/Chroot#Using_chroot explains how to use plain chroot and how to chroot using /bin/bash
Offline
1. ok but after 30 years or so of bash, I'm kind of liking fish
2. right, I figured out that I needed to change SHELL to /usr/bin/bash
3. when I had trouble with they keyboard stuff and read on keymaps, I thought it might be even better. Would be nice to login in to Arch and even if I don't want to run X, I could run vi and still have Caps Lock work like Escape.
4. you're right again, I think I had gotten confused as to which level of things I was on. After 'exit' ing a couple times I do in fact see arch-chroot now and I've used it to get at my main machine.
I think now first thing I will remove that vconsole.conf which was apparently a bad idea, or I got it wrong.
Will report back on progress or lack thereof.
thanks again.
Offline
For the console you'll need a https://wiki.archlinux.org/title/Linux_ … tom_keymap
after 30 years or so of bash, I'm kind of liking fish
So you've not tried zsh…
Offline
yeah that keymap stuff was kind of what got me into this most recent prob. I must have rushed through it.
and re zsh, true. I looked into zsh a bit and felt that for my purposes, I just wanted fish's simple autocompletion and colorizing.
I'm a sort of semi-retired web dev dinosaur, so I spend a lot of time in the shell but rarely doing anything fancy.
Last edited by chrisco23 (2023-05-27 06:37:34)
Offline
ok so my world now is back to "normal" I think.
I want to read up more on setting this in the X config somewhere again. I can live without making capslock be esc before I start my x sessions.
I'll come back to mark this solved when I believe I have it consistent.
Thanks.
Offline
By far the best solution (not just for this problem but in general) is to use a custom mechanical keyboard. It will allow you to tailor the keymap exactly to your needs. Oh, and don't use fish. ![]()
Offline
@tucuxi, interesting, you know I might well be willing to go that direction. Any particular place you might point me to?
I'm in a bit of keyboard transition anyway. I very much liked my HyperX Alloy with the Cherry Blue but in the last few weeks, do to ergonomic / RSI considerations, I've gone over to a DK61, also Cherry Blue.
In both cases, I really hate the moving colored lights. Just one color, white or anything, don't care, but I'm not a gamer and it's not Christmas.
So I'm just getting the muscle memory down for the DK61 but if I could get a custom mechanical keyboard without the stupid moving colors, and maybe I'd stick to this 60%, I'd be very interested in that option.
Offline
I assume what you like about fish is using it as your interactive shell (I assume, as I can't honestly imagine anything anyone would like about fish - but to each their own). So by all means use fish for interactive shells. But that's no reason at all for it to be your default login shell... actually we still don't really know if it is, do we?
Can you please answer the questions posed in post #4?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yes, I started using fish just as an interactive shell, but yes I'm using it as default now.
I did not want to derail the thread with shell debates, but until I find a problem with using fish in this way (this thread is unrelated except my trouble exporting variables I suppose, so first time trouble).
If anyone can suggest why not to use fish (again, this export issue has been my first snag), I'm all ears.
I wanted to start fresh without all the .bashrc and .bash_aliases and things thad I'd sort of allowed to accumulate just a bit too much over the years.
Bash is still on the machine of course for when needed by scripts that state they need bash on line 1.
It really has increased my workflow some using fish. Just fish and fzf (I know fzf has nothing to do with fish) make navigation faster for me.
Offline
If anyone can suggest why not to use fish (again, this export issue has been my first snag), I'm all ears.
1. it's not bash
2. it's not bash-compatible
3. it's less used and probably has more bugs
4. you don't know how to export variables in fish
I just wanted fish's simple autocompletion and colorizing.
https://aur.archlinux.org/packages?K=zsh+highlight
https://aur.archlinux.org/packages?K=zsh+complete
Alacritty, as pretty much every TE allows you to run a command instead of your default shell, eg. "alacritty -e /bin/fish"
Offline
I did not want to derail the thread with shell debates, but until I find a problem with using fish in this way (this thread is unrelated except my trouble exporting variables I suppose, so first time trouble).
Sorry, I was being (mostly) tongue-in-cheek in my last post. I'm happy to help people use software that suits them even if it wouldn't suit me. If I were really engaging in shell debates, I'd go on at length ranting about how bad bash is. But setting aside personal preferences, the fact is you are going to have a hard time getting much support when fish is your default login shell for your user as there are relatively few experienced users that use fish (there are certainly some, but it's a much smaller resource pool to draw from).
Yes, I started using fish just as an interactive shell, but yes I'm using it as default now.
My point is you can use it as your default for every terminal emulator that opens, or in any other context in which you'd be typing in commands - and you can do this without having fish entered in /etc/passwd. Having fish as your user's shell listed in /etc/passwd does not carry any advantage that I can see, but it does carry disadvantages of it being harder to get support.
FWIW I also have a very niche shell as my login shell. But I know a whole lot about that shell - I've reviewed most of it's source code, customized some of it, and built it to suit my needs. I'd support anyone else in doing similar customizations - but it does carry a responsibility of learning all the ins and outs of the chosen shell.
Last edited by Trilby (2023-05-27 14:02:24)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I guess I had opted for fish rather than zsh because I imagined myself getting too sidetracked with zsh configuration.
But given your points and especially given this first non-POSIX pain point I hit, I'll give zsh at least a spin.
Thanks for pointing those links as well.
Offline