Initial commit

master
Yash Karandikar 7 months ago
commit 6948d015ac
  1. 1
      .Xdefaults
  2. 226
      .config/i3/config
  3. 2
      .config/i3/i3next.sh
  4. 55
      .config/i3status/config
  5. 1
      .config/polybar/.gitignore
  6. 271
      .config/polybar/README.md
  7. 15
      .config/polybar/dark-colors
  8. 72
      .config/polybar/dark-config
  9. 19
      .config/polybar/launch.sh
  10. 15
      .config/polybar/light-colors
  11. 73
      .config/polybar/light-config
  12. 105
      .config/polybar/nord-config
  13. 149
      .config/polybar/nord-down
  14. 344
      .config/polybar/nord-top
  15. BIN
      .config/polybar/polybar-nord.png
  16. BIN
      .config/polybar/screenshots/rofi-run.png
  17. 26
      .config/polybar/scripts/clash.sh
  18. 36
      .config/polybar/scripts/clipmenu.sh
  19. BIN
      .config/polybar/scripts/daily-poem
  20. 63
      .config/polybar/scripts/info-hackspeed.sh
  21. 26
      .config/polybar/scripts/onedrive.sh
  22. 96
      .config/polybar/scripts/openweathermap-fullfeatured.sh
  23. 2
      .config/polybar/scripts/rofi_run
  24. 46
      .config/polybar/scripts/themes/dmenu.rasi
  25. 9
      .config/polybar/scripts/toggle-redshift.sh
  26. 7
      .config/polybar/systemd/clash.service
  27. BIN
      .config/polybar/wallpaper.jpg
  28. 1
      .config/rofi/config.rasi
  29. 89
      .config/rofi/nord.rasi
  30. 197
      .config/tiny/config.yml
  31. 2
      .fehbg
  32. 5
      .gitconfig
  33. 1630
      .p10k.zsh
  34. 23
      .ssh/config
  35. 1
      .tmux.conf
  36. 3
      .vimrc
  37. 51
      .xinitrc
  38. 34
      .zshrc

@ -0,0 +1 @@
Xft.dpi: 120

@ -0,0 +1,226 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -i ~/Downloads/wallpaper.png --nofork
# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet
exec xinput set-prop 12 285 1 &
# exec xrandr --output eDP1 --scale 0.8x0.8
exec ~/.fehbg &
bindsym $mod+s exec scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f'
bindsym $mod+e layout toggle split
focus_follows_mouse no
for_window [class="^.*"] border pixel 3
set $Locker i3lock -i ~/Downloads/wallpaper.png && sleep 1
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id $Locker, mode "default"
bindsym e exec --no-startup-id i3-msg exit, mode "default"
bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
bindsym r exec --no-startup-id systemctl reboot, mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+s mode "$mode_system"
# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec st
bindsym $mod+Shift+Return exec firefox-developer-edition
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
#bindsym $mod+space exec --no-startup-id i3-dmenu-desktop
# A more modern dmenu replacement is rofi:
bindsym $mod+space exec "rofi -modi drun,run -show drun -show-icons"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split in horizontal orientation
bindsym $mod+h split h
# split in vertical orientation
bindsym $mod+v split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+d focus mode_toggle
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
#bindsym $mod+d focus child
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# next/prev workspace
bindsym $mod+Control+Left exec ~/.config/i3/i3next.sh -1
bindsym $mod+Control+Right exec ~/.config/i3/i3next.sh 1
# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
# Gap config
gaps inner 5
# resize window (you can also use the mouse for that)
mode "resize" {
# These bindings trigger as soon as you enter the resize mode
# Pressing left will shrink the window’s width.
# Pressing right will grow the window’s width.
# Pressing up will shrink the window’s height.
# Pressing down will grow the window’s height.
bindsym j resize shrink width 10 px or 10 ppt
bindsym k resize grow height 10 px or 10 ppt
bindsym l resize shrink height 10 px or 10 ppt
bindsym semicolon resize grow width 10 px or 10 ppt
# same bindings, but for the arrow keys
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
# back to normal: Enter or Escape or $mod+r
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
# class border background text indicator child_border
client.focused #81a1c1 #285577 #ffffff #81a1c1 #81a1c1
client.focused_inactive #4c566a #5f676a #ffffff #4c566a #4c566a
client.unfocused #4c566a #222222 #888888 #4c566a #4c566a
client.urgent #81a1c1 #900000 #ffffff #900000 #81a1c1
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
# status_command i3status
# colors {
# background #1F2D3A
# statusline #FFFFFF
# }
#}
exec_always --no-startup-id $HOME/.config/polybar/launch.sh dark

@ -0,0 +1,2 @@
wsNext=$(( $( i3-msg -t get_workspaces | jq '.[] | select(.focused).num' ) + $1))
i3-msg workspace $wsNext

@ -0,0 +1,55 @@
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
interval = 5
}
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
order += "volume master"
order += "tztime local"
wireless _first_ {
format_up = "W: (%quality at %essid) %ip"
format_down = "W: down"
}
ethernet _first_ {
format_up = "E: %ip (%speed)"
format_down = "E: down"
}
battery all {
format = "%status %percentage %remaining"
}
disk "/" {
format = "%avail"
}
load {
format = "%1min"
}
memory {
format = "%used | %available"
threshold_degraded = "1G"
format_degraded = "MEMORY < %available"
}
tztime local {
format = "%Y-%m-%d %I:%M:%S"
}
volume master {
format = "V: %volume"
format_muted = "V: muted (%volume)"
}

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

@ -0,0 +1,271 @@
# 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)
2. Dunst (required by `notify` module)
3. redshift (required by `backlight` module)
4. clash (required by `clash-widget` module)
5. [onedrive](https://github.com/skilion/onedrive) (required by `onedrive-widget` module)
6. [clipmenu](https://github.com/cdown/clipmenu/) (required by `clipmenu-widget` module)
7. [nord-oneline](https://github.com/lr-tech/rofi-themes-collection) (required by `rofi-run` module)
### 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 configuration 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 configuration. 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)
11. [bspwm](#bspwm)
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)
22. [powermenu](#powermenu)
23. [clash-widget](#clash-widget)
24. [onedrive-widget](#onedrive-widget)
25. [clipmenu-widget](#clipmenu-widget)
26. [rofi-run](#rofi-run)
### 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 |
### bspwm
Display bspwm workspace icon.
### 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 |
### powermenu
List of power options, `shutdown`, `reboot` and `logout`.
### clash-widget
Require clash service. You can write by yourself or use mine in `systemd/clash.service`.
| Bind | Event |
| ----------------- | -------------- |
| mouse left click | toggle service |
| mouse right click | update status |
### onedrive-widget
Require [onedrive](https://github.com/skilion/onedrive).
| Bind | Event |
| ----------------- | -------------- |
| mouse left click | toggle service |
| mouse right click | update status |
### clipmenu-widget
Require [clipmenu](https://github.com/cdown/clipmenu/).
| Bind | Event |
| ----------------- | -------------- |
| mouse left click | trigger menu |
| double left click | toggle service |
| mouse right click | update status |
### nord-oneline
One-line style program runner. It will cover the top panel by left click the icon.
![rofi-run](https://github.com/Yucklys/polybar-nord-theme/raw/master/screenshots/rofi-run.png)

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

@ -0,0 +1,72 @@
; 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/base]
theme = dark
monitor = ${config.monitor}
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 = 0
override-redirect = ${config.override-redirect}
wm-restack = ${config.wm-restack}
tray-padding = 3
tray-detached = false
tray-maxsize = 22
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
[bar/nord-top]
inherit = bar/base
module-margin = 1
font-0 = WenQuanYiMicroHei:size=12
font-1 = FontAwesome5FreeSolid:pixelsize=12;1
font-2 = FontAwesome5FreeRegular:pixelsize=12;1
font-3 = FontAwesome5Brands:pixelsize=8;1
font-4 = FiraCodeRegular:pixelsize=12
modules-left = ${config.top-left}
modules-center = ${config.top-center}
modules-right = ${config.top-right}
tray-position = ${config.systray-top}
[bar/nord-down]
inherit = bar/base
bottom = true
module-margin = 2
font-0 = WenQuanYiMicroHei:size=12
font-1 = FontAwesome5FreeSolid:pixelsize=12;1
font-2 = FontAwesome5Brands:pixelsize=8;1
font-3 = Weather Icons:style=Regular:size=12;1
font-4 = FiraCodeRegular:pixelsize=12
modules-left = ${config.bottom-left}
modules-center = ${config.bottom-center}
modules-right = ${config.bottom-right}
tray-position = ${config.systray-bottom}

@ -0,0 +1,19 @@
#!/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..."

@ -0,0 +1,15 @@
; 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

@ -0,0 +1,73 @@
; 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/base]
theme = light
monitor = ${config.monitor}
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 = 0
override-redirect = ${config.override-redirect}
wm-restack = ${config.wm-restack}
tray-padding = 3
tray-detached = false
tray-maxsize = 22
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
[bar/nord-top]
inherit = bar/base
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}
[bar/nord-down]
inherit = bar/base
bottom = true
padding = 2
module-margin = 2
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 = Weather Icons:style=Regular:size=12;1
font-5 = WenQuanYiMicroHei:size=12
modules-left = ${config.bottom-left}
modules-center = ${config.bottom-center}
modules-right = ${config.bottom-right}
tray-position = ${config.systray-bottom}

@ -0,0 +1,105 @@
;vim:ft=dosini
[config]
# DPI value for HiDPI screen
dpi = 82
monitor = ${env:MONITOR:eDP1}
# bar position, apply globally
width = 100%
height = 3%
offset-x = 0
offset-y = 0
radius = 0.0
fixed-center = true
override-redirect = false
wm-restack = bspwm
# 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
# bspwm: bspwm 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
# powermenu: menu to control system power
# 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)
# clash-widget: showing clash service
# onedrive-widget: showing onedrive service
# clipmenu-widget: showing clipmenu service
# Top modules
bottom-left = rofi-run title cpu memory temperature
bottom-center = i3
bottom-right = alsa network-detail battery date
systray-top = none
systray-bottom = right
# 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 = wlp1s0
# 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 = 3
# 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

@ -0,0 +1,149 @@
; vim:ft=dosini
[module/powermenu]
type = custom/menu
expand-right = true
label-open =
label-open-foreground = ${colors.background}
label-open-background = ${colors.nord9}
label-open-padding = 3
label-close =
label-close-foreground = ${colors.background}
label-close-background = ${colors.nord9}
label-close-padding = 4
menu-0-0 =
menu-0-0-foreground = ${colors.urgent}
menu-0-0-padding = 2
menu-0-0-exec = shutdown
menu-0-1 =
menu-0-1-foreground = ${colors.warning}
menu-0-1-padding = 2
menu-0-1-exec = reboot
menu-0-2 =
menu-0-2-foreground = ${colors.warning}
menu-0-2-padding = 2
menu-0-2-exec = systemctl suspend
[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 7UfdzOWorOAHZHcsxFQl2Ufa/7E9BtdT with your token from https://v2.jinrishici.com/token.
hook-0 = ~/.config/polybar/scripts/daily-poem require 7UfdzOWorOAHZHcsxFQl2Ufa/7E9BtdT ~/.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}
interval = 10
[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

@ -0,0 +1,344 @@
; vim:ft=dosini
[module/i3]
type = internal/i3
pin-workspaces = ${config.i3-pin-workspaces}
strip-wsnumbers = false
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;
; color
; label-focused =
lable-focused = %index%
label-focused-underline = ${colors.nord7}
label-focused-foreground = ${colors.nord7}
label-focused-padding = 2
; label-unfocused = •
label-unfocused = %index%
label-unfocused-foreground = ${colors.nord9}
label-unfocused-padding = 2
label-urgent = %index%
label-urgent-foreground = ${colors.urgent}
label-urgent-background = ${colors.foreground}
label-urgent-padding = 2
; seperator
label-separator = |
label-separator-foreground = ${colors.buffer}
[module/bspwm]
type = internal/bspwm
ws-icon-0 = I;
ws-icon-1 = II;
ws-icon-2 = III;
ws-icon-3 = IV;
ws-icon-4 = V;
ws-icon-5 = VI;
ws-icon-6 = VII;
ws-icon-7 = VIII;
ws-icon-8 = IX;
ws-icon-9 = X;
label-focused = %icon%
label-focused-underline = ${colors.nord7}
label-focused-foreground = ${colors.nord7}
label-focused-padding = 2
label-occupied = %icon%
label-occupied-underline = ${colors.nord9}
label-occupied-foreground = ${colors.nord9}
label-occupied-padding = 2
label-empty = %icon%
label-empty-foreground = ${colors.buffer}
label-empty-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 = %a %Y-%m-%d %I:%M
date-alt = %I:%M
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/backlight
card = intel_backlight
enable-scroll = true
; Use xbacklight when the default backlight does not work.
; For more details check https://github.com/polybar/polybar/wiki/Module:-xbacklight.
; [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}
[module/clash-widget]
type = custom/script
exec = ~/.config/polybar/scripts/clash.sh
interval = 3
click-left = ~/.config/polybar/scripts/clash.sh toggle
[module/onedrive-widget]
type = custom/script
exec = ~/.config/polybar/scripts/onedrive.sh
interval = 3
click-left = ~/.config/polybar/scripts/onedrive.sh toggle
[module/clipmenu-widget]
type = custom/script
exec = ~/.config/polybar/scripts/clipmenu.sh
interval = 3
click-left = ~/.config/polybar/scripts/clipmenu.sh menu
click-right = ~/.config/polybar/scripts/clipmenu.sh toggle
[module/rofi-run]
type = custom/text
content =
content-background = ${colors.nord9}
content-foreground = ${colors.background}
content-padding = 3
click-left = ~/.config/polybar/scripts/rofi_run

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

@ -0,0 +1,26 @@
#!/bin/sh
# this requires a service for clash at /usr/lib/systemd/system
service=$(systemctl is-active --user clash)
case $1 in
"toggle")
if [ $service == 'active' ]
then
systemctl stop --user clash
printf '%s' '%{F#4c566a}%{F-}'
else
systemctl start --user clash
printf '%s' '%{F#a3be8c}%{F-}'
fi
;;
"")
if [ $service == "active" ]
then
printf '%s' '%{F#a3be8c}%{F-}'
else
printf '%s' '%{F#4c566a}%{F-}'
fi
esac

@ -0,0 +1,36 @@
#!/bin/sh
# this requires a service for clipmenu at /usr/lib/systemd/system
service=$(systemctl is-active --user clipmenud)
dmenu_launcher=rofi
case $1 in
"toggle")
if [ $service == 'active' ]
then
systemctl stop --user clipmenud
printf '%s' '%{F#4c566a}%{F-}'
else
systemctl start --user clipmenud
printf '%s' '%{F#a3be8c}%{F-}'
fi
;;
"menu")
if [ $service == 'active' ]
then
CM_LAUNCHER=$dmenu_launcher clipmenu
printf '%s' '%{F#a3be8c}%{F-}'
else
printf '%s' '%{F#4c566a}%{F-}'
fi
;;
"")
if [ $service == "active" ]
then
printf '%s' '%{F#a3be8c}%{F-}'
else
printf '%s' '%{F#4c566a}%{F-}'
fi
esac

@ -0,0 +1,63 @@
#!/bin/sh
# shellcheck disable=SC2016,SC2059
KEYBOARD_ID="KBDFans DZ60 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

@ -0,0 +1,26 @@
#!/bin/sh
# this requires a service for onedrive at /usr/lib/systemd/system
service=$(systemctl is-active --user onedrive)
case $1 in
"toggle")
if [ $service == 'active' ]
then
systemctl stop --user onedrive
printf '%s' '%{F#4c566a}%{F-}'
else
systemctl start --user onedrive
printf '%s' '%{F#a3be8c}%{F-}'
fi
;;
"")
if [ $service == "active" ]
then
printf '%s' '%{F#a3be8c}%{F-}'
else
printf '%s' '%{F#4c566a}%{F-}'
fi
esac

@ -0,0 +1,96 @@
#!/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