blob: 35bc84c7e149bf68d31e844ab4626ad36223665e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
*********************
Desktop Environment
*********************
Some useful text commands to work on graphical interfaces.
.. only:: html
.. contents::
Xorg
====
Resizing windows
----------------
Resize all of the windows from ``$PROGRAM`` to 800x600::
xdotool search --name $PROGRAM windowsize %@ 800 600
Resize the active window to 800x600::
xdotool getactivewindow windowsize 800 600
Clipboard
---------
Get the contents of the X selection on stdout::
xclip -o
Copy clipboard contents (e.g. from ctrl-C in a graphical program) to the
primary (which can be basted with a middle mouse click)::
xclip -o -selection clipboard | xclip -i
Screenshots
===========
With ImageMagick
----------------
The default behaviour of import is to take a custom rectangular portion
of the screen; just launch::
import $FILENAME
and drag the cursor to select the area you are interested into.
To get a screenshot of the full screen (the root window)::
import -window root $FILENAME
To get a screenshot of one specific window::
import -window `xwininfo | awk '/.*Window id:.*/ {print $4}'` $FILENAME
and then click on the window you are interested in; to also include the
window borders the command is::
import -border -window `xwininfo | awk '/.*Window id:.*/ {print $4}'` \
$FILENAME
To take a screenshot of a running screensaver, login remotely to the
computer e.g. via ssh, with the same user that is running the X session,
and then::
DISPLAY=:0 import -window root $FILENAME
XDG
===
Set MIME associations and default apps
--------------------------------------
``xdg-settings`` is used to set some deskoppish properties and
expecially the default web browser::
xdg-settings set default-web-browser xombrero.desktop
other associations can be set using ``xdg-mime``::
xdg-mime default apvlv.desktop application/pdf
of course the ``.desktop`` can be any available file for any app, placed
in one of the standard directories, either system-wide or per-user.
Both write to ``~/.local/share/applications/mimeapps.list``.
See Also
========
* `The old version of this article on my old website
<https://www.trueelena.org/computers/howto/managing_x_from_the_command_line.html>`_
* `Another article from my old website that has been added here
<https://www.trueelena.org/computers/howto/screenshots_with_imagemagick.html>`_
..
vim: set filetype=rst:
|