Portál AbcLinuxu, 10. května 2025 07:09
# # Even if we have defined a DISPLAY, we can't detect easily its number. # We could have more than one X server running on our machine, # so it's better to fix it to the :0.0 or the :0 value. # There is a chance that the first X invoked is running on the :0.0 display. # # We also suppose to run this script with root rightsZřejmě zafunguje špatně a nastaví tam místo např. :0 nějaké blbosti. Je to textový skript, tak si s ním můžeš pohrát.# (probably not a good choice, but functional to gain the right to write to X screen) # # Now is time to determine what is the authority file generated by kdm, xdm or gdm: # XLINE=\$(ps axuwww | grep -e "[/\s]X .* \?-auth" | head -1) AUTHORITYFILE=\$(echo \$XLINE | awk '/-auth/ { match( \$0, /.*-auth ([^ ]+).*/, pippo); print pippo[1]; }') export DISPLAY=\$(echo \$XLINE | sed 's#.* \(:[0-9]\+\(\.\?[0-9]\+\)\?\).*#\1#' )
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.