summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/fbrun/FbRun.cc10
-rw-r--r--util/fbrun/main.cc6
-rw-r--r--util/fbsetbg18
-rw-r--r--util/fbsetroot.hh2
-rwxr-xr-xutil/fluxbox-generate_menu.in6
-rw-r--r--util/fluxbox-update_configs.cc17
6 files changed, 31 insertions, 28 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index f98a02e..3bf83aa 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -21,11 +21,11 @@
21 21
22#include "FbRun.hh" 22#include "FbRun.hh"
23 23
24#include "App.hh" 24#include "FbTk/App.hh"
25#include "EventManager.hh" 25#include "FbTk/EventManager.hh"
26#include "Color.hh" 26#include "FbTk/Color.hh"
27#include "KeyUtil.hh" 27#include "FbTk/KeyUtil.hh"
28#include "FileUtil.hh" 28#include "FbTk/FileUtil.hh"
29 29
30#ifdef HAVE_CONFIG_H 30#ifdef HAVE_CONFIG_H
31#include "config.h" 31#include "config.h"
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc
index 0bb8456..edb88ff 100644
--- a/util/fbrun/main.cc
+++ b/util/fbrun/main.cc
@@ -20,9 +20,9 @@
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#include "FbRun.hh" 22#include "FbRun.hh"
23#include "App.hh" 23#include "FbTk/App.hh"
24#include "StringUtil.hh" 24#include "FbTk/StringUtil.hh"
25#include "Color.hh" 25#include "FbTk/Color.hh"
26 26
27#ifdef XINERAMA 27#ifdef XINERAMA
28extern "C" { 28extern "C" {
diff --git a/util/fbsetbg b/util/fbsetbg
index a12d427..9047be2 100644
--- a/util/fbsetbg
+++ b/util/fbsetbg
@@ -58,7 +58,7 @@ command="`basename \"$0\"`"
58display_usage() { 58display_usage() {
59 cat << EOF 59 cat << EOF
60Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA] /path/to/wallpaper 60Usage: $command [-u/-U [wallpapersetter]] [-fFcCtTaA] /path/to/wallpaper
61 $command [-u/-U [wallpapersetter]] [-fFcCtTaA] -r/-R /path/to/wallpaperdirectory 61 $command [-u/-U [wallpapersetter]] [-fFcCtTaA] -r/-R /path/to/directory
62 $command [-b/-B fbsetrootoptions] 62 $command [-b/-B fbsetrootoptions]
63 $command [-lhip] 63 $command [-lhip]
64Use \`\`$command -h'' for a complete help message. 64Use \`\`$command -h'' for a complete help message.
@@ -72,17 +72,21 @@ display_help() {
72 72
73Options: 73Options:
74 74
75 -u Use specified wallpapersetter, use no argument to forget.
76
75 -f Set fullscreen wallpaper (default). 77 -f Set fullscreen wallpaper (default).
76 -c Set centered wallpaper. 78 -c Set centered wallpaper.
77 -t Set tiled wallpaper. 79 -t Set tiled wallpaper.
78 -a Set maximized wallpaper, preserving aspect. 80 -a Set maximized wallpaper, preserving aspect.
79 ( if your bgsetter doesn't support this 81 ( if your wallpapersetter doesn't support this
80 we fall back to -f ) 82 we fall back to -f )
81 -u Use specified wallpapersetter, use no argument to forget. 83
82 -b Forward the options to fbsetroot.
83 -r set random wallpaper from a directory 84 -r set random wallpaper from a directory
84 85
85 -F,-C,-T,-A,-U,-B,-R same as uncapsed but without remembering. 86 -b Forward the rest of the arguments to fbsetroot(1).
87 This can be used to set solid, pattern, or gradient backgrounds.
88
89 -F,-C,-T,-A,-U,-B,-R same as lower-case, but without remembering.
86 90
87 -h Display this help. 91 -h Display this help.
88 92
@@ -308,6 +312,7 @@ while [ $# -gt 0 ]; do
308 remember=false 312 remember=false
309 break 313 break
310 fi 314 fi
315 ignore_missing_wallpaper=true
311 style="style" 316 style="style"
312 shift ;; 317 shift ;;
313 -Z) 318 -Z)
@@ -521,6 +526,9 @@ fi
521 526
522 527
523if [ ! -r "$wallpaper" ]; then 528if [ ! -r "$wallpaper" ]; then
529 if [ "$ignore_missing_wallpaper" == "true" ]; then
530 exit 0
531 fi
524 message "Can't find wallpaper $wallpaper" 532 message "Can't find wallpaper $wallpaper"
525 exit 1 533 exit 1
526fi 534fi
diff --git a/util/fbsetroot.hh b/util/fbsetroot.hh
index 5a4400f..3cc931b 100644
--- a/util/fbsetroot.hh
+++ b/util/fbsetroot.hh
@@ -27,7 +27,7 @@ namespace FbTk {
27 27
28class ImageControl; 28class ImageControl;
29 29
30}; 30}
31 31
32class fbsetroot : public FbTk::App { 32class fbsetroot : public FbTk::App {
33public: 33public:
diff --git a/util/fluxbox-generate_menu.in b/util/fluxbox-generate_menu.in
index aca8b08..7fb5ef7 100755
--- a/util/fluxbox-generate_menu.in
+++ b/util/fluxbox-generate_menu.in
@@ -1671,13 +1671,15 @@ append_submenu "${MULTIMEDIAMENU}"
1671 append_submenu "${MUSICMENU}" 1671 append_submenu "${MUSICMENU}"
1672 normal_find xmms noatun alsaplayer gqmpeg aumix xmixer gnome-alsamixer gmix kmix kscd \ 1672 normal_find xmms noatun alsaplayer gqmpeg aumix xmixer gnome-alsamixer gmix kmix kscd \
1673 grecord kmidi xplaycd soundtracker grip easytag audacity \ 1673 grecord kmidi xplaycd soundtracker grip easytag audacity \
1674 zinf rhythmbox kaboodle beep-media-player amarok tagtool 1674 zinf rhythmbox kaboodle beep-media-player amarok tagtool \
1675 audacious bmpx
1675 cli_find cdcd cplay alsamixer orpheus mp3blaster 1676 cli_find cdcd cplay alsamixer orpheus mp3blaster
1676 append_menu_end 1677 append_menu_end
1677 1678
1678 1679
1679 append_submenu "${VIDEOMENU}" 1680 append_submenu "${VIDEOMENU}"
1680 normal_find xine aviplay gtv gmplayer xmovie xcdroast xgdb realplay xawtv fxtv ogle goggles vlc 1681 normal_find xine gxine aviplay gtv gmplayer xmovie xcdroast xgdb \
1682 realplay xawtv fxtv ogle goggles vlc
1681 find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}" 1683 find_it dvdrip append "[exec] (dvdrip) {nohup dvdrip}"
1682 append_menu_end 1684 append_menu_end
1683 1685
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index 96382da..85bbbfe 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -22,8 +22,9 @@
22#include "../src/FbTk/I18n.hh" 22#include "../src/FbTk/I18n.hh"
23#include "../src/FbTk/Resource.hh" 23#include "../src/FbTk/Resource.hh"
24#include "../src/FbTk/StringUtil.hh" 24#include "../src/FbTk/StringUtil.hh"
25#include "../src/FbTk/FileUtil.hh"
25 26
26#include "../src/defaults.hh" 27#include "defaults.hh"
27 28
28#ifdef HAVE_CONFIG_H 29#ifdef HAVE_CONFIG_H
29#include "config.h" 30#include "config.h"
@@ -463,7 +464,7 @@ set<string> modified_files;
463// we may want to put a size limit on this cache, so it doesn't grow too big 464// we may want to put a size limit on this cache, so it doesn't grow too big
464map<string,string> file_cache; 465map<string,string> file_cache;
465 466
466}; 467}
467 468
468// returns the contents of the file given, either from the cache or by reading 469// returns the contents of the file given, either from the cache or by reading
469// the file from disk 470// the file from disk
@@ -473,11 +474,9 @@ string read_file(const string& filename) {
473 if (it != file_cache.end()) 474 if (it != file_cache.end())
474 return it->second; 475 return it->second;
475 476
476 struct stat s; 477 if (!FbTk::FileUtil::isRegularFile(filename.c_str())) {
477 stat(filename.c_str(), &s);
478
479 if (! (s.st_mode & S_IFREG))
480 return ""; 478 return "";
479 }
481 480
482 // nope, we'll have to read the file 481 // nope, we'll have to read the file
483 ifstream infile(filename.c_str()); 482 ifstream infile(filename.c_str());
@@ -489,12 +488,6 @@ string read_file(const string& filename) {
489 string linebuffer; 488 string linebuffer;
490 while (!infile.eof()) { 489 while (!infile.eof()) {
491 getline(infile, linebuffer); 490 getline(infile, linebuffer);
492
493 // check if we read something at all. if its 0, its a strange file
494 // (eg a directory) or we are at the end
495 if (infile.gcount() == 0) {
496 break;
497 }
498 whole_file += linebuffer + "\n"; 491 whole_file += linebuffer + "\n";
499 } 492 }
500 infile.close(); 493 infile.close();