Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
[R] Added: GTK dialogs, Menu Launcher, Manpage, timeout property
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Rittstieg committed Dec 27, 2018
1 parent 15e3380 commit e617f0c
Show file tree
Hide file tree
Showing 15 changed files with 670 additions and 162 deletions.
76 changes: 69 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,53 @@

A CLI tool for saving and restoring virtual linux desktops.

Currently in proof of concept.
Stage of development: alpha version


Main features:
-------------------
- Dumping window geometry and hints to human readable JSON files
- Apply the saved layout to any virtual desktop
- Command Line Interface
- GTK Interface

Dependencies:
----------------------

- X Window Manager that implement the EWMH specification
- wmctrl (https://sites.google.com/site/tstyblo/wmctrl/)
- xwininfo
- xwininfo (for getting window geometry and extents)
- xdotool (for hiding windows)
- Python 3
- python-setuptools
- zenity, yad (for gtk dialogs)

Compatible:
--------------------------

Tested with Cinnamon Window Manager (Muffin)

- Chromium
- Firefox
- Galculator
- Gedit
- Libre Office
- Nemo
- Wine Apps
- Xed

Incompatible:
--------------------------

- Gimp, setting gemometry failed

Installation:
--------------------------

Arch Linux package:

```
$ pacman -U savedesktop-*.pkg.tar.xz
$ sudo pacman -U savedesktop-*.pkg.tar.xz
```

For manual installation use the following command:
Expand All @@ -40,7 +63,7 @@ Usage:
dump a desktop:

```
$ sd -d 0 -p profile1 -o
$ svd -d 0 -p profile1 -o
```
options:

Expand All @@ -50,17 +73,56 @@ options:

`-o` open in default editor

save with gui:

```
$ svd --gui
```

restore a desktop:

```
$ rd -d 1 -p profile1
$ rvd -d 1 -p profile1
```

`-d 1` restore to second desktop

`-p profile1` load ~/.config/savedesktop/profile1.json
`-p profile1` load ~/.config/savedesktop/profile1.json

restore with gui dialog:

```
$ rvd --gui
```

Profiles:
--------------------

Profile files are stored in '~/.config/savedesktop'

```
[
{
"x": 403,
"y": 219,
"width": 1094,
"height": 599,
"cmd": [
"nemo"
],
"state": ""
}
]
```

The following state properties are supported:
- maximized_vert
- maximized_horz
- shaded
- hidden
- fullscreen.

Project Web site :
Project Web site:
--------------------

https://github.com/nrittsti/savedesktop/
Expand Down
10 changes: 10 additions & 0 deletions data/restoredesktop.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Restore Desktop
Comment=Restore virtual desktop
Exec=rvd --gui
Icon=desktop
Terminal=false
Type=Application
StartupNotify=true
Categories=Utility;
Keywords=desktop;workspace;wmctrl;
56 changes: 56 additions & 0 deletions data/rvd.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.TH rvd 1 "23 Dezember 2018" "0.1" "rvd man page"
.\"---------------------------------------------------------------
.SH NAME
.\"---------------------------------------------------------------
rvd \- restore virtual desktop
.\"---------------------------------------------------------------
.SH SYNOPSIS
.\"---------------------------------------------------------------
.B rvd
.RI [ " options " ] ...
.\"---------------------------------------------------------------
.SH DESCRIPTION
.\"---------------------------------------------------------------
.B rvd
loads stored desktop profiles.
The profiles must be stored in the directory ~/.config/savedesktop.

.B OPTIONS

.TP
\fB\-d\fR, \fB\-\-desktop\fR
desktop number from 0 to n (default is 0)

.TP
\fB\-g\fR, \fB\-\-gui\fR
gui mode, gtk interface based on yad and zenity

.TP
\fB\-p\fR, \fB\-\-profile\fR
profile name with default ~/.config/savedesktop/default.json

.\"---------------------------------------------------------------
.SH EXAMPLES
.\"---------------------------------------------------------------

Restore second desktop with profile 'demo'

rvd -d 1 -p demo

Show user interface

rvd --gui

.\"---------------------------------------------------------------
.SH AUTHOR
.\"---------------------------------------------------------------
SD was written by Nico Rittstieg.

https://github.com/nrittsti/savedesktop
.\"---------------------------------------------------------------
.SH SEE ALSO
.\"---------------------------------------------------------------
.BR svd (1)
.BR wmctrl (1)
.BR xdotool (1)
.BR xwininfo (1)
10 changes: 10 additions & 0 deletions data/savedesktop.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=Save Desktop
Comment=Save virtual desktop
Exec=svd --gui
Icon=desktop
Terminal=false
Type=Application
StartupNotify=true
Categories=Utility;
Keywords=desktop;workspace;wmctrl;
77 changes: 77 additions & 0 deletions data/svd.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.TH svd 1 "23 Dezember 2018" "0.1" "svd man page"
.\"---------------------------------------------------------------
.SH NAME
.\"---------------------------------------------------------------
svd \- save virtual desktop
.\"---------------------------------------------------------------
.SH SYNOPSIS
.\"---------------------------------------------------------------
.B svd
.RI [ " options " ] ...
.\"---------------------------------------------------------------
.SH DESCRIPTION
.\"---------------------------------------------------------------
.B svd
reads geometry information and properties from all running desktop applications
and saves the collected data to disk. Profile files are stored in '~/.config/savedesktop'.
The profiles are saved in json format and can be easily customized.

[
{
"x": 403,
"y": 219,
"width": 1094,
"height": 599,
"cmd": [
"nemo"
],
"state": ""
}
]

The following state properties are supported:
maximized_vert, maximized_horz, shaded, hidden, fullscreen.

.B OPTIONS

.TP
\fB\-d\fR, \fB\-\-desktop\fR
desktop number from 0 to n (default is 0)

.TP
\fB\-g\fR, \fB\-\-gui\fR
gui mode, gtk interface based on yad and zenity

.TP
\fB\-o\fR, \fB\-\-open\fR
open saved profile with xdg-open

.TP
\fB\-p\fR, \fB\-\-profile\fR
profile name with default ~/.config/savedesktop/default.json

.\"---------------------------------------------------------------
.SH EXAMPLES
.\"---------------------------------------------------------------

Save second desktop to profile 'demo'

svd -d 1 -p demo

Show user interface

svd --gui

.\"---------------------------------------------------------------
.SH AUTHOR
.\"---------------------------------------------------------------
svd was written by Nico Rittstieg.

https://github.com/nrittsti/savedesktop
.\"---------------------------------------------------------------
.SH SEE ALSO
.\"---------------------------------------------------------------
.BR rd (1)
.BR wmctrl (1)
.BR xdotool (1)
.BR xwininfo (1)
4 changes: 2 additions & 2 deletions read.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <http://www.gnu.org/licenses/>.

import savedesktop.rd as rd
import savedesktop.rvd as rvd

if __name__ == '__main__':
rd.main()
rvd.main()
4 changes: 2 additions & 2 deletions save.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <http://www.gnu.org/licenses/>.

import savedesktop.sd as sd
import savedesktop.svd as svd

if __name__ == '__main__':
sd.main()
svd.main()
Loading

0 comments on commit e617f0c

Please sign in to comment.