Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Thursday, June 1, 2017

Posted by beni in , , , , , , , , | June 01, 2017

9 Beautiful Alternatives To The Default Linux Icon Sets



Danny Stieben,On Linux

Some of the default icon sets that come with Linux distributions are just plain ugly. Have you ever looked at the default icon set for Gnome � the real one? While it works, it could look so much better. Thankfully, we can fix this rather easily. Here�s how you can switch icon sets, and which ones I recommend trying out.

How to Install

gnome tweak interface 9 Beautiful Alternatives To The Default Linux Icon Sets

To install an icon set, you�ll first want to install Gnome Tweak Tool, a utility that allows you to access more configurability settings. This will allow you to switch between installed icon sets. Next, find your desired icon set and download it. Extract the contents of the zip folder, and place them in /home/<user>/.icons. Different icon sets should be in their own folders within the .icons folder. If you can�t see the .icons folder, you�ll need to enable visibility of hidden files and folders. In Nautilus, you can do this by simply hitting Ctrl + H on your keyboard.Then, you can go to the Interface tab in Gnome Tweak Tool and switch to the icon set you want. The change should apply immediately.
If you�re a KDE user, you don�t have to install anything extra. Just go to System Settings �> Appearance �> Icons and choose the icon set you want.
There are loads of icon sets available, but which ones are good and worth trying out? Take a look at these 9 icon sets.

Moka

linuxicons moka 9 Beautiful Alternatives To The Default Linux Icon Sets

Moka is currently the hottest icon set available. It�s clean and very well designed � all icons have the same size and square shape with rounded corners. It�s also one of the more complete icon sets available, with a number of icons made for various third-party applications, and not just for generic items or default applications.

Faience/Faenza

linuxicons faience 9 Beautiful Alternatives To The Default Linux Icon Sets

Faience/Faenza are a pair of icon themes by developer tiheum that are also wildly popular, although their heyday was roughly around the time when Gnome Shell was first released. The design concepts are actually very similar to Moka�s, but this theme also includes darker themes that can fit in well with light desktop themes.

Awoken

linuxicons awoken 9 Beautiful Alternatives To The Default Linux Icon Sets

Awoken follows a completely different design concept that doesn�t use square icons for everything. Instead, Awoken first gained popularity from its original mono mode of icons. It has since evolved to include colored icons as well as dark and white themes. I think they look a little cartoony, but it�s not a bad thing � the icons are still cleanly designed.

Numix

linuxicons numix square 9 Beautiful Alternatives To The Default Linux Icon Sets
Numix goes back to the square icon concept, and offers some of the flattest icons around. The colors used in this one are also a bit brighter � sometimes intentional to add exaggerated effects. However, its simplicity is attractive.
linuxicons numix circle 9 Beautiful Alternatives To The Default Linux Icon Sets

Unlike other icon sets, you have a choice between square or circle icons. They look the same; only the shape is different. I welcome this option since (as you might already be able to tell) there�s an abundance of square icon sets.

Nitrux

linuxicons nitrux 9 Beautiful Alternatives To The Default Linux Icon Sets

The icons found in the Nitrux set also follow square design principles, but these look much more three-dimensional and glossy. Yet again, this set also has its own style that works great and gels well among itself.

Candy

linuxicons candy 9 Beautiful Alternatives To The Default Linux Icon Sets

If you like the type of icons that come with most distributions, but just don�t like their style, the Candy icon set is for you. Icons here aren�t all squares or circles, but rather just in the shape of whatever the icon depicts. It�s straightforward and not too fancy.

Elementary

linuxicons elementary 9 Beautiful Alternatives To The Default Linux Icon Sets

Elementary OS has been getting a ton of attention from my colleague Akshata, and the broader Linux community, over recent months. Part of the reason: it looks fantastic. The distribution�s icon set has something to do with that, so thankfully you can get it for your own Linux system without having to install Elementary OS. This one is similar in style to Candy, but it does come off as slightly more elegant. Or maybe that�s just the prestige talking.

Mac

linuxicons mac 9 Beautiful Alternatives To The Default Linux Icon Sets

You can�t deny that the icons in Mac OS X look pretty nice, so it�s no surprise that someone made an icon set based off of Apple�s operating system. This isn�t a perfect copy of the icons used in Mac OS X, but the inspiration is clear enough. If you like Apple�s icons, then this is a good icon set for you.

There you go! Those were nine great icon sets that you can try out with ease. Be sure to check out the installation instructions for the icon sets above � while my instructions at the beginning of this article apply to all Linux distributions, there are some icon sets that provide Ubuntu PPAs that make installation easier.
What�s your favorite icon set? What do you like most about it? Let us know in the comments!

Source: http://www.makeuseof.com/tag/9-beautiful-alternatives-default-linux-icons/

Sunday, April 2, 2017

Posted by beni in , , , , , , , , , , , , | April 02, 2017

A general approach to command line switches and their default values in Perl


In the UNIX world youll rarely find a program which doesnt support a few or many arguments (or command line parameters) which influence the execution of the program.

When Perl programs require arguments (one of the simplest cases: an input filename) one could investigate the ARGV hash (an approach which works well in easy cases) or one could turn to one of the Perl modules, in particular if the arguments are command line switches.

In this article I will discuss a few types of command line switches and the possible logic behind.

What is a command line switch?

Just to recap: a command line switch is traditionally denoted as a hyphen followed by a letter optionally followed by a value e.g.  -d or  -d 25 . Note the space between the switch and its value. Some programs require this space whereas other require the value to be attached to the switch like -d25 and still others allow both. Some programs allow switches to be concatenated like  -ltr instead of  -l -t -r . Others allow switches to be more than one letter. Some programs allow a switch to appear multiple times like -v in awk.
Further complexities exist: one switch might override others. Some switches exclude each other mutually.
All these cases would need to be handled properly.

On top of that (I think it was) the GNU world introduced double hyphen switches with (usually) string switches e.g.  --verbose .

In the remainder of this article I will only use the simple case of single letter switches with or without argument. I will be using Getopt::Std, one of the core Perl modules and its function getopts. Its basic usage is  getopts(ab:,%opts); for two switches  -a and  -b foo.

Various types of command line switches with or without default values

The typical distinction between command line switches is whether they are boolean (switched on or off) or carry an additional argument. Then there is the question: if a command line switch is absent should there be a default value used in the program?

The following table explains the differences and shows a few examples.

switchExampleDefaultNotes
 -a 
...falseA boolean switch by its very nature has a default value true or false which should be the opposite of what the switch intends to trigger.
 -d $HOME/tmp 
output directory/tmpCertain things in the program require a default value e.g. the program needs to know where to store its output files. Its left to the programmer to decide which of the default values can be overruled by command line switches.
 -u joe,sandy 
user listcurrent userSome command line switches can take more complex arguments, in this case a comma separated list of users. Its absence should be covered by a reasonable default value e.g. the current user.
 -p 1507 
process idall processesSome switches do specify a setting which acts as a filter or a kind of a restriction but its absence does not imply a default value but is somewhat vague.
In the user list example before another default behaviour could have been all users instead of current user.

Rather than defining a list of variables to set the defaults like

 $OUTDIR = "/tmp"; $USERS = $ENV{USER}; ... 
and later somehow associate these variables with the switches a (in my view) cleaner approach is to
  • define the defaults in a hash (the keys are the switches)
  • create a new hash (again with switches for keys) and set them to either the defaults or values supplied by the command line
    The following Perl program handles the cases above.
  • boolean switches and unspecified defaults are set to undef, all others are set to their reasonable default values.
  • the  ... ? ... : ... operator is used to set the actual variables
    (Getopt::Std sets boolean switches to 1 which represents true, the opposite (and default) could be anything that evaluates to false in an if(...) clause, I chose undef rather than 0).

     #!/usr/bin/perl use strict; use Getopt::Std; # to process command line arguments # Define the defaults in a hash my %defaults; $defaults{"a"} = undef; $defaults{"d"} = "/tmp"; $defaults{"u"} = $ENV{USER}; $defaults{"p"} = undef; # Retrieve the command line switches into a hash # making sure which ones are boolean and which require an argument with : my %opts; getopts(ad:u:p:,%opts); # Put either the default values or the command line switch arguments into a hash my %vars; foreach my $key (keys %defaults) { $vars{$key} = exists $opts{$key} ? $opts{$key} : $defaults{$key} ; } # Test output: see what is contained in vars foreach my $key (keys %vars) { print $key," ",$vars{$key}," "; } print " "; # Check decision tree for boolean and unspecified switches print "a is set " if( $vars{"a"} ); print "p: all processes " unless( $vars{"p"} ); 

    If run without any command line switches:

     u andreas p a d /tmp p: all processes 

    With -a and -u

     ... -a -u joe,sandy u joe,sandy p a 1 d /tmp a is set p: all processes 

    With -p and -d

     ... -d $HOME/tmp -p 1507 u andreas p 1507 a d /export/home/andreas/tmp 

    With this general approach one hash vars contains all the information and its contents can be used directly later in the program (like -d output directory) or used in a decision process defined vs. undefined.

    Of course there are more issues like the ones mentioned above (e.g. conflicting switches) or validity of values (e.g. does the output directory exist and is writable) but they need to be resolved somewhere else in the code.

  • Search