Closed Hippyjake closed 6 years ago
Script installation can even be made simple using something like Bitbar has. https://github.com/matryer/bitbar/blob/master/Scripts/bitbar-bundler
At least we need a place (reddit thread? google sheet?) where could collect links.
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.
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
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!
Script to show stock quotes:
https://github.com/dfaour/argos-scripts/blob/master/getquotes.py
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.
@Hippyjake Made it a python script, click the name to open the repo in your browser. https://gist.github.com/Jomik/f90a38877363b7d3d4f15df9ea4380d5
@Jomik Amazing work!
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
Dang @Jomik It would have taken me a week to do that!
My analog of Safeyes: https://github.com/fadeouter/safeeyes For authors may be interesting how I implemented disable/enable script feature.
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
nice work 👍 !
I created a Google Authenticator -like app to manage OTP/MFA tokens:
https://github.com/daniperez/gnome-mfa
Feedback welcome!
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!
#!/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"
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.
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!
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.
@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.
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:
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.
Ok let's put mine as well…
Lists the buffers in running Emacs (you need to have Emacs-Server enabled) and goes right to the selected one.
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 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.
Lists the VirtualBox virtual machines, and allows changing their state.
Finally, you can try my extension for Weather: https://github.com/fadeouter/argosWeather
@fadeouter @mmuman Your scripts have been added to https://argos-scripts.github.io!
@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.
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.
Interesting, last time I tried ddcutil it just hanged the kernel, but that was a while ago...
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.
https://github.com/OccamsQuattro/ws_time_tracker This is a time tracking service aimed at freelancers and consultants with gnome shell integration using Argos.
I have opened up the Wiki for editing. The Wiki is now the official place for listing Argos plugins; please add your plugins there.
first plugin added to wiki :laughing:
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!
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!
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
Made a little power draw info tool :) https://github.com/iSonik/SimpleWattage-Argos
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
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 :)
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.
Yeah i fixed that with an update :) has quite some features now
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…
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 :)
https://github.com/kmeehl/argos-firefox-profile-launcher
This Argos extension finds and lists all Firefox profiles, to make it convenient to launch them.
RSS Reader
i adapted this script "https://github.com/akras14/eznews/blob/master/index.php" to make it works on argos
HELP....! SCRIPT for Argos Notify Birthdays in system status area it's possible ?
Hi everyone I used a gnome extension shell "Notify Birthdays" for a very long time and with gnome shell 3.34 stopped working, I tried to contact the author without success, he abandoned the project.
I kindly ask if possible to create a script for Argos that notifies the birthdays with a small icon and a facsimile of the "Notify Birthdays" extension with notification in system status area https://extensions.gnome.org/extension/687/birthdays_notify/
Thank you all for your kind attention.
Found on the net : https://easyoradba.com/2019/01/20/having-fun-with-shell-scripting-send-birthday-email-alerts-via-a-shell-script/
Adaptation : birthday.txt data.txt
I'm not a dev !!! ;-) icon is in base64 you have to rename birthday.txt => birthday.sh data.txt => data put the right path of data file it works on my PC good luck
Thank you so much as soon as I get home I'll try the script thanks a lot ....
I have made a Spotify extension. https://github.com/Skillzore/argosSpotifyExtension It has been on the wiki for a while, would be nice to have it searchable on https://argos-scripts.github.io as well :)
@Skillzore i've added it!
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
https://github.com/p-e-w/argos/issues/13#issuecomment-296490068
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)
https://github.com/p-e-w/argos/issues/13#issuecomment-300304939
Gnome MFA (Google Multi-factor Authentication)
https://github.com/daniperez/gnome-mfa
Menu of applications you have sandboxed with Firejail
https://github.com/p-e-w/argos/issues/13#issuecomment-301972212