adtac / climate Goto Github PK
View Code? Open in Web Editor NEWThe swiss-army knife of utility tools for Linux.
License: GNU General Public License v3.0
The swiss-army knife of utility tools for Linux.
License: GNU General Public License v3.0
this would be a massive help in being able to package climate using alternative package managers such as pacman
. in the install script, completions mutate config files. it would be better to simply have the completions be seperate, so they can be installed to /usr/share/zsh/site-functions
Usually AGPL is used for applications that are only used on a server (i.e., aren't downloaded to the end user). I think AGPL is not appropriate for a shell helper tool, so this is a request to change the license to GPL (or MIT/BSD) to be friendlier to places where AGPL may not be allowed.
I can do it. I will first look on how I could do it with dynamic autocomplete.
When I type climate update I dot this:
sh: 162: [[: not found
sh: 166: [[: not found
┌───────────────────┐
│ climate installer │
└───────────────────┘
sh: 180: [[: not found
sh: 188: Bad substitution
There is no auto-completion in this version,add the command auto-completion could be better.
coala.io
Hey,
I just tried to install this script. During the installation progress it showed me that npm is not installed. But I have npm installed using nvm
(https://github.com/creationix/nvm)
Running node -v
and npm -v
gives from both the version back.
Would be awesome if the script recognises this.
Have a nice day :)
Nice script, I find some of the ideas are pretty clever. Consider running it through shellcheck, lot of low hanging fruits in there.
For portability reasons (I don't mean BSD and others, there are linux distros in the wild not having bash under /bin/bash):
-#!/bin/bash
+#!/usr/bin/env bash
Every day is a good day to learn something new. The variable is not used anyway.
-ABSOLUTE_PATH="$(cd "$(dirname "${0}")" && pwd)/$(basename "${0}")"
+ABSOLUTE_PATH="$(readlink -nf "${0}")"
Avoid variable leaking (example below).
spinner() {
- spin="\\|/-"
- i=0
+ local spin="\\|/-"
+ local i="0"
bar() {
foo='Hello world!'
}
bar
echo "${foo}"
Always quote variables to avoid splitting.
-while kill -0 $1 2>/dev/null; do
+while kill -0 "$1" &>/dev/null; do
Variables shouldn't be used as printf
formatting string
- printf "\b${spin:$i:1}"
+ printf "\b%s" "${spin:$i:1}"
There is no reason to use single square brackets test. In bash always use double. Also quotes.
extract () {
- if [ -f $1 ] ; then
- if [[ $2 == "" ]]; then
- case $1 in
- *.rar) rar x $1 ${1%.rar}/ ;;
+ if [[ -f "$1" ]] ; then
+ if [[ "$2" == "" ]]; then
+ case "$1" in
+ *.rar) rar x "$1" "${1%.rar}/" ;;
Reading from $1
and $2
and shifting is cleaner than double-shift.
replace() {
- find_this="$1"
- shift
- replace_with="$1"
- shift
+ local find_this="$1"
+ local replace_with="$2"
+ shift 2
Awk is magic; quotes.
- PERCENTAGE=$(upower -i $(upower -e | grep battery) |
- grep "percentage" |
- grep -o "[0-9]*")
+ PERCENTAGE=$(upower -i "$(upower -e | grep battery)" |
+ awk -F: '/percentage/{gsub(/^\s+|\s+$/, "", $2); print $2}')
Backticks are evil, use $()
. Also putting --utc
near every date
in script may be a good idea (yeah, yeah, I know it's %s
).
- date1=$((`date +%s` + $commandargs));
+ local start_date="$(date --utc '+%s')"
+ local stop_date="$(( $now + $commandargs ))"
Should the 2nd if
check for $commandargs
instead?
elif [[ $command == "user-stats" ]]; then
if [[ $command != "" ]]; then
UTC is the time than all other timezones deviate from. ISO 8601 is an international standard for displaying the time and date.
UTC is used a lot to keep international organisations in sync. It allows global communications without ambiguity. The ISO 8601 date standard is similarly used to remove ambiguity. An example ISO 8601 date is 2017-01-17T18:03:26
. The most significant part of the date is placed first. This means files can be much more easily sorted. It is supposed to remove ambiguity from dates (e.g. American dates are structured as MM-DD-YY, while European dates are DD-MM-YY).
I think it is a good idea to implement UTC and ISO 8601 support. The command affected are time
and clock
. I think it would be ideal to have flags like the command date does, where date --utc
returns Tue 17 Jan 18:53:03 UTC 2017
. The user should be able to use the two flags together.
Overall this would improve global communications for millions (ok, a couple) of people :)
when i run climate trash-size
and empty-trash
it throw error Error: Unable to find trash size. Check if ~/.local/share/Trash exists.
. But i have checked and i have the Trash folder in ~/.local/share/Trash
My linux is Debian 8.6 jessie
Could be worth implementing a new climate clip
or a climate c
command similar to climate ix
that pipe stuff on the clipboard?
alias clipboard='xclip -sel clip'
climate stopwatch
date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
i get this error during install
environment: line 162: /etc/bash_completion.d/climate_completion: No such file or directory
, should this file created by me or climate ?
• upower exists!
• curl exists!
• rar missing. Installing... Installed!
• unzip exists!
• 7z missing. Installing... Installed!
• xdg-screensaver exists!
• dig exists!
• git exists!
• python exists!
• pip missing. Installing... Installed!
• node missing. Installing... Installed!
• npm missing. Installing... Installed!
• fdupes missing. Installing... Installed!
• glances missing. Installing... Installed!
• sensors exists!
• sshfs missing. Installing... Installed!
• gawk missing. Installing... Installed!
• jq missing. Installing... Installed!
• http-server missing. Installing... Installed!
• is-up missing. Installing... Installed!
• is-online missing. Installing... Installed!
• speedtest missing. Installing... Installed!
• httpstat missing. Installing... Installed!
I DIDN'T NEED that. How to uninstall all of that?
sudo apt-get purge node
doesn't work
Hi, i would like to see what command is executed when a shortcut runs
For example climate download-file <file>
should show something like The command you just executed was a shortcut to "wget <file> "
I really enjoy the clock command but because of it's implementation it has some things that are a bit annoying. First, it would be nice to have a command to remove the clock. Currently the only way is to kill the process manually or by killing the terminal window. Also, since it uses the tput command, it is not possible to scroll on your terminal, because it is constantly refreshing. Just some thoughts.
Great little app btw!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.