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

Repo For Argos modded scripts #13

Closed
Hippyjake opened this issue Apr 10, 2017 · 41 comments

Comments

Projects
None yet
@Hippyjake
Copy link

commented Apr 10, 2017

https://argos-scripts.github.io

We have a site.

Add your Argos Scripts here!

Leave a comment and I'll update this post with your links to comments, repos and gists.

Users!

Click here to search Github for scripts!

Authors

Add tags to your repos so users have a better chance of finding your scripts. Use "gnome-shell" or "gnome" and "argos"

The List

System Monitor

https://github.com/fadeouter/sysinfo

Network Monitor

#13 (comment)

Stock Quotes

https://github.com/dfaour/argos-scripts/blob/master/getquotes.py

Search For Argos Scripts On Github

https://gist.github.com/Jomik/f90a38877363b7d3d4f15df9ea4380d5

GNOME Shell menu to switch between different PulseAudio sinks

https://gitlab.com/sjohannes/argos-pasink

GiDeviceInfoMenu for the ideviceinfo tool of libimobiledevice displayed via Bitbar or Argos

https://github.com/BobyMCbobs/GiDeviceInfoMenu

CPU monitor

https://github.com/luisfpg/argos-scripts#cpu-monitor-cpu1spy

Memory monitor

https://github.com/luisfpg/argos-scripts#memory-monitor-mem1spy

Network monitor

https://github.com/luisfpg/argos-scripts#network-monitor-net1spy

Safeeyes For Argos

https://github.com/fadeouter/safeeyes

Caffeine Replacement (toggles gnome screensaver)

#13 (comment)

Gnome MFA (Google Multi-factor Authentication)

https://github.com/daniperez/gnome-mfa

Menu of applications you have sandboxed with Firejail

#13 (comment)

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Apr 11, 2017

Script installation can even be made simple using something like Bitbar has.
https://github.com/matryer/bitbar/blob/master/Scripts/bitbar-bundler

@fadeouter

This comment has been minimized.

Copy link

commented Apr 15, 2017

At least we need a place (reddit thread? google sheet?) where could collect links.

@p-e-w

This comment has been minimized.

Copy link
Owner

commented Apr 23, 2017

Given the small user base Argos has at the moment, I'm not sure the overhead of a separate repository is warranted just yet.

If you have scripts to share, why don't you just post them in this issue for now? If a certain number of Argos-specific scripts accumulate this way, we can move them to a more suitable place eventually.

@VVhitehead

This comment has been minimized.

Copy link

commented Apr 23, 2017

Okay then, the following is a simple network/bandwidth monitor script.
It uses bwm-ng which should be the only dependency.

#!/bin/bash

outp=$(bwm-ng -o csv -C ' ' -c 1 | grep eth0 | awk '{printf "%d %d", $3, $4}')
                    #name of the interface^ you want or 'total' 4 all
up=${outp% *}
dl=${outp#* }
dunit="Bps"
uunit="Bps"

if [ $dl -ge 1000 ] && [ $dl -le 1000000 ]; then
  dunit="KBps"
  dl=$(echo "$dl" | awk '{printf("%d",$1 / 1000 + 0.5)}') # (((rounding)))
elif [ $dl -ge 1000000 ]; then
  dunit="MBps"
  dl=$(echo "$dl" | awk '{printf("%d",$1 / 1000000 + 0.5)}')
fi
if [ $up -ge 1000 ] && [ $dl -le 1000000 ]; then
  uunit="KBps"
  up=$(echo "$up" | awk '{printf("%d",$1 / 1000 + 0.5)}') # (((rounding)))
elif [ $up -ge 1000000 ]; then
  uunit="MBps"
  up=$(echo "$up" | awk '{printf("%d",$1 / 1000000 + 0.5)}')
fi

drop=$(bwm-ng -o plain -c 1 | head -n 10 | tail -n 7 | awk '{ORS="\\n"};1')

socketstat=$(ss -s | awk '{ORS="\\n"};1') # ⇡ ⇣ ⇃ ↾

echo "<big>⇣</big>$dl<small>$dunit</small><big></big><big>⇡</big>$up"\
"<small>$uunit</small> | font=monospace size=8 color=#33BEFF refresh=true"
echo "---"
echo "$drop | size=10 font=monospace trim=false bash='bwm-ng; touch $0'"
echo "---"
echo "$socketstat | size=10 font=monospace | bash='ss | less'" # ss -a -A udp
@fadeouter

This comment has been minimized.

Copy link

commented Apr 24, 2017

So, this is my "System monitor" script and it uses SVG to draw realtime CPU chart and memory pie charts.
https://github.com/fadeouter/sysinfo

Upd. (20/06/17):
Now it has HIDPI support!

@dfaour

This comment has been minimized.

Copy link

commented Apr 25, 2017

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Apr 29, 2017

Hey check this out. https://github.com/search?utf8=✓&q=argos+gnome&type=
And https://github.com/search?utf8=✓&q=argos+gnome+topic%3Agnome-shell&type=

I'll contact the authors and see if I can link them here. If I don't hear back I'll add the links for easy searching A wiki page might bee a good Idea.

Oh a good idea might be to add tags to script repos with "gnome-shell" so the search has a better chance of returning the best results.

@Jomik

This comment has been minimized.

Copy link

commented Apr 30, 2017

@Hippyjake Made it a python script, click the name to open the repo in your browser.
https://gist.github.com/Jomik/f90a38877363b7d3d4f15df9ea4380d5

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Apr 30, 2017

@Jomik Amazing work!

@Jomik

This comment has been minimized.

Copy link

commented May 1, 2017

Script installation can even be made simple using something like Bitbar has.
https://github.com/matryer/bitbar/blob/master/Scripts/bitbar-bundler

https://gist.github.com/Jomik/0a3de172bc2f7ee9f17ae97a324077a7

./argos-get.sh USER REPO FILE
./argos-get.sh fadeouter sysinfo sysinfo.1s.sh

@Hippyjake

This comment has been minimized.

Copy link
Author

commented May 1, 2017

Dang @Jomik It would have taken me a week to do that!

@fadeouter

This comment has been minimized.

Copy link

commented May 5, 2017

My analog of Safeyes: https://github.com/fadeouter/safeeyes
For authors may be interesting how I implemented disable/enable script feature.

@lacereation

This comment has been minimized.

Copy link

commented May 9, 2017

This toggles the gnome screensaver. It's the only thing ever to work for me incl. Caffeine. I wrote it for a desktop. There is also an unplugged setting for Notebooks, so it may not be the complete solution for Notebooks.

keep-awake.2s.sh

#!/bin/bash
if [[ $(gsettings get org.gnome.desktop.session idle-delay) == "uint32 0" ]]; then
    i=weather-clear 
else
    i=weather-clear-night 
fi
echo " | iconName=$i"
echo "---"
echo "toggle wakefullness | iconName=$i bash=awake terminal=false"


it works with this script
awake

#!/bin/bash
# awake with no arg toggles sleep/awake mode for screensaver
# awake 1 # keeps awake
# awake 0 # allows screensaver activation
idleDelay=720 #12 mins.
if [[ $1 == 0 ]]; then
    if [[ $(gsettings get org.gnome.desktop.session idle-delay) == "uint32 0" ]]; then
        gsettings set org.gnome.desktop.session idle-delay $idleDelay 
        gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout $idleDelay
        fi
elif [[ $1 == 1 ]]; then
    if [[ $(gsettings get org.gnome.desktop.session idle-delay) == "uint32 $idleDelay" ]]; then
        gsettings set org.gnome.desktop.session idle-delay 0 
        gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
    fi
elif [[ $(gsettings get org.gnome.desktop.session idle-delay) == "uint32 0" ]]; then
    gsettings set org.gnome.desktop.session idle-delay $idleDelay 
    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout $idleDelay
else
    gsettings set org.gnome.desktop.session idle-delay 0 
    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0      
fi

@daniperez

This comment has been minimized.

Copy link

commented May 14, 2017

nice work 👍 !

I created a Google Authenticator -like app to manage OTP/MFA tokens:

https://github.com/daniperez/gnome-mfa

mfa

Feedback welcome!

@filchermcurr

This comment has been minimized.

Copy link

commented May 17, 2017

I have absolutely no idea what I'm doing Bash-wise, so here's my attempt at showing a menu of applications you have sandboxed with Firejail. Theoretically clicking on an entry in the menu will open a terminal inside of the sandbox. It's not very useful, but it was a fun learning experience!

image

#!/bin/bash

list=$(firejail --list | grep -v "firejail --list")
# wc -l will apparently interpret the blank variable as 1, which is undesirable!
if [ -z "$list" ]; then
    jail="0"
else
    jail=$(echo "$list" | wc -l)
fi
echo "<span color='yellow'>🛡️</span>: $jail"
echo "---"
if [ -z "$list" ]; then
    echo "No sandboxed applications running."
else
echo "Sandboxed Applications | size=12"
for x in $list
do
    xpid=$(echo "$x" | awk '{s=index($1,":"); print substr($1, 1, s-1);}')
    if [ "$xpid" != "" ]; then
        printpid="$xpid"
    fi
    if [ -e "$x" ]; then
 	filename="${x##*/}"
    # Icon overrides for those pesky things that don't work quite right.
    if [ "$filename" == "firefox-bin" ]; then
        iconname="firefox-nightly"
    else
        iconname="$filename"
    fi
    echo "$filename (<span color='orangered'><tt>${printpid}</tt></span>) | iconName=${iconname} bash='firejail --join=${printpid}' terminal=true"
fi
done
fi
echo "----"
echo "Refresh... | refresh=true"

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Jul 7, 2017

So I did a thing guys.

https://argos-scripts.github.io

The source is https://github.com/argos-scripts. Forked from the Fisherman site. What do you all think?

The site is setup to read from a text file located in the index repo. The urls can point anywhere repo comment gist whatever. So authors would just fork the index repo, update the file with the new info and make a pull request to be added to the search results.

@fadeouter

This comment has been minimized.

Copy link

commented Aug 13, 2017

hey people, check out the new version of sysinfo script (https://github.com/fadeouter/sysinfo)
i did many impovements in svg drawing part and CPU calculation
i'll be appreciate for any feedback
also, now im in work with this one: http://i.imgur.com/8djJQtE.png
SVG is amazing!

@shaqman

This comment has been minimized.

Copy link

commented Aug 15, 2017

This is interesting stuff.
I checked out https://argos-scripts.github.io and it still seems needs a lot of touch.
Is there any plan to continue on that site? As for now, even the links are still going to Fisherman site.

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Aug 15, 2017

@bluespy Yes I have not had much time to work on it. Are you good at Javascript? Cause im not ha. If you want we can move this conversation to the site repo. The javascript is having a parsing error reading the index file.

@marksev1

This comment has been minimized.

Copy link

commented Aug 19, 2017

So for the MQTT publish I know how to do it and also for MQTT subscribe i figured it out. But I need to press the button that the value refreshes, how do i do it so that it does it automatically:

#!/usr/bin/env bash

MQTT_TEST=$(mosquitto_sub -t 'test/topic' -C 1)
echo "HASS | iconName=utilities-terminal-symbolic"
echo "---"
echo "Living room light | iconName=utilities-terminal-symbolic bash='mosquitto_pub -t "test/topic" -m "helloWorld"' terminal=false"
echo "Bedroom room light | iconName=utilities-terminal-symbolic bash='mosquitto_pub -t "bed/topic" -m "helloWorld"' terminal=false"
echo "Outside light | iconName=utilities-terminal-symbolic bash='mosquitto_pub -t "out/topic" -m "helloWorld"' terminal=false"
echo "---"
echo "$MQTT_TEST| iconName=utilities-terminal-symbolic terminal=false refresh=true"

It looks like this currently

Nevermind I made two extensions one with sensor values that refreshes every 3s and one for actuators...but would be nice if it could be in the same extension :). That some buttons refresh and some no.

@mmuman

This comment has been minimized.

Copy link

commented Sep 3, 2017

Ok let's put mine as well…

Emacs Buffers: emacs.sh

Lists the buffers in running Emacs (you need to have Emacs-Server enabled) and goes right to the selected one.

Freeze processes: freeze.sh

Lists the top processes and allows freezing them, and unfreezing as well.
This helps when, say, Firefox eats up too much RAM and you want to leave it swapped out when working on something else.

Silkaj: silkaj.10m.sh

Silkaj is a python command line client for the DUniter blockchain-based P2P Fair Money system.
I added an "argos" command to Silkaj, so this script just runs it with the command as argument.

VirtualBox VMs: virtualbox.sh

Lists the VirtualBox virtual machines, and allows changing their state.

@fadeouter

This comment has been minimized.

Copy link

commented Sep 3, 2017

Finally, you can try my extension for Weather: https://github.com/fadeouter/argosWeather

@Hippyjake

This comment has been minimized.

Copy link
Author

commented Sep 4, 2017

@fadeouter @mmuman Your scripts have been added to https://argos-scripts.github.io!

@p-e-w

This comment has been minimized.

Copy link
Owner

commented Sep 30, 2017

@fadeouter: That weather extension is... amazing. I am awed by your SVG wizardry!

A quick note to the "Argos community": Although there hasn't been an update in a while, Argos is most definitely not abandoned, and I am planning to make some small tweaks soon, as well as possibly add some new features later.

Also, in the future, Argos will be even more awesome than it is today, because color emoji support has landed in the GNOME stack!!!!! This means that any number of multicolor icons can be inlined in menu items by referencing their name and might allow scripts like the weather extension above to be dramatically simplified at some point.

@domsle

This comment has been minimized.

Copy link

commented Oct 2, 2017

My little snippet, that lets you control external monitors brightness via DDC/CI (most HDMI) here, just insert it into any existing script:

for VARI in {0..100..5}
do
echo "$VARI | bash='sudo /usr/bin/ddcutil --bus=2 setvcp 0x10 $VARI' terminal=false"
done

Required dependancies are: ddcutil, i2c-tools with i2c_dev module enabled.
You also need to add a proper line to your sudoers file, making ddcutil (/usr/bin/ddcutil for me) able to run without password.

After that, you might need to change your --bus=X number to one that ddcutil detect will output, you might as well ignore it but that way it is a bit faster.

Shame that argos does not support mouse scroll actions/sliders.

@mmuman

This comment has been minimized.

Copy link

commented Oct 2, 2017

Interesting, last time I tried ddcutil it just hanged the kernel, but that was a while ago...

@mmuman

This comment has been minimized.

Copy link

commented Oct 2, 2017

As for sliders, I'm quite sure argos would accept patches to support that (and the native slider control would likely handle mouse wheel directly). Would be nice to agree with BitBar on the syntax though.

@OccamsQuattro

This comment has been minimized.

Copy link

commented Oct 10, 2017

https://github.com/OccamsQuattro/ws_time_tracker
This is a time tracking service aimed at freelancers and consultants with gnome shell integration using Argos.

@p-e-w

This comment has been minimized.

Copy link
Owner

commented Mar 4, 2018

I have opened up the Wiki for editing. The Wiki is now the official place for listing Argos plugins; please add your plugins there.

@p-e-w p-e-w closed this Mar 4, 2018

@daniperez

This comment has been minimized.

Copy link

commented Mar 8, 2018

first plugin added to wiki 😆

@p-e-w

This comment has been minimized.

Copy link
Owner

commented Apr 8, 2018

Dear friends of Argos,

in the past weeks I have fixed some long-standing issues and added new capabilities to Argos (see the commit log for details). I intend to submit an update to extensions.gnome.org soon, but would like some confirmation first that everything still works as expected, particularly on older versions of GNOME Shell.

If you have a few minutes to spare, you would help me greatly by manually installing the latest Argos from master and testing your plugins, then dropping a quick comment with the result in this thread, mentioning your GNOME Shell version.

Thanks!

@fadeouter

This comment has been minimized.

Copy link

commented Apr 8, 2018

Hi! Tested the new version in Shell 3.28 (Ubuntu 18.04). All my scripts working fine, noticed better placement of the pop-up menus. Thanks for update!

@mmuman

This comment has been minimized.

Copy link

commented Apr 8, 2018

Seems to work here on a mixture of 3.22 and 3.26.
gnome-shell 3.22.3-3 (but control panel says 3.26.2 !?)
gjs 1.46.0-1+b2
libgjs0e 1.46.0-1+b2

@iSonik

This comment has been minimized.

Copy link

commented Jan 27, 2019

Made a little power draw info tool :)
https://github.com/iSonik/SimpleWattage-Argos

@mmuman

This comment has been minimized.

Copy link

commented Jan 27, 2019

Made a little power draw info tool :)
https://github.com/iSonik/SimpleWattage-Argos

Nice!

I'd use W as suffix though, as it's the unit (Watt), the quantity measured being the power. Btw, some machines have multiple batteries ;-)

Hmm, guess the done is a leftover…

SimpleWattage.5s.sh: 14: SimpleWattage.5s.sh: Syntax error: "done" unexpected
@iSonik

This comment has been minimized.

Copy link

commented Jan 27, 2019

Oh thx. Yeah multiple batteries would have been my next step, and yeah the "done" was an leftover :p oops!
You wrote on my Github page:
; if [ "$Wattage" = 0 ]; then
echo "🗲🔌\n"

So i assume your laptop shows 0 Watt when plugged to the wall? Because my still shows a number. Like (35. the max TDP Wattage which my Laptop jumps to.

Its my first project ever on linux! So i pardon my mistakes :)

@mmuman

This comment has been minimized.

Copy link

commented Jan 27, 2019

So i assume your laptop shows 0 Watt when plugged to the wall? Because my still shows a number.

Only when it has stopped charging actually.

@iSonik

This comment has been minimized.

Copy link

commented Jan 27, 2019

Yeah i fixed that with an update :) has quite some features now

@mmuman

This comment has been minimized.

Copy link

commented Jan 27, 2019

Btw, until you actually push newer commits it's still possible to rewrite them, specially those "update readme" ones, you can squash them, or just commit --amend with new changes ;-)

Oh, and why use tail to read values? it forces a fork+exec while the read with redirect I used avoids it.

Besides, you still only account for the first battery, there is no guarantee that it's the one that will be used. Actually if it gets empty you'll likely start drawing power from the second one, in which case you'll show 0.

And please, don't force color to black, I have a black top bar…

@iSonik

This comment has been minimized.

Copy link

commented Jan 28, 2019

Great input again! Thx.

I currently have an idea to fix the problem with multiple batteries, but i cannot test it since my Mi Laptop has only one (arent multiple batteries quite rare anyways?) Does your laptop have 2 batteries?

Lets say you have Bat0 & Bat1
if your Bat 0 is empty would /sys/class/power_supply/BAT*/status be saying "Empty"?

I am thinking about:
if [ ! "$(ls -A /sys/class/power_supply/BAT1)" ]; then
Here: is the previous code showing wattage and whatnot
else
Here: Check for wattage of Bat 0,
if [Bat0 Wattage = 0 and Battery Status =Empty:]; then show Wattage for Battery 1
else
Use normal code for Bat0

Regarding tail. Is it really that bad?
for b in /sys/class/power_supply/BAT*; do
read mV < "$b/device/power_supply/${b##*/}/voltage_now"
mA=0

I just removed the Force Black Icon :)

@kmeehl

This comment has been minimized.

Copy link

commented Jan 29, 2019

https://github.com/kmeehl/argos-firefox-profile-launcher

This Argos extension finds and lists all Firefox profiles, to make it convenient to launch them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.