Make a Shut Down mode able to restore running applications like Suspend after having provided a decryption password such that cannot steal memory content and potentially decryption token #29

Open
opened 2024-06-25 13:38:19 +02:00 by Benjamin_Loison · 11 comments

Does suspend writes memory to hard disk or keep it in memory but with a lowest frequency?

What does hibernate means?

Wikipedia: Hibernation (computing) (1253395493):

powering down a computer while retaining its state

When the computer is turned on [...] the computer is exactly as it was before entering hibernation

After hibernating, the hardware is powered down like a regular shutdown. The system can have a total loss of power for an indefinite length of time and then resume to the original state.

Comparison to sleep mode

Many systems support a low-power sleep mode in which the processing functions of the machine are lowered, using a trickle of power to preserve the contents of RAM and support waking up. Instantaneous resumption is one of the advantages of sleep mode over hibernation.

Hibernation is defined as sleeping mode S4 in the ACPI specification.

systemd, if deployed, manages hibernation itself.

Hybrid sleep

Sleep mode and hibernation can be combined: the contents of RAM are copied to the non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, survives a power outage.

Wikipedia: Uswsusp (1224419680)

is a set of userspace command-line utilities for Linux that act primarily as wrappers around the Linux kernel hibernation functionality and implement sleep mode (s2ram utility, referred to as "suspend to RAM"), hibernation (s2disk utility, referred to as "suspend to disk"), and hybrid sleep (s2both utility, referred to as "suspend to both")

I have read Wikipedia: Swsusp (1225481684) but it may need further investigation.

Should read Wikipedia: Preemption (computing) (1247633956).

hibernate
hibernate: command not found
sudo hibernate
sudo: hibernate: command not found

wiki.archlinux.org: Power management/Suspend and hibernate (820401)

Related to Benjamin_Loison/ecryptfs/issues/3 and Benjamin-Loison/cinnamon/issues/107.

Does suspend writes memory to hard disk or keep it in memory but with a lowest frequency? What does hibernate means? [Wikipedia: Hibernation (computing) (1253395493)](https://en.wikipedia.org/w/index.php?title=Hibernation_(computing)&oldid=1253395493): > powering down a computer while retaining its state > When the computer is turned on [...] the computer is exactly as it was before entering hibernation > After hibernating, the hardware is powered down like a regular shutdown. The system can have a total loss of power for an indefinite length of time and then resume to the original state. > Comparison to sleep mode > Many systems support a low-power sleep mode in which the processing functions of the machine are lowered, using a trickle of power to preserve the contents of RAM and support waking up. Instantaneous resumption is one of the advantages of sleep mode over hibernation. > Hibernation is defined as sleeping mode S4 in the ACPI specification. > systemd, if deployed, manages hibernation itself. > Hybrid sleep > Sleep mode and hibernation can be combined: the contents of RAM are copied to the non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, survives a power outage. [Wikipedia: Uswsusp (1224419680)](https://en.wikipedia.org/w/index.php?title=Uswsusp&oldid=1224419680) > is a set of userspace command-line utilities for Linux that act primarily as wrappers around the Linux kernel hibernation functionality and implement sleep mode (s2ram utility, referred to as "suspend to RAM"), hibernation (s2disk utility, referred to as "suspend to disk"), and hybrid sleep (s2both utility, referred to as "suspend to both") I have read [Wikipedia: Swsusp (1225481684)](https://en.wikipedia.org/w/index.php?title=Swsusp&oldid=1225481684) but it may need further investigation. Should read [Wikipedia: Preemption (computing) (1247633956)](https://en.wikipedia.org/w/index.php?title=Preemption_(computing)&oldid=1247633956). ```bash hibernate ``` ``` hibernate: command not found ``` ```bash sudo hibernate ``` ``` sudo: hibernate: command not found ``` [wiki.archlinux.org: Power management/Suspend and hibernate (820401)](https://wiki.archlinux.org/index.php?title=Power_management/Suspend_and_hibernate&oldid=820401) Related to [Benjamin_Loison/ecryptfs/issues/3](https://codeberg.org/Benjamin_Loison/ecryptfs/issues/3) and [Benjamin-Loison/cinnamon/issues/107](https://github.com/Benjamin-Loison/cinnamon/issues/107).
Author
Owner
Would help [Benjamin-Loison/cinnamon/issues/155](https://github.com/Benjamin-Loison/cinnamon/issues/155).
Author
Owner

Maybe list running programs in taskbar and be able to start them would be a good start.

Maybe list running programs in taskbar and be able to start them would be a good start.
Author
Owner
ps aux | grep '^benjamin'

lists too many programs.

DuckDuckGo search Linux list running taskbar programs.

wmctrl -l
Output:
0x02a00003  0 benjamin-loison-framework Desktop
0x03c0002c  0 benjamin-loison-framework ubuntu - Get a list of open windows in Linux - Super User — Mozilla Firefox
0x04000335  0 benjamin-loison-framework Unsaved Document 1
0x0440000b  0 benjamin-loison-framework benjamin@benjamin-loison-framework: ~

Source: the Super User answer 176790

I would like also to have the program names.

xlsclients
Output:
benjamin-loison-framework  csd-clipboard
benjamin-loison-framework  csd-xsettings
benjamin-loison-framework  csd-keyboard
benjamin-loison-framework  csd-automount
benjamin-loison-framework  csd-housekeeping
benjamin-loison-framework  csd-background
benjamin-loison-framework  csd-media-keys
benjamin-loison-framework  csd-color
benjamin-loison-framework  csd-wacom
benjamin-loison-framework  csd-power
benjamin-loison-framework  cinnamon-launcher
benjamin-loison-framework  cinnamon
benjamin-loison-framework  xapp-sn-watcher
benjamin-loison-framework  polkit-gnome-authentication-agent-1
benjamin-loison-framework  caribou
benjamin-loison-framework  nm-applet
benjamin-loison-framework  nemo-desktop
benjamin-loison-framework  evolution-alarm-notify
benjamin-loison-framework  cinnamon-killer-daemon
benjamin-loison-framework  blueman-applet
benjamin-loison-framework  blueman-tray
benjamin-loison-framework  firefox
benjamin-loison-framework  xdg-desktop-portal-gtk
benjamin-loison-framework  mintUpdate.py
benjamin-loison-framework  tray.py
benjamin-loison-framework  xed
benjamin-loison-framework  gnome-terminal-server

Source: the Super User answer 176761

xwininfo -root -children
Output:
xwininfo: Window id: 0x5e7 (the root window) (has no name)

  Root window id: 0x5e7 (the root window) (has no name)
  Parent window id: 0x0 (none)
     61 children:
     0x3c00041 "Firefox": ("Firefox" "firefox")  576x140+1086+132  +1086+132
     0x3c000db "Firefox": ()  20x20+-200+-200  +-200+-200
     0x200000b "cinnamon": ("cinnamon" "Cinnamon")  1x1+-200+-200  +-200+-200
     0x2000877 (has no name): ()  2260x1428+-2+-2  +-2+-2
     0x200035d (has no name): ()  2260x1428+-2+-2  +-2+-2
     0x4400006 (has no name): ()  1x1+-1+-1  +-1+-1
     0x4400002 "Terminal": ()  20x20+-200+-200  +-200+-200
     0x4400001 "Terminal": ("gnome-terminal-server" "Gnome-terminal-server")  20x20+20+20  +20+20
     0x400034e "xed": ()  20x20+-200+-200  +-200+-200
     0x200083c (has no name): ()  2260x1428+-2+-2  +-2+-2
     0x4000321 (has no name): ()  1x1+-1+-1  +-1+-1
     0x4000001 "xed": ("xed" "Xed")  20x20+20+20  +20+20
     0x3c0009d "Firefox": ("firefox" "firefox")  400x400+0+0  +0+0
     0x3400001 "tray.py": ("tray.py" "")  20x20+20+20  +20+20
     0x3c00092 "Firefox": ("Firefox" "firefox")  1574x276+362+598  +362+598
     0x2c00003 (has no name): ()  1x1+-1+-1  +-1+-1
     0x2c00001 "mintUpdate.py": ("mintUpdate.py" "")  20x20+20+20  +20+20
     0x3c00060 "Open a new tab (Ctrl+T)": ("Firefox" "firefox")  326x78+1504+118  +1504+118
     0x3c0003d "Firefox": ("firefox" "firefox")  400x400+0+0  +0+0
     0x3c00039 "Firefox": ("firefox" "firefox")  400x400+0+0  +0+0
     0x3e00001 "xdg-desktop-portal-gtk": ("xdg-desktop-portal-gtk" "Xdg-desktop-portal-gtk")  20x20+20+20  +20+20
     0x3c00001 "Firefox": ("firefox" "Firefox")  20x20+20+20  +20+20
     0x2a00021 "nemo-desktop": ()  20x20+-200+-200  +-200+-200
     0x2a0000c (has no name): ()  1x1+-1+-1  +-1+-1
     0x2a00003 "Desktop": ("nemo-desktop" "Nemo-desktop")  2256x1424+0+0  +0+0
     0x200001d (has no name): ()  1x1+-1+-1  +-1+-1
     0x3800001 "blueman-tray": ("blueman-tray" "")  20x20+20+20  +20+20
     0x2800008 (has no name): ()  1x1+-1+-1  +-1+-1
     0x3600001 "blueman-applet": ("blueman-applet" "")  20x20+20+20  +20+20
     0x3200001 "cinnamon-killer-daemon": ("cinnamon-killer-daemon" "")  20x20+20+20  +20+20
     0x2e00001 "evolution-alarm-notify": ("evolution-alarm-notify" "Evolution-alarm-notify")  20x20+20+20  +20+20
     0x2a00001 "nemo-desktop": ("nemo-desktop" "Nemo-desktop")  20x20+20+20  +20+20
     0x2800001 "NetworkManager Applet": ("nm-applet" "Nm-applet")  20x20+20+20  +20+20
     0xa00003 (has no name): ()  1x1+-1+-1  +-1+-1
     0x2400001 "caribou": ("caribou" "")  20x20+20+20  +20+20
     0x2600001 "polkit-gnome-authentication-agent-1": ("polkit-gnome-authentication-agent-1" "Polkit-gnome-authentication-agent-1")  20x20+20+20  +20+20
     0x2000018 "cinnamon": ()  10x10+-100+-100  +-100+-100
     0x2200001 "xapp-sn-watcher": ("xapp-sn-watcher" "Xapp-sn-watcher")  20x20+20+20  +20+20
     0x2000011 (has no name): ()  1x1+-100+-100  +-100+-100
     0x200000f (has no name): ()  1x1+-1+-1  +-1+-1
     0x2000009 (has no name): ()  1x1+-100+-100  +-100+-100
     0x2000008 (has no name): ()  1x1+-100+-100  +-100+-100
     0x2000007 (has no name): ()  1x1+-100+-100  +-100+-100
     0x2000006 "Mutter (Muffin)": ()  1x1+-100+-100  +-100+-100
     0x2000001 "cinnamon": ("cinnamon" "Cinnamon")  10x10+10+10  +10+10
     0x1c0000a (has no name): ()  1x1+-100+-100  +-100+-100
     0x1a00001 "cinnamon-launcher": ("cinnamon-launcher" "")  20x20+10+10  +10+10
     0x160000c (has no name): ()  1x1+-1+-1  +-1+-1
     0x800002 (has no name): ()  10x10+0+0  +0+0
     0x600002 (has no name): ()  10x10+0+0  +0+0
     0x1600001 "csd-power": ("csd-power" "Csd-power")  10x10+10+10  +10+10
     0x1400001 "csd-wacom": ("csd-wacom" "Csd-wacom")  10x10+10+10  +10+10
     0x1200001 "csd-color": ("csd-color" "Csd-color")  10x10+10+10  +10+10
     0x1000001 "csd-media-keys": ("csd-media-keys" "Csd-media-keys")  10x10+10+10  +10+10
     0xa00001 "csd-background": ("csd-background" "Csd-background")  10x10+10+10  +10+10
     0xe00001 "csd-housekeeping": ("csd-housekeeping" "Csd-housekeeping")  10x10+10+10  +10+10
     0xc00001 "csd-automount": ("csd-automount" "Csd-automount")  20x20+10+10  +10+10
     0x400001 "csd-keyboard": ("csd-keyboard" "Csd-keyboard")  10x10+10+10  +10+10
     0x600001 "csd-xsettings": ("csd-xsettings" "Csd-xsettings")  10x10+10+10  +10+10
     0x800001 "csd-clipboard": ("csd-clipboard" "Csd-clipboard")  10x10+10+10  +10+10
     0x2000010 "mutter guard window": ()  2256x1504+0+0  +0+0
```bash ps aux | grep '^benjamin' ``` lists too many programs. DuckDuckGo search *Linux list running taskbar programs*. ```bash wmctrl -l ``` <details> <summary>Output:</summary> ``` 0x02a00003 0 benjamin-loison-framework Desktop 0x03c0002c 0 benjamin-loison-framework ubuntu - Get a list of open windows in Linux - Super User — Mozilla Firefox 0x04000335 0 benjamin-loison-framework Unsaved Document 1 0x0440000b 0 benjamin-loison-framework benjamin@benjamin-loison-framework: ~ ``` </details> Source: [the Super User answer 176790](https://superuser.com/a/176790) I would like also to have the program names. ```bash xlsclients ``` <details> <summary>Output:</summary> ``` benjamin-loison-framework csd-clipboard benjamin-loison-framework csd-xsettings benjamin-loison-framework csd-keyboard benjamin-loison-framework csd-automount benjamin-loison-framework csd-housekeeping benjamin-loison-framework csd-background benjamin-loison-framework csd-media-keys benjamin-loison-framework csd-color benjamin-loison-framework csd-wacom benjamin-loison-framework csd-power benjamin-loison-framework cinnamon-launcher benjamin-loison-framework cinnamon benjamin-loison-framework xapp-sn-watcher benjamin-loison-framework polkit-gnome-authentication-agent-1 benjamin-loison-framework caribou benjamin-loison-framework nm-applet benjamin-loison-framework nemo-desktop benjamin-loison-framework evolution-alarm-notify benjamin-loison-framework cinnamon-killer-daemon benjamin-loison-framework blueman-applet benjamin-loison-framework blueman-tray benjamin-loison-framework firefox benjamin-loison-framework xdg-desktop-portal-gtk benjamin-loison-framework mintUpdate.py benjamin-loison-framework tray.py benjamin-loison-framework xed benjamin-loison-framework gnome-terminal-server ``` </details> Source: [the Super User answer 176761](https://superuser.com/a/176761) ```bash xwininfo -root -children ``` <details> <summary>Output:</summary> ``` xwininfo: Window id: 0x5e7 (the root window) (has no name) Root window id: 0x5e7 (the root window) (has no name) Parent window id: 0x0 (none) 61 children: 0x3c00041 "Firefox": ("Firefox" "firefox") 576x140+1086+132 +1086+132 0x3c000db "Firefox": () 20x20+-200+-200 +-200+-200 0x200000b "cinnamon": ("cinnamon" "Cinnamon") 1x1+-200+-200 +-200+-200 0x2000877 (has no name): () 2260x1428+-2+-2 +-2+-2 0x200035d (has no name): () 2260x1428+-2+-2 +-2+-2 0x4400006 (has no name): () 1x1+-1+-1 +-1+-1 0x4400002 "Terminal": () 20x20+-200+-200 +-200+-200 0x4400001 "Terminal": ("gnome-terminal-server" "Gnome-terminal-server") 20x20+20+20 +20+20 0x400034e "xed": () 20x20+-200+-200 +-200+-200 0x200083c (has no name): () 2260x1428+-2+-2 +-2+-2 0x4000321 (has no name): () 1x1+-1+-1 +-1+-1 0x4000001 "xed": ("xed" "Xed") 20x20+20+20 +20+20 0x3c0009d "Firefox": ("firefox" "firefox") 400x400+0+0 +0+0 0x3400001 "tray.py": ("tray.py" "") 20x20+20+20 +20+20 0x3c00092 "Firefox": ("Firefox" "firefox") 1574x276+362+598 +362+598 0x2c00003 (has no name): () 1x1+-1+-1 +-1+-1 0x2c00001 "mintUpdate.py": ("mintUpdate.py" "") 20x20+20+20 +20+20 0x3c00060 "Open a new tab (Ctrl+T)": ("Firefox" "firefox") 326x78+1504+118 +1504+118 0x3c0003d "Firefox": ("firefox" "firefox") 400x400+0+0 +0+0 0x3c00039 "Firefox": ("firefox" "firefox") 400x400+0+0 +0+0 0x3e00001 "xdg-desktop-portal-gtk": ("xdg-desktop-portal-gtk" "Xdg-desktop-portal-gtk") 20x20+20+20 +20+20 0x3c00001 "Firefox": ("firefox" "Firefox") 20x20+20+20 +20+20 0x2a00021 "nemo-desktop": () 20x20+-200+-200 +-200+-200 0x2a0000c (has no name): () 1x1+-1+-1 +-1+-1 0x2a00003 "Desktop": ("nemo-desktop" "Nemo-desktop") 2256x1424+0+0 +0+0 0x200001d (has no name): () 1x1+-1+-1 +-1+-1 0x3800001 "blueman-tray": ("blueman-tray" "") 20x20+20+20 +20+20 0x2800008 (has no name): () 1x1+-1+-1 +-1+-1 0x3600001 "blueman-applet": ("blueman-applet" "") 20x20+20+20 +20+20 0x3200001 "cinnamon-killer-daemon": ("cinnamon-killer-daemon" "") 20x20+20+20 +20+20 0x2e00001 "evolution-alarm-notify": ("evolution-alarm-notify" "Evolution-alarm-notify") 20x20+20+20 +20+20 0x2a00001 "nemo-desktop": ("nemo-desktop" "Nemo-desktop") 20x20+20+20 +20+20 0x2800001 "NetworkManager Applet": ("nm-applet" "Nm-applet") 20x20+20+20 +20+20 0xa00003 (has no name): () 1x1+-1+-1 +-1+-1 0x2400001 "caribou": ("caribou" "") 20x20+20+20 +20+20 0x2600001 "polkit-gnome-authentication-agent-1": ("polkit-gnome-authentication-agent-1" "Polkit-gnome-authentication-agent-1") 20x20+20+20 +20+20 0x2000018 "cinnamon": () 10x10+-100+-100 +-100+-100 0x2200001 "xapp-sn-watcher": ("xapp-sn-watcher" "Xapp-sn-watcher") 20x20+20+20 +20+20 0x2000011 (has no name): () 1x1+-100+-100 +-100+-100 0x200000f (has no name): () 1x1+-1+-1 +-1+-1 0x2000009 (has no name): () 1x1+-100+-100 +-100+-100 0x2000008 (has no name): () 1x1+-100+-100 +-100+-100 0x2000007 (has no name): () 1x1+-100+-100 +-100+-100 0x2000006 "Mutter (Muffin)": () 1x1+-100+-100 +-100+-100 0x2000001 "cinnamon": ("cinnamon" "Cinnamon") 10x10+10+10 +10+10 0x1c0000a (has no name): () 1x1+-100+-100 +-100+-100 0x1a00001 "cinnamon-launcher": ("cinnamon-launcher" "") 20x20+10+10 +10+10 0x160000c (has no name): () 1x1+-1+-1 +-1+-1 0x800002 (has no name): () 10x10+0+0 +0+0 0x600002 (has no name): () 10x10+0+0 +0+0 0x1600001 "csd-power": ("csd-power" "Csd-power") 10x10+10+10 +10+10 0x1400001 "csd-wacom": ("csd-wacom" "Csd-wacom") 10x10+10+10 +10+10 0x1200001 "csd-color": ("csd-color" "Csd-color") 10x10+10+10 +10+10 0x1000001 "csd-media-keys": ("csd-media-keys" "Csd-media-keys") 10x10+10+10 +10+10 0xa00001 "csd-background": ("csd-background" "Csd-background") 10x10+10+10 +10+10 0xe00001 "csd-housekeeping": ("csd-housekeeping" "Csd-housekeeping") 10x10+10+10 +10+10 0xc00001 "csd-automount": ("csd-automount" "Csd-automount") 20x20+10+10 +10+10 0x400001 "csd-keyboard": ("csd-keyboard" "Csd-keyboard") 10x10+10+10 +10+10 0x600001 "csd-xsettings": ("csd-xsettings" "Csd-xsettings") 10x10+10+10 +10+10 0x800001 "csd-clipboard": ("csd-clipboard" "Csd-clipboard") 10x10+10+10 +10+10 0x2000010 "mutter guard window": () 2256x1504+0+0 +0+0 ``` </details>
Author
Owner
wmctrl --help
Output:
wmctrl 1.07
Usage: wmctrl [OPTION]...
Actions:
  -m                   Show information about the window manager and
                       about the environment.
  -l                   List windows managed by the window manager.
  -d                   List desktops. The current desktop is marked
                       with an asterisk.
  -s <DESK>            Switch to the specified desktop.
  -a <WIN>             Activate the window by switching to its desktop and
                       raising it.
  -c <WIN>             Close the window gracefully.
  -R <WIN>             Move the window to the current desktop and
                       activate it.
  -r <WIN> -t <DESK>   Move the window to the specified desktop.
  -r <WIN> -e <MVARG>  Resize and move the window around the desktop.
                       The format of the <MVARG> argument is described below.
  -r <WIN> -b <STARG>  Change the state of the window. Using this option it's
                       possible for example to make the window maximized,
                       minimized or fullscreen. The format of the <STARG>
                       argument and list of possible states is given below.
  -r <WIN> -N <STR>    Set the name (long title) of the window.
  -r <WIN> -I <STR>    Set the icon name (short title) of the window.
  -r <WIN> -T <STR>    Set both the name and the icon name of the window.
  -k (on|off)          Activate or deactivate window manager's
                       "showing the desktop" mode. Many window managers
                       do not implement this mode.
  -o <X>,<Y>           Change the viewport for the current desktop.
                       The X and Y values are separated with a comma.
                       They define the top left corner of the viewport.
                       The window manager may ignore the request.
  -n <NUM>             Change number of desktops.
                       The window manager may ignore the request.
  -g <W>,<H>           Change geometry (common size) of all desktops.
                       The window manager may ignore the request.
  -h                   Print help.

Options:
  -i                   Interpret <WIN> as a numerical window ID.
  -p                   Include PIDs in the window list. Very few
                       X applications support this feature.
  -G                   Include geometry in the window list.
  -x                   Include WM_CLASS in the window list or
                       interpret <WIN> as the WM_CLASS name.
  -u                   Override auto-detection and force UTF-8 mode.
  -F                   Modifies the behavior of the window title matching
                       algorithm. It will match only the full window title
                       instead of a substring, when this option is used.
                       Furthermore it makes the matching case sensitive.
  -v                   Be verbose. Useful for debugging.
  -w <WA>              Use a workaround. The option may appear multiple
                       times. List of available workarounds is given below.

Arguments:
  <WIN>                This argument specifies the window. By default it's
                       interpreted as a string. The string is matched
                       against the window titles and the first matching
                       window is used. The matching isn't case sensitive
                       and the string may appear in any position
                       of the title.

                       The -i option may be used to interpret the argument
                       as a numerical window ID represented as a decimal
                       number. If it starts with "0x", then
                       it will be interpreted as a hexadecimal number.

                       The -x option may be used to interpret the argument
                       as a string, which is matched against the window's
                       class name (WM_CLASS property). Th first matching
                       window is used. The matching isn't case sensitive
                       and the string may appear in any position
                       of the class name. So it's recommended to  always use
                       the -F option in conjunction with the -x option.

                       The special string ":SELECT:" (without the quotes)
                       may be used to instruct wmctrl to let you select the
                       window by clicking on it.

                       The special string ":ACTIVE:" (without the quotes)
                       may be used to instruct wmctrl to use the currently
                       active window for the action.

  <DESK>               A desktop number. Desktops are counted from zero.

  <MVARG>              Specifies a change to the position and size
                       of the window. The format of the argument is:

                       <G>,<X>,<Y>,<W>,<H>

                       <G>: Gravity specified as a number. The numbers are
                          defined in the EWMH specification. The value of
                          zero is particularly useful, it means "use the
                          default gravity of the window".
                       <X>,<Y>: Coordinates of new position of the window.
                       <W>,<H>: New width and height of the window.

                       The value of -1 may appear in place of
                       any of the <X>, <Y>, <W> and <H> properties
                       to left the property unchanged.

  <STARG>              Specifies a change to the state of the window
                       by the means of _NET_WM_STATE request.
                       This option allows two properties to be changed
                       simultaneously, specifically to allow both
                       horizontal and vertical maximization to be
                       altered together.

                       The format of the argument is:

                       (remove|add|toggle),<PROP1>[,<PROP2>]

                       The EWMH specification defines the
                       following properties:

                           modal, sticky, maximized_vert, maximized_horz,
                           shaded, skip_taskbar, skip_pager, hidden,
                           fullscreen, above, below

Workarounds:

  DESKTOP_TITLES_INVALID_UTF8      Print non-ASCII desktop titles correctly
                                   when using Window Maker.

The format of the window list:

  <window ID> <desktop ID> <client machine> <window title>

The format of the desktop list:

  <desktop ID> [-*] <geometry> <viewport> <workarea> <title>


Author, current maintainer: Tomas Styblo <tripie@cpan.org>
Released under the GNU General Public License.
Copyright (C) 2003
```bash wmctrl --help ``` <details> <summary>Output:</summary> ``` wmctrl 1.07 Usage: wmctrl [OPTION]... Actions: -m Show information about the window manager and about the environment. -l List windows managed by the window manager. -d List desktops. The current desktop is marked with an asterisk. -s <DESK> Switch to the specified desktop. -a <WIN> Activate the window by switching to its desktop and raising it. -c <WIN> Close the window gracefully. -R <WIN> Move the window to the current desktop and activate it. -r <WIN> -t <DESK> Move the window to the specified desktop. -r <WIN> -e <MVARG> Resize and move the window around the desktop. The format of the <MVARG> argument is described below. -r <WIN> -b <STARG> Change the state of the window. Using this option it's possible for example to make the window maximized, minimized or fullscreen. The format of the <STARG> argument and list of possible states is given below. -r <WIN> -N <STR> Set the name (long title) of the window. -r <WIN> -I <STR> Set the icon name (short title) of the window. -r <WIN> -T <STR> Set both the name and the icon name of the window. -k (on|off) Activate or deactivate window manager's "showing the desktop" mode. Many window managers do not implement this mode. -o <X>,<Y> Change the viewport for the current desktop. The X and Y values are separated with a comma. They define the top left corner of the viewport. The window manager may ignore the request. -n <NUM> Change number of desktops. The window manager may ignore the request. -g <W>,<H> Change geometry (common size) of all desktops. The window manager may ignore the request. -h Print help. Options: -i Interpret <WIN> as a numerical window ID. -p Include PIDs in the window list. Very few X applications support this feature. -G Include geometry in the window list. -x Include WM_CLASS in the window list or interpret <WIN> as the WM_CLASS name. -u Override auto-detection and force UTF-8 mode. -F Modifies the behavior of the window title matching algorithm. It will match only the full window title instead of a substring, when this option is used. Furthermore it makes the matching case sensitive. -v Be verbose. Useful for debugging. -w <WA> Use a workaround. The option may appear multiple times. List of available workarounds is given below. Arguments: <WIN> This argument specifies the window. By default it's interpreted as a string. The string is matched against the window titles and the first matching window is used. The matching isn't case sensitive and the string may appear in any position of the title. The -i option may be used to interpret the argument as a numerical window ID represented as a decimal number. If it starts with "0x", then it will be interpreted as a hexadecimal number. The -x option may be used to interpret the argument as a string, which is matched against the window's class name (WM_CLASS property). Th first matching window is used. The matching isn't case sensitive and the string may appear in any position of the class name. So it's recommended to always use the -F option in conjunction with the -x option. The special string ":SELECT:" (without the quotes) may be used to instruct wmctrl to let you select the window by clicking on it. The special string ":ACTIVE:" (without the quotes) may be used to instruct wmctrl to use the currently active window for the action. <DESK> A desktop number. Desktops are counted from zero. <MVARG> Specifies a change to the position and size of the window. The format of the argument is: <G>,<X>,<Y>,<W>,<H> <G>: Gravity specified as a number. The numbers are defined in the EWMH specification. The value of zero is particularly useful, it means "use the default gravity of the window". <X>,<Y>: Coordinates of new position of the window. <W>,<H>: New width and height of the window. The value of -1 may appear in place of any of the <X>, <Y>, <W> and <H> properties to left the property unchanged. <STARG> Specifies a change to the state of the window by the means of _NET_WM_STATE request. This option allows two properties to be changed simultaneously, specifically to allow both horizontal and vertical maximization to be altered together. The format of the argument is: (remove|add|toggle),<PROP1>[,<PROP2>] The EWMH specification defines the following properties: modal, sticky, maximized_vert, maximized_horz, shaded, skip_taskbar, skip_pager, hidden, fullscreen, above, below Workarounds: DESKTOP_TITLES_INVALID_UTF8 Print non-ASCII desktop titles correctly when using Window Maker. The format of the window list: <window ID> <desktop ID> <client machine> <window title> The format of the desktop list: <desktop ID> [-*] <geometry> <viewport> <workarea> <title> Author, current maintainer: Tomas Styblo <tripie@cpan.org> Released under the GNU General Public License. Copyright (C) 2003 ``` </details>
Author
Owner
wmctrl -m
Output:
Name: Mutter (Muffin)
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF
```bash wmctrl -m ``` <details> <summary>Output:</summary> ``` Name: Mutter (Muffin) Class: N/A PID: N/A Window manager's "showing the desktop" mode: OFF ``` </details>
Author
Owner
wmctrl -d
Output:
0  * DG: 2256x1504  VP: 0,0  WA: 0,0 2256x1424  Workspace 1
1  - DG: 2256x1504  VP: N/A  WA: 0,0 2256x1424  Workspace 2
2  - DG: 2256x1504  VP: N/A  WA: 0,0 2256x1424  Workspace 3
3  - DG: 2256x1504  VP: N/A  WA: 0,0 2256x1424  Workspace 4
```bash wmctrl -d ``` <details> <summary>Output:</summary> ``` 0 * DG: 2256x1504 VP: 0,0 WA: 0,0 2256x1424 Workspace 1 1 - DG: 2256x1504 VP: N/A WA: 0,0 2256x1424 Workspace 2 2 - DG: 2256x1504 VP: N/A WA: 0,0 2256x1424 Workspace 3 3 - DG: 2256x1504 VP: N/A WA: 0,0 2256x1424 Workspace 4 ``` </details>
Author
Owner
wmctrl -lv
Output:
envir_utf8: 1
Invalid type of _NET_WM_DESKTOP property.
Invalid type of _WIN_WORKSPACE property.
0x02a00003  0 benjamin-loison-framework Desktop
Invalid type of WM_NAME property.
0x03c0002c  0 benjamin-loison-framework ubuntu - Get a list of open windows in Linux - Super User — Mozilla Firefox
0x04000335  0 benjamin-loison-framework Unsaved Document 1
0x0440000b  0 benjamin-loison-framework benjamin@benjamin-loison-framework: ~
```bash wmctrl -lv ``` <details> <summary>Output:</summary> ``` envir_utf8: 1 Invalid type of _NET_WM_DESKTOP property. Invalid type of _WIN_WORKSPACE property. 0x02a00003 0 benjamin-loison-framework Desktop Invalid type of WM_NAME property. 0x03c0002c 0 benjamin-loison-framework ubuntu - Get a list of open windows in Linux - Super User — Mozilla Firefox 0x04000335 0 benjamin-loison-framework Unsaved Document 1 0x0440000b 0 benjamin-loison-framework benjamin@benjamin-loison-framework: ~ ``` </details>
Author
Owner
wmctrl -lp
Output:
0x02a00003  0 3011   benjamin-loison-framework Desktop
0x03c0002c  0 3229   benjamin-loison-framework #29 - Make a `Shut Down` mode able to restore running applications like `Suspend` after having provided a decryption password such that cannot steal memory content and potentially decryption token - linux - Gitea LemnosLife — Mozilla Firefox
0x04000335  0 4506   benjamin-loison-framework Unsaved Document 1
0x0440000b  0 4520   benjamin-loison-framework benjamin@benjamin-loison-framework: ~
wmctrl -lx
Output:
0x02a00003  0 nemo-desktop.Nemo-desktop  benjamin-loison-framework Desktop
0x03c0002c  0 Navigator.firefox     benjamin-loison-framework #29 - Make a `Shut Down` mode able to restore running applications like `Suspend` after having provided a decryption password such that cannot steal memory content and potentially decryption token - linux - Gitea LemnosLife — Mozilla Firefox
0x04000335  0 xed.Xed               benjamin-loison-framework Unsaved Document 1
0x0440000b  0 gnome-terminal-server.Gnome-terminal  benjamin-loison-framework benjamin@benjamin-loison-framework: ~
```bash wmctrl -lp ``` <details> <summary>Output:</summary> ``` 0x02a00003 0 3011 benjamin-loison-framework Desktop 0x03c0002c 0 3229 benjamin-loison-framework #29 - Make a `Shut Down` mode able to restore running applications like `Suspend` after having provided a decryption password such that cannot steal memory content and potentially decryption token - linux - Gitea LemnosLife — Mozilla Firefox 0x04000335 0 4506 benjamin-loison-framework Unsaved Document 1 0x0440000b 0 4520 benjamin-loison-framework benjamin@benjamin-loison-framework: ~ ``` </details> ```bash wmctrl -lx ``` <details> <summary>Output:</summary> ``` 0x02a00003 0 nemo-desktop.Nemo-desktop benjamin-loison-framework Desktop 0x03c0002c 0 Navigator.firefox benjamin-loison-framework #29 - Make a `Shut Down` mode able to restore running applications like `Suspend` after having provided a decryption password such that cannot steal memory content and potentially decryption token - linux - Gitea LemnosLife — Mozilla Firefox 0x04000335 0 xed.Xed benjamin-loison-framework Unsaved Document 1 0x0440000b 0 gnome-terminal-server.Gnome-terminal benjamin-loison-framework benjamin@benjamin-loison-framework: ~ ``` </details>
Author
Owner
ps aux | grep -w [4]506
benjamin    4506  0.0  0.2 593268 77852 ?        Sl   16:32   0:00 /usr/bin/xed
```bash ps aux | grep -w [4]506 ``` ``` benjamin 4506 0.0 0.2 593268 77852 ? Sl 16:32 0:00 /usr/bin/xed ```
Author
Owner

DuckDuckGo search Linux get program name from program id.

DuckDuckGo search *Linux get program name from program id*.
Author
Owner
/bin/cat /proc/4506/comm
xed

Source: the Unix Stack Exchange answer 373689

```bash /bin/cat /proc/4506/comm ``` ``` xed ``` Source: [the Unix Stack Exchange answer 373689](https://unix.stackexchange.com/a/373689)
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/linux#29
No description provided.