Created
October 5, 2014 05:03
-
-
Save nickserv/ae337914511c3dfb3be5 to your computer and use it in GitHub Desktop.
Experiments with Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print <STDIN>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prints out information on what software the user is using for different | |
# things. Kind of like Archey, but it just shows the user's default programs | |
# based on his/her environment variables. | |
# Displays one of the items, but only if the environment variable for it is set. | |
sub display_item { | |
print("$_[0] $_[1]\n") if ($_[1]); | |
} | |
# Print ALL the things! | |
display_item("WM: ", $ENV{"XDG_CURRENT_DESKTOP"}); | |
display_item("Shell: ", $ENV{"SHELL"}); | |
display_item("Pager: ", $ENV{"PAGER"}); | |
display_item("Editor: ", $ENV{"EDITOR"}); | |
display_item("GUI Editor:", $ENV{"VISUAL"}); | |
display_item("Browser: ", $ENV{"BROWSER"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment