parent
fbf0251f0a
commit
2de869c68f
@ -0,0 +1,33 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI="3"
|
||||
|
||||
SUPPORT_PYTHON_ABIS="1"
|
||||
PYTHON_DEPEND="2:2.7"
|
||||
RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*"
|
||||
|
||||
inherit distutils eutils
|
||||
|
||||
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2"
|
||||
|
||||
DESCRIPTION="The program of the desktop configuration Calculate Linux"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND="~sys-apps/calculate-core-3.1.0_beta1
|
||||
>=dev-python/python-ldap-2.0[ssl]
|
||||
!<sys-apps/calculate-desktop-3.1.0_alpha1"
|
||||
|
||||
RDEPEND="${DEPEND}"
|
||||
src_unpack() {
|
||||
unpack "${A}"
|
||||
cd "${S}"
|
||||
|
||||
# apply revision changes
|
||||
epatch "${FILESDIR}/calculate-desktop-3.1.0_beta1-r1.patch"
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
diff --git data/gtkbg data/gtkbg
|
||||
deleted file mode 100644
|
||||
index 7489965..0000000
|
||||
--- data/gtkbg
|
||||
+++ /dev/null
|
||||
@@ -1,61 +0,0 @@
|
||||
-#!/usr/bin/env python2
|
||||
-# Copyright 2008-2010 Calculate Ltd. http://www.calculate-linux.org
|
||||
-#
|
||||
-# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-# you may not use this file except in compliance with the License.
|
||||
-# You may obtain a copy of the License at
|
||||
-#
|
||||
-# http://www.apache.org/licenses/LICENSE-2.0
|
||||
-#
|
||||
-# Unless required by applicable law or agreed to in writing, software
|
||||
-# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-# See the License for the specific language governing permissions and
|
||||
-# limitations under the License.
|
||||
-
|
||||
-import pygtk
|
||||
-pygtk.require('2.0')
|
||||
-import gtk
|
||||
-import os
|
||||
-import sys
|
||||
-import re
|
||||
-import subprocess
|
||||
-
|
||||
-def select_color():
|
||||
- try:
|
||||
- if filter(re.compile(r"(cld|cldx|cldg|cmc|cls)-themes-12").search,
|
||||
- os.listdir('/var/db/pkg/media-gfx')):
|
||||
- return "#73a363"
|
||||
- except:
|
||||
- pass
|
||||
- return '#30648b'
|
||||
-
|
||||
-if __name__ == "__main__":
|
||||
- if gtk.gdk.get_display():
|
||||
- window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
-
|
||||
- # Here we connect the "destroy" event to a signal handler
|
||||
- window.connect("destroy", lambda w: gtk.main_quit())
|
||||
- pipe = subprocess.Popen(["xdpyinfo"],
|
||||
- stdout=subprocess.PIPE, env=os.environ)
|
||||
- reRes = re.compile("dimensions:\s+(\d+)x(\d+)\s+pixels")
|
||||
- cx, cy = 1024, 768
|
||||
- if pipe.wait() == 0:
|
||||
- for line in pipe.stdout:
|
||||
- searchRes = reRes.search(line)
|
||||
- if searchRes:
|
||||
- cx, cy = int(searchRes.group(1)), int(searchRes.group(2))
|
||||
- break
|
||||
- pipe.stdout.close()
|
||||
- window.set_size_request(cx,cy)
|
||||
- window.maximize()
|
||||
-
|
||||
- window.set_border_width(0)
|
||||
- window.modify_bg(gtk.STATE_NORMAL,
|
||||
- gtk.gdk.rgb_get_colormap().alloc_color(select_color()))
|
||||
-
|
||||
- window.show()
|
||||
- pid = os.fork()
|
||||
- if not pid:
|
||||
- gtk.main()
|
||||
- sys.exit(0)
|
||||
diff --git data/setbg data/setbg
|
||||
new file mode 100755
|
||||
index 0000000..86b411a
|
||||
--- /dev/null
|
||||
+++ data/setbg
|
||||
@@ -0,0 +1,63 @@
|
||||
+#!/usr/bin/env python
|
||||
+
|
||||
+# Copyright 2008-2012 Calculate Ltd. http://www.calculate-linux.org
|
||||
+#
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+from PySide import QtCore, QtGui
|
||||
+import os,sys
|
||||
+
|
||||
+class ImageViewer(QtGui.QMainWindow):
|
||||
+ def __init__(self):
|
||||
+ super(ImageViewer, self).__init__()
|
||||
+
|
||||
+ self.setWindowFlags(QtCore.Qt.X11BypassWindowManagerHint)
|
||||
+ self.imageLabel = QtGui.QLabel()
|
||||
+ self.imageLabel.setScaledContents(True)
|
||||
+ self.setCentralWidget(self.imageLabel)
|
||||
+
|
||||
+ screen = QtGui.QDesktopWidget().screenGeometry()
|
||||
+ self.setGeometry(screen)
|
||||
+ self.open('/usr/share/wallpapers/dm-background.png') or \
|
||||
+ self.open('/usr/share/apps/ksplash/Themes/CalculateSplashEn/'
|
||||
+ '400x300/background.png') or \
|
||||
+ self.setBackground()
|
||||
+
|
||||
+ def selectColor(self):
|
||||
+ try:
|
||||
+ if filter(re.compile(r"(cld|cldx|cldg|cmc|cls)-themes-12").search,
|
||||
+ os.listdir('/var/db/pkg/media-gfx')):
|
||||
+ return "#73a363"
|
||||
+ except:
|
||||
+ pass
|
||||
+ return '#30648b'
|
||||
+
|
||||
+ def setBackground(self):
|
||||
+ self.setStyleSheet("background-color: %s"%self.selectColor())
|
||||
+
|
||||
+ def open(self,fileName):
|
||||
+ image = QtGui.QImage(fileName)
|
||||
+ if image.isNull():
|
||||
+ return False
|
||||
+
|
||||
+ self.imageLabel.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||
+
|
||||
+ self.imageLabel.adjustSize()
|
||||
+ return True
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ import sys
|
||||
+ app = QtGui.QApplication(sys.argv)
|
||||
+ imageViewer = ImageViewer()
|
||||
+ imageViewer.show()
|
||||
+ sys.exit(app.exec_())
|
||||
diff --git data/xdm data/xdm
|
||||
index 209f191..113da05 100755
|
||||
--- data/xdm
|
||||
+++ data/xdm
|
||||
@@ -64,11 +64,11 @@ die_xmes() {
|
||||
}
|
||||
|
||||
gtk_background(){
|
||||
- if [[ -n $(env | grep RUNNING_UNDER_GDM=true) ]] && ls /var/db/pkg/gnome-base/gdm-2* &>/dev/null;
|
||||
- then
|
||||
- /usr/bin/env python2 /usr/share/calculate/xdm/gtkbg
|
||||
- BG_PID=$(ps ax | sed -nr "s/^\s*([0-9]+)\s.*gtkbg$/\1/p")
|
||||
- fi
|
||||
+ #if [[ -n $(env | grep RUNNING_UNDER_GDM=true) ]] && ls /var/db/pkg/gnome-base/gdm-2* &>/dev/null;
|
||||
+ #then
|
||||
+ /usr/bin/env python2 /usr/share/calculate/xdm/setbg &
|
||||
+ BG_PID=$(ps ax | sed -nr "s/^\s*([0-9]+)\s.*setbg$/\1/p")
|
||||
+ #fi
|
||||
}
|
||||
|
||||
umount_user_res(){
|
||||
@@ -153,5 +153,11 @@ do
|
||||
FILE_LOG=$FILE_LOG DOMAIN_USER=$DOMAIN_USER /bin/bash $script || die_xmes "failed on execute $script"
|
||||
done
|
||||
|
||||
-[[ -n $BG_PID ]] && kill $BG_PID
|
||||
+sleep_kill()
|
||||
+{
|
||||
+ sleep 2
|
||||
+ kill $1
|
||||
+}
|
||||
+
|
||||
+[[ -n $BG_PID ]] && sleep_kill $BG_PID &
|
||||
exit 0
|
||||
diff --git setup.py setup.py
|
||||
index e0575de..473ec63 100755
|
||||
--- setup.py
|
||||
+++ setup.py
|
||||
@@ -34,7 +34,7 @@ data_files = []
|
||||
|
||||
data_files += [('/usr/share/calculate/xdm', ['data/cmd_login',
|
||||
'data/functions',
|
||||
- 'data/gtkbg',
|
||||
+ 'data/setbg',
|
||||
'data/xdm'])] + \
|
||||
[('/usr/share/calculate/xdm/login.d',
|
||||
['data/login.d/00init',
|
||||
@@ -77,7 +77,7 @@ def create_data_files(data_dirs, prefix="", replace_dirname=""):
|
||||
class cl_install_data(install_data):
|
||||
def run (self):
|
||||
install_data.run(self)
|
||||
- data_file = [("/usr/share/calculate/xdm/gtkbg",0755),
|
||||
+ data_file = [("/usr/share/calculate/xdm/setbg",0755),
|
||||
("/usr/share/calculate/xdm/cmd_login",0755),
|
||||
("/usr/share/calculate/xdm/xdm",0755)]
|
||||
fileNames = map(lambda x: os.path.split(x[0])[1], data_file)
|
@ -0,0 +1,25 @@
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
EAPI=4
|
||||
|
||||
DESCRIPTION="Calculate Utilities meta package"
|
||||
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="3"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="cl_consolegui cl_client cl_desktop cl_console"
|
||||
|
||||
RDEPEND="${RDEPEND}
|
||||
=sys-apps/calculate-install-3.1.0_beta1
|
||||
=sys-apps/calculate-i18n-3.1.0_beta1-r1
|
||||
=sys-apps/calculate-lib-3.1.0_beta1-r3
|
||||
=sys-apps/calculate-core-3.1.0_beta1-r1
|
||||
cl_client? ( =sys-apps/calculate-client-3.1.0_beta1 )
|
||||
cl_desktop? ( =sys-apps/calculate-desktop-3.1.0_beta1-r1 )
|
||||
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.0_beta1 )
|
||||
cl_console? ( =sys-apps/calculate-console-3.1.0_beta1 )
|
||||
"
|
Loading…
Reference in new issue