Skip to content
This repository was archived by the owner on Aug 3, 2019. It is now read-only.

Commit 838a1d9

Browse files
committed
Removed system tray icon, fixes #68, #70 and #77
1 parent cf634f5 commit 838a1d9

8 files changed

+89
-94
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The program requires the pydbus python module, install it first:
9191

9292
sudo pip install pydbus
9393

94-
The source code is available to download via: [https://github.com/green-project/green-recorder/archive/master.zip](https://github.com/green-project/green-recorder/archive/master.zip). You can simply download it and install the dependencies on your distribution (gir1.2-appindicator3, gawk, python-gobject, python-urllib3, x11-utils, ffmpeg, pydbus, pulseaudio, xdg-open (or xdg-utils), python-configparser, imagemagick). And then run:
94+
The source code is available to download via: [https://github.com/green-project/green-recorder/archive/master.zip](https://github.com/green-project/green-recorder/archive/master.zip). You can simply download it and install the dependencies on your distribution (gawk, python-gobject, python-urllib3, x11-utils, ffmpeg, pydbus, pulseaudio, xdg-open (or xdg-utils), python-configparser, imagemagick). And then run:
9595

9696
sudo python setup.py install
9797

debian/changelog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
green-recorder (3.1) zesty; urgency=low
2+
3+
* Removed the system tray indicator, and added a stop button.
4+
* Fixed #68, #70, #77.
5+
6+
-- M.Hanny Sabbagh <[email protected]> Sun, 29 Oct 2017 11:02:00 +0200
7+
18
green-recorder (3.0.6) zesty; urgency=low
29

310
* Fixed #73.

debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Build-Depends: debhelper (>= 9), python2.7, python-dev, python-configparser, pul
77

88
Package: green-recorder
99
Architecture: all
10-
Depends: gir1.2-appindicator3-0.1, gawk, python-gobject, python-urllib3, x11-utils, python-pydbus, ffmpeg (>= 3.0)
10+
Depends: gawk, python-gobject, python-urllib3, x11-utils, python-pydbus, ffmpeg (>= 3.0)
1111
Description: Green Recorder
1212
Record your desktop easily using a simple GUI. Built using Python, GTK+ 3 and ffmpeg. Very easy to use. Supports both Xorg and Wayland (GNOME) display servers.

green-recorder

+54-86
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
import gi
1818

1919
gi.require_version('Gtk','3.0')
20-
gi.require_version('AppIndicator3', '0.1')
2120

22-
from gi.repository import Gtk, Gdk, GLib, AppIndicator3 as appindicator
21+
from gi.repository import Gtk, Gdk, GLib
2322
from pydbus import SessionBus
2423
import subprocess, signal, threading, datetime, urllib, gettext, locale, os, ConfigParser
2524

@@ -81,33 +80,6 @@ if "wayland" in DisplayServer:
8180
GNOMEScreencast = bus.get('org.gnome.Shell.Screencast', '/org/gnome/Shell/Screencast')
8281
else:
8382
DisplayServer = "xorg"
84-
85-
def recorderindicator():
86-
# Create the app indicator widget.
87-
global indicator
88-
try:
89-
s = subprocess.check_output("ps -cat|grep mate-panel", shell=True)
90-
except:
91-
indicator = appindicator.Indicator.new("Green Recorder", '/usr/share/pixmaps/green-recorder.png', appindicator.IndicatorCategory.APPLICATION_STATUS)
92-
pass
93-
else:
94-
indicator = appindicator.Indicator.new("Green Recorder", 'green-recorder', appindicator.IndicatorCategory.APPLICATION_STATUS)
95-
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
96-
indicator.set_menu(indicator_menu())
97-
# Make middle-click stops the recording process.
98-
indicator.set_secondary_activate_target(stoprecordingbutton)
99-
Gtk.main()
100-
101-
def indicator_menu():
102-
# Here menu items are defined and built. Used global on stoprecordingbutton to pass it as a Gtk.Widget to the indicator to be able to stop recording using middle click on the icon directly.
103-
menu = Gtk.Menu()
104-
global stoprecordingbutton
105-
stoprecordingbutton = Gtk.MenuItem('Stop Recording')
106-
stoprecordingbutton.connect('activate', stoprecording)
107-
menu.append(stoprecordingbutton)
108-
menu.show_all()
109-
return menu
110-
11183

11284
def sendnotification(text, time):
11385
notifications = bus.get('.Notifications')
@@ -173,7 +145,7 @@ def RecordXorg():
173145
window.show()
174146
sendnotification("There seems to be a problem in recording. Try running 'green-recorder' from the command line to see the issue.", 4)
175147
else:
176-
recorderindicator()
148+
sendnotification("Recording has started!", 1)
177149

178150

179151

@@ -207,9 +179,7 @@ def RecordGnome():
207179
else:
208180
GNOMEScreencast.ScreencastArea(WindowXAxis, WindowYAxis, WindowWidth, WindowHeight, RecorderAbsPathName, {'framerate': GLib.Variant('i', int(RecorderFrames)), 'draw-cursor': GLib.Variant('b', mousecheck.get_active()), 'pipeline': GLib.Variant('s', RecorderPipeline)})
209181

210-
t = threading.RLock()
211-
with t:
212-
recorderindicator()
182+
sendnotification("Recording has started!", 1)
213183

214184
def checkbool(s):
215185
return s.lower() in ("True", "true", "1")
@@ -241,10 +211,6 @@ def record():
241211
dialog.destroy()
242212
elif response == Gtk.ResponseType.CANCEL:
243213
return
244-
245-
# Hide the window. Used flush() to avoid the interface waiting.
246-
window.hide()
247-
Gdk.flush()
248214

249215
# Get the given values from the input fields.
250216
#global RecorderFullPathName
@@ -263,6 +229,7 @@ def record():
263229
RecorderAbsPathName = RecorderFullPathName.replace("file://", "")
264230

265231
subprocess.call(["sleep", RecorderDelay])
232+
stopbutton.set_sensitive(True)
266233

267234
if "xorg" in DisplayServer:
268235
RecordXorg()
@@ -274,53 +241,6 @@ def record():
274241
else:
275242
sendnotification("Sorry Jim, looks like you are using something we don't support", 3)
276243
window.show()
277-
278-
def stoprecording(self):
279-
subprocess.call(["sleep", "1"]) # Wait ffmpeg.
280-
281-
indicator.set_status(appindicator.IndicatorStatus.PASSIVE)
282-
Gtk.main_quit()
283-
window.show()
284-
playbutton.set_sensitive(True)
285-
filenameentry.set_placeholder_text(_("File Name.."))
286-
287-
try:
288-
global areaaxis, WindowXAxis, WindowYAxis, WindowWidth, WindowHeight
289-
del areaaxis, WindowXAxis, WindowYAxis, WindowWidth, WindowHeight
290-
except NameError:
291-
pass
292-
293-
if "xorg" in DisplayServer:
294-
subprocess.call(["sleep", "1"])
295-
RecorderProcess.terminate()
296-
297-
elif "gnomewayland" in DisplayServer:
298-
subprocess.call(["sleep", "1"])
299-
300-
global RecorderPipeline
301-
del RecorderPipeline
302-
303-
try:
304-
GNOMEScreencast.StopScreencast()
305-
AudioProcess.terminate()
306-
except:
307-
pass # I know.
308-
309-
if videocheck.get_active() == True and audiocheck.get_active() == True:
310-
m = subprocess.call(["ffmpeg", "-i", RecorderFullPathName, "-i", "/tmp/Green-recorder-tmp.mkv", "-c", "copy", "/tmp/Green-Recorder-Final." + formatchooser.get_active_id(), "-y"])
311-
k = subprocess.Popen(["mv", "/tmp/Green-Recorder-Final." + formatchooser.get_active_id(), RecorderAbsPathName])
312-
elif videocheck.get_active() == False and audiocheck.get_active() == True:
313-
k = subprocess.Popen(["mv", "/tmp/Green-recorder-tmp.mkv", RecorderAbsPathName])
314-
315-
if formatchooser.get_active_id() == "gif":
316-
sendnotification("Your GIF image is currently being processed, this may take a while according to your PC's resources.", 5)
317-
318-
subprocess.call(["mv", RecorderAbsPathName, RecorderAbsPathName+".tmp"])
319-
subprocess.call(["convert", "-layers", "Optimize", RecorderAbsPathName+".tmp", RecorderAbsPathName])
320-
subprocess.call(["rm", RecorderAbsPathName+".tmp"])
321-
322-
CommandToRun = commandentry.get_text()
323-
subprocess.Popen([CommandToRun], shell=True)
324244

325245
def hide_on_delete(widget, event):
326246
widget.hide()
@@ -342,7 +262,8 @@ commandentry = builder.get_object("entry2")
342262
preffilename = builder.get_object("entry3")
343263
formatchooser = builder.get_object("comboboxtext1")
344264
audiosource = builder.get_object("audiosource")
345-
recordbutton = builder.get_object("button1")
265+
recordbutton = builder.get_object("recordbutton")
266+
stopbutton = builder.get_object("stopbutton")
346267
windowgrabbutton = builder.get_object("button4")
347268
areagrabbutton = builder.get_object("button5")
348269
videocheck = builder.get_object("checkbutton1")
@@ -399,7 +320,7 @@ mousecheck.set_label(_("Show Mouse"))
399320
followmousecheck.set_label(_("Follow Mouse"))
400321
aboutdialog.set_transient_for(window)
401322
aboutdialog.set_program_name(_("Green Recorder"))
402-
aboutdialog.set_version("3.0")
323+
aboutdialog.set_version("3.1")
403324
aboutdialog.set_copyright("© 2017 FOSS Project")
404325
aboutdialog.set_wrap_license(True)
405326
aboutdialog.set_license("Green Recorder is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nGreen Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\nSee the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Green Recorder. If not, see <http://www.gnu.org/licenses/>.")
@@ -449,6 +370,7 @@ audiocheck.set_active(checkbool(config.get('Options', 'audiocheck')))
449370
mousecheck.set_active(checkbool(config.get('Options', 'mousecheck')))
450371
followmousecheck.set_active(checkbool(config.get('Options', 'followmousecheck')))
451372

373+
stopbutton.set_sensitive(False)
452374
playbutton.set_sensitive(False)
453375

454376
# Audio input sources
@@ -512,6 +434,52 @@ class Handler:
512434
areachooser.set_title(_("Area Chooser"))
513435
areachooser.show()
514436

437+
def stoprecording(self, GtkButton):
438+
subprocess.call(["sleep", "1"]) # Wait ffmpeg.
439+
440+
window.show()
441+
442+
playbutton.set_sensitive(True)
443+
filenameentry.set_placeholder_text(_("File Name.."))
444+
445+
try:
446+
global areaaxis, WindowXAxis, WindowYAxis, WindowWidth, WindowHeight
447+
del areaaxis, WindowXAxis, WindowYAxis, WindowWidth, WindowHeight
448+
except NameError:
449+
pass
450+
451+
if "xorg" in DisplayServer:
452+
subprocess.call(["sleep", "1"])
453+
RecorderProcess.terminate()
454+
455+
elif "gnomewayland" in DisplayServer:
456+
subprocess.call(["sleep", "1"])
457+
458+
global RecorderPipeline
459+
del RecorderPipeline
460+
461+
try:
462+
GNOMEScreencast.StopScreencast()
463+
AudioProcess.terminate()
464+
except:
465+
pass # I know.
466+
467+
if videocheck.get_active() == True and audiocheck.get_active() == True:
468+
m = subprocess.call(["ffmpeg", "-i", RecorderFullPathName, "-i", "/tmp/Green-recorder-tmp.mkv", "-c", "copy", "/tmp/Green-Recorder-Final." + formatchooser.get_active_id(), "-y"])
469+
k = subprocess.Popen(["mv", "/tmp/Green-Recorder-Final." + formatchooser.get_active_id(), RecorderAbsPathName])
470+
elif videocheck.get_active() == False and audiocheck.get_active() == True:
471+
k = subprocess.Popen(["mv", "/tmp/Green-recorder-tmp.mkv", RecorderAbsPathName])
472+
473+
if formatchooser.get_active_id() == "gif":
474+
sendnotification("Your GIF image is currently being processed, this may take a while according to your PC's resources.", 5)
475+
476+
subprocess.call(["mv", RecorderAbsPathName, RecorderAbsPathName+".tmp"])
477+
subprocess.call(["convert", "-layers", "Optimize", RecorderAbsPathName+".tmp", RecorderAbsPathName])
478+
subprocess.call(["rm", RecorderAbsPathName+".tmp"])
479+
480+
CommandToRun = commandentry.get_text()
481+
subprocess.Popen([CommandToRun], shell=True)
482+
515483
def preferencesbuttonclicked(self, GtkButton):
516484
preferenceswindow.show()
517485

green-recorder.spec

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name: green-recorder
55
Summary: A simple yet functional desktop recorder for Linux systems. Supports both Xorg server and Wayland (GNOME).
66
URL: https://foss-project.com
7-
Version: 3.0.6
7+
Version: 3.1
88
Release: 1%{?dist}
99
Source: https://github.com/%{owner}/%{name}/archive/%{version}/%{version}.tar.gz
1010
License: GPLv3
@@ -14,7 +14,6 @@ Requires: python2
1414
Requires: python2-pydbus
1515
Requires: ffmpeg
1616
Requires: gawk
17-
Requires: libappindicator-gtk3
1817
Requires: python2-urllib3
1918
Requires: python-configparser
2019
Requires: pulseaudio
@@ -41,6 +40,10 @@ python setup.py install -O1 --root=$RPM_BUILD_ROOT
4140
%{_datadir}/pixmaps/%{name}.png
4241

4342
%changelog
43+
* Sun Oct 29 2017 M.Hanny Sabbagh <[email protected]> 3.1
44+
- Removed system tray icon and added close button.
45+
- Fixed #68, #70 and #77.
46+
4447
* Fri Oct 20 2017 M.Hanny Sabbagh <[email protected]> 3.0.6
4548
- Fixed #73.
4649

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
data_files.extend(locales)
2020

2121
setup(name = "green-recorder",
22-
version = "3.0.6",
22+
version = "3.1",
2323
description = "Record your desktop easily using a simple GUI",
2424
author = "FOSS Project",
2525
author_email = "[email protected]",

snap/snapcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
name: green-recorder
3-
version: '3.0.6'
3+
version: '3.1'
44
summary: Simple screen recorder for Linux desktop. Supports Xorg & Wayland.
55
description: |
66
Simple and easy screen recorder for Linux desktop. Supports Xorg & Wayland.

ui/ui.glade

+19-2
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,11 @@
470470
<property name="can_focus">False</property>
471471
<property name="stock">gtk-media-record</property>
472472
</object>
473+
<object class="GtkImage" id="image5">
474+
<property name="visible">True</property>
475+
<property name="can_focus">False</property>
476+
<property name="stock">gtk-media-stop</property>
477+
</object>
473478
<object class="GtkWindow" id="window1">
474479
<property name="visible">True</property>
475480
<property name="can_focus">False</property>
@@ -808,7 +813,7 @@
808813
<property name="has_subtitle">False</property>
809814
<property name="show_close_button">True</property>
810815
<child>
811-
<object class="GtkButton" id="button1">
816+
<object class="GtkButton" id="recordbutton">
812817
<property name="visible">True</property>
813818
<property name="can_focus">True</property>
814819
<property name="receives_default">True</property>
@@ -818,6 +823,18 @@
818823
<signal name="clicked" handler="recordclicked" swapped="no"/>
819824
</object>
820825
</child>
826+
<child>
827+
<object class="GtkButton" id="stopbutton">
828+
<property name="visible">True</property>
829+
<property name="can_focus">True</property>
830+
<property name="receives_default">True</property>
831+
<property name="image">image5</property>
832+
<signal name="clicked" handler="stoprecording" swapped="no"/>
833+
</object>
834+
<packing>
835+
<property name="position">2</property>
836+
</packing>
837+
</child>
821838
<child>
822839
<object class="GtkButton" id="playbutton">
823840
<property name="visible">True</property>
@@ -833,7 +850,7 @@
833850
</packing>
834851
</child>
835852
<child>
836-
<object class="GtkButton" id="button3">
853+
<object class="GtkButton" id="aboutbutton">
837854
<property name="visible">True</property>
838855
<property name="can_focus">True</property>
839856
<property name="receives_default">True</property>

0 commit comments

Comments
 (0)