Visudo/keyboard-Help

Joined
Oct 16, 2023
Messages
30
Reaction score
2
Credits
332
Hello those smarter than me. I was/am trying to address and fix permissions and admin stuff that I believe is affecting a lot of different things I do or try to do on my PC. I was attempting ti edit the sudoers file in visudo and after adding myself in the user priviledge section, ALL ALL ALL, and then attempting to save and exit doing the "w:" a error flag came up : visudo E45 'readonly' option is set (add ! to override) I was in root user when I went into visudo and guess I went in to edit still without the correct permissions. The other problem I am having is that I am using an Apple keyboard ( A1243-EMC NO-2171) extended keyboard with numerical pad that I have not been able to get configured right so inside text editers and such like certain buttons don't do what is hoped. In this issue, no insert button. I don't want to make my situation worse by just trial&error. I tried this I found online ":w ! sudo tee %" but my issue is pressing return or enter does not do as it should! It's all very confusing and frustrating. Here is a copy&paste of where I am. The only edit I made was under user priv. curly. Thank you.:
# Ditto for GPG agent
#Defaults:%sudo env_keep += "GPG_AGENT_INFO"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL
curlystooge ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:

@includedir /etc/sudoers.d
 


sudo visudo will open visudo with sudo privileges so that you can save your changes. So long as you're doing this command, there will be no permission issues.

Not sure how to resolve your apple keyboard issue.
 
You also need to change permissions on target file prior and after modification and finally also verify changes, e.g.

Bash:
cd /etc/sudoers.d
sudo chmod u+w user_name
sudo visudo -f user_name

# Do something in file, e.g. change default sudo password timeout
Defaults        timestamp_timeout=180

sudo chmod u-w user_name
sudo visudo -c
 
MOE-LARRY&CURLY said:
The other problem I am having is that I am using an Apple keyboard ( A1243-EMC NO-2171) extended keyboard with numerical pad that I have not been able to get configured right so inside text editers and such like certain buttons don't do what is hoped. In this issue, no insert button

1) Open a terminal and enter xev. Then a window will open and lots of info will fille ther terminal, just drage the window out the way som you can see that info.
2) Press a key on your Apple kbd. You should see something like so
Code:
KeyPress event, serial 37, synthetic NO, window 0x4e00001,
    root 0x1d8, subw 0x0, time 86397107, (169,-12), root:(873,425),
    state 0x110, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False
3. Do this for each key to make sure that all keys are detected.
4. Install input-remapper and input-remapper-gtk
5. Open input-remapper-gtk.
6. Under "Device", select your keyboard.
7. Move the highlight onto "new entry"
8. Click "change key"
9. Press the key you want to change.
10. Next to "change key" is a drop-down menu, ensure it's set to "keyboard" (unless you want mouse binds, lol)
11. In the field below, enter the desired key by typing it's name and clicking on the suggestion that matches.
12. Click apply.
Notes: Needs to be run as root or through sudo/pkexec. UI is a little clunky again in 1.5 (preferred the older layout). To ensure it starts with your x-session, toggle auto-load. Enjoy. I use it for my programmable mouse because it's made in China, so naturally the software only runs on Windows. This negates the need for vendor software (I had a Win7 VM and was passing the device through before I stumbled on this gem).
 
1) Open a terminal and enter xev. Then a window will open and lots of info will fille ther terminal, just drage the window out the way som you can see that info.
2) Press a key on your Apple kbd. You should see something like so
Code:
KeyPress event, serial 37, synthetic NO, window 0x4e00001,
    root 0x1d8, subw 0x0, time 86397107, (169,-12), root:(873,425),
    state 0x110, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False
3. Do this for each key to make sure that all keys are detected.
4. Install input-remapper and input-remapper-gtk
5. Open input-remapper-gtk.
6. Under "Device", select your keyboard.
7. Move the highlight onto "new entry"
8. Click "change key"
9. Press the key you want to change.
10. Next to "change key" is a drop-down menu, ensure it's set to "keyboard" (unless you want mouse binds, lol)
11. In the field below, enter the desired key by typing it's name and clicking on the suggestion that matches.
12. Click apply.
Notes: Needs to be run as root or through sudo/pkexec. UI is a little clunky again in 1.5 (preferred the older layout). To ensure it starts with your x-session, toggle auto-load. Enjoy. I use it for my programmable mouse because it's made in China, so naturally the software only runs on Windows. This negates the need for vendor software (I had a Win7 VM and was passing the device through before I stumbled on this gem).
This sounds promising my good fellow. I will carefully give it a shot. I tried another method once before using some script I found but I think after an update and or upgrade it got lost up. So what happens is when it on standby/suspend/sleeping/napping,snoozing lol, I will get anywhere from 1-12 flag windows accumilate in my desktop and panel. Close em out one by one...I will be back to say you rock if it works!
Thank you.
 
This sounds promising my good fellow. I will carefully give it a shot. I tried another method once before using some script I found but I think after an update and or upgrade it got lost up. So what happens is when it on standby/suspend/sleeping/napping,snoozing lol, I will get anywhere from 1-12 flag windows accumilate in my desktop and panel. Close em out one by one...I will be back to say you rock if it works!
Thank you.
OK so after step 3, I hit all keys, the control was funky because it acts as a shortcut key to open main menu gui on desktop. So should I now exit this xev to install suggested?
 
I followed to the yee, F1-F5 worked ,as with function key depressed but F6 nothing, same with 7. I put esp and return in input also into remapper. Here the window that always pops up.
This sounds promising my good fellow. I will carefully give it a shot. I tried another method once before using some script I found but I think after an update and or upgrade it got lost up. So what happens is when it on standby/suspend/sleeping/napping,snoozing lol, I will get anywhere from 1-12 flag windows accumilate in my desktop and panel. Close em out one by one...I will be back to say you rock if it works!
Thank you.
 

Attachments

  • Screenshot from 2024-10-04 22-58-18.png
    Screenshot from 2024-10-04 22-58-18.png
    17.3 KB · Views: 59
Is there output in xev when you press the keys that don't work at all? If there's keys that show no ouput in xev, then xinput is not aware of them... which means a custom driver is likely needed. If there is output, post the output each key in [ spoiler][ code] tags.

As for the Gnome XKB error, the other method used XKB mappings and likely there was a derp in the way the keyboard is handled or the script. As a rule, don't run scripts if you cannot understand the contents -- albeit vaguely, you don't need to be fluent. Another issue is changes upstream affect scripts that aren't maintained.
Input-remapper hooks input from a device, then provides a virtual device to inject events, so it's less tied to any particular version/standards/environment.

Edit: Yeah, sorry, thought I'd put a space in the mention of the tags 'n didn't look at my message after posting... fixed.
 
Last edited:
Is there output in xev when you press the keys that don't work at all? If there's keys that show no ouput in xev, then xinput is not aware of them... which means a custom driver is likely needed. If there is output, post the output each key in
Code:
 tags.
As for the Gnome XKB error, the other method used XKB mappings and likely there was a derp in the way the keyboard is handled or the script. As a rule, don't run scripts if you cannot understand the contents -- albeit vaguely, you don't need to be fluent. Another issue is changes upstream affect scripts that aren't maintained.
Input-remapper hooks input from a device, then provides a virtual device to inject events, so it's less tied to any particular version/standards/environment.
So there is no spoiler I see. I have a small white window w/a black box in it that when my mouse is hovered over seems to work. Called event tester/ running out of Input-Remapper So two seperate apps are runnind with seperate gui's . And yes, every key outputs a line of info in term. I get what you saying, I would basically copy and drag or paste somewhere?? As for scripts, yeah, I try not to mess w em but it's apparent I need to sometimes at least esp as I'm on old hardware. So I'm studying/learning. plenty of vids that teach. I did remember I had another keyboard with my sons i-pad, it may work, it's a Logitech ultra thin. It magnets to his old i-pad2, my old his new, lol.
 
So there is no spoiler I see.
Yeah, sorry, I forgot to put a space when I typed "[ spoiler]" so the forum software auto-converted it. I edited my previous post, it's fixed.

And yes, every key outputs a line of info in term
Okay, that's good if you can get output from every key. It's detected.


I get what you saying, I would basically copy and drag or paste somewhere??
Nope, just wanted to make sure all your keys are working. input-remapper will detect them. It may display insane things, but it will detect the raw events. My mouse's 8th button sends the XF86 AudioMute toggle (programmable mice connect as keyboard + mouse combos), but input-remapper has me covered and I have mapped it to Shift for side-scrolling. I can still use my real keyboard's mute toggle as well.
So you should be able to map your keys fine then. Make sure you installed the GUI frontend, input-remapper-gtk, package, it'll pull the right dependencies. If you need help with the GUI (it's a little clunky), feel free to ask and I'll post some screen shots.

As for scripts, yeah, I try not to mess w em but it's apparent I need to sometimes at least esp as I'm on old hardware. So I'm studying/learning. plenty of vids that teach.
Good, don't just blindly use scripts. Great that you're studying. Learning keeps our brains young!
 

Staff online


Top