Skip to content

Instantly share code, notes, and snippets.

@nickserv
Created October 5, 2014 05:03
Show Gist options
  • Save nickserv/ae337914511c3dfb3be5 to your computer and use it in GitHub Desktop.
Save nickserv/ae337914511c3dfb3be5 to your computer and use it in GitHub Desktop.
Experiments with Perl
print <STDIN>;
# 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