Windows display variable value

SET DISPLAY variable

Privet vsem.
Linux from scratch s X11. Sistema imeet 2 video karti. Ne mogu poniat’, kto ustanavlivaet peremennuiu DISPLAY dlia kagdogo monitora. Gde rit?
Zaranee blgodaren.
Tolik.

Re: SET DISPLAY variable

и эта. xorg.conf в студию

SET DISPLAY variable

Da v kurse ia proetu komandu, avtomatom kak mne eto delo vistavit’?

Section «ServerLayout»
Identifier «X.org Configured»
Screen 0 «Screen0» 0 0
InputDevice «Mouse0» «CorePointer»
InputDevice «Keyboard0» «CoreKeyboard»
EndSection

Section «Files»
RgbPath «/usr/X11R6/lib/X11/rgb»
ModulePath «/usr/X11R6/lib/modules»
FontPath «/usr/X11R6/lib/X11/fonts/misc/»
FontPath «/usr/X11R6/lib/X11/fonts/TTF/»
FontPath «/usr/X11R6/lib/X11/fonts/Type1/»
FontPath «/usr/X11R6/lib/X11/fonts/CID/»
FontPath «/usr/X11R6/lib/X11/fonts/75dpi/»
FontPath «/usr/X11R6/lib/X11/fonts/100dpi/»
EndSection

Section «Module»
Load «extmod»
Load «glx»
Load «dri»
Load «dbe»
Load «record»
Load «xtrap»
Load «type1»
Load «freetype»
EndSection

Section «InputDevice»
Identifier «Keyboard0»
Driver «kbd»
EndSection

Section «InputDevice»
Identifier «Mouse0»
Driver «mouse»
Option «Protocol» «auto»
Option «Device» «/dev/mouse0»
EndSection

Section «Monitor»
#DisplaySize 340 270 # mm
Identifier «Monitor0»
VendorName «SAM»
ModelName «SyncMaster»
### Uncomment if you don’t want to default to DDC:
# HorizSync 30.0 — 70.0
# VertRefresh 56.0 — 75.0
Option «DPMS»
EndSection

Section «Device»
### Available Driver options are:-
### Values: : integer, : float, : «True»/»False»,
### : «String», : » Hz/kHz/MHz»
### [arg]: arg optional
#Option «NoAccel» # [ ]
#Option «SWcursor» # [ ]
#Option «Dac6Bit» # [ ]
#Option «Dac8Bit» # [ ]
#Option «BusType» # [ ]
#Option «CPPIOMode» # [ ]
#Option «CPusecTimeout» #
#Option «AGPMode» #
#Option «AGPFastWrite» # [ ]
#Option «AGPSize» #
#Option «GARTSize» #
#Option «RingSize» #
#Option «BufferSize» #
#Option «EnableDepthMoves» # [ ]
#Option «EnablePageFlip» # [ ]
#Option «NoBackBuffer» # [ ]
#Option «PanelOff» # [ ]
#Option «DDCMode» # [ ]
#Option «MonitorLayout» # [ ]
#Option «IgnoreEDID» # [ ]
#Option «UseFBDev» # [ ]
#Option «VideoKey» #
#Option «MergedFB» # [ ]
#Option «CRT2HSync» # [ ]
#Option «CRT2VRefresh» # [ ]
#Option «CRT2Position» # [ ]
#Option «MetaModes» # [ ]
#Option «MergedDPI» # [ ]
#Option «NoMergedXinerama» # [ ]
#Option «MergedXineramaCRT2IsScreen0» # [ ]
#Option «DisplayPriority» # [ ]
#Option «PanelSize» # [ ]
#Option «ForceMinDotClock» #
#Option «RenderAccel» # [ ]
#Option «SubPixelOrder» # [ ]
#Option «ShowCache» # [ ]
#Option «DynamicClocks» # [ ]
Identifier «Card0»
Driver «vesa»
VendorName «ATI Technologies Inc»
BoardName «Unknown Board»
# BusID «PCI:1:0:0»
EndSection

Section «Screen»
Identifier «Screen0»
Device «Card0»
Monitor «Monitor0»
DefaultDepth 24
SubSection «Display»
Viewport 0 0
Depth 24
Modes «1024×768» «800×600» «640×480»
EndSubSection

dv (Display Local Variables)

The dv command displays the names and values of all local variables in the current scope.

Parameters

Flags
Causes additional information to be displayed. Any of the following case-sensitive Flags can be included:

/i
Causes the display to specify the kind of variable: local, global, parameter, function, or unknown.

/t
Causes the display to include the data type for each local variable.

/v
Causes the display to include the virtual memory address or register location of each local variable.

/V
Same as /v, and also includes the address of the local variable relative to the relevant register.

/a
Sorts the output by address, in ascending order.

/A
Sorts the output by address, in descending order.

/n
Sorts the output by name, in ascending order.

/N
Sorts the output by name, in descending order.

/z
Sorts the output by size, in ascending order.

/Z
Sorts the output by size, in descending order.

Pattern
Causes the command to only display local variables that match the specified Pattern. The pattern may contain a variety of wildcards and specifiers; see String Wildcard Syntax for details. If Pattern contains spaces, it must be enclosed in quotation marks. If Pattern is omitted, all local variables will be displayed.

Environment

Modes

user mode, kernel mode

Targets

live, crash dump

Platforms

Additional Information

For details on displaying and changing local variables and a description of other memory-related commands, see Reading and Writing Memory.

Remarks

In verbose mode, the addresses of the variables are displayed as well. (This can also be done with the x (Examine Symbols) command.)

Data structures and unfamiliar data types are not displayed in full; rather, their type name is displayed. To display the entire structure, or display a particular member of the structure, use the dt (Display Type) command.

The local context determines which set of local variables will be displayed. By default, this context matches the current position of the program counter. For information about how this can be changed, see Local Context.

Читайте также:  Windows http error 503

Inspect variables in the Autos and Locals windows

The Autos and Locals windows show variable values while you are debugging. The windows are only available during a debugging session. The Autos window shows variables used around the current breakpoint. The Locals window shows variables defined in the local scope, which is usually the current function or method.

If this is the first time that you’ve tried to debug code, you may want to read Debugging for absolute beginners and Debugging techniques and tools before going through this article.

The Autos window is available for C#, Visual Basic, C++, and Python code, but not for JavaScript or F#.

To open the Autos window, while debugging, select Debug > Windows > Autos, or press Ctrl+Alt+V > A.

To open the Locals window, while debugging, select Debug > Windows > Locals, or press Alt+4.

This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Data visualizations in Visual Studio for Mac.

Use the Autos and Locals windows

Arrays and objects show in the Autos and Locals windows as tree controls. Select the arrow to the left of a variable name to expand the view to show fields and properties. Here is an example of a System.IO.FileStream object in the Locals window:

A red value in the Locals or Autos window means the value has changed since the last evaluation. The change could be from a previous debugging session, or because you have changed the value in the window.

The default numeric format in debugger windows is decimal. To change it to hexadecimal, right-click in the Locals or Autos window and select Hexadecimal Display. This change affects all debugger windows.

Edit variable values in the Autos or Locals window

To edit the values of most variables in the Autos or Locals windows, double-click the value and enter the new value.

You can enter an expression for a value, for example a + b . The debugger accepts most valid language expressions.

In native C++ code, you might have to qualify the context of a variable name. For more information, see Context operator (C++).

Make sure you understand the consequences before you change values and expressions. Some possible issues are:

Evaluating some expressions can change the value of a variable or otherwise affect the state of your program. For example, evaluating var1 = ++var2 changes the value of both var1 and var2 . These expressions are said to have side effects. Side effects can cause unexpected results if you are not aware of them.

Editing floating-point values can result in minor inaccuracies because of decimal-to-binary conversion of fractional components. Even a seemingly harmless edit can result in changes to some of the bits in the floating-point variable.

Search in the Autos or Locals window

You can search for keywords in the Name, Value, and Type columns of the Autos or Locals window using the search bar above each window. Hit ENTER or select one of the arrows to execute a search. To cancel an ongoing search, select the «x» icon in the search bar.

Use the left and right arrows (Shift+F3 and F3, respectively) to navigate between found matches.

To make your search more or less thorough, use the Search Deeper dropdown at the top of the Autos or Locals window to select how many levels deep you want to search into nested objects.

Pin properties in the Autos or Locals window

This feature is supported for .NET Core 3.0 or higher.

You can quickly inspect objects by their properties in the Autos and Locals windows with the Pinnable Properties tool. To use this tool, hover over a property and select the pin icon that appears or right-click and select the Pin Member as Favorite option in the resulting context menu. This bubbles up that property to the top of the object’s property list, and the property name and value is displayed in the Value column. To unpin a property, select the pin icon again or select the Unpin Member as Favorite option in the context menu.

You can also toggle property names and filter out non-pinned properties when viewing the object’s property list in the Autos or Locals windows. You can access each option by selecting the buttons in the toolbar above the Autos or Locals windows.

Change the context for the Autos or Locals window

You can use the Debug Location toolbar to select a desired function, thread, or process, which changes the context for the Autos and Locals windows.

Читайте также:  Abbyy business card reader для windows

To enable the Debug Location toolbar, click in an empty part of the toolbar area and select Debug Location from the dropdown, or select View > Toolbars > Debug Location.

Set a breakpoint and start debugging. When the breakpoint is hit, execution pauses and you can see the location in the Debug Location toolbar.

Variables in the Autos window (C#, C++, Visual Basic, Python)

Different code languages display different variables in the Autos window.

In C# and Visual Basic, the Autos window displays any variable used on the current or preceding line. For example, in C# or Visual Basic code, declare the following four variables:

Set a breakpoint on the line c = 3; , and start the debugger. When execution pauses, the Autos window will display:

The value of c is 0, because the line c = 3 has not yet been executed.

In C++, the Autos window displays the variables used in at least three lines before the current line where execution is paused. For example, in C++ code, declare six variables:

Set a breakpoint on the line e = 5; and run the debugger. When execution stops, the Autos window will display:

The variable e is uninitialized, because the line e = 5 has not yet been executed.

View return values of method calls

In .NET and C++ code, you can examine return values in the Autos window when you step over or out of a method call. Viewing method call return values can be useful when they are not stored in local variables. A method could be used as a parameter, or as the return value of another method.

For example, the following C# code adds the return values of two functions:

To see the return values of the sumVars() and subtractVars() method calls in the Autos window:

Set a breakpoint on the int x = sumVars(a, b) + subtractVars(c, d); line.

Start debugging, and when execution pauses at the breakpoint, select Step Over or press F10. You should see the following return values in the Autos window:

What is the $DISPLAY environment variable?

I am new to shell scripting. I don’t understand what the $DISPLAY environmental variable is.

I have Ubuntu 13.10 and I use /bin/bash shell. I have two monitors.

Command echo $DISPLAY will print :0.0 on my machine (on both monitors). What does this mean?

In which cases will the $DISPLAY variable be blank or NULL?

Are there any articles or tutorials on this?

5 Answers 5

The magic word in the X window system is DISPLAY. A display consists (simplified) of:

A display is managed by a server program, known as an X server. The server serves displaying capabilities to other programs that connect to it.

The remote server knows where it has to redirect the X network traffic via the definition of the DISPLAY environment variable which generally points to an X Display server located on your local computer.

The value of the display environment variable is:

hostname is the name of the computer where the X server runs. An omitted hostname means the localhost.

D is a sequence number (usually 0). It can be varied if there are multiple displays connected to one computer.

S is the screen number. A display can actually have multiple screens. Usually, there’s only one screen though where 0 is the default.

Example of values

hostname:D.S means screen S on display D of host hostname; the X server for this display is listening at TCP port 6000+D.

host/unix:D.S means screen S on display D of host host; the X server for this display is listening at UNIX domain socket /tmp/.X11-unix/XD (so it’s only reachable from host).

:D.S is equivalent to host/unix:D.S, where host is the local hostname.

:0.0 means that we are talking about the first screen attached to your first display in your local host

From a X(7) man page:

From the user’s perspective, every X server has a display name of the form:

This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple monitors):

hostname The hostname specifies the name of the machine to which the display is physically connected. If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used. displaynumber The phrase «display» is usually used to refer to a collection of monitors that share a common keyboard and pointer (mouse, tablet, etc.). Most workstations tend to only have one keyboard, and therefore, only one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a display number (beginning at 0) when the X server for that display is started. The display number must always be given in a display name. screennumber Some displays share a single keyboard and pointer among two or more monitors. Since each monitor has its own set of windows, each screen is assigned a screen number (beginning at 0) when the X server for that display is started. If the screen number is not given, screen 0 will be used.

Читайте также:  Файловая система btrfs для linux

The existing answers fail to address the broader picture.

If you are not using a graphical environment (i.e. you are logging in on the system console with no windows etc; or you are logging in remotely from a text-only terminal over SSH or similar, such as from a Windows computer running PuTTY) then no GUI is involved, and DISPLAY will typically be unset. Your only means of communicating with the computer is the command line (though there may be ways to pivot into a GUI session if you know how).

If you are logging in on the console with a graphical interface (on Ubuntu, typically the GDM greeter is used) or using a graphical terminal (such as from a Windows computer running eXceed or mobaX, or remote desktop software like a VNC client) the DISPLAY variable is set up by the program which manages your graphical session to indicate to graphical clients which I/O devices to connect to.

Traditionally, the GUI on an Ubuntu computer was running X.org, an X11 implementation, though more recently, a modernized replacement called Mir was introduced by Canonical; and even more recently, I believe Mir will be abandoned in favor of another project with broadly similar goals called Wayland. These replacements are intended to reduce the complexity of a full X11 stack, which we will not be going into here — they adhere to the same DISPLAY convention, which is after all what we are discussing here.

On X11, the host part of DISPLAY could be a remote server, and you would use your Ubuntu computer as a «graphical terminal» to access files and programs on that remote server (in which case your computer is the «server» which serves a keyboard, a mouse, and one or more display devices to «client» programs running on the remote . server). More commonly, the X11 (or Mir, or Wayland) server and the client programs (a desktop manager and various graphical clients such as a web browser, an email client, a calendar program, etc) all run on your computer. This is indicated by the «server» part of the DISPLAY value, which in the latter case is typically empty (which implies the default value, localhost ).

An X11 server may run one or more graphical sessions — for example, your console login and a remote VNC session could be running at the same time. In this case (if they are managed by the same X11 server instance) you have more than one «display» in X11 terms. In practice, one session (one login event and the desktop instance spawned from this) is one display in X11.

One such display can have one or more screens. Traditionally, this meant one monitor, though the original architecture had some unfortunate traits such as the inability to move a window from one screen to another. Add-ons like Xinerama and Xrandr further muddied the situation to the point where one screen often connects multiple monitors in various ways.

If you have played with multiple-monitor systems, you have probably discovered that you can arrange monitors in various ways and end up with a rectangular area where your monitors display some parts of it and other parts are not assigned to any monitor. This is the «screen» that X11 creates, and if you have more than one display card, you can have multiple of these screens, each assigned to one or more monitors (or in theory, running without a monitor; Xvfb exploits this to allow you to run X11 without any monitors, simply mapping the GUI to a memory region for whatever purpose).

Оцените статью