Add using feh

master3.3
parent 35fce3ca76
commit 0b93fa3d87

@ -14,11 +14,16 @@
# limitations under the License.
# set background color
if ls /var/db/pkg/media-gfx/cld[-gx]*themes-12* &>/dev/null
if [[ -f /usr/share/wallpapers/dm-background.png ]]
then
xsetroot -solid rgb:73/a3/63
feh --no-fehbg --bg-scale /usr/share/wallpapers/dm-background.png
else
xsetroot -solid rgb:30/64/8b
if ls /var/db/pkg/media-gfx/cld[-gx]*themes-12* &>/dev/null
then
xsetroot -solid rgb:73/a3/63
else
xsetroot -solid rgb:30/64/8b
fi
fi
if [[ "`ps axeo command | grep 'xdm/xdm --logout' | grep -v grep | \

@ -14,10 +14,15 @@
# limitations under the License.
# set background color
if ls /var/db/pkg/media-gfx/cld[-gx]*themes-12* &>/dev/null
if [[ -f /usr/share/wallpapers/dm-background.png ]]
then
xsetroot -solid rgb:73/a3/63
feh --no-fehbg --bg-scale /usr/share/wallpapers/dm-background.png
else
xsetroot -solid rgb:30/64/8b
if ls /var/db/pkg/media-gfx/cld[-gx]*themes-12* &>/dev/null
then
xsetroot -solid rgb:73/a3/63
else
xsetroot -solid rgb:30/64/8b
fi
fi
exit 0

@ -1,63 +0,0 @@
#!/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_())

@ -63,14 +63,6 @@ die_xmes() {
die "${1}"
}
gtk_background(){
#if [[ -n $(env | grep RUNNING_UNDER_GDM=true) ]] && ls /var/db/pkg/gnome-base/gdm-2* &>/dev/null;
#then
/usr/bin/env HOME=/root python2 /usr/share/calculate/xdm/setbg &
BG_PID=$(ps ax | sed -nr "s/^\s*([0-9]+)\s.*setbg$/\1/p")
#fi
}
umount_user_res(){
if [[ -n $USER && -z `who | awk '{ print $1, $2 }' | grep -P ":\d+" | awk '{ print $1}' | grep $USER` ]];
then
@ -146,7 +138,6 @@ fi
FILELIST=$(find ${EXECDIR} -type f | sort)
[[ $FILELIST ]] || warning "${EXECDIR} hasn't scripts"
gtk_background
DOMAIN_USER="`desktop_variable_value desktop.ur_domain_set`"
for script in $FILELIST
do

Loading…
Cancel
Save