public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fluxbox] epel10: - fix #209347 and #187740
@ 2026-11-09 12:24 Andreas Bierfert
  0 siblings, 0 replies; only message in thread
From: Andreas Bierfert @ 2026-11-09 12:24 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fluxbox
            Branch : epel10
            Commit : 8be0e161b3dec53eea07086a8e0736c0f1f6f615
            Author : Andreas Bierfert <awjb@fedoraproject.org>
            Date   : 2006-10-21T09:38:14+00:00
            Stats  : +134/-109 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/fluxbox/c/8be0e161b3dec53eea07086a8e0736c0f1f6f615?branch=epel10

            Log:
            - fix #209347 and #187740
- fc{5,6} fix #196106

---
diff --git a/fluxbox-menu.patch b/fluxbox-menu.patch
deleted file mode 100644
index 4810521..0000000
--- a/fluxbox-menu.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- util/startfluxbox.in.orig	2006-03-02 16:10:01.000000000 +0100
-+++ util/startfluxbox.in	2006-03-02 16:11:29.000000000 +0100
-@@ -76,6 +76,10 @@
- # wmsmixer -w &
- # idesk &
- 
-+if [ -x /usr/bin/fluxbox-xdg-menu ]; then
-+ /usr/bin/fluxbox-xdg-menu --with-icons &
-+fi
-+
- # And last but not least we start fluxbox.
- # Because it is the last app you have to run it with ''exec'' before it.
- 

diff --git a/fluxbox-xdg-menu.py b/fluxbox-xdg-menu.py
index e2fc47e..a2d1625 100644
--- a/fluxbox-xdg-menu.py
+++ b/fluxbox-xdg-menu.py
@@ -1,27 +1,42 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
+# vim: noexpandtab:ts=4:sts=4
+
 """Menu Generator for Fluxbox
 
 Generates a menu for Fluxbox using the freedesktop.org standards
 
-Usage: fluxbox-fdo-menugen.py [options]
+Usage: fluxbox-xdg-menu.py [options]
 
 Options:
   -l ..., --lang=...      create the menu using a language. Default = $LANG
   -h, --help              show this help
   -f ..., --file=...      output the menu into a file. Default = ~/.fluxbox/menu
-  --with-icons         do not put icons for applications in the menu
+  -t ..., --theme=...     what icon theme you want to use
+  --with-icons            put icons for applications in the menu
   --stdout                output the menu to standard output
+  --submenu               output to be used as an include/submenu with fluxbox
+  --with-backgrounds      creates a background menu. Default background_paths = 
+                          ~/.fluxbox/backgrounds, /usr/share/wallpapers,
+                          /usr/share/backgrounds
+  --backgrounds-only      do not regenerate menu, only do the bg menu.
+  --bg-path=              path to location to look for images 
+                          example: --bg-path=~/pics  
+			  may be used with --backgrounds-only but --bg-path= 
+			  must be first: --bg-path=~/some/path --backgrounds-only
 
+A nice example string to use: fluxbox-fdo-menugen.py --with-icons --with-backgrounds --bg-path=~/some/path
+To update only the backgrounds: fluxbox-fdo-menugen.py --bg-path=~/some/path --backgrounds-only
 """
 
-__author__ = "Rudolf Kastl , Antonio Gomes"
-__version__ = "$Revision: 1.0 $"
-__date__ = "$Date: 2005/04/09 17:46:19 $"
+__author__ = "Rudolf Kastl , Antonio Gomes, Michael Rice"
+__version__ = "$Revision: 1.2 $"
+__date__ = "$Date: 2006/10/09 23:20:10 $"
 __license__ = "GPL"
 
 
 import os,re,sys,glob,getopt
 import xdg.Menu,xdg.DesktopEntry,xdg.IconTheme
+from os.path import isfile
 
 def usage():
 	print __doc__
@@ -31,7 +46,7 @@ def header(wm="fluxbox"):
 [begin] (Fluxbox)
 	[exec] (Web Browser) {htmlview}
 	[exec] (Email) {evolution}
-	[exec] (Terminal) {gnome-terminal}
+	[exec] (Terminal) {$TERM}
 	[exec] (Irc) {xchat}
 	[separator]\n"""
 
@@ -78,66 +93,31 @@ def checkWm(entry, wm="fluxbox"):
 			else:
 				entry.Show = True 
 	
-#def findIcon(icon):
-#	"""Finds the path and filename for the given icon name
-#		e.g. gaim --> /usr/share/pixmaps/gaim.png
-#		e.g. fart.png --> /usr/share/pixmaps/fart.png
-#	"""
-#	if os.path.isfile(icon): return icon
-#	paths = ["~/.icons","/usr/share/pixmaps","/usr/share/icons"]
-#	for path in paths:
-#		for dirpath , dirnames, filenames in os.walk(os.path.expanduser(path)):
-#			for filename in filenames:
-#				pattern = '^%s\.(png|jpg|gif|xpm)' % icon # matches <filename>.<something>
-#				if icon == filename or re.search(pattern, filename):
-#					return os.path.join(dirpath,filename)
-
-
-def findIcon(icon):
+def findIcon(icon, theme):
 	"""Finds the path and filename for the given icon name
 		e.g. gaim --> /usr/share/pixmaps/gaim.png
 		e.g. fart.png --> /usr/share/pixmaps/fart.png
 	"""
-	global paths
-	global locs
-
-	# Case Icon=/path/to/file.extension
-	if os.path.isfile(icon): return icon
-
-
-	# Case Icon=file.extension	
-
-	if re.search("^\w+.*\.\w{3}$",icon):
-		names=[icon]
-	# Case Icon=file
-	elif re.search("^\w+.*$",icon):
-		names=[icon+".png",icon+".xpm",icon+".jpg"]
-	else:
-		names=[]
-
-	for path in paths:	
-		for name in names:
-			if (os.path.isfile(path+name)):
-				locs.append(path)
-				return (path+name).encode('utf8')
+	retval=str(xdg.IconTheme.getIconPath(icon, 48, theme))
+	if retval == "None":
+		retval=""
 
+	return (retval + "").encode('utf8')
 
-def parseMenu(menu,depth=1):
-	global wm
-	global use_icons
+def parseMenu(menu,wm,use_icons,theme,depth=1):
 	if use_icons:
-		print "%s[submenu] (%s) <%s> " % ( (depth*"\t"), menu.getName().encode('utf8'), findIcon(menu.getIcon()) )
+		print "%s[submenu] (%s) <%s> " % ( (depth*"\t"), menu.getName().encode('utf8'),  findIcon(menu.getIcon(), theme) )
 	else:
 		print "%s[submenu] (%s) " % ( (depth*"\t"), menu.getName().encode('utf8'), )
 	depth += 1
 	for entry in menu.getEntries():
 		if isinstance(entry, xdg.Menu.Menu):
-			parseMenu(entry,depth)
+			parseMenu(entry,wm,use_icons,theme,depth)
 		elif isinstance(entry, xdg.Menu.MenuEntry):
 			checkWm(entry,wm)
 			if entry.Show == False: continue
 			if use_icons:
-				print "%s[exec] (%s) {%s} <%s> " % ( (depth*"\t"), entry.DesktopEntry.getName().encode("utf8"), entry.DesktopEntry.getExec().split()[0], findIcon(entry.DesktopEntry.getIcon()) )
+				print "%s[exec] (%s) {%s} <%s> " % ( (depth*"\t"), entry.DesktopEntry.getName().encode("utf8"), entry.DesktopEntry.getExec().split()[0], findIcon(entry.DesktopEntry.getIcon(), theme) )
 			else:
 				print "%s[exec] (%s) {%s} " % ( (depth*"\t"), entry.DesktopEntry.getName().encode("utf8"), entry.DesktopEntry.getExec().split()[0] )
 		elif isinstance(entry,xdg.Menu.Separator):
@@ -147,22 +127,77 @@ def parseMenu(menu,depth=1):
 	depth -= 1
 	print "%s[end]" % (depth*"\t")
 
+def get_bgimgs_and_parse(xPath):
+    try:
+        if isfile(os.path.expanduser("~/.fluxbox/bgmenu")) == True:
+            os.unlink(os.path.expanduser("~/.fluxbox/bgmenu"))
+    except OSError:
+        pass
+    h = {}
+    bg_paths =["~/.fluxbox/backgrounds","/usr/share/wallpapers",
+		"/usr/share/backgrounds","/usr/share/backgrounds/images"]
+    try:
+        if xPath == None:
+           pass
+        else:
+            bg_paths.append(xPath)
+    except(TypeError):
+        pass
+    for dir in bg_paths:
+        for imgpth in bg_paths:
+            try:
+                imgs = os.listdir(os.path.expanduser(imgpth))
+                for i in imgs:
+                    h[i] = imgpth
+            except (OSError):
+                pass
+    bgMenu = open(os.path.expanduser("~/.fluxbox/bgmenu"),'w+')
+    num = len(h)
+    countNum = 1
+    bgPagCk = 1
+    bgPgNum = 1
+    bgMenu.write( "[submenu] (Backgrounds)\n" )
+    bgMenu.write( "[submenu] (Backgrounds) {Set Your Background}\n" )
+    bgMenu.write("\t[exec]  (Random Image)  {fbsetbg -r ~/.fluxbox/backgrounds}\n")
+	types = ["png","jpg","jpeg","gif"]
+    for i in h.keys():
+	    try:
+		    t = i.split(".")[-1].lower()
+			if t in types:
+			    print "Hello"
+			    bgMenu.write( "\t[exec]\t("+ i +") {fbsetbg -f "+ h[i] + "/" + i +"}\n" )
+				countNum = countNum + 1
+				num = num - 1
+				bgPagCk = bgPagCk + 1
+				if bgPagCk == 26:
+				    bgPgNum = bgPgNum + 1
+					bgMenu.write("[end]\n[submenu] (Backgrounds " + str(bgPgNum) +") \
+						{Set Your Background}\n")
+					bgPagCk = 1
+				if num == 0:
+				    bgMenu.write( "[end]\n[end]\n" )
+					bgMenu.close()
+		except(KeyError):
+		    print h[i]
+		    pass
 
 def main(argv):
 # Setting the default values
-	global locs
-	locs=[]
-	global wm
 	wm = "fluxbox"
-	global file
 	file = "~/.fluxbox/menu"
-	global use_icons
 	use_icons = False
+    use_bg = False
+    bg_Xpath = False
+	theme = "gnome"
 	lang = os.getenv("LANG","C")
 	file = os.path.expanduser("~/.fluxbox/menu")
+	do_submenu = False
+	use_stdout = False
 	
 	try:
-		opts, args = getopt.getopt(argv, "hf:dl:d", ["help","lang=","file=","with-icons","stdout"])
+		opts, args = getopt.getopt(argv, "hf:dl:d", ["help","lang=","file=","with-icons","stdout",\
+			"theme=","submenu","with-backgrounds","backgrounds-only","bg-path="])
+
 	except getopt.GetoptError:
 		usage()
 		sys.exit(2)
@@ -175,50 +210,51 @@ def main(argv):
 		elif opt in ("-f", "--file"):
 			file = os.path.expanduser(arg)
 		elif opt == '--with-icons':
-			use_icons = True		
-			global paths
-			locations = \
-			['/usr/share/pixmaps/', \
-			'/usr/share/icons/hicolor/24x24/apps/', \
-			'/usr/share/icons/hicolor/32x32/apps/', \
-			'/usr/share/icons/hicolor/48x48/apps/', \
-			'/usr/share/icons/hicolor/24x24/stock/generic/', \
-			'/usr/share/icons/HighContrastLargePrintInverse/48x48/apps/', \
-			'/usr/share/icons/crystalsvg/16x16/apps/', \
-			'/usr/share/icons/crystalsvg/32x32/apps/', \
-			'/usr/share/icons/crystalsvg/48x48/apps/', \
-			'/usr/share/icons/crystalsvg/48x48/devices/', \
-			'/usr/share/icons/', \
-			'/usr/share/icons/hicolor/32x32/apps/', \
-			'/usr/share/icons/Bluecurve/24x24/stock/', \
-			'/usr/share/icons/Bluecurve/48x48/filesystems/']
-			paths=locations
-#			for path in locations:
-#				paths+=glob.glob(path+"/*/")+glob.glob(path+"/*/*/")
-#			print paths
+			use_icons = True
+		elif opt in ("-t", "--theme"):
+			theme = arg
+		elif opt == '--stdout':
+			use_stdout = True
 		elif opt == '--stdout':
 			file = sys.stdout
+		elif opt == '--bg-path':
+		    bg_Xpath = True
+			xPath = os.path.expanduser(arg)
+		elif opt == '--with-backgrounds':
+		    use_bg = True
+		elif opt == '--backgrounds-only':
+		    if bg_Xpath:
+			    get_bgimgs_and_parse(xPath)
+			else:
+			    get_bgimgs_and_parse(None)
+				raise SystemExit
+			  
+		elif opt == '--submenu':
+			do_submenu = True
 
-
-	fsock = open(file,'w')
-	saveout = sys.stdout
-	sys.stdout = fsock
+	if not use_stdout:
+		fsock = open(file,'w')
+		saveout = sys.stdout
+		sys.stdout = fsock
 
 	menu=xdg.Menu.parse()
 # is done automatically now
 #	menu.setLocale(lang)
 
-	print header()
-	parseMenu(menu)
-	print footer()
+	if not do_submenu:
+        print header()
+	parseMenu(menu,wm,use_icons,theme)
+	if not do_submenu and use_bg and bg_Xpath:
+	    get_bgimgs_and_parse(xPath) 
+	    print "[include] (~/.fluxbox/bgmenu)"
+	if not do_submenu and use_bg and not bg_Xpath:
+	    print "[include] (~/.fluxbox/bgmenu)"
+		get_bgimgs_and_parse(None)
+    if not do_submenu:
+        print footer()
+	if not use_stdout:
+		sys.stdout = saveout
 
-	sys.stdout = saveout
 #	print menu
 if __name__ == "__main__":
 	main(sys.argv[1:])
-
-#WindowMaker Reminder
-#>>> p=re.compile("(\).*),(\s*\))")
-#>>> p.search("((ola),(ola),)").groups()
-#('),(ola)', ')')
-

diff --git a/fluxbox.spec b/fluxbox.spec
index 7924a62..18c9db6 100644
--- a/fluxbox.spec
+++ b/fluxbox.spec
@@ -1,6 +1,6 @@
 Name:           fluxbox
 Version:        0.9.15.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 
 Summary:	Window Manager based on Blackbox
 
@@ -11,7 +11,6 @@ URL:            http://fluxbox.sourceforge.net
 Source0:        http://download.sourceforge.net/fluxbox/fluxbox-0.9.15.1.tar.bz2
 Source3:        fluxbox.desktop
 Source4:        fluxbox-xdg-menu.py
-Patch1:         fluxbox-menu.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot
 BuildRequires:  imlib2-devel
@@ -42,7 +41,6 @@ Have a look at the homepage for more info ;)
 
 %prep
 %setup -q
-%patch1
 
 %build
 %configure      --enable-xft \
@@ -63,7 +61,7 @@ make install DESTDIR=$RPM_BUILD_ROOT
 
 # this is for Fedora Core
 mkdir -p $RPM_BUILD_ROOT%{_datadir}/xsessions/
-install -m 0755 -p %SOURCE3 $RPM_BUILD_ROOT%{_datadir}/xsessions/
+install -m 0644 -p %SOURCE3 $RPM_BUILD_ROOT%{_datadir}/xsessions/
 install -m 0755 -p %SOURCE4 $RPM_BUILD_ROOT%{_bindir}/fluxbox-xdg-menu
 
 %clean
@@ -78,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/xsessions/fluxbox.desktop
 
 %changelog
+* Sat Oct 21 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
+0.9.15.1-3
+- fix #209347,#196106, and #187740
+
 * Wed Sep 13 2006 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
 0.9.15.1-2
 - FE6 rebuild

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-09 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 12:24 [rpms/fluxbox] epel10: - fix #209347 and #187740 Andreas Bierfert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox