no more polybar

This commit is contained in:
Nemo 2021-01-20 13:22:33 +05:30
parent aec042b2ef
commit 0cdf920bd3
15 changed files with 0 additions and 1104 deletions

View File

@ -1 +0,0 @@
scripts/poem.txt

View File

@ -1,219 +0,0 @@
# Polybar Nord
> Collection of Polybar theme and module.
The theme and module collection for [Polybar](https://github.com/polybar/polybar) based on [Nord](https://www.nordtheme.com/) colors. This theme provides two bar setups, each of them has light and dark variants. Besides the official modules, there are also scripts from [polybar-scripts](https://github.com/polybar/polybar-scripts) and myself which are configured to suit the theme.
![i3-nord-dark.png](https://github.com/Yucklys/polybar-nord-theme/raw/master/polybar-nord.png)
<!--more-->
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [File Structure](#file-structure)
- [Module Details](#module-details)
## Install
### Dependency
Required dependency:
1. [Font Awesome](https://www.archlinux.org/packages/community/any/ttf-font-awesome/)
Optional dependency:
1. [Weather Icon](https://github.com/erikflowers/weather-icons)required by `weather` module to display weather icon
2. Dunst required by `notify` module to display history notify
3. redshift required by `backlight` module to toggle redshift service
### Install by `git clone` (recommand)
```shell
git clone https://github.com/Yucklys/polybar-nord-theme ~/.config/polybar/
```
`~/.config/polybar` is the default path for polybar configuration, if you want to use other location, change `~/.config/polybar` to your location and also change the location specified in the `launch.sh` file.
## Usage
1. Enter the installation directory `cd ~/.config/polybar`.
2. Run `./launch.sh light` for light theme, and `./launch.sh dark` for dark theme.
3. For customization, most of the options are listed in `nord-config` file. For more details, check [File Structure](#File Structure) part.
4. `pkill polybar` to kill the bars.
## File Structure
### `dark-colors` and `light-colors`
The color for dark and light theme. You don't need to edit these flies unless you want to change the color globally.
### `dark-config` and `light-config`
The config files for dark and light theme. Most of the settings are covered by `nord-config` except font settings. You can change the font setting in these files.
### `nord-config`
The global config file. You can customize the position of the bars, DPI setting, modules, etc. The detailed help messages are in the comment for each option.
### `nord-top` and `nord-down`
The modules for top and bottom bar setup. For some specific modules you need to edit these files. For more details of these modules check [Module Details](#Module Details).
### `scripts`
The directory contains all the scripts and files that required by the modules.
## Module Details
1. [alsa](#alsa)
2. [backlight](#backlight)
3. [date](#date)
4. [notify (基于dunst)](#notify)
5. [network-detail](#network-detail)
6. [network-short](#network-short)
7. [battery](#battery)
8. [keyboard](#keyboard)
10. [mpd](#mpd)
11. [i3](#i3)
12. [workspace-name](#workspace-name)
13. [title](#title)
14. [weather](#weather)
15. [info-hackspeed](#info-hackspeed)
16. [github](#github)
17. [daily-poem](#daily-poem)
18. [temperature](temperature)
19. [memory](#memory)
20. [cpu](#cpu)
21. [show-desktop](#show-desktop)
### alsa
Display current volume. The default sound card is `default`, you can change this option in `nord-config`.
| Bind | Event |
| ---------------- | -------------------- |
| mouse left click | toggle mute |
| scroll up | volume + 5% for each |
| scroll down | volume - 5% for each |
### backlight
Display current lightness of screen.
| Bind | Event |
| ---------------- | ----------------------- |
| scroll up | lightness + 5% for each |
| scroll down | lightness - 5% for each |
| mouse left click | toggle redshift |
### date
Display date and time.
| Bind | Event |
| ---------------- | ------------------------------- |
| mouse left click | switch between date/time format |
### notify
Notify icon.
| Bind | Event |
| -------- | ------------------------------------------------------------ |
| mouse left click | key event `ctrl+grave`, the default hotkey for dunst history notify |
### network-detail
Display upload and download speed in KB/s. Need to set your network interface at `nord-config.interface`.
### network-short
Display network connection icon. By defailt left click on the icon will call `networkmanager-dmenu`. For more details of this you can check [networkmanager-dmenu](https://github.com/firecat53/networkmanager-dmenu).
| Bind | Event |
|:---------|:---------------------|
| mouse left click | networkmanager-dmenu |
### battery
Display battery infomation. Requires to set `nord-config.battery-full-at`, `nord-config.battery-bat` and `nord-config.battery-adp`.
### keyboard
Display keyboard CapsLock indicator.
### mpd
Display mpd information. It is hidden when mpd process does not running. There are three layout corresponding to **play**, **pause** and **stop**.
- Display full content when in play status, including *pause*, *prev*, *artist - song*, *next*, *stop*, *progress bar*, *cycle* and *random*.
- Display part of the content when in pause status, including *play*, *prev*, *artist - song*, *next*, *stop*.
- Display *play* only in stop status.
Requires `nord-config.mpd-host` and `nord-config.mpd-port`.
### i3
Display i3 workspace icon. Icon list can be customized in `nord-top`.
| Bind | Event |
| -------- | ------------------------ |
| mouse left click | i3-msg workspace <index> |
| scroll up | i3-msg workspace prev |
| scroll down | i3-msg workspace next |
### workspace-name
Display the name of current workspace which is defined in the configuration of i3. The format should be `index:identifier`, for example `1:Home`.
### title
Display the title of current active window.
### weather
Display weather information from Openweather with scripts [polybar/polybar-scripts/openweather-fullfeatured](https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured). Personal API and city code is required. For more detailed usage check the project's README.
### info-hackspeed
Display the speed of inputting in cpm(char per minute) or wpm (word per minute). The script comes from [polybar/polybar-scripts/info-hackspeed](https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/info-hackspeed).
### daily-poem
Display Chese poem. The API is from [今日诗词 API](https://www.jinrishici.com/). Before usage you need to get your token from https://v2.jinrishici.com/token and replace mine in `nord-dowm`.
| content | index |
| ---- | ----- |
| 日落,风 | 2 |
| 唐代·李白 宫中行乐词八首 | 1 |
| 烟花宜落日,丝管醉春风 | 0 (initial value) |
| Bind | Event |
| -------- | ------------ |
| scroll up | index += 1 |
| scroll down | index -= 1 |
| mouse left double click | update poem and reset index |
### temperature
Display internal temperature. You can specify the thermal-zone in `nord-config.thermal-zone`, the default value is 0. When the temperature is lower than `nord-config.base-temperature` it will switch to lowest temperature layout; when the temperature is higher than `nord-config.warn-temperature` is will switch to warning temperature layout. The color of icon will change between `base-temperature` and `warn-temperature`, so set the proper values for your environment.
### memory
Display memory usage in the format used/total.
### cpu
Display CPU usage.
### show-desktop
Display desktop. By default it will switch to `25:Desktop`. You can customize this in `nord-down`.
| Bind | Event |
| -------- | --------------------------- |
| mouse left click | i3-msg workspace 25:Desktop |

View File

@ -1,15 +0,0 @@
; vim:ft=dosini
[colors]
background = #2E3440
buffer = #3B4252
foreground = #D8DEE9
nord6 = #ECEFF4
nord7 = #8FBCBB
nord8 = #88C0D0
nord9 = #81A1C1
urgent = #BF616A
warning = #D08770
notify = #EBCB8B
success = #A3BE8C
function = #B48EAD

View File

@ -1,92 +0,0 @@
; vim:ft=dosini
[global-wm]
include-file = $HOME/.config/polybar/dark-colors
include-file = $HOME/.config/polybar/nord-top
include-file = $HOME/.config/polybar/nord-down
include-file = $HOME/.config/polybar/nord-config
[bar/nord-top]
monitor = ${env:MONITOR:DP1}
width = ${config.width}
height = ${config.height}
offset-x = ${config.offset-x}
offset-y = ${config.offset-y}
radius = ${config.radius}
fixed-center = ${config.fixed-center}
dpi = ${config.dpi}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = ${config.line-size}
padding-left = 0
padding-right = 0
override-redirect = ${config.override-redirect}
module-margin = 1
font-0 = FiraCodeRegular:pixelsize=12
font-1 = FontAwesome5FreeSolid:pixelsize=12;1
font-2 = FontAwesome5FreeRegular:pixelsize=12;1
font-3 = FontAwesome5Brands:pixelsize=8;1
font-4 = WenQuanYiMicroHei:size=12
modules-left = ${config.top-left}
modules-center = ${config.top-center}
modules-right = ${config.top-right}
tray-position = ${config.systray-top}
tray-padding = 3
tray-detached = false
tray-maxsize = 22
cursor-click = pointer
cursor-scroll = ns-resize
[bar/nord-down]
monitor = ${env:MONITOR:DP1}
width = ${config.width}
height = ${config.height}
offset-x = ${config.offset-x}
offset-y = ${config.offset-y}
radius = ${config.radius}
fixed-center = ${config.fixed-center}
bottom = true
dpi = ${config.dpi}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = ${config.line-size}
padding = 2
override-redirect = ${config.override-redirect}
module-margin = 2
font-0 = FiraCodeRegular:pixelsize=12
font-1 = Font Awesome 5 Free:style=Solid:pixelsize=12;1
font-2 = Font Awesome 5 Brands:pixelsize=8;1
font-3 = Weather Icons:style=Regular:size=12;1
font-4 = WenQuanYiMicroHei:size=12
modules-left = ${config.bottom-left}
modules-center = ${config.bottom-center}
modules-right = ${config.bottom-right}
tray-position = ${config.systray-bottom}
tray-padding = 3
tray-detached = false
tray-maxsize = 22
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch bar1 and bar2
if [ "$1" == "light" ]
then
polybar -c $HOME/.config/polybar/light-config nord-top &
polybar -c $HOME/.config/polybar/light-config nord-down &
else
polybar -c $HOME/.config/polybar/dark-config nord-top &
polybar -c $HOME/.config/polybar/dark-config nord-down &
fi
echo "Bars launched..."

View File

@ -1,15 +0,0 @@
; vim:ft=dosini
[colors]
background = #D8DEE9
buffer = #3B4252
foreground = #2E3440
nord6 = #ECEFF4
nord7 = #8FBCBB
nord8 = #88C0D0
nord9 = #81A1C1
urgent = #BF616A
warning = #D08770
notify = #EBCB8B
success = #A3BE8C
function = #B48EAD

View File

@ -1,91 +0,0 @@
; vim:ft=dosini
[global-wm]
include-file = $HOME/.config/polybar/light-colors
include-file = $HOME/.config/polybar/nord-top
include-file = $HOME/.config/polybar/nord-down
include-file = $HOME/.config/polybar/nord-config
[bar/nord-top]
monitor = ${env:MONITOR:eDP1}
width = ${config.width}
height = ${config.height}
offset-x = ${config.offset-x}
offset-y = ${config.offset-y}
radius = ${config.radius}
fixed-center = ${config.fixed-center}
dpi = ${config.dpi}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = ${config.line-size}
padding-left = 0
padding-right = 0
override-redirect = ${config.override-redirect}
module-margin = 1
font-0 = FiraCodeRegular:pixelsize=12
font-1 = FontAwesome5FreeSolid:pixelsize=12;1
font-2 = FontAwesome5FreeRegular:pixelsize=12;1
font-3 = FontAwesome5Brands:pixelsize=8;1
font-4 = WenQuanYiMicroHei:size=12
modules-left = ${config.top-left}
modules-center = ${config.top-center}
modules-right = ${config.top-right}
tray-position = ${config.systray-top}
tray-padding = 0
tray-detached = false
tray-maxsize = 30
cursor-click = pointer
cursor-scroll = ns-resize
[bar/nord-down]
monitor = ${env:MONITOR:eDP1}
width = ${config.width}
height = ${config.height}
offset-x = ${config.offset-x}
offset-y = ${config.offset-y}
radius = ${config.radius}
fixed-center = ${config.fixed-center}
bottom = true
dpi = ${config.dpi}
background = ${colors.background}
foreground = ${colors.foreground}
line-size = ${config.line-size}
padding = 2
module-margin = 2
font-0 = FiraCodeRegular:pixelsize=12
font-1 = Font Awesome 5 Free:style=Solid:pixelsize=12;1
font-2 = Font Awesome 5 Brands:pixelsize=8;1
font-3 = Weather Icons:style=Regular:size=12;1
font-4 = WenQuanYiMicroHei:size=12
modules-left = ${config.bottom-left}
modules-center = ${config.bottom-center}
modules-right = ${config.bottom-right}
tray-position = ${config.systray-bottom}
tray-padding = 3
tray-detached = false
tray-maxsize = 22
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true

View File

@ -1,102 +0,0 @@
; vim:ft=dosini
[config]
# DPI value for HiDPI screen
dpi = 96
# bar position, apply globally
width = 100%
height = 2%
offset-x = 0%
offset-y = 0%
radius = 0.0
fixed-center = true
override-redirect = false
# module list:
# alsa: Display current volume
# backlight: Display screen brightness
# date: Display date
# notify: Notify icon, can customize its binding
# network-short: Network connect icon, can customize its binding
# battery: Battery info
# keyboard: CapsLock indicator
# mpd: mpd status and controls
# i3: i3 workspace icons
# workspace-name: i3 current workspace name, need to be in the format like "1:Home"
# title: title of the active window
# network-detail: Download and upload speed
# weather: Display openweather info
# info-hackspeed: Numper of characters clicked per minute
# daily-poem: Display poem
# temperature: Display internal temperature
# memory: Display memory usage
# cpu: Display cpu usage
# show-desktop: Display desktop (i3 only)
# Top modules
top-left = i3 title
top-center =
top-right = keyboard backlight alsa network-short date
# Bottom modules
bottom-left = info-hackspeed
bottom-center = daily-poem
bottom-right = temperature memory cpu
systray-top = none
systray-bottom = left
# global style
line-size = 6
# Modules configure option
# the default value in this section should work in most cases,
# if some of them doesn't suit your environment, you can change
# it from here.
# network interface, check by `ip link show`
interface = wlan0
# when the current battery capacity excess this value,
# the full-capacity format will be displayed.
battery-full-at = 95
# battery and adapter
battery-bat = BAT0
battery-adp = AC
# soundcard setting
master-soundcard = default
speaker-soundcard = default
headphone-soundcard = default
master-mixer = Master
# mpd service connection setting
mpd-host = 127.0.0.1
mpd-port = 6600
thermal-zone = 0
# Base temperature for where to start the ramp (in degrees celsius)
base-temperature = 20
# Threshold temperature to display warning label (in degrees celsius)
warn-temperature = 70
# GitHub personal token, generate from https://github.com/settings/tokens/new?scopes=notifications&description=Notifier+for+Polybar
# where select at least `notifications` option
github-token = 00ed987a6d7efd532c5b4ca0849c2803228d1b5d
# notify module setting
notify-click-left = xdotool key control+grave
# network module setting
network-click-left = i3-msg workspace 2
# i3
# Only show workspaces defined on the same output as the bar
#
# Useful if you want to show monitor specific workspaces
# on different bars
#
# Default: false
i3-pin-workspaces = false

View File

@ -1,120 +0,0 @@
; vim:ft=dosini
[module/cpu]
type = internal/cpu
interval = 1
format = <ramp-load> <label>
ramp-load-0 = 
ramp-load-0-foreground = ${colors.success}
ramp-load-1 = 
ramp-load-1-foreground = ${colors.warning}
ramp-load-2 = 
ramp-load-2-foreground = ${colors.urgent}
[module/show-desktop]
type = custom/text
content = 
click-left = i3-msg workspace 25:Desktop
[module/memory]
type = internal/memory
interval = 3
format = <ramp-used> <label>
label = %gb_used%/%gb_total%
ramp-used-0 = 
ramp-used-0-foreground = ${colors.success}
ramp-used-1 = 
ramp-used-1-foreground = ${colors.warning}
ramp-used-2 = 
ramp-used-2-foreground = ${colors.urgent}
[module/github]
type= internal/github
token = ${config.github-token}
empty-notifications = false
interval = 10
label =  %notifications%
[module/daily-poem]
type = custom/ipc
# replace B25KQR2Z50dxWG2oLX+PfPG5OqP/BG4s with your token from https://v2.jinrishici.com/token.
hook-0 = ~/.config/polybar/scripts/daily-poem require B25KQR2Z50dxWG2oLX+PfPG5OqP/BG4s ~/.config/polybar/scripts/poem.txt
hook-1 = ~/.config/polybar/scripts/daily-poem get ~/.config/polybar/scripts/poem.txt plus
hook-2 = ~/.config/polybar/scripts/daily-poem get ~/.config/polybar/scripts/poem.txt minus
initial = 1
scroll-up = polybar-msg -p %pid% hook daily-poem 2
scroll-down = polybar-msg -p %pid% hook daily-poem 3
double-click-left = polybar-msg -p %pid% hook daily-poem 1
format-underline = ${colors.nord7}
[module/network-detail]
type = internal/network
interface = ${config.interface}
interval = 3
format-connected = <label-connected>
label-connected =  %downspeed:9%  %upspeed:9%
label-connected-foreground = ${colors.success}
[module/temperature]
type = internal/temperature
thermal-zone = ${config.thermal-zone}
base-temperature = ${config.base-temperature}
warn-temperature = ${config.warn-temperature}
; Format
format = <ramp> <label>
format-warn = <label-warn>
format-warn-background = ${colors.foreground}
label-warn =  %temperature-c%
label-warn-padding = 1
label-warn-foreground = ${colors.urgent}
label-warn-background = ${colors.foreground}
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-3 = 
ramp-4 = 
ramp-0-foreground = ${colors.nord8}
ramp-1-foreground = ${colors.nord8}
ramp-2-foreground = ${colors.success}
ramp-3-foreground = ${colors.success}
ramp-4-foreground = ${colors.warning}
[module/info-hackspeed]
type = custom/script
exec = ~/.config/polybar/scripts/info-hackspeed.sh
tail = true
[module/weather]
type = custom/script
exec = ~/.config/polybar/scripts/openweathermap-fullfeatured.sh
interval = 600
label-font = 4

View File

@ -1,262 +0,0 @@
; vim:ft=dosini
[module/i3]
type = internal/i3
pin-workspaces = ${config.i3-pin-workspaces}
strip-wsnumbers = true
index-sort = true
enable-click = true
enable-scroll = true
wrapping-scroll = true
reverse-scroll = true
fuzzy-match = false
; Available tags:
; <label-state> (default) - gets replaced with <label-(focused|unfocused|visible|urgent)>
; <label-mode> (default)
format = <label-state> <label-mode>
; icons
ws-icon-0 = 1:Home;
ws-icon-1 = 2:Browser;
ws-icon-2 = 3:Coding;
ws-icon-3 = 4:Learning;
ws-icon-4 = 5:Fun;
ws-icon-5 = 25:Desktop;
ws-icon-default = 
; color
label-focused = 
label-focused-underline = ${colors.nord7}
label-focused-foreground = ${colors.nord7}
label-focused-padding = 2
label-unfocused = •
label-unfocused-foreground = ${colors.nord9}
label-unfocused-padding = 2
label-urgent = 
label-urgent-foreground = ${colors.urgent}
label-urgent-background = ${colors.foreground}
label-urgent-padding = 2
; seperator
label-separator = |
label-separator-foreground = ${colors.buffer}
[module/workspace-name]
type = internal/i3
strip-wsnumbers = true
format = <label-state>
label-focused = %name%
label-focused-padding = 2
label-focused-foreground = ${colors.nord7}
label-focused-underline = ${colors.nord7}
label-unfocused =
label-urgent = %name%
label-urgent-foreground = ${colors.urgent}
label-urgent-background = ${colors.foreground}
label-urgent-padding = 2
[module/title]
type = internal/xwindow
format-foreground = ${colors.nord7}
format-underline = ${colors.nord7}
format-padding = 4
label-maxlen = 20
label-empty = Desktop
[module/date]
type = internal/date
interval = 1.0
; See "http://en.cppreference.com/w/cpp/io/manip/put_time" for details on how to format the date string
; NOTE: if you want to use syntax tags here you need to use %%{...}
date = %H:%M
date-alt = %Y-%m-%d%
format = <label>
label =  %date%
label-margin = 1
label-underline = ${colors.nord8}
[module/battery]
type = internal/battery
full-at = ${config.battery-full-at}
battery = ${config.battery-bat}
adapter = ${config.battery-adp}
format-charging = <animation-charging> <label-charging>
format-charging-underline = ${colors.foreground}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-framerate = 750
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${colors.notify}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.notify}
label-full = 
label-full-foreground = ${colors.success}
label-full-underline = ${colors.success}
[module/keyboard]
type = internal/xkeyboard
; List of indicators to ignore
bufferlist-0 = num lock
bufferlist-1 = scroll lock
; Format
format = <label-indicator>
label-indicator-on-capslock =  CL
label-indicator-on-capslock-foreground = ${colors.warning}
label-indicator-on-capslock-underline = ${colors.warning}
; Icons
layout-icon-default = 
[module/alsa]
type = internal/alsa
master-soundcard = ${config.master-soundcard}
speaker-soundcard = ${config.speaker-soundcard}
headphone-soundcard = ${config.headphone-soundcard}
master-mixer = ${config.master-mixer}
; Format
format-volume = <ramp-volume> <label-volume>
format-volume-underline = ${colors.function}
label-muted =  muted
label-muted-foreground = ${colors.urgent}
label-muted-underline = ${colors.urgent}
ramp-volume-0 = 
ramp-volume-0-foreground = ${colors.success}
ramp-volume-1 = 
ramp-volume-1-foreground = ${colors.notify}
ramp-volume-2 = 
ramp-volume-2-foreground = ${colors.urgent}
ramp-headphones-0 = 
ramp-volume-foreground = ${colors.nord7}
[module/backlight]
type = internal/xbacklight
enable-scroll = true
; Format
format = <ramp> <label>
format-underline = ${colors.nord9}
ramp-0 = 
label = %{A1:$HOME/.config/polybar/scripts/toggle-redshift.sh:}%percentage%%%{A}
ramp-foreground = ${colors.nord9}
[module/mpd]
type = internal/mpd
host = ${config.mpd-host}
port = ${config.mpd-port}
; Format
format-online = <toggle> <icon-prev> <label-song> <icon-next> <icon-stop> | <bar-progress> | <icon-repeat> <icon-random>
format-paused = <toggle> <icon-prev> <label-song> <icon-next> <icon-stop>
format-stopped = <toggle>
label-song-underline = ${colors.nord8}
label-song = %artist:0:10:...% - %title:0:10:...%
icon-play = 
icon-play-foreground = ${colors.success}
icon-play-margin = 1
icon-pause = 
icon-pause-foreground = ${colors.warning}
icon-pause-margin = 1
icon-stop = 
icon-stop-foreground = ${colors.urgent}
icon-stop-margin = 1
icon-prev = 
icon-prev-foreground = ${colors.function}
icon-prev-margin = 1
icon-next = 
icon-next-foreground = ${colors.function}
icon-next-margin = 1
icon-repeat = 
icon-repeat-margin = 1
icon-random = 
icon-random-margin = 1
toggle-on-foreground = ${colors.success}
toggle-off-foreground = ${colors.urgent}
bar-progress-width = 20
bar-progress-indicator = |
bar-progress-fill = -
bar-progress-empty = -
bar-progress-gradient = true
bar-progress-foreground-0 = ${colors.nord7}
bar-progress-foreground-1 = ${colors.nord8}
bar-progress-foreground-2 = ${colors.nord9}
[module/notify]
type = custom/text
content = 
content-foreground = ${colors.warning}
content-underline = ${colors.warning}
content-padding = 1
click-left = ${config.notify-click-left}
[module/network-short]
type = internal/network
interface = ${config.interface}
interval = 1
format-connected = %{A1:networkmanager_dmenu:}<ramp-signal>%{A}
format-disconnected = %{A1:networkmanager_dmenu:}<label-disconnected>%{A}
label-disconnected = 
label-disconnected-foreground = ${colors.urgent}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-0-foreground = ${colors.urgent}
ramp-signal-0-underline = ${colors.urgent}
ramp-signal-1-foreground = ${colors.notify}
ramp-signal-1-underline = ${colors.notify}
ramp-signal-2-foreground = ${colors.nord7}
ramp-signal-2-underline = ${colors.nord7}
ramp-signal-3-foreground = ${colors.success}
ramp-signal-3-underline = ${colors.success}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 MiB

View File

@ -1,63 +0,0 @@
#!/bin/sh
# shellcheck disable=SC2016,SC2059
KEYBOARD_ID="AT Translated Set 2 keyboard"
# cpm: characters per minute
# wpm: words per minute (1 word = 5 characters)
METRIC=cpm
FORMAT=" %d $METRIC"
INTERVAL=20
# If you have a keyboard layout that is not listed here yet, create a condition
# yourself. $3 is the key index. Use `xinput test "AT Translated Set 2 keyboard"`
# to see key codes in real time. Be sure to open a pull request for your
# layout's condition!
LAYOUT=qwerty
case "$LAYOUT" in
qwerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 53) || ($3 >= 52 && $3 <= 58)'; ;;
azerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 54) || ($3 >= 52 && $3 <= 57)'; ;;
qwertz) CONDITION='($3 >= 10 && $3 <= 20) || ($3 >= 24 && $3 <= 34) || ($3 == 36) || ($3 >= 38 && $3 <= 48) || ($3 >= 52 && $3 <= 58)'; ;;
dontcare) CONDITION='1'; ;; # Just register all key presses, not only letters and numbers
*) echo "Unsupported layout \"$LAYOUT\""; exit 1; ;;
esac
# We have to account for the fact we're not listening a whole minute
multiply_by=60
divide_by=$INTERVAL
case "$METRIC" in
wpm) divide_by=$((divide_by * 5)); ;;
cpm) ;;
*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
esac
hackspeed_cache="$(mktemp -p '' hackspeed_cache.XXXXX)"
trap 'rm "$hackspeed_cache"' EXIT
# Write a dot to our cache for each key press
printf '' > "$hackspeed_cache"
xinput test "$KEYBOARD_ID" | \
stdbuf -o0 awk '$1 == "key" && $2 == "press" && ('"$CONDITION"') {printf "."}' >> "$hackspeed_cache" &
while true; do
# Ask the kernel how big the file is with the command `stat`. The number we
# get is the file size in bytes, which equals the amount of dots the file
# contains, and hence how much keys were pressed since the file was last
# cleared.
lines=$(stat --format %s "$hackspeed_cache")
# Truncate the cache file so that in the next iteration, we count only new
# keypresses
printf '' > "$hackspeed_cache"
# The shell only does integer operations, so make sure to first multiply and
# then divide
value=$((lines * multiply_by / divide_by))
printf "$FORMAT\\n" "$value"
sleep $INTERVAL
done

View File

@ -1,96 +0,0 @@
#!/bin/sh
get_icon() {
case $1 in
01d) icon="";;
01n) icon="";;
02d) icon="";;
02n) icon="";;
03*) icon="";;
04*) icon="";;
09d) icon="";;
09n) icon="";;
10d) icon="";;
10n) icon="";;
11d) icon="";;
11n) icon="";;
13d) icon="";;
13n) icon="";;
50d) icon="";;
50n) icon="";;
*) icon="";
esac
echo $icon
}
get_duration() {
osname=$(uname -s)
case $osname in
*BSD) date -r "$1" -u +%H:%M;;
*) date --date="@$1" -u +%H:%M;;
esac
}
KEY="62628c16e6247d2c1caf0cb398a3dffa"
CITY="Beijing"
UNITS="metric"
SYMBOL="°"
API="https://api.openweathermap.org/data/2.5"
if [ -n "$CITY" ]; then
if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
CITY_PARAM="id=$CITY"
else
CITY_PARAM="q=$CITY"
fi
current=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
forecast=$(curl -sf "$API/forecast?appid=$KEY&$CITY_PARAM&units=$UNITS&cnt=1")
else
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
if [ -n "$location" ]; then
location_lat="$(echo "$location" | jq '.location.lat')"
location_lon="$(echo "$location" | jq '.location.lng')"
current=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
forecast=$(curl -sf "$API/forecast?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS&cnt=1")
fi
fi
if [ -n "$current" ] && [ -n "$forecast" ]; then
current_temp=$(echo "$current" | jq ".main.temp" | cut -d "." -f 1)
current_icon=$(echo "$current" | jq -r ".weather[0].icon")
forecast_temp=$(echo "$forecast" | jq ".list[].main.temp" | cut -d "." -f 1)
forecast_icon=$(echo "$forecast" | jq -r ".list[].weather[0].icon")
if [ "$current_temp" -gt "$forecast_temp" ]; then
trend=""
elif [ "$forecast_temp" -gt "$current_temp" ]; then
trend=""
else
trend=""
fi
sun_rise=$(echo "$current" | jq ".sys.sunrise")
sun_set=$(echo "$current" | jq ".sys.sunset")
now=$(date +%s)
if [ "$sun_rise" -gt "$now" ]; then
daytime="$(get_duration "$((sun_rise-now))")"
elif [ "$sun_set" -gt "$now" ]; then
daytime="$(get_duration "$((sun_set-now))")"
else
daytime="$(get_duration "$((sun_rise-now))")"
fi
echo "$(get_icon "$current_icon") $current_temp$SYMBOL $trend $(get_icon "$forecast_icon") $forecast_temp$SYMBOL $daytime"
fi

View File

@ -1,9 +0,0 @@
#! /bin/bash
if pgrep -x redshift > /dev/null
then
pgrep redshift | xargs -n1 kill -9 | notify-send 'Redshift stopped'
else
notify-send 'Redshift started'
redshift &
fi