LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-12-2010, 10:24 AM   #1
josephj
Member
 
Registered: Nov 2007
Location: Northeastern USA
Distribution: kubuntu
Posts: 58

Rep: Reputation: 24
zenity - hiding hidden files from file selections


I'm using zenity 2.28.0 in a bash script (under kde4) to select multiple files in a directory. It works fine, but always defaults to showing hidden files.

How can I get it to hide hidden files by default?

I know about toggling them on and off with Ctrl-H, but I would prefer not to have to use that.

I have my options set so that dolphin and konqueror do not show hidden files by default. I even tried adding shopt -u dotglob to my script.

TIA

Joe

kubuntu karmic

zenity invocation (extracted from a more complex statement):
zenity --title "Select Print Files to Delete" --file-selection --multiple
 
Old 10-11-2010, 03:39 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,615
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
As far as I know Zenity does not provide that type of selection filter.
 
Old 10-12-2010, 12:35 PM   #3
josephj
Member
 
Registered: Nov 2007
Location: Northeastern USA
Distribution: kubuntu
Posts: 58

Original Poster
Rep: Reputation: 24
A friend at the local lug found it for me. It's in the help files, but only if you get help on the file-selection command itself. It's kind of like an Easter egg.

zenity --title "Select Print Files to Delete" --file-selection --multiple --file-filter=[A-Za-z0-9]*

Joe
 
Old 10-14-2010, 03:06 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,615
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Thanks for posting the solution!
 
Old 10-14-2010, 08:33 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 10,466

Rep: Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627
Of course that will also "hide" file with whitespace or special characters (I use underscore a lot).

Edit: well that's embarrassing - my underscore files got included regardless. But I show no "dot" files - ever. Filter or not.
So something is amiss somewhere.

Last edited by syg00; 10-14-2010 at 11:05 PM.
 
Old 10-15-2010, 01:53 PM   #6
josephj
Member
 
Registered: Nov 2007
Location: Northeastern USA
Distribution: kubuntu
Posts: 58

Original Poster
Rep: Reputation: 24
syg00: Good point. I'll modify it.

unSpawn: I ask a lot more questions than those I solve, so I always try to give back when I can.

Joe
 
  


Reply

Tags
zenity


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding hidden files arubin Slackware 1 11-03-2009 05:08 PM
bash: mv hidden and not hidden files lupe Linux - General 4 06-22-2009 01:27 PM
thunar crashes the kernel when hiding/unhiding hidden files basscad Linux - Software 0 02-21-2009 08:44 AM
thunar crashes the kernel when hiding/unhiding hidden files basscad Linux - Kernel 1 02-18-2009 01:28 AM
Hiding hidden files in the "save as" option window n926bb Linux - Desktop 3 07-12-2008 09:06 AM


All times are GMT -5. The time now is 02:29 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration