Comments (7)
I don't understand why you think deviceid
should be $3 instead of $2.
$0 is the function name, i.e show_menu
here
$1 is devicename
$2 is deviceid
$3 is battery
.
If the name and battery status appear in the menu, that means $1 and $3 are working properly.
from polybar-kdeconnect.
Because with the default settings, the battery status shows the device ID for me. Additionally, the other options didn't work at all until I replaced each $2
with $3
.
from polybar-kdeconnect.
That is weird behaviour. I will do some tests and get back to you
from polybar-kdeconnect.
Can you provide me with info about the shell you are using?
I am not extremely knowledgeable about shell behaviours but I made the following test script
#!/usr/bin/env bash
func () {
echo $0 $1 $2 $3
}
and executed
. ./script.sh; func "arg1" "arg2" "arg3"
and got the following output
func arg1 arg2 arg3
which confirms that at least on my shell (zsh, and previously bash) $0 is the name of the function, $1 is the first argument and so on.
Can you test it and check what output you get?
from polybar-kdeconnect.
I'm using zsh. Per #6, shebangs don't seem to make any difference on my system, so I just symlinked /bin/bash
to /bin/sh
.
Running ./script.sh; func "arg1" "arg2" "arg3"
in zsh returns func arg1 arg2 arg3
, but so does simply inputting func "arg1" "arg2" "arg3"
.
Running . ./test.sh; func "arg1" "arg2" "arg3"
in bash returns bash arg1 arg2 arg3
.
from polybar-kdeconnect.
In any case, in the test script, $1 is arg1. This same behaviour should be happening in the main script as well. I still have no ideas on why this is happening. I will continue working on it.
Edit:
Since the output of the test script is correct, can you run the main script in shell and check how the variables work there?
from polybar-kdeconnect.
I have modified the script to use getopts
. Hopefully it fixes the issue.
from polybar-kdeconnect.
Related Issues (17)
- My keyboard stops working when i click the icon and there is none device paired HOT 4
- error: Disabling module "kdeconnect" (reason: Missing parameter "module/kdeconnect.type") HOT 14
- No such interface org.kde.kdeconnect.device.battery HOT 2
- Polybar freezes and CPU usage 100% HOT 1
- error: Duplicate key name "type" defined on line X HOT 2
- format_underline don't work HOT 2
- Nothing happens when clicking on the icon HOT 12
- Unclosed action blocks HOT 2
- qbus-qt5 HOT 3
- High CPU usage HOT 6
- format error HOT 3
- 56: -1: substring expression < 0 HOT 2
- Using it with standalone rofi HOT 1
- Script Error HOT 14
- Script error HOT 2
- "Syntax error: redirection unexpected" - script uses sh instead bash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polybar-kdeconnect.