Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use echo and Append Percentage Symbol on WSL #107

Closed
wants to merge 1 commit into from

Conversation

thekpaul
Copy link

@thekpaul thekpaul commented Apr 24, 2023

Instead of straightforwardly calling cat, I've encased the command in echo to enable appending strings. This allows me to add a percentage symbol after calling cat "$battery", like with other battery-related tools.

This also suppresses any echos for machines without battery (i.e. a desktop environment)

@thekpaul thekpaul changed the title Use echo and Append Percentage Symbol Use echo and Append Percentage Symbol on WSL Apr 24, 2023
Instead of straightforwardly calling `cat`, I've encased the command in
`echo` to enable appending strings. This allows me to add a percentage
symbol after calling `cat "$battery"`!

This also suppresses any `echo`s for machines without battery
(i.e. a desktop environment)
@thekpaul
Copy link
Author

Something got messed up in the previous commit, so I refreshed the file locally and did a force push. The commits now appear as expected.

@thekpaul
Copy link
Author

There's a problem when working with wired WSL environments (i.e. a Windows desktop - gasp) where battery-related files are nonexistent to begin with. I'll be building on this commit to provide better return formats for these types of environments, and in the meantime, will be closing this pull request...but I'll be back ;)

@thekpaul
Copy link
Author

Check out #108 for an extended patch targeting WSL containing commits covered above.

@thekpaul thekpaul deleted the master branch May 2, 2023 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant