Code Monkey home page Code Monkey logo

scripts's People

Contributors

brodierobertson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

scripts's Issues

Alternative to 'i3disk' Method

I thought you might be interested in this:

#!/usr/bin/env bash

read -a ARRAY <<< `df -h -l --output=pcent /home`
VALUE="${ARRAY[1]%\%}"
if [ $VALUE -gt 90 ]; then
        printf "\e[1;31m%s%%\e[0m\n" "$VALUE"
else
        printf "%s%%\n" "$VALUE"
fi

It saves the need for and loading up of awk, which I believe is a lot faster (good for polling) but the caveat is that it needs bash, whereas your previous script uses sh. If you're okay with that.

However, this works differently, as I thought I'd offer something slightly different, in that this will instead turn red when the percentile hits and exceeds 90%. On that note, this will show the percentage of space used on the provided device. The previous behavior shouldn't be a problem to replicate, though.

Less parsing is needed too, since df is specifying to only display one field (plus header, sadly).

The code here is more of a proof of concept, by the way; I realise it might be missing some stuff you'd otherwise have.

mntandroid missing

you have defined a shortcut in your i3 config and have a readme entry for "mntandroid", but the script is not in your repo.
is the script really missing, as you are currently using bspwm and there is no shortcut in your shxkd config.

bash scripts marked as sh

I noticed a number of these scripts are marked as #!/bin/sh, but still have some bashisms. I was running some on my system where I have sh linked to dash and had errors due to this (it would be the same on Ubuntu/Debian, where dash is default, I believe). I'd recommend running shellcheck on them all to be careful.

In general:

  • echo flags are not posix compliant, so it's best to use printf "%s" "$var" rather than echo -n "$var".
  • == is a bashism too, but it looks like a simple = would suffice in most places in these scripts.
  • [[ ]] are undefined in posix as well.

Again, shellcheck is the easiest way to know what's what. Otherwise, it's better to mark them as bash scripts.

songnotification - album art

This works for me:
#!/bin/sh
set -e
thumb=$(playerctl metadata --format '{{lc(mpris:artUrl)}}')
song=$(playerctl metadata --format "Title: {{ title }}\nArtist: {{ artist }}\nAlbum: {{ album }}")
convert "$thumb" -flatten -thumbnail 256x256 /home/dboneham/.icons/target && dunstify -I /home/dboneham/.icons/target -t 5000 "Spotify" "$song"

Depends on dunstify, playerctl, convert (ImageMagick)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.