Created
April 4, 2022 16:11
-
-
Save ntBre/22647852c70bb1f6784c89437487b629 to your computer and use it in GitHub Desktop.
Script to visualize a selected molecular geometry with molden
This file contains hidden or 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
| #!/usr/bin/perl | |
| use warnings; | |
| use strict; | |
| use feature "say"; | |
| use File::Temp qw/ tempfile /; | |
| my ($fh, $filename) = tempfile(); | |
| my $mol = `xclip -o -selection primary`; | |
| $mol =~ s/\s+$//; | |
| my @sp = split /\n/, $mol; | |
| if ($sp[0] !~ /^\s*\d+/) { | |
| say $fh scalar @sp; | |
| say $fh "generated from primary selection by `molecule` script"; | |
| } | |
| say $fh $mol; | |
| exec 'molden', $filename; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment