XRDP add layout - xfce

On Debian 8 installed XRDP + xfce4. There is no possibility to add a new layout to system - the "Add" button is disabled: after logging in go to the "Application Menu - Settings - Keyboard" select "Layout" and see the following picture: see screenshot.
In the directory /etc/xrdp/ there are files:
km-0407.ini
km-0409.ini
km-040c.ini
km-0410.ini
km-0419.ini
km-041d.ini
rsakeys.ini
sesman.ini
startwm.sh
xrdp.ini
km-0419.ini - layout, which I need.
How to add a keyboard layout?
I tried to run inside a terminal session (under root) commands:
setxkbmap
and
xrdp-genkeymap /etc/xrdp/km-0419.ini
In response to the first command I get:
XKB extention not present on: 10.0
second silently executed, nothing happens.
The same commands is a terminal session (on a host-machine) reported:
Can not open display «default display»
and
unable to open display ""

I had a trouble with Debian 9 + xfce + xrdp.
The trouble was the additional layouts disappeared when I reconnected by RDP.
I'm not sure this is exactly you are looking for, I apologize if it is not.
Maybe my experience will help you to figure out how to resolve your trouble.
Also I do not know if it works for your version of xrdp.
For example here is solution for Russian keyboard.
It returns all keyboard layouts settings to default when you start new RDP session.
So there are two ways to resolve it.
Run the command to change your settings to preferable after any RDP login.
setxkbmap -layout us,ru -variant ',winkeys' -option 'grp:alt_shift_toggle,grp_led:scroll'
Or change xrdp config to make it use the settings you want.
What helped me is correcting file /etc/xrdp/xrdp_keyboard.ini
(pay attention for sections [rdp_keyboard_ru] and [layouts_map_ru])
You can use it for another's languages by analogy.
Here is an example of /etc/xrdp/xrdp_keyboard.ini file of mine.
You can see at the end of the file I use my custom sets:
;
; RDP Keyboard <-> X11 Keyboard layout map
;
; How this file works:
; 1. load the file and scan each section to find matching "keyboard_type"
; and "keyboard_subtype" based on the values received from the client.
; If not found, then jump to default section.
; 2. in the selected section, look for "rdp_layouts" and "layouts_map".
; Based on the "keylayout" value from the client, find the right x11
; layout value.
; 3. model/variant are inferred based on the "keyboard_type" and
; "keyboard_subtype", but they can be overridden.
;
;
; RDP Keyboard Type (http://msdn.microsoft.com/en-us/library/cc240563.aspx)
;
; 0 is not a valid value
;
; 1 - IBM PC/XT or compatible (83-key) keyboard
; 2 - Olivetti "ICO" (102-key) keyboard
; 3 - IBM PC/AT (84-key) or similar keyboard
; 4 - IBM enhanced (101- or 102-key) keyboard
; 5 - Nokia 1050 and similar keyboards
; 6 - Nokia 9140 and similar keyboards
; 7 - Japanese keyboard
;
; RDP Keyboard Subtype is vendor dependent. XRDP defines as follows:
;
; 0 is not a valid value
;
; 1 - Standard
; 2 - FreeRDP JP keyboard
; 3 - Macintosh
; ... - < any vendor dependent subtype >
;
; The list can be augmented.
;
; default
[default]
; keyboard_type and keyboard_subtype is not read for default section. It
; is only a placeholder to keep consistency. Default model/variant are
; platform dependent, and could be overridden if needed.
keyboard_type=0
keyboard_subtype=0
; user could override variant and model, but generally they should be inferred
; automatically based on keyboard type and subtype
;variant=
;model=
; A list of supported RDP keyboard layouts
rdp_layouts=default_rdp_layouts
; The map from RDP keyboard layout to X11 keyboard layout
layouts_map=default_layouts_map
[default_rdp_layouts]
rdp_layout_us=0x00000409
rdp_layout_de=0x00000407
rdp_layout_fr=0x0000040C
rdp_layout_it=0x00000410
rdp_layout_jp=0x00000411
rdp_layout_jp=0xe0010411
rdp_layout_jp=0xe0200411
rdp_layout_jp=0xe0210411
rdp_layout_kr=0x00000412
rdp_layout_ru=0x00000419
rdp_layout_se=0x0000041D
rdp_layout_ch=0x00000807
rdp_layout_pt=0x00000816
rdp_layout_br=0x00000416
rdp_layout_pl=0x00000415
; <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
rdp_layout_us=us
rdp_layout_de=de
rdp_layout_fr=fr
rdp_layout_it=it
rdp_layout_jp=jp
rdp_layout_kr=kr
rdp_layout_ru=ru
rdp_layout_se=se
rdp_layout_ch=ch
rdp_layout_pt=pt
rdp_layout_br=br(abnt2)
rdp_layout_pl=pl
; if two sections have the same keyboard_type and keyboard_subtype, then
; the latter could override the former.
[rdp_keyboard_mac]
keyboard_type=4
keyboard_subtype=3
rdp_layouts=default_rdp_layouts
layouts_map=rdp_layouts_map_mac
[rdp_keyboard_jp]
keyboard_type=7
keyboard_subtype=2
model=pc105
rdp_layouts=default_rdp_layouts
layouts_map=default_layouts_map
[rdp_layouts_map_mac]
rdp_layout_us=us
rdp_layout_de=de
rdp_layout_fr=fr
rdp_layout_jp=jp
rdp_layout_kr=kr
rdp_layout_it=it
rdp_layout_ru=ru
rdp_layout_se=se
rdp_layout_ch=ch
rdp_layout_pt=pt
rdp_layout_br=br(abnt2)
rdp_layout_pl=pl
[rdp_keyboard_ru]
keyboard_type=4
keyboard_type=7
keyboard_subtype=1
model=pc105
options=grp:lctrl_lshift_toggle,compose:ralt
variant=,
rdp_layouts=default_rdp_layouts
layouts_map=layouts_map_ru
[layouts_map_ru]
rdp_layout_us=us,ru
rdp_layout_ru=us,ru

look at $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml
setxkbmap -layout us,ru -variant ',' -option 'grp:win_space_toggle'

Related

terminal shortcut for mail account switching using com.apple.mail.plist

Environment: OS X 10.14.3
I am trying to set up a keyboard short cut for mail.app using a terminal command to write to the plist file.
In Settings > Keyboard > Shortcuts > App Shortcuts, it is possible to set keyboard shortcuts to switch mail accounts. When set the short cut appears in the change mail menu when composing a new mail:
With these set, running defaults read com.apple.mail.plist generates this output:
{
NSUserKeyEquivalents = {
"john doe \\U2013 john.doe#gmail.com" = "#~^d";
"john doe2 \\U2013 john.doe2#gmail.com" = "#~^k";
"john doe3 \\U2013 john.doe3#gmail.com" = "#~^g";
};
}
If I delete one of this entries using the GUI interface in Settings > Keyboard > Shortcuts > App Shortcuts and try and reset it using the following terminal command:
defaults write com.apple.mail.plist NSUserKeyEquivalents -dict-add "john doe3 \\U2013 john.doe3#gmail.com" "#~^g"
the entry appears correctly when I query defaults read com.apple.mail.plist but it does not work in Mail nor does it appear in the GUI interface.
Does anyone know why this is not working?

debug bpf code on netlink messages

I am writing a bpf filter to prevent certain netlink messages. I am trying to debug the bpf code. Is there any debug tool that could help me?
I was initially thinking of using nlmon to capture netlink messages:
From https://jvns.ca/blog/2017/09/03/debugging-netlink-requests/
# create the network interface
sudo ip link add nlmon0 type nlmon
sudo ip link set dev nlmon0 up
sudo tcpdump -i nlmon0 -w netlink.pcap # capture your packets
Then use ./bpf_dbg (
https://github.com/cloudflare/bpftools/blob/master/linux_tools/bpf_dbg.c)
1) ./bpf_dbg to enter the shell (shell cmds denoted with '>'):
2) > load bpf 6,40 0 0 12,21 0 3 20... (this is the bpf code I intend to debug)
3) > load pcap netlink.pcap
4) > run /disassemble/dump/quit (self-explanatory)
5) > breakpoint 2 (sets bp at loaded BPF insns 2, do run then;
multiple bps can be set, of course, a call to breakpoint
w/o args shows currently loaded bps, breakpoint reset for
resetting all breakpoints)
6) > select 3 (run etc will start from the 3rd packet in the pcap)
7) > step [-, +] (performs single stepping through the BPF)
Did anyone try this before?
Also, I was not able to make nlmon module to load on my linux kernel(Is there a doc for this?)
I am running kernel version Linux version 4.10.0-40-generic
The nlmon module seems to be present in the kernel source:
https://elixir.free-electrons.com/linux/v4.10/source/drivers/net/nlmon.c#L41
But, when I search inside, /lib/modules/ for nlmon.ko I dont find anything.
instance-1:/lib/modules$ find . | grep -i nlmon
instance-1:/lib/modules$

Unable to start the startxwin cygwin

I was using Cygwin download by some one in our organization and the xterm worked fine, I recently updated the xterm version, since then I lost the ability to use the xwindow/start the xserver. The bash console where I ran the startxwin shows the following and does not open the xterm window. I manually opened the xterm window and it does not open the xwindows when I ssh'd into the remote machine.
$ startxwin
:0" in "list" command display name "6175
xauth: (stdin):1: bad "add" command line
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.19.3.0
OS: CYGWIN_NT-6.1 6175 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64
OS: Windows 7 Service Pack 1 [Windows NT 6.1 build 7601] (Win64)
Package: version 1.19.3-2 built 2017-04-23
XWin was started with the following command line:
/usr/bin/XWin :0 -multiwindow -auth
/home/usrpao/.serverauth.13204
(II) xorg.conf is not supported
(II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
LoadPreferences: /home/usrpao/.XWinrc not found
LoadPreferences: Loading /etc/X11/system.XWinrc
LoadPreferences: Done parsing the configuration file...
winDetectSupportedEngines - RemoteSession: no
winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL
winDetectSupportedEngines - Returning, supported engines 00000005
winSetEngine - Multi Window or Rootless => ShadowGDI
winScreenInit - Using Windows display depth of 32 bits per pixel
winAllocateFBShadowGDI - Creating DIB with width: 2560 height: 1024 depth: 32
winFinishScreenInitFB - Masks: 00ff0000 0000ff00 000000ff
winInitVisualsShadowGDI - Masks 00ff0000 0000ff00 000000ff BPRGB 8 d 24 bpp 32
MIT-SHM extension disabled due to lack of kernel support
XFree86-Bigfont extension local-client optimization disabled due to lack of shared memory support in the kernel
glWinSelectGLimplementation: Loaded 'cygnativeGLthunk.dll'
(II) AIGLX: Testing pixelFormatIndex 1
GL_VERSION: 4.3.0 - Build 10.18.14.4280
GL_VENDOR: Intel
GL_RENDERER: Intel(R) HD Graphics 4600
(II) GLX: enabled GLX_SGI_make_current_read
(II) GLX: enabled GLX_SGI_swap_control
(II) GLX: enabled GLX_MESA_swap_control
(II) GLX: enabled GLX_SGIX_pbuffer
(II) GLX: enabled GLX_ARB_multisample
(II) GLX: enabled GLX_SGIS_multisample
(II) GLX: enabled GLX_ARB_fbconfig_float
(II) GLX: enabled GLX_EXT_fbconfig_packed_float
(II) GLX: enabled GLX_ARB_create_context
(II) GLX: enabled GLX_ARB_create_context_profile
(II) GLX: enabled GLX_ARB_create_context_robustness
(II) GLX: enabled GLX_EXT_create_context_es2_profile
(II) GLX: enabled GLX_ARB_framebuffer_sRGB
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) 80 pixel formats reported by wglGetPixelFormatAttribivARB
(II) 44 fbConfigs
(II) ignored pixel formats: 0 not OpenGL, 0 unknown pixel type, 36 unaccelerated
(II) GLX: Initialized Win32 native WGL GL provider for screen 0
winPointerWarpCursor - Discarding first warp: 1280 512
(--) 8 mouse buttons found
(--) Setting autorepeat to delay=500, rate=31
(--) Windows keyboard layout: "00000409" (00000409) "US", type 4
(--) Found matching XKB configuration "English (USA)"
(--) Model = "pc105" Layout = "us" Variant = "none" Options = "none"
Rules = "base" Model = "pc105" Layout = "us" Variant = "none" Options = "none"
winInitMultiWindowWM - DISPLAY=:0.0
winMultiWindowXMsgProc - DISPLAY=:0.0
winInitMultiWindowWM - xcb_connect () returned and successfully opened the display.
winProcEstablishConnection - winInitClipboard returned.
winClipboardThreadProc - DISPLAY=:0.0
winMultiWindowXMsgProc - xcb_connect() returned and successfully opened the display.
OS maintains clipboard viewer chain: yes
winClipboardProc - XOpenDisplay () returned and successfully opened the display.
Using Composite redirection
I had a similar issue and tracked it down to startx misbehaving. This is what I saw:
$ ./startx -- :1
:1" in "list" command display name "hostname
xauth: (stdin):1: bad "add" command line
The problem is with the way startx is setting its hostname variable. It does not strip out the carriage return. Later, when startx uses the hostname variable, the contained carriage return causes xuath "add" command to terminate prematurely and fail.
The fix for me was to strip out the carriage return.
Find where the variable hostname gets set in /usr/bin/startx, and just below there add this line:
hostname=$(echo $hostname | sed 's/\x0D//g')
It's a PATH issue. Cygwin\bin should be in the PATH before Windows\System32.
Otherwise system32\hostname.exe is invoked instead of /bin/hostname, which adds a trailing newline to the hostname.
A possible workaround is to invoke /bin/hostname instead of just hostname:
sed -i s/\`hostname/\`\\/bin\\/hostname/ /usr/bin/startx /usr/bin/startxwin
... but you'll face other issues until you put Cygwin at the beginning of the PATH (though then you might face yet other issues, so there's no ideal solution).

Print raw EPL using Zebra GC420t(EPL) using windows "Generic Text Only" driver

Strange that I'm able to print raw ZPL commands but not EPL commands using windows Generic Text Only driver through GC420t(EPL) machine.the below is the raw EPLfile exported from .lbl file.But on printing it does nothing.
I8,A,001
Q799,024
q863
rN
S3
D7
ZT
JF
O
R32,0
f100
N
B445,62,0,1,4,12,78,B,"AB"
A471,162,0,4,6,8,N,"AB"
A447,305,0,2,2,2,N,"Rh POSITIVE"
B451,456,0,1,2,6,82,B,"08/01/2015"
A450,431,0,4,1,1,N,"Expiry Date"
A456,574,0,4,1,1,N,"12/08/89"
B64,69,0,1,3,9,82,B,"123"
A67,564,0,2,2,2,N,"Whole Blood"
B69,458,0,1,2,6,79,B,"Whole Blood"
A67,615,0,1,1,1,N,"prepared from 450ml of "
A71,635,0,1,1,1,N,"whole blood"
A69,658,0,1,1,1,N,"stora at 4c to 5c"
A69,679,0,1,1,1,N,"transport at 5c to 10c"
A62,52,0,1,1,1,N,"DIN"
A65,207,0,2,1,1,N,"Date Bled"
TDdd/mn/y2
B67,225,0,1,2,6,84,B,TD
A67,337,0,4,1,1,N,"12 FEB 89"
A67,369,0,1,1,1,N,"Properly Identify Intended"
A69,388,0,1,1,1,N,"Recipient"
P1
I also had an issue with EPL commands getting through with the Generic/Text driver.
I used the Seagull Scientific, Zebra printer driver. After install go to Printing Preferences -> Page Setup tab -> Advanced Options -> Pass Through tab. Set to "Generic/Text Only" mode and check the "Add CR/LF" box at the bottom. Worked great after that.

OS X Yosemite - Adding a Printer - UI Vs lpadmin

My problem is that when I add a printer using the Printers and Scanners UI printing works, when I add the same printer using lpadmin it doesn't.
To Add it through the UI I did the following:
From Printers and Scanners I selected the IP tab.
Address: 10.20.30.40, Protocol HP Jetdirect - Socket, Queue left blank, Name: TEST_01, Location "Top Floor", Use -> Select software -> HP LaserJet P3010 Series
After doing this, the Printer works as expected.
This is a (segment from a) script containing my lpadmin command that doesn't work
SUBNET=socket://10.20.30.
TEST_01=40
PPD_DIR=/Library/Printers/PPDs/Contents/Resources
TEST_01_PPD="hp LaserJet P3010 Series.gz"
lpadmin -E -p TEST_01 -v $SUBNET$TEST_01 -P "$PPD_DIR/$TEST_01_PPD" -D "TEST_01" -L "Top Floor"
The printer appears correctly in the UI but shows as paused.
I did find a message in system.log that may or may not be relevant - I was using Notes to test the printer:
Notes[502]: Failed to connect (_delegate) outlet from (com_hp_psdriver_19_11_0_PDEView) to (com_hp_psdriver_19_11_0_PDEAccountingController): missing setter or instance variable
Notes[2198]: Printing failed because PMSessionEndDocumentNoDialog() returned -30871.
The reason I want to use a script is that there are 20 printers to add on each of 30 new Macs. The actual script uses a series of arrays with lpadmin in a for loop. Everything I have read says it should work. What am I missing?
I think -E specified before the printer name enables encryption, whereas specified after it Enables the printer - effectively "unpausing" it. Madness- I know!
Mad Apple Documentation - see second sentence
I think you want:
lpadmin -p TEST_01 -v $SUBNET$TEST_01 -P "$PPD_DIR/$TEST_01_PPD" -D "TEST_01" -L "Top Floor" -E
I don't have a direct answer, but I can suggest an alternate approach: set up all 20 printers by hand on one computer, then copy the /etc/cups directory from that one to the other 29.

Resources