Skip to content

Commit

Permalink
module cleanups and tweaks #2
Browse files Browse the repository at this point in the history
  • Loading branch information
lasers committed Feb 7, 2019
1 parent bdd3dbf commit 79842a1
Show file tree
Hide file tree
Showing 33 changed files with 112 additions and 133 deletions.
1 change: 0 additions & 1 deletion py3status/modules/apt_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Display number of pending updates for Debian based Distros.
Thanks to Iain Tatch <iain.tatch@gmail.com> for the script that this is based on.
This will display a count of how many 'apt' updates are waiting to be installed.
Configuration parameters:
Expand Down
8 changes: 3 additions & 5 deletions py3status/modules/async_script.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-
"""
Display output of a given script, updating the display when new lines
come in.
Display output of a given script asynchronously.
Always displays the last line of output from a given script, set by
`script_path`. If a line contains only a color (/^#[0-F]{6}$/), it is
used as such (set force_nocolor to disable).
The script may have parameters.
`script_path`. If a line contains only a color (/^#[0-F]{6}$/), it is used
as such (set force_nocolor to disable). The script may have parameters.
Configuration parameters:
force_nocolor: if true, won't check if a line contains color
Expand Down
4 changes: 2 additions & 2 deletions py3status/modules/backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
the value is changed by a minimal value instead of the brightness_delta.
(default 0)
Format status string parameters:
Format placeholders:
{level} brightness
Requires:
xbacklight: need for changing brightness, not detection
light: program to easily change brightness on backlight-controllers
@author Tjaart van der Walt (github:tjaartvdwalt)
@license BSD
Expand All @@ -43,7 +44,6 @@
"""

from __future__ import division

import os

STRING_NOT_AVAILABLE = "no available device"
Expand Down
2 changes: 0 additions & 2 deletions py3status/modules/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@
format_time = "{name} %H:%M"
}
# Show the time and date in New York
clock {
format = "Big Apple {America/New_York}"
format_time = "%Y-%m-%d %H:%M:%S"
}
# wall clocks
clock {
format = "{Asia/Calcutta} {Africa/Nairobi} {Asia/Bangkok}"
Expand Down
4 changes: 2 additions & 2 deletions py3status/modules/coin_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
thresholds: specify color thresholds to use
(default [(-100, 'bad'), (0, 'good')])
Format placeholder:
Format placeholders:
{format_coin} format for cryptocurrency coins
format_datetime placeholders:
Expand Down Expand Up @@ -85,7 +85,7 @@
("Litecoin", "crimson"),
("Dogecoin", "orange"),
],
"percent_change_24": [(-100, "bad"), (0, "good")],
"percent_change_24h": [(-100, "bad"), (0, "good")],
}
}
Expand Down
4 changes: 0 additions & 4 deletions py3status/modules/dpms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"""
Turn on and off DPMS and screen saver blanking.
This module allows activation and deactivation
of DPMS (Display Power Management Signaling)
by clicking on 'DPMS' in the status bar.
Configuration parameters:
button_off: mouse button to turn off screen (default None)
button_toggle: mouse button to toggle DPMS (default 1)
Expand Down
11 changes: 7 additions & 4 deletions py3status/modules/emerge_status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""
Emerge_status provides a short information on the current
emerge status if there is an emerge process currently running
Display information about the currently running emerge process.
Configuration parameters:
cache_timeout: how often we refresh this module in second.
Expand All @@ -10,7 +9,9 @@
emerge_log_file: path to the emerge log file.
(default '/var/log/emerge.log')
format: display format for this module
(default '{prefix}[\?if=is_running : [\?if=!total=0 [{current}/{total} {action} {category}/{pkg}]|calculating...]|: stopped 0/0]')
*(default '{prefix}[\?if=is_running : [\?if=!total=0 '
'[{current}/{total} {action} {category}/{pkg}]'
'|calculating...]|: stopped 0/0]')*
prefix: prefix in statusbar
(default "emrg")
Expand All @@ -25,7 +26,9 @@
```
# Hide if not running
emerge_status {
format = "[\?if=is_running {prefix}: [\?if=!total=0 {current}/{total} {action} {category}/{pkg}|calculating...]]"
format = "[\?if=is_running {prefix}: [\?if=!total=0 "
format += "{current}/{total} {action} {category}/{pkg}"
format += "|calculating...]]"
}
# Minimalistic
Expand Down
9 changes: 4 additions & 5 deletions py3status/modules/external_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"""
Display output of a given script.
Display output of any executable script set by `script_path`.
Only the first two lines of output will be used. The first line is used
as the displayed text. If the output has two or more lines, the second
line is set as the text color (and should hence be a valid hex color
code such as #FF0000 for red).
Display output of any executable script set by `script_path`. Only the first
two lines of output will be used. The first line is used as the displayed
text. If the output has two or more lines, the second line is set as the text
color (and should hence be a valid hex color code such as #FF0000 for red).
The script should not have any parameters, but it could work.
Configuration parameters:
Expand Down
3 changes: 1 addition & 2 deletions py3status/modules/fedora_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Display number of pending updates for Fedora Linux.
This will display a count of how many `dnf` updates are waiting
to be installed.
Additionally check if any update security notices.
to be installed. Additionally check for update security notices.
Configuration parameters:
cache_timeout: How often we refresh this module in seconds
Expand Down
3 changes: 2 additions & 1 deletion py3status/modules/file_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
path: print a color based on the number of paths
Examples:
# add multiple paths with wildcard or with pathnames
```
# add multiple paths with wildcard or with pathnames
file_status {
paths = ['/tmp/test*', '~user/test1', '~/Videos/*.mp4']
}
Expand All @@ -43,6 +43,7 @@
format_path_separator = ', '
}
```
@author obb, Moritz Lüdecke, Cyril Levis (@cyrinux)
SAMPLE OUTPUT
Expand Down
16 changes: 5 additions & 11 deletions py3status/modules/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
open: If button then the frame can be set to be open or close
(default True)
Format of status string parameters:
Format placeholders:
{button} If used a button will be used that can be clicked to hide/show
the contents of the frame.
{output} The output of the modules in the frame
Example config:
Examples:
```
# A frame showing times in different cities.
# We also have a button to hide/show the content
frame time {
format = '{output}{button}'
format_separator = ' ' # have space instead of usual i3bar separator
Expand All @@ -39,28 +37,24 @@
format = "LA %H:%M"
timezone = "America/Los_Angeles"
}
tztime ny {
format = "NY %H:%M"
timezone = "America/New_York"
}
tztime du {
format = "DU %H:%M"
timezone = "Asia/Dubai"
}
}
# Define a group which shows volume and battery info
# or the current time.
# The frame, volume_status and battery_level modules are named
# to prevent them clashing with any other defined modules of the same type.
# Define a group which shows volume and battery info or the current time.
# The frame, volume_status and battery_level modules are named to prevent
# them clashing with any other defined modules of the same type.
group {
frame {
volume_status {}
battery_level {}
}
time {}
}
```
Expand Down
4 changes: 0 additions & 4 deletions py3status/modules/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@
# Create a disks group that will show space on '/' and '/home'
# Change between disk modules every 30 seconds
...
order += "group disks"
...
group disks {
cycle = 30
format = "Disks: {output} {button}"
Expand All @@ -72,7 +69,6 @@
disk "/" {
format = "/ %avail"
}
disk "/home" {
format = "/home %avail"
}
Expand Down
4 changes: 2 additions & 2 deletions py3status/modules/hueshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
thresholds: specify color thresholds to use
(default [(6499, '#f6c'), (6500, '#ff6'), (6501, '#6cf')])
Control placeholder:
Control placeholders:
{enabled} a boolean based on pgrep processing data, eg False, True
Format placeholder:
Format placeholders:
{color_temperature} color temperature, eg 6500
{name} name, eg Blueshift, Redshift, Sct
Expand Down
6 changes: 3 additions & 3 deletions py3status/modules/i3block.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
as in i3blocks configuration. Currently blocklets must provide responses
in the standard i3blocks manner of one line per value (not as json).
@author tobes
Examples
Examples:
```
# i3blocks config
[time]
Expand Down Expand Up @@ -72,6 +70,8 @@
}
```
@author tobes
SAMPLE OUTPUT
{'full_text': 'wifi:100%', 'color': '#00FF00'}
Expand Down
2 changes: 1 addition & 1 deletion py3status/modules/i3pystatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# the modules parameters are provided as such
i3pystatus clock {
module = 'clock'
format = [ ('%a %b %-d %b %X', 'America/New_York'), ('%X', 'Etc/GMT+9') ]
format = [('%a %b %-d %b %X', 'America/New_York'), ('%X', 'Etc/GMT+9')]
}
# if backend(s) are provided they should be given as a dict with the key being
Expand Down
4 changes: 4 additions & 0 deletions py3status/modules/icinga2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
user: username to authenticate against the icinga-web2 interface
(default '')
Format placeholders:
{status_name} status name, eg OK, WARNING, CRITICAL
{count} count, eg 0, 1, 2
@author Ben Oswald <ben.oswald@root-space.de>
@license BSD License <https://opensource.org/licenses/BSD-2-Clause>
@source https://github.com/nazco/i3status-modules
Expand Down
18 changes: 6 additions & 12 deletions py3status/modules/mpd_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
state_play: label to display for "playing" state (default '[play]')
state_stop: label to display for "stopped" state (default '[stop]')
Color options:
color_pause: Paused, default color_degraded
color_play: Playing, default color_good
color_stop: Stopped, default color_bad
Format placeholders:
{state} state (paused, playing. stopped) can be defined via `state_..`
configuration parameters
Expand All @@ -32,16 +27,15 @@
`next_` to retrieve the data for the song following the one currently
playing.
Color options:
color_pause: Paused, default color_degraded
color_play: Playing, default color_good
color_stop: Stopped, default color_bad
Requires:
python-mpd2: (NOT python2-mpd2)
```
# pip install python-mpd2
```
Note: previously formats using %field% where allowed for this module, but
standard placeholders should be used.
Examples of `format`
Examples:
```
# Show state and (artist -) title, if no title fallback to file:
{state} [[[{artist} - ]{title}]|[{file}]]
Expand Down
4 changes: 2 additions & 2 deletions py3status/modules/mpris.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
state_play: text for placeholder {state} when song is playing (default '▶')
state_stop: text for placeholder {state} when song is stopped (default '◾')
Format of status string placeholders:
Format placeholders:
{album} album name
{artist} artiste name (first one)
{length} time duration of the song
Expand All @@ -37,7 +37,7 @@
{time} played time of the song
{title} name of the song
Format of button placeholders:
Button format placeholders:
{next} play the next title
{pause} pause the player
{play} play the player
Expand Down
17 changes: 6 additions & 11 deletions py3status/modules/rainbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,25 @@
steps: Number of steps between each color in the gradient
(default 10)
Example config:
Format placeholders:
{output} rainbow output
Examples:
```
order += "rainbow time"
# show time colorfully
order += "rainbow time"
rainbow time {
time {}
}
```
Example blinking config:
```
order += "rainbow blink_time"
# blinking text black/white
rainbow blink_time{
order += "rainbow blink_time"
rainbow blink_time {
gradient = [
'#FFFFFF',
'#000000',
]
steps = 1
time {}
}
```
Expand Down
2 changes: 1 addition & 1 deletion py3status/modules/rate_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{total_hours} The total number of whole hours in running timer
{total_mins} The total number of whole minutes in running timer
Money placeholders:
format_money placeholders:
{price} numeric value of money
Color options:
Expand Down
Loading

0 comments on commit 79842a1

Please sign in to comment.