Started move to chezmoi managed .dotfiles.

This commit is contained in:
Joachim Nielandt 2020-07-13 14:31:48 +02:00
commit 1a84bee6aa
188 changed files with 7360 additions and 0 deletions

60
dot_Xresources Normal file
View File

@ -0,0 +1,60 @@
!
! URxvt settings
!
URxvt.transparent: true
URxvt.shading:20
! Included this so you know how to make your foreground not match the color of your background
URxvt.foreground: #eeeeee
URxvt*background: #1d2021
URxvt*scrollBar: false
URxvt*scrollstyle: plain
URxvt.internalBorder: 8
URxvt*saveLines: 65500
! starts as a login shell, prepending - to argv[0] of the shell.
URxvt*loginShell: false
!URxvt*termName: screen-256color
URxvt.font: xft:Fura Code Nerd Font Mono:size=12
URxvt.boldfont: xft:Fura Code Nerd Font Mono:bold:size=12
! Give us a nice cursor then
Xcursor.theme: Breeze
Xcursor.size: 16
! -----------------------------------------------------------------------------
! File: gruvbox-dark.xresources
! Description: Retro groove colorscheme generalized
! Author: morhetz <morhetz@gmail.com>
! Source: https://github.com/morhetz/gruvbox-generalized
! Last Modified: 6 Sep 2014
! -----------------------------------------------------------------------------
! hard contrast: *background: #1d2021
*backgroundhard: #1d2021
*background: #282828
! soft contrast: *background: #32302f
*backgroundsoft: #32302f
*foreground: #ebdbb2
! Black + DarkGrey
*color0: #282828
*color8: #928374
! DarkRed + Red
*color1: #cc241d
*color9: #fb4934
! DarkGreen + Green
*color2: #98971a
*color10: #b8bb26
! DarkYellow + Yellow
*color3: #d79921
*color11: #fabd2f
! DarkBlue + Blue
*color4: #458588
*color12: #83a598
! DarkMagenta + Magenta
*color5: #b16286
*color13: #d3869b
! DarkCyan + Cyan
*color6: #689d6a
*color14: #8ec07c
! LightGrey + White
*color7: #a89984
*color15: #ebdbb2

0
dot_config/.keep Normal file
View File

0
dot_config/dunst/.keep Normal file
View File

331
dot_config/dunst/dunstrc Normal file
View File

@ -0,0 +1,331 @@
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectively.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x5-0+54"
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing window manager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 0
# The height of the entire notification. If the height is smaller
# than the font height and padding combined, it will be raised
# to the font height and padding.
notification_height = 0
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 1
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Defines width in pixels of frame around the notification window.
# Set to 0 to disable.
frame_width = 1
# Defines color of the frame around the notification window.
#frame_color = "#aaaaaa"
frame_color = "#458588"
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
#separator_color = frame
separator_color = "#1d2021"
# Sort messages by urgency.
sort = yes
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# Transient notifications ignore this setting.
idle_threshold = 120
### Text ###
#font = Monospace 8
font = xft:FuraCode Nerd Font 8
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
# Possible values are:
# full: Allow a small subset of html markup in notifications:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
# server. Dunst will try to strip the markup but the parsing is
# simplistic so using this option outside of matching rules for
# specific applications *IS GREATLY DISCOURAGED*.
#
# no: Disable markup parsing, incoming notifications will be treated as
# plain text. Dunst will not advertise that it has the body-markup
# capability if this is set as a global setting.
#
# It's important to note that markup inside the format option will be parsed
# regardless of what this is set to.
markup = no
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# %n progress value if set without any extra characters
# %% Literal %
# Markup is allowed
format = "<b>%s</b>\n%b"
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# When word_wrap is set to no, specify where to ellipsize long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Merge multiple notifications with the same content
stack_duplicates = true
# Hide the count of merged notifications with the same content
hide_duplicate_count = false
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
### Icons ###
# Align icons left/right/off
icon_position = left
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons.
#icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/:/usr/share/icons/hicolor/22x22/apps/
### History ###
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
### Misc/Advanced ###
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Always run rule-defined scripts, even if the notification is suppressed
always_run_script = true
# Define the title of the windows spawned by dunst
title = Dunst
# Define the class of the windows spawned by dunst
class = Dunst
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
### Legacy
# Use the Xinerama extension instead of RandR for multi-monitor support.
# This setting is provided for compatibility with older nVidia drivers that
# do not support RandR and using it on systems that support RandR is highly
# discouraged.
#
# By enabling this setting dunst will not be able to detect when a monitor
# is connected or disconnected which might break follow mode if the screen
# layout changes.
force_xinerama = false
# Experimental features that may or may not work correctly. Do not expect them
# to have a consistent behaviour across releases.
[experimental]
# Calculate the dpi to use on a per-monitor basis.
# If this setting is enabled the Xft.dpi value will be ignored and instead
# dunst will attempt to calculate an appropriate dpi value for each monitor
# using the resolution and physical size. This might be useful in setups
# where there are multiple screens with very different dpi values.
per_monitor_dpi = false
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1". Make sure this key actually exists on your keyboard layout,
# e.g. check output of 'xmodmap -pke'
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#32302f"
foreground = "#ebdbb2"
timeout = 10
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
[urgency_normal]
background = "#32302f"
foreground = "#ebdbb2"
frame_color = "#b8bb26"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
[urgency_critical]
background = "#32302f"
foreground = "#ebdbb2"
frame_color = "#fb4934"
timeout = 0
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[history-ignore]
# # This notification will not be saved in history
# summary = "foobar"
# history_ignore = yes
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg

0
dot_config/i3/.keep Normal file
View File

489
dot_config/i3/config Normal file
View File

@ -0,0 +1,489 @@
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
# this sets the mod button -> windows key
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
# overrides title bars -> makes sure i3-gaps can do its thing
for_window [class="^.*"] border pixel 2
# for jetbrains windows... focus on dialogs!
for_window [class="^jetbrains-.+"][window_type=dialog] focus
# fix citrix windows
for_window [class="Wfica_Seamless"] floating enable
# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
# Using the prefix of workspaces in order to be able to define ordering for special workspaces.
set $ws1 "1:1"
set $ws2 "2:2"
set $ws3 "3:3"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:10"
set $wsleft "11:"
set $wsright "12:"
# automatically assign programs to workspace
# using workspace names here, otherwise doesn't work as expected
# assign [class="Chromium"] $ws1
assign [class="Thunderbird"] $ws2
assign [class="Slack"] $ws9
assign [class="Mattermost"] $ws9
assign [class="Hamsket"] $ws9
assign [class="Wfica_Seamless"] $ws10
#assign [class="jetbrains-idea"] 7
#assign [class="jetbrains-webstorm"] 8
#assign [class="jetbrains-datagrip"] 9
# i3-gaps
gaps inner 10
gaps outer 5
# Disallow endless looping of focus: extreme right is extreme right, don't flip to extreme left whenever you want...
focus_wrapping no
# 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
# font xft:Fantasque Sans Mono 9
font xft:FuraCode Nerd Font 8
# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesnt scale on retina/hidpi displays.
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Shift+Return exec xfce4-terminal
bindsym $mod+Return exec urxvt
# screenshotting
# Desktop screenshot
#bindsym --release Print exec "scrot ~/Bilder/Bildschirmfotos/$(date --iso-8601='seconds').png -m -e 'xclip -selection c -t image/png < $f'"
# Choose window
#bindsym --release Mod1+Sys_Req exec "import -window `xwininfo | awk '/.*Window id:.*/ {print $4}'` ~/Bilder/Bildschirmfotos/$(date --iso-8601='seconds').png"
# Selection screenshot
#bindsym --release Shift+Print exec "scrot ~/Bilder/Bildschirmfotos/$(date --iso-8601='seconds').png -s -e 'xclip -selection c -t image/png < $f'"
bindsym --release Print exec /home/jnieland/.config/i3/screenshot.sh
# kill focused window
bindsym $mod+Shift+q kill
# start dmenu (a program launcher)
# bindsym $mod+d exec dmenu_run
bindsym $mod+d exec ~/.config/rofi/runrofi.sh
# this uses the output of greenclip (see here https://wiki.archlinux.org/index.php/Greenclip) to show clipboard history in rofi
bindsym $mod+c exec rofi -modi "clipboard:greenclip print" -show clipboard -run-command '{cmd}'
# do a nice menu with mode
# lock / logout / sleep / hibernate / restart / poweroff
set $mode_system  l e s鈴 h rﰇ וּsﮤ
mode "$mode_system" {
bindsym l exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh lock, mode "default"
bindsym e exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh logout, mode "default"
bindsym s exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh suspend, mode "default"
bindsym h exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh hibernate, mode "default"
bindsym r exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh reboot, mode "default"
bindsym Shift+s exec --no-startup-id /home/jnieland/.config/i3/i3exit.sh shutdown, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Pause mode "$mode_system"
bindsym $mod+F12 mode "$mode_system"
# do a nice menu for redshift values
set $mode_redshift Redshift <2,3,4,5,6,7,8>k
mode "$mode_redshift" {
bindsym 2 exec --no-startup-id redshift -P -O 2000
bindsym 3 exec --no-startup-id redshift -P -O 3000
bindsym 4 exec --no-startup-id redshift -P -O 4000
bindsym 5 exec --no-startup-id redshift -P -O 5000
bindsym 6 exec --no-startup-id redshift -P -O 6000
bindsym 7 exec --no-startup-id redshift -P -O 7000
bindsym 8 exec --no-startup-id redshift -P -O 8000
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+F9 mode "$mode_redshift"
# do a nice menu for keyboard layouts
set $mode_xkbmap Layout (a) us, (b) us-intl (c) us-altgr (d) gb (e) gb-intl (f) dvorak
mode "$mode_xkbmap" {
bindsym a exec --no-startup-id setxkbmap us, mode "default"
bindsym b exec --no-startup-id setxkbmap us intl, mode "default"
bindsym c exec --no-startup-id setxkbmap us altgr-intl, mode "default"
bindsym d exec --no-startup-id setxkbmap gb, mode "default"
bindsym e exec --no-startup-id setxkbmap gb intl, mode "default"
bindsym f exec --no-startup-id setxkbmap dvorak, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Ctrl+k mode "$mode_xkbmap"
# this is a menu dedicated to audio stuff
# some nice symbols to try here: 0|    論b籠i錄 
set $mode_audio    - + 0 y
mode "$mode_audio" {
# Pulse Audio controls
# Increase sound volume
bindsym plus exec --no-startup-id pactl set-sink-volume 0 +5%
# Decrease sound volume
bindsym minus exec --no-startup-id pactl set-sink-volume 0 -5%
# Mute sound
bindsym 0 exec --no-startup-id pactl set-sink-mute 0 toggle
# Start mps-youtube
bindsym y exec --no-startup-id urxvt -e mpsyt, mode "default"
# Media player controls
# Toggle pause/play
bindsym space exec playerctl play-pause
#bindsym XF86AudioPause exec playerctl pause
#bindsym XF86AudioNext exec playerctl next
#bindsym XF86AudioPrev exec playerctl previous
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+F11 mode "$mode_audio"
# do a nice menu for custom launches
set $mode_launch  adefault start-up bnoise-fix cdual dhorizontal etearing
mode "$mode_launch" {
# These are all the default programs launching at startup.
bindsym a exec hamsket, exec thunderbird, mode "default"
# This fixes audio noise
bindsym b exec sudo hda-verb /dev/snd/hwC*D0 0x1d SET_PIN_WIDGET_CONTROL 0x0, mode "default"
# This bypasses weird xrandr bug, resets to single display, then goes back to triple monitor setup (use autorandr profile here, needs to be set up in advance)
#bindsym c exec xrandr --output eDP1 --mode 2560x1440, exec autorandr triple, mode "default"
bindsym c exec autorandr dual2k, mode "default"
bindsym d exec autorandr horizontal, mode "default"
bindsym e exec nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+F10 mode "$mode_launch"
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
# these are shortcuts for programs
bindsym $mod+Ctrl+t exec urxvt
bindsym $mod+Ctrl+e exec thunar
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l 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+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l 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
# move workspace to left and right monitors
bindsym $mod+Shift+bracketleft move workspace to output left
bindsym $mod+Shift+bracketright move workspace to output right
# explicit bindings for arandr's setups: might not need these anymore... using autorandr now
# bindsym $mod+Shift+Ctrl+1 exec /home/jnieland/.screenlayout/laptop-only.sh
# bindsym $mod+Shift+Ctrl+2 exec /home/jnieland/.screenlayout/work-desk.sh
# split in horizontal orientation
bindsym $mod+m split h
# split in vertical orientation
bindsym $mod+n split v
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
# focus the parent container
bindsym $mod+i focus parent
# do some gaps magic: win+shift+g
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"
mode "$mode_gaps" {
bindsym o mode "$mode_gaps_outer"
bindsym i mode "$mode_gaps_inner"
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_inner" {
bindsym plus gaps inner current plus 5
bindsym minus gaps inner current minus 5
bindsym 0 gaps inner current set 0
bindsym Shift+plus gaps inner all plus 5
bindsym Shift+minus gaps inner all minus 5
bindsym Shift+0 gaps inner all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
bindsym plus gaps outer current plus 5
bindsym minus gaps outer current minus 5
bindsym 0 gaps outer current set 0
bindsym Shift+plus gaps outer all plus 5
bindsym Shift+minus gaps outer all minus 5
bindsym Shift+0 gaps outer all set 0
bindsym Return mode "default"
bindsym Escape mode "default"
}
# focus the child container
bindsym $mod+u focus child
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+comma workspace $wsleft
bindsym $mod+period workspace $wsright
# Scratchpad
bindsym $mod+Shift+BackSpace move scratchpad
bindsym $mod+BackSpace scratchpad show
# generic switch
#bindcode 49+34 workspace $ws9
#bindsym $mod+grave workspace $ws9
#bindsym $mod+shift+grave workspace $ws9
# check this out: https://unix.stackexchange.com/questions/338228/i3wm-more-than-10-workspaces-with-double-modifier-key#339985
bindsym $mod+grave exec i3-input -F 'workspace %s' -P 'go to workspace: '
bindsym $mod+shift+grave exec i3-input -F 'move container to workspace %s' -P 'move to workspace: '
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
bindsym $mod+Shift+comma move container to workspace $wsleft
bindsym $mod+Shift+period move container to workspace $wsright
# reload the configuration file
bindsym $mod+Shift+c exec "i3-msg reload && notify-send ' i3' 'Reloaded config.' -u low"
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
#bindsym $mod+Shift+r exec "i3-msg 'restart' && sleep 3 && notify-send ' i3' 'Restarted.' -u low"
# 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'"
# 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 windows width.
# Pressing right will grow the windows width.
# Pressing up will shrink the windows height.
# Pressing down will grow the windows height.
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l 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"
# Edit config files
bindsym XF86Tools exec --no-startup-id urxvt -e vim /home/jnieland/.config/i3/config
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
bindsym $mod+XF86AudioPlay exec --no-startup-id urxvt -e mpsyt # start terminal youtube player
#bindsym $mod+F11 exec --no-startup-id urxvt -e mpsyt # start terminal youtube player
# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
#bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
# Screen brightness keys
# (This should work for both acpilight or xbacklight.)
bindsym XF86MonBrightnessUp exec xbacklight -inc 20
bindsym XF86MonBrightnessDown exec xbacklight -dec 20
# start multi touch support
exec --no-startup-id libinput-gestures-setup start
# start polybar
exec_always --no-startup-id ~/.config/polybar/launch-multi.sh
# start the network manager applet
exec --no-startup-id nm-applet
# start the xfce4-power-manager -> helping us do lid / laptop things
exec --no-startup-id xfce4-power-manager
# load the wallpaper
exec_always --no-startup-id sh ~/.fehbg
# start compton: compositor that allows, for example, transparency
exec --no-startup-id compton
# start greenclip, this somehow fails to start at launch (sometimes?)
exec --no-startup-id systemctl --user start greenclip
# reload the walpaper / color configuratin using pywal
# exec --no-startup-id wal -R -q
# change the wallpaper exec_always feh --bg-scale ~/Documents/private/img/mars-wallpaper-23.jpg
# GAPS i3-gaps specific things...
# smart gaps: only one window? no gaps!
smart_gaps on
# this removes borders when there's no gaps, nice!
# smart_borders on|no_gaps
smart_borders no_gaps
# Current color set
set_from_resource $color0 i3wm.color0 #000000
set_from_resource $color1 i3wm.color1 #000000
set_from_resource $color2 i3wm.color2 #000000
set_from_resource $color3 i3wm.color3 #000000
set_from_resource $color4 i3wm.color4 #000000
set_from_resource $color5 i3wm.color5 #000000
set_from_resource $color6 i3wm.color6 #000000
set_from_resource $color7 i3wm.color7 #000000
set_from_resource $color8 i3wm.color8 #000000
set_from_resource $color9 i3wm.color9 #000000
set_from_resource $color10 i3wm.color10 #000000
set_from_resource $color11 i3wm.color11 #000000
set_from_resource $color12 i3wm.color12 #000000
set_from_resource $color13 i3wm.color13 #000000
set_from_resource $color14 i3wm.color14 #000000
set_from_resource $color15 i3wm.color15 #000000
set_from_resource $color66 i3wm.color66 #000000
set_from_resource $gruv_black i3wm.color0 #000000
set_from_resource $gruv_darkgrey i3wm.color8 #000000
set_from_resource $gruv_red i3wm.color9 #000000
set_from_resource $gruv_darkred i3wm.color1 #000000
set_from_resource $gruv_magenta i3wm.color13 #000000
set_from_resource $gruv_darkmagenta i3wm.color5 #000000
set_from_resource $gruv_cyan i3wm.color14 #000000
set_from_resource $gruv_darkcyan i3wm.color6 #000000
set_from_resource $gruv_yellow i3wm.color11 #000000
set_from_resource $gruv_darkyellow i3wm.color3 #000000
set_from_resource $gruv_lightgrey i3wm.color7 #000000
set_from_resource $gruv_white i3wm.color15 #000000
set_from_resource $gruv_foreground i3wm.foreground #000000
set_from_resource $gruv_background i3wm.background #000000
set_from_resource $gruv_green i3wm.color10 #000000
set_from_resource $gruv_darkgreen i3wm.color2 #000000
# window color class [border|backgr.|text|indicator|child_border]
client.focused $gruv_green $gruv_background $gruv_foreground #FFFFFF $gruv_yellow
client.focused_inactive #333333 $gruv_background $gruv_foreground #484e50 $gruv_darkyellow
client.unfocused $gruv_background $gruv_background $ufg $indicator $gruv_lightgrey
client.urgent $bg $bg $fg $indicator $gruv_red
client.placeholder $bg $bg $fg $indicator $bg
client.background $gruv_background
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# <colorclass> <border> <background> <text>
# bar {
# status_command i3status
#
# colors {
# background $gruv_background
# statusline $gruv_darkred
# separator #666666
#
# focused_workspace $gruv_yellow $gruv_green $gruv_foreground
# active_workspace #333333 $gruv_darkgreen $gruv_foreground
# inactive_workspace #333333 $gruv_darkgreen $gruv_foreground
# urgent_workspace $gruv_red $gruv_darkgreen $gruv_foreground
# binding_mode #2f343a #900000 #ffffff
# }
# }

View File

@ -0,0 +1,78 @@
#!/bin/bash
# this script can lock / restart / shutdown / ...
col11="$(xrdb -query | grep '*color11' | cut -f 2)FF"
col10="$(xrdb -query | grep '*color10' | cut -f 2)FF"
# red
col9="$(xrdb -query | grep '*color9' | cut -f 2)FF"
col8="$(xrdb -query | grep '*color8' | cut -f 2)FF"
col7="$(xrdb -query | grep '*color7' | cut -f 2)FF"
col6="$(xrdb -query | grep '*color6' | cut -f 2)FF"
col5="$(xrdb -query | grep '*color5' | cut -f 2)FF"
col4="$(xrdb -query | grep '*color4' | cut -f 2)FF"
col3="$(xrdb -query | grep '*color3' | cut -f 2)FF"
col2="$(xrdb -query | grep '*color2' | cut -f 2)FF"
# darkred
col1="$(xrdb -query | grep '*color1' | cut -f 2)FF"
foreground="$(xrdb -query | grep -E '^.foreground:' | cut -f 2)FF"
background="$(xrdb -query | grep -E '^.background:' | cut -f 2)FF"
echo "{$background}"
lock() {
# --screen 1
# --keylayout 2
i3lock -i /home/jnieland/pictures/great-wall-namib.jpg --blur 5 --clock --indicator \
--insidevercolor=$background \
--ringvercolor=$col4 \
\
--insidewrongcolor=$background \
--ringwrongcolor=$col9 \
\
--insidecolor=$background \
--ringcolor=$col2 \
--linecolor=$background \
--separatorcolor=$col11 \
\
--verifcolor=$col4 \
--wrongcolor=$col4 \
--timecolor=$col4 \
--datecolor=$col4 \
--layoutcolor=$col4 \
--keyhlcolor=$col11 \
--bshlcolor=$col9 \
\
--blur 5 \
--clock \
--indicator \
--timestr="%H:%M:%S" \
--datestr="%A, %m %Y" \
}
case "$1" in
lock)
lock
;;
logout)
i3-msg exit
;;
suspend)
lock && systemctl suspend
;;
hibernate)
lock && systemctl hibernate
;;
reboot)
systemctl reboot
;;
shutdown)
systemctl poweroff
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0

View File

@ -0,0 +1,9 @@
#!/bin/bash
# the screenshot will be saved here
TARGETDIR=/home/jnieland/pictures/screenshots
# make a screenshot filename
TARGETFILE=screenshot.$(date '+%Y.%m.%d.%H.%M.%S').png
# start the process
notify-send ' Screenshot' 'Select area...' -u normal
scrot -s $TARGETDIR/$TARGETFILE -d 1 -e 'notify-send -i '$TARGETDIR/$TARGETFILE' "Screenshot" "Created file: "'$TARGETDIR/$TARGETFILE' && xclip -selection clipboard -target image/png -i '$TARGETDIR/$TARGETFILE

View File

@ -0,0 +1,28 @@
# Generated by Gestures 0.2.2 --> https://gitlab.com/cunidev/gestures
# Manual editing might result in data loss!
# Invalid lines
# Swipe threshold (0-100)
swipe_threshold 0
# Unsupported lines
# Gestures
gesture swipe right 4 _internal ws_up
gesture swipe left 4 _internal ws_down
gesture swipe right 3 xdotool key alt+Right
gesture swipe left 3 xdotool key alt+Left
#gesture pinch in 4 xdotool key super+s
#gesture pinch out 4 xdotool key super+e
# Special stuff
gesture swipe left_down 4 xdotool key super+comma
gesture swipe right_down 4 xdotool key super+period
gesture swipe left_up 4 xdotool key super+Shift+comma
gesture swipe right_up 4 xdotool key super+Shift+period
gesture pinch clockwise 2 notify-send 'Pinch 2 clockwise.'
gesture pinch anticlockwise 2 notify-send 'Pinch 2 anticlockwise.'

View File

View File

View File

@ -0,0 +1,4 @@
# make sure LS behaves as we want it to
if [[ $OSTYPE = (linux)* ]]; then
export LS_OPTIONS='--color=auto'
fi

View File

@ -0,0 +1,2 @@
# this enables vi bindings in zsh
bindkey -v

View File

@ -0,0 +1,15 @@
alias rm="rm -v"
alias vi="vim"
alias cp="cp -v"
alias mv="mv -v"
alias ls="ls $LS_OPTIONS -hFtr"
alias ll="ls $LS_OPTIONS -lAhFtr"
alias ccat="pygmentize -O style=monokai -f 256 -g"
alias dig="dig +nocmd any +multiline +noall +answer"
alias prettyjson='python -m json.tool'
# aliases to quickly switch between two keyboard layouts
alias aoeu="setxkbmap us"
alias asdf="setxkbmap dvorak"
disable -r time # disable shell reserved word
alias time='time -p ' # -p for POSIX output

View File

604
dot_config/polybar/config Normal file
View File

@ -0,0 +1,604 @@
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
background = ${xrdb:color0:#222}
foreground = ${xrdb:color7:#222}
background-alt = ${xrdb:color10:#222}
foreground-alt = ${xrdb:color4:#222}
icon-color = ${xrdb:color4:#FF2}
primary = ${xrdb:color1:#222}
alert = ${xrdb:color10:#222}
secondary = ${xrdb:color10:#222}
; let's get some colors from xrdb (pywal)
col0 = ${xrdb:color0:#222}
col1 = ${xrdb:color1:#222}
col2 = ${xrdb:color2:#222}
col3 = ${xrdb:color3:#222}
col4 = ${xrdb:color4:#222}
col5 = ${xrdb:color5:#222}
col6 = ${xrdb:color6:#222}
col7 = ${xrdb:color7:#222}
col8 = ${xrdb:color8:#222}
col9 = ${xrdb:color9:#222}
col10 = ${xrdb:color10:#222}
col11 = ${xrdb:color11:#222}
col12 = ${xrdb:color12:#222}
col13 = ${xrdb:color13:#222}
gruvbg = ${xrdb:background:#222}
gruvbghard = ${xrdb:backgroundhard:#222}
gruvbgsoft = ${xrdb:backgroundsoft:#222}
gruvfg = ${xrdb:foreground:#222}
; control some of the later elements from here, nice and tidy
underline-cpu = ${xrdb:color2:#222}
underline-memory = ${xrdb:color3:#222}
underline-date = ${xrdb:color4:#222}
underline-battery = ${xrdb:color5:#222}
underline-temperature = ${xrdb:color6:#222}
underline-keyboard = ${xrdb:color7:#222}
underline-i3-focused = ${xrdb:color10:#222}
underline-i3-unfocused = ${xrdb:color8:#222}
[bar/general]
width = 100%
; spaces before/after each module
module-margin-left = 1
module-margin-right = 1
height = 27
fixed-center = true
line-size = 3
line-color = #f00
; rounded corners of the bar
radius = 0.0
;this makes sure that i3 doesn't reposition everything when polybar becomes active... is shit
override-redirect = false
wm-restack = i3
; all the bar colors
background = ${colors.background}
foreground = ${colors.foreground}
border-color = ${colors.background}
; spaces on begin/end of bar
padding-left = 2
padding-right = 2
; set the bar fonts
;font-0 = fixed:pixelsize=10;1
;font-0 = "Wuncon Siji:pixelsize=15;1"
;font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
;font-2 = "Inconsolata\ For\ Powerline:pixelsize=10;1"
font-0 = FuraCode Nerd Font:pixelsize=11;1
; override pointers
cursor-click = pointer
cursor-scroll = pointer
[bar/example]
inherit = bar/general
monitor = ${env:MONITOR:eDP-1}
;offset-x = 2%
;offset-y = 1%
;i'm faking the left and right margins with a fat border. i'm helpless
;border-size = 20
;border-left-size = 16
;border-right-size = 16
;unused modules - mpd xbacklight backlight-acpi alsa
modules-left = i3
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process
modules-right = net1 wifi0 vpn powermenu
; TRAY MANAGEMENT
;tray-position = right
tray-position = ${env:TRAY_POSITION:none}
;tray-transparent = true
tray-detached = false
tray-maxsize = 16
;tray-background = ${colors.background-alt}
;this makes sure that the tray doesn't run off to the right of the monitor - only enable this when the bar's width is a bit off
tray-offset-x = 0
tray-offset-y = 27
tray-padding = 2
tray-scale = 1.0
scroll-up = i3wm-wsnext
scroll-down = i3wm-wsprev
cursor-click = pointer
;cursor-scroll = ns-resize
cursor-scroll = pointer
[bar/secondary]
inherit = bar/general
monitor = ${env:MONITOR:eDP-1}
;offset-x = 2%
;offset-y = 1%
;unused modules - mpd xbacklight backlight-acpi alsa
modules-right = pulseaudio
modules-center = player-mpris-tail
modules-left = date info-hackspeed
[module/player-mpris-tail]
type = custom/script
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/player-mpris-tail/player-mpris-tail.py -f '{icon} {artist} - {title}' --icon-playing  --icon-paused  --icon-stopped  --icon-none ﱙ
tail = true
label = %output%
[module/info-hackspeed]
type = custom/script
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/info-hackspeed/info-hackspeed.sh
tail = true
[module/top-process]
type = custom/script
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-underline = ${colors.alert}
interval = 5
exec = ~/.dotfiles/scripts/top.process.sh
tail = true
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-prefix-underline = ${colors.underline-keyboard}
; layout, number, name
label-layout = %layout%
label-layout-underline = ${colors.underline-keyboard}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.underline-keyboard}
cursor-click = pointer
[module/vpn]
type = custom/script
exec = nmcli | grep "VPN connection" | sed -e "s/VPN connection//g"
exec-if = pgrep -x openvpn
interval = 5
format-underline = #268bd2
format-prefix = " "
format-prefix-foreground = ${colors.col1}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /mnt/ext4
label-mounted = %{F#0a81f5}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
label-occupied = %index%
label-occupied-padding = 2
label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true
; This will split the workspace name on ':'
; Default: false
strip-wsnumbers = true
; using siji icons... see view.sh for codes
; not using siji anymore, check out nerdfonts.com!
;  
ws-icon-0 = 1:1;
ws-icon-1 = 2:2;
ws-icon-2 = 3:3;
ws-icon-3 = 4:4;
ws-icon-4 = 5:5;
ws-icon-5 = 6:6;
ws-icon-6 = 7:7;
ws-icon-7 = 8:8;
ws-icon-8 = 9:9;﬐
ws-icon-9 = 10:10;
ws-icon-10 = 11:;
ws-icon-11 = 12:;
ws-icon-default = 
; Whenever the 'move' changes... like 'resize', ...
label-mode-padding = 2
label-mode-foreground = ${colors.gruvfg}
;label-mode-background = ${colors.primary}
label-mode-background = ${colors.col4}
label-mode-underline = ${colors.col12}
; focused = Active workspace on focused monitor
label-focused = %icon% %name%
;label-focused = %index%
;label-focused-background = ${module/bspwm.label-focused-background}
;label-focused-underline = ${module/bspwm.label-focused-underline}
;label-focused-padding = ${module/bspwm.label-focused-padding}
label-focused-background = ${colors.col2}
label-focused-foreground = ${colors.gruvbghard}
label-focused-underline = ${colors.underline-i3-focused}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
;label-unfocused = %index%
label-unfocused = %icon% %name%
label-unfocused-underline = ${colors.underline-i3-unfocused}
;label-unfocused-padding = ${module/bspwm.label-occupied-padding}
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
; label-visible = %index%
label-visible = %icon% %name%
;label-visible-background = ${self.label-focused-background}
;label-visible-underline = ${self.label-focused-underline}
;label-visible-padding = ${self.label-focused-padding}
label-visible-background = ${colors.col12}
label-visible-foreground = ${colors.gruvbghard}
label-visible-underline = #FFFFFF
label-visible-padding = 2
; urgent = Workspace with urgency hint set
label-urgent = %icon% %name%
; label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-background = ${colors.col1}
label-urgent-foreground = ${colors.col9}
label-urgent-underline = ${colors.col9}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = 玲
icon-stop = 
icon-play = 
icon-pause = 
icon-next = 怜
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = 
; format-underline = ${colors.foreground-alt}
format-underline = ${colors.col6}
format-prefix-foreground = ${colors.underline-cpu}
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #ff
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = ${colors.col6}
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.col7}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
;card = intel_backlight
card = acpi_video0
[module/cpu]
type = internal/cpu
interval = 2
;format-prefix = " "
;format = <label> <ramp-coreload>
format = <ramp-coreload>
ramp-coreload-spacing = 0.5
ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
ramp-coreload-2 = ▃
ramp-coreload-3 = ▄
ramp-coreload-4 = ▅
ramp-coreload-5 = ▆
ramp-coreload-6 = ▇
ramp-coreload-7 = █
format-prefix = " "
format-prefix-foreground = ${colors.underline-cpu}
;format-underline = #f90000
format-underline = ${colors.underline-cpu}
label = %percentage-cores%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
;format-underline = #4bffdc
format-underline = ${colors.underline-memory}
label = %percentage_used%%
[module/updates-arch]
type = custom/script
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/updates-arch/updates-arch.sh
format-prefix = " "
format-prefix-foreground = ${colors.icon-color}
format-underline = ${colors.col13}
interval = 600
label = "%output%"
[module/reboot-check]
type = custom/script
exec = ~/bin/reboot.check
format-underline = ${colors.col1}
format-foreground = ${colors.col1}
interval = 30
label = ""
[module/wifi0]
type = internal/network
interface = wifi0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
;label-connected = %{A1:networkmanager_dmenu:}%essid%%{A}
;  
label-connected = "%{A1:networkmanager_dmenu:}%essid%%{A} %downspeed:3% %upspeed:3%"
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-1 = 
ramp-signal-2 = 
ramp-signal-3 = 
ramp-signal-4 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/net1]
type = internal/network
interface = net1
interval = 3.0
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.icon-color}
;label-connected = %local_ip%
label-connected = "%downspeed:3% %upspeed:3%"
label-connected-foreground = ${colors.foreground}
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date = " %Y-%m-%d"
date-alt =
time = %H:%M:%S
time-alt = %H:%M
format-prefix = ""
format-prefix-foreground = ${colors.foreground-alt}
;format-underline = #0a6cf5
;format-underline = ${colors.underline-date}
label = "%date% %time%"
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume =  %percentage%%
label-volume-foreground = ${root.foreground}
; the muted symbol comes from siji font (check the 'view.sh' script for altcodes)
label-muted =  muted
;label-muted-foreground = #66
label-muted-foreground = ${colors.alert}
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/alsa]
type = internal/alsa
format-volume = <label-volume> <bar-volume>
label-volume = VOL
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = sound muted
bar-volume-width = 10
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
bar-volume-foreground-3 = #55aa55
bar-volume-foreground-4 = #55aa55
bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
time-format = %H:%M
label-charging =  %time% %percentage%%
format-charging = <animation-charging> <label-charging>
;format-charging-underline = #ffb52a
format-charging-underline = ${colors.underline-battery}
label-discharging =  %time% %percentage%%
format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
;format-underline = #f50a4d
format-underline = ${colors.underline-temperature}
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
;found this with following command
; for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done
;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input
;hwmon-path = ${env:HWMON_PATH:/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input}
; different approach: add to .xinitrc a line that sets up an env variable
; > CPU_TEMP_PATH=$(ls /sys/devices/platform/coretemp*/hwmon/hwmon*/temp*_input | grep -m 1 '')
hwmon-path = ${env:CPU_TEMP_PATH:/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp5_input}
;hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
ramp-0 = 
ramp-1 = 
ramp-2 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = ⏻
label-open-foreground = ${colors.secondary}
label-close = " back"
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = systemctl reboot
menu-2-0 = power off
menu-2-0-exec = systemctl poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
[global/wm]
;margin-top = 5
;margin-bottom = 5
; vim:ft=dosini

View File

@ -0,0 +1,29 @@
#!/bin/zsh
# 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
# started tray...
started_tray=false
# set some global variables to be passed to polybar
export HWMON_PATH=$(ls /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp*_input | head -n 1)
# launch polybar on all connected monitors
for m in $(polybar --list-monitors | cut -d":" -f1); do
echo "Launching polybar on monitor $m"
MONITOR=$m TRAY_POSITION=none polybar --reload secondary &
if [ "$started_tray" = false ]; then
MONITOR=$m TRAY_POSITION=right polybar --reload example &
started_tray=true
echo "launching $m with tray"
else
MONITOR=$m TRAY_POSITION=none polybar --reload example &
echo "launching $m without tray"
fi
done
echo "Done launching."

View File

@ -0,0 +1,12 @@
#!/bin/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 Polybar, using default config location ~/.config/polybar/config
polybar example &
echo "Polybar launched..."

View File

@ -0,0 +1,14 @@
# Contributing to polybar-scripts
Thank you for your interest in improving polybar-scripts.
Some things that have become standard:
* The [skeleton](skeleton/). This is an example of how each script is organized to create a common file structure.
* Use `#` or `#1`, `#2` .. as icon replacement in your scripts. Everyone use another icon font. So let the user decide which icon he wants to use.
* Remove your colors unless they have a special function. This way scripts remain customizable.
## check your code
* Use `shellcheck` to check your shell scripts for possible errors. Otherwise, Travis CI will do it for you. A good start to try [ShellCheck](https://www.shellcheck.net/) is their website.

View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>

View File

@ -0,0 +1,79 @@
# polybar-scripts
[![Build Status](https://travis-ci.org/x70b1/polybar-scripts.svg?branch=master)](https://travis-ci.org/x70b1/polybar-scripts)
[![GitHub contributors](https://img.shields.io/github/contributors/x70b1/polybar-scripts.svg)](https://github.com/x70b1/polybar-scripts/graphs/contributors)
[![license](https://img.shields.io/github/license/x70b1/polybar-scripts.svg)](https://github.com/x70b1/polybar-scripts/blob/master/LICENSE)
This is a community project. We write and collect scripts for Polybar!
To find out how to write and use your own scripts, read [Polybars wiki](https://github.com/jaagr/polybar/wiki).
This repository is not an exact blueprint. I guess every script has to be customized to make your Polybar unique. We cannot guarantee that all scripts will work because many scripts are written for very specific purposes. But we're trying.
Your script isn't here yet? You have ideas to extend the scripts or descriptions? Send us your pull request or join us on freenode's `#polybar`.
## Hall of Fame
Is this your first time here? You should definitely take a look at these scripts:
* [battery-combined-udev](polybar-scripts/battery-combined-udev)
* [openweathermap-fullfeatured](polybar-scripts/openweathermap-fullfeatured)
* [player-mpris-tail](polybar-scripts/player-mpris-tail)
* [pulseaudio-tail](polybar-scripts/pulseaudio-tail)
* [system-usb-udev](polybar-scripts/system-usb-udev)
* [updates-arch-combined](polybar-scripts/updates-arch-combined)
* [info-hackspeed](polybar-scripts/info-hackspeed)
## all colors are beautiful
[![updates-arch-combined](polybar-scripts/updates-arch-combined/screenshots/1.png)](polybar-scripts/updates-arch-combined/)
[![system-cpu-temppercore](polybar-scripts/system-cpu-temppercore/screenshots/1.png)](polybar-scripts/system-cpu-temppercore/)
[![notification-chess](polybar-scripts/notification-chess/screenshots/1.png)](polybar-scripts/notification-chess/)
[![inbox-reddit](polybar-scripts/inbox-reddit/screenshots/1.png)](polybar-scripts/inbox-reddit/)
[![openvpn-isrunning](polybar-scripts/openvpn-isrunning/screenshots/1.png)](polybar-scripts/openvpn-isrunning/)
[![inbox-imap-python](polybar-scripts/inbox-imap-python/screenshots/1.png)](polybar-scripts/inbox-imap-python/)
[![openweathermap-fullfeatured](polybar-scripts/openweathermap-fullfeatured/screenshots/1.png)](polybar-scripts/openweathermap-fullfeatured/)
[![ticker-btceur](polybar-scripts/ticker-btceur/screenshots/1.png)](polybar-scripts/ticker-btceur/)
[![player-mpris-simple](polybar-scripts/player-mpris-simple/screenshots/1.png)](polybar-scripts/player-mpris-simple/)
[![battery-combined-tlp](polybar-scripts/battery-combined-tlp/screenshots/1.png)](polybar-scripts/battery-combined-tlp/)
[![info-projecthamster](polybar-scripts/info-projecthamster/screenshots/1.png)](polybar-scripts/info-projecthamster/)
[![system-usb-udev](polybar-scripts/system-usb-udev/screenshots/1.png)](polybar-scripts/system-usb-udev/)
[![system-usb-udev](polybar-scripts/system-usb-udev/screenshots/2.png)](polybar-scripts/system-usb-udev/)
[![openweathermap-simple](polybar-scripts/openweathermap-simple/screenshots/1.png)](polybar-scripts/openweathermap-simple/)
[![info-pingrtt](polybar-scripts/info-pingrtt/screenshots/3.png)](polybar-scripts/info-pingrtt/)
[![info-ssh-sessions](polybar-scripts/info-ssh-sessions/screenshots/1.png)](polybar-scripts/info-ssh-sessions/)
[![openweathermap-detailed](polybar-scripts/openweathermap-detailed/screenshots/1.png)](polybar-scripts/openweathermap-detailed/)
[![info-hackspeed](polybar-scripts/info-hackspeed/screenshots/1.png)](polybar-scripts/info-hackspeed/)
[![info-xampp](polybar-scripts/info-xampp/screenshots/1.png)](polybar-scripts/info-xampp/)
[![player-mpris-tail](polybar-scripts/player-mpris-tail/screenshots/1.png)](polybar-scripts/player-mpris-tail/)
[![info-redshift-temp](polybar-scripts/info-redshift-temp/screenshots/1.png)](polybar-scripts/info-redshift-temp/)
[![info-trash](polybar-scripts/info-trash/screenshots/1.png)](polybar-scripts/info-trash/)
[![pulseaudio-rofi](polybar-scripts/pulseaudio-rofi/screenshots/1.png)](polybar-scripts/pulseaudio-rofi/)
[![pulseaudio-rofi](polybar-scripts/info-softwarecounter/screenshots/1.png)](polybar-scripts/info-softwarecounter/)
[![info-twitch-countdown](polybar-scripts/info-twitch-countdown/screenshots/1.png)](polybar-scripts/info-twitch-countdown/)
[![info-twitch-countdown](polybar-scripts/info-twitch-countdown/screenshots/2.png)](polybar-scripts/info-twitch-countdown/)
[![info-todotxt](polybar-scripts/info-todotxt/screenshots/1.png)](polybar-scripts/info-todotxt/)
[![info-wifionice](polybar-scripts/info-wifionice/screenshots/1.png)](polybar-scripts/info-wifionice/)
## See also these other user repositories:
* [vyachkonovalov/polybar-gmail](https://github.com/vyachkonovalov/polybar-gmail): A Polybar module to show unread messages from Gmail
* [0nse/now_playing](https://github.com/0nse/now_playing): Output the currently scrobbling song
* [dakuten/taskwarrior-polybar](https://github.com/dakuten/taskwarrior-polybar): merely just a script showing the most urgent task and allowing it to be marked done
* [quelotic/polybarModules](https://github.com/quelotic/polybarModules): scripts for mail and caffeine
* [vyp/scripts](https://github.com/vyp/scripts): A script to show focused, occupied, free and urgent herbstluftwm tags in polybar
* [willHol/polybar-crypto](https://github.com/willHol/polybar-crypto): A polybar script that displays the price of crypto-currencies
* [DanaruDev/UnseenMail](https://framagit.org/DanaruDev/UnseenMail): Polybar Python script for viewing unread email from multi accounts
* [drdeimos/polybar_another_battery](https://github.com/drdeimos/polybar_another_battery): Simple battery charge level watcher with notifications (libnotify)
* [zemmsoares/polynews](https://github.com/zemmsoares/polynews): read news on your polybar
## Setup
* Save the script of your choice somewhere at `~/.config/polybar/`.
* Don't forget to make the script executable: `chmod +x ~/.config/polybar/script.sh`.
* Copy the module settings into your configuration file.
* Replace the appropriate icon strings in the script (e.g. replace `#1` with `🎉`).

View File

@ -0,0 +1,26 @@
#!/bin/sh
error_count=0
scripts="polybar-scripts/*/*.sh"
for file in $scripts; do
# Exceptions
if [ "$file" = "polybar-scripts/info-hackspeed/info-hackspeed.sh" ]; then
shellcheck --exclude=SC2016,SC2059 "$file"
if [ $? -ne 0 ]; then
error_count=$((error_count+1))
fi
else
shellcheck "$file"
if [ $? -ne 0 ]; then
error_count=$((error_count+1))
fi
fi
done
if [ $error_count -eq 0 ]; then
exit 0
else
exit 1
fi

View File

@ -0,0 +1,13 @@
language: c
install:
- scversion="stable"
- wget "https://storage.googleapis.com/shellcheck/shellcheck-$scversion.linux.x86_64.tar.xz"
- tar --xz -xvf "shellcheck-$scversion.linux.x86_64.tar.xz"
- shellcheck() { "shellcheck-$scversion/shellcheck" "$@"; }
before_script:
- shellcheck --version
script:
- source ${TRAVIS_BUILD_DIR}/build.sh

View File

@ -0,0 +1,15 @@
# Script: battery-combined-shell
A shell script that shows the battery status.
It supports two rechargeable batteries and changing icons. It works even if only one battery is used.
## Module
```ini
[module/battery-combined-shell]
type = custom/script
exec = ~/polybar-scripts/battery-combined-shell.sh
interval = 10
```

View File

@ -0,0 +1,61 @@
#!/bin/sh
path_ac="/sys/class/power_supply/AC"
path_battery_0="/sys/class/power_supply/BAT0"
path_battery_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$path_ac/online" ]; then
ac=$(cat "$path_ac/online")
fi
if [ -f "$path_battery_0/energy_now" ]; then
battery_level_0=$(cat "$path_battery_0/energy_now")
fi
if [ -f "$path_battery_0/energy_full" ]; then
battery_max_0=$(cat "$path_battery_0/energy_full")
fi
if [ -f "$path_battery_1/energy_now" ]; then
battery_level_1=$(cat "$path_battery_1/energy_now")
fi
if [ -f "$path_battery_1/energy_full" ]; then
battery_max_1=$(cat "$path_battery_1/energy_full")
fi
battery_level=$(("$battery_level_0 + $battery_level_1"))
battery_max=$(("$battery_max_0 + $battery_max_1"))
battery_percent=$(("$battery_level * 100"))
battery_percent=$(("$battery_percent / $battery_max"))
if [ "$ac" -eq 1 ]; then
icon="#1"
if [ "$battery_percent" -gt 97 ]; then
echo "$icon"
else
echo "$icon $battery_percent %"
fi
else
if [ "$battery_percent" -gt 85 ]; then
icon="#21"
elif [ "$battery_percent" -gt 60 ]; then
icon="#22"
elif [ "$battery_percent" -gt 35 ]; then
icon="#23"
elif [ "$battery_percent" -gt 10 ]; then
icon="#24"
else
icon="#25"
fi
echo "$icon $battery_percent %"
fi

View File

@ -0,0 +1,31 @@
# Script: battery-combined-tlp
A shell script that shows the battery status.
It uses TLP and requires root privileges. Note that the icon doesn't change.
![battery-combined-tlp](screenshots/1.png)
## Dependencies
* `tlp`
## Configuration
You may need to add `tlp-stat` command to the `/etc/sudoers` NOPASSWD of your user:
```ini
user ALL=(ALL) NOPASSWD: /usr/bin/tlp-stat
```
## Module
```ini
[module/battery-combined-tlp]
type = custom/script
exec = ~/polybar-scripts/battery-combined-tlp.sh
interval = 10
```

View File

@ -0,0 +1,5 @@
#!/bin/sh
battery=$(sudo tlp-stat -b | tail -2 | head -n 1 | tr -d -c "[:digit:],.")
echo "# $battery %"

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

View File

@ -0,0 +1,4 @@
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", \
RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", \
RUN+="/home/user/.config/polybar/battery-combined-udev.sh --update"

View File

@ -0,0 +1,24 @@
# Script: battery-combined-udev
A shell script that shows the battery status. This is an extended version of [battery-combined-shell](../battery-combined-shell).
It supports two rechargeable batteries and changing icons. It works even if only one battery is used.
This script is able to display power supply changes in real time. For this udev is being used.
## Configuration
Copy `95-battery.rules` to `/etc/udev/rules.d/95-battery.rules`. Make sure that the paths in the file have been modified properly.
Also change the file path in line `#65`.
## Module
```ini
[module/battery-combined-udev]
type = custom/script
exec = ~/polybar-scripts/battery-combined-udev.sh
tail = true
```

View File

@ -0,0 +1,88 @@
#!/bin/sh
battery_print() {
path_ac="/sys/class/power_supply/AC"
path_battery_0="/sys/class/power_supply/BAT0"
path_battery_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$path_ac/online" ]; then
ac=$(cat "$path_ac/online")
fi
if [ -f "$path_battery_0/energy_now" ]; then
battery_level_0=$(cat "$path_battery_0/energy_now")
fi
if [ -f "$path_battery_0/energy_full" ]; then
battery_max_0=$(cat "$path_battery_0/energy_full")
fi
if [ -f "$path_battery_1/energy_now" ]; then
battery_level_1=$(cat "$path_battery_1/energy_now")
fi
if [ -f "$path_battery_1/energy_full" ]; then
battery_max_1=$(cat "$path_battery_1/energy_full")
fi
battery_level=$(("$battery_level_0 + $battery_level_1"))
battery_max=$(("$battery_max_0 + $battery_max_1"))
battery_percent=$(("$battery_level * 100"))
battery_percent=$(("$battery_percent / $battery_max"))
if [ "$ac" -eq 1 ]; then
icon="#1"
if [ "$battery_percent" -gt 97 ]; then
echo "$icon"
else
echo "$icon $battery_percent %"
fi
else
if [ "$battery_percent" -gt 85 ]; then
icon="#21"
elif [ "$battery_percent" -gt 60 ]; then
icon="#22"
elif [ "$battery_percent" -gt 35 ]; then
icon="#23"
elif [ "$battery_percent" -gt 10 ]; then
icon="#24"
else
icon="#25"
fi
echo "$icon $battery_percent %"
fi
}
path_pid="/home/user/.config/polybar/battery-combined-udev.pid"
case "$1" in
--update)
pid=$(cat $path_pid)
if [ "$pid" != "" ]; then
kill -10 "$pid"
fi
;;
*)
echo $$ > $path_pid
trap exit INT
trap "echo" USR1
while true; do
battery_print
sleep 30 &
wait
done
;;
esac

View File

@ -0,0 +1,25 @@
# Script: battery-cyberpower
A shell script that shows the battery status for CyberPower UPS devices.
This script is able to display power supply changes in real time.
## Dependencies
* `pwrstat` from CyberPower's website
## Configuration
It requires access to run `pwrstat` as root, so you may need to adjust your system to allow this (for example `sudo`).
## Module
```ini
[module/battery-cyberpower]
type = custom/script
exec = ~/polybar-scripts/battery-cyberpower.sh
tail = true
```

View File

@ -0,0 +1,56 @@
#!/bin/sh
ICON_AC="#1"
ICON_BATTERY_FULL="#21"
ICON_BATTERY_GOOD="#22"
ICON_BATTERY_LOW="#23"
ICON_BATTERY_CAUTION="#24"
ICON_BATTERY_EMPTY="#25"
SHOW_ESTIMATION=1
battery_print() {
battery_info="$(sudo pwrstat -status)"
battery_capacity="$(echo "$battery_info" | awk '/Capacity/{print $3}')"
battery_ac="$(echo "$battery_info" | awk '/Power Supply by/{print $4,$5}')"
battery_load="$(echo "$battery_info" | grep "Load" | cut -d \( -f 2 | tr -d ' %)')"
battery_remaining="$(echo "$battery_info" | awk '/Remaining Runtime/{print $3}')"
output=""
if [ "$battery_ac" = "Utility Power" ]; then
if [ "$battery_capacity" -gt 97 ]; then
output="$ICON_AC"
else
output="$ICON_AC $battery_capacity %"
fi
else
if [ "$battery_capacity" -gt 85 ]; then
output="$ICON_BATTERY_FULL $battery_capacity %"
elif [ "$battery_capacity" -gt 60 ]; then
output="$ICON_BATTERY_GOOD $battery_capacity %"
elif [ "$battery_capacity" -gt 35 ]; then
output="$ICON_BATTERY_LOW $battery_capacity %"
elif [ "$battery_capacity" -gt 10 ]; then
output="$ICON_BATTERY_CAUTION $battery_capacity %"
else
output="$ICON_BATTERY_EMPTY $battery_capacity %"
fi
fi
if [ "$SHOW_ESTIMATION" -eq 1 ]; then
output="$output ($battery_load % / $battery_remaining min)"
fi
echo "$output"
}
trap exit INT
trap "echo" USR1
while true; do
battery_print "$@"
sleep 30 &
wait
done

View File

@ -0,0 +1,20 @@
# Script: inbox-imap-python
A script that shows if there are unread mails in your IMAPs inbox.
![inbox-imap-python](screenshots/1.png)
## Configuration
For Gmail, you must allow [less secure apps](https://myaccount.google.com/security#connectedapps).
## Module
```ini
[module/inbox-imap-python]
type = custom/script
exec = ~/polybar-scripts/inbox-imap-python.py
interval = 60
```

View File

@ -0,0 +1,9 @@
#!/usr/bin/python
import imaplib
obj = imaplib.IMAP4_SSL('imap.mail.net', 993)
obj.login('userlogin', 'pass123')
obj.select()
print(len(obj.search(None, 'unseen')[1][0].split()))

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

View File

@ -0,0 +1,27 @@
# Script: inbox-imap-shellnetrc
A script that shows if there are unread mails in your IMAP inbox.
This script actually use IMAPs. `curl` can also handle unencrypted IMAP. You only need to change the protocol in the command.
The login data is stored in a `.netrc`. This is more secure because the password is not visible in the process list.
## Dependencies
* `curl`
## Configuration
For Gmail, you must allow [less secure apps](https://myaccount.google.com/security#connectedapps).
## Module
```ini
[module/inbox-imap-shellnetrc]
type = custom/script
exec = ~/polybar-scripts/inbox-imap-shellnetrc.sh
interval = 60
```

View File

@ -0,0 +1,3 @@
machine mail.server.tld
login username
password supersecretpw

View File

@ -0,0 +1,12 @@
#!/bin/sh
SERVER=""
NETRC=".netrc"
inbox=$(curl -sf --netrc-file "$NETRC" -X "STATUS INBOX (UNSEEN)" imaps://"$SERVER"/INBOX | tr -d -c "[:digit:]")
if [ "$inbox" ] && [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo ""
fi

View File

@ -0,0 +1,22 @@
# Script: inbox-pop3-shellnetrc
A script that shows if there are unread mails in your POP3 inbox.
This script actually use POP3s. `curl` can also handle unencrypted POP3. You only need to change the protocol in the command.
The login data is stored in a `.netrc`. This is more secure because the password is not visible in the process list.
## Dependencies
* `curl`
## Module
```ini
[module/inbox-pop3-shellnetrc]
type = custom/script
exec = ~/polybar-scripts/inbox-pop3-shellnetrc.sh
interval = 60
```

View File

@ -0,0 +1,3 @@
machine mail.server.tld
login username
password supersecretpw

View File

@ -0,0 +1,12 @@
#!/bin/sh
SERVER=""
NETRC=".netrc"
inbox=$(curl -sf --netrc-file "$NETRC" pop3s://"$SERVER" | wc -l)
if [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo ""
fi

View File

@ -0,0 +1,23 @@
# Script: inbox-reddit
A script that shows if there are unread mails in your Reddit inbox.
Type Reddit JSON URL from [reddit.com/prefs/feeds/](https://www.reddit.com/prefs/feeds/). Click `your inbox` > `unread messages` > `JSON` and copy the link.
![inbox-reddit](screenshots/1.png)
## Dependencies
* `curl`
* `jq`
## Module
```ini
[module/inbox-reddit]
type = custom/script
exec = ~/polybar-scripts/inbox-reddit.sh
interval = 60
```

View File

@ -0,0 +1,15 @@
#!/bin/sh
url="your url here"
unread=$(curl -sf "$url" | jq '.["data"]["children"] | length')
case "$unread" in
''|*[!0-9]*)
unread=0
esac;
if [ "$unread" -gt 0 ]; then
echo "#1 $unread"
else
echo "#2"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,33 @@
# Script: info-hackspeed
A small script that shows your typing speed. Happy Hacking!
![info-hackspeed](screenshots/1.png)
## Dependencies
* `xorg-xinput`
* `awk`
* coreutils (`rm`, `stdbuf`, `mktemp`, `stat`, you probably have this)
## Configuration
* `KEYBOARD_ID`: name of your keyboard. See Setup above. Default: `AT Translated Set 2 keyboard`
* `METRIC`: either `cpm` (characters per minute) of `wpm` ([words per minute, 1 word = 5 characters](https://en.wikipedia.org/wiki/Words_per_minute)). Default: `cpm`
* `FORMAT`: format string according to which the metric will be output. Default: `# %d $METRIC`
* `INTERVAL`: amount of seconds to gather data. Default: 20
* `LAYOUT`: keyboard layout, to be able to only count letters and numbers. Currently supported are `qwerty` and `azerty`. If you have a different layout, please contribute a condition for it! See the script's source code. Use the special value `dontcare` to count all keys, not just letters and numbers. Default: `qwerty`
If after 20 seconds the value stays at 0 even though you're typing, you may have to configure the name of your keyboard. Change the setting `KEYBOARD_ID` (see Configuration below) in the script. You can find your keyboard description with `xinput list --short`.
## Module
```ini
[module/info-hackspeed]
type = custom/script
exec = ~/polybar-scripts/info-hackspeed.sh
tail = true
```

View File

@ -0,0 +1,61 @@
#!/bin/sh
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)'; ;;
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

View File

@ -0,0 +1,13 @@
# Script: info-kernel
A script that shows the running kernel version.
## Module
```ini
[module/info-kernel]
type = custom/script
exec = uname -r
interval = 1024
```

View File

@ -0,0 +1,17 @@
# Script: info-pingrtt
A script that displays a ping result. It also shows a colored icon.
![info-pingrtt](screenshots/1.png)
![info-pingrtt](screenshots/2.png)
![info-pingrtt](screenshots/3.png)
## Module
```ini
[module/info-pingrtt]
type = custom/script
exec = ~/polybar-scripts/info-pingrtt.sh
interval = 10
```

View File

@ -0,0 +1,19 @@
#!/bin/sh
HOST=127.43.12.64
if ! ping=$(ping -n -c 1 -W 1 $HOST); then
echo "# ping failed"
else
rtt=$(echo "$ping" | sed -rn 's/.*time=([0-9]{1,})\.?[0-9]{0,} ms.*/\1/p')
if [ "$rtt" -lt 50 ]; then
icon="%{F#3cb703}#%{F-}"
elif [ "$rtt" -lt 150 ]; then
icon="%{F#f9dd04}#%{F-}"
else
icon="%{F#d60606}#%{F-}"
fi
echo "$icon $rtt ms"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

View File

@ -0,0 +1,15 @@
# Script: info-projecthamster
This script displays Hamster Time Tracker information.
![info-projecthamster](screenshots/1.png)
## Module
```ini
[module/info-projecthamster]
type = custom/script
exec = ~/polybar-scripts/info-projecthamster.sh
interval = 5
```

View File

@ -0,0 +1,9 @@
#!/bin/sh
activity=$(hamster current 2> /dev/null | cut -d " " -f 3- | sed 's/@.* / - /')
if [ -n "$activity" ]; then
echo "$activity"
else
echo "No Activity"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,15 @@
# Script: info-redshift-temp
This script displays the current color temperature.
![info-redshift](screenshots/1.png)
## Module
```ini
[module/info-redshift-temp]
type = custom/script
exec = ~/polybar-scripts/info-redshift-temp.sh
interval = 5
```

View File

@ -0,0 +1,15 @@
#!/bin/sh
if [ "$(pgrep -x redshift)" ]; then
temp=$(redshift -p 2> /dev/null | grep temp | cut -d ":" -f 2 | tr -dc "[:digit:]")
if [ -z "$temp" ]; then
echo "%{F#65737E} #"
elif [ "$temp" -ge 5000 ]; then
echo "%{F#8FA1B3} #"
elif [ "$temp" -ge 4000 ]; then
echo "%{F#EBCB8B} #"
else
echo "%{F#D08770} #"
fi
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

View File

@ -0,0 +1,25 @@
# Script: info-softwarecounter
A script that counts the number of specified running software including GUIs and processes.
Options to only monitor GUI applications or only processes exist. Users can add their own applications or processes they wish to watch simply by updating the existing dictionaries at the start of the script.
Arbitrary program counts can be combined, for example, the vim/nvim or chrome/chromium counts can be added together and the total displayed.
![info-softwarecounter](screenshots/1.png)
## Dependencies
* `wmctrl`
* `pgrep`
## Module
```
[module/info-softwarecounter]
type = custom/script
exec = ~/polybar-scripts/info-softwarecounter.py
interval = 10
```

View File

@ -0,0 +1,145 @@
#!/usr/bin/env python3
import subprocess
import sys
from collections import Counter, OrderedDict
# update GUIs
GUI = True
# update processes
PROCESS = True
# program/process names and corresponding gylphs
guis = OrderedDict({
'terminals': '#',
'chromes': '#',
'firefox': '#',
'skypeforlinux': '#',
'filemanager': '#',
'remote-desktop': '#',
'pdfviewer': '#',
'image': '#',
})
processes = OrderedDict({
'vims': '#',
'ssh': '#',
'updater': '#',
})
# combine counts of program/process names in the tuple
# the resulting glpyh used will be that of the corresponding key
combine_guis = {
'terminals': ('termite', 'terminator', 'urxvt'),
'chromes': ('chromium', 'chrome'),
'filemanger': ('nemo', 'thunar', 'dolphin', 'nautilus', 'pcmanfm'),
'remote-desktop': ('TeamViewer', ),
'pdfviewer': ('evince', 'okular', 'zathura'),
'image': ('gthumb', 'shotwell', 'deepin-image-vi'),
}
combine_proccesses = {
'vims': ('nvim', 'vim'),
'updater': ('pacman', 'yay', 'trizen', 'yaourt'),
}
gui_output = ''
process_output = ''
if GUI:
def get_running_guis():
try:
listed = sys.argv[1]
except IndexError:
listed = []
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8").strip()
def check_wtype(w_id):
# check the type of window, only list "NORMAL" windows
return "_NET_WM_WINDOW_TYPE_NORMAL" in get(["xprop", "-id", w_id])
def get_process(w_id):
# get the name of the process, owning the window
proc = get(["ps", "-p", w_id, "-o", "comm="])
return proc
wlist = [l.split() for l in subprocess.check_output(["wmctrl", "-lp"])\
.decode("utf-8").splitlines()]
validprocs = [
get_process(w[2]) for w in wlist if check_wtype(w[0]) == True
]
return validprocs
# get list of running GUI programs
gui_counts = Counter(get_running_guis())
# combine programs in program combine list
for k, lst in combine_guis.items():
count = 0
for i in lst:
try:
count += gui_counts.pop(i)
except KeyError:
pass
if count:
gui_counts[k] += count
# generate program output
for k, v in guis.items():
try:
c = gui_counts[k]
if c:
gui_output += '%s %i ' % (v, c)
except:
pass
if PROCESS:
def get_running_proc(process_name_list):
counts = [None] * len(process_name_list)
for i, p in enumerate(process_name_list):
try:
count = int(
subprocess.check_output(['pgrep', '-c', '-x',
p]).decode('utf-8'))
except subprocess.CalledProcessError:
count = 0
counts[i] = (p, count)
return dict(counts)
# count running proccesses
process_counts = get_running_proc(processes.keys())
combine_counts = get_running_proc(
list(sum(combine_proccesses.values(), ())))
process_counts.update(combine_counts)
# combine processes in process combine list
for k, lst in combine_proccesses.items():
count = 0
for i in lst:
try:
count += process_counts.pop(i)
except KeyError:
pass
if count:
process_counts[k] += count
# generate process output
for k, v in processes.items():
try:
c = process_counts[k]
if c:
process_output += '%s %i ' % (v, c)
except:
pass
print(gui_output + process_output)

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -0,0 +1,20 @@
# Script: info-ssh-sessions
A script that displays the count of current ssh sessions as well as the public IP address of the fist session.
![info-ssh-sessions](screenshots/1.png)
## Dependencies
* `lsof`
## Module
```ini
[module/info-ssh-sessions]
type = custom/script
exec = ~/polybar-scripts/info-ssh-sessions.sh
interval = 5
```

View File

@ -0,0 +1,10 @@
#!/bin/sh
sessions="$(lsof -Pi | grep ":22")"
if [ ! -z "$sessions" ]; then
count=$(echo "$sessions" | wc -l)
echo "# ($count): $(echo "$sessions" | cut -d ">" -f 2 | cut -d " " -f 1 | cut -d ":" -f 1 | tail -n 1)"
else
echo "# (0)"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,15 @@
# Script: info-todotxt
A script that shows todo.txt items due. The first column shows items due today, and the second column shows items due this week (including today).
![todotxt](screenshots/1.png)
## Module
```ini
[module/info-todotxt]
type = custom/script
exec = ~/polybar-scripts/info-todotxt.sh
interval = 60
```

View File

@ -0,0 +1,16 @@
#!/bin/sh
duetoday=$(grep "due:$(date -I)" ~/todo.txt | grep -c -v "x")
dueweek=0
weekday=0
while [ "$weekday" -le 7 ]; do
dueweek=$((dueweek + $(grep "due:$(date -I --date="$weekday day")" ~/todo.txt | grep -c -v "x")))
weekday=$(( weekday + 1 ))
done
if [ "$dueweek" -gt 0 ]; then
echo "#1 $duetoday $dueweek"
else
echo "#2"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

View File

@ -0,0 +1,16 @@
# Script: info-trash
This script count the files in you trash directory.
![info-trash](screenshots/1.png)
## Module
```ini
[module/info-trash]
type = custom/script
exec = ~/polybar-scripts/info-trash.sh
interval = 60
click-left = ~/polybar-scripts/info-trash.sh --clean
```

View File

@ -0,0 +1,13 @@
#!/bin/sh
case "$1" in
--clean)
rm -rf ~/.local/share/Trash/files
rm -rf ~/.local/share/Trash/info
mkdir ~/.local/share/Trash/files
mkdir ~/.local/share/Trash/info
;;
*)
find ~/.local/share/Trash/files/ -maxdepth 1 | wc -l
;;
esac

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

View File

@ -0,0 +1,37 @@
# Script: info-twitch-countdown
This script pulls the time a live streamer is streaming from their Streamlabs countdown on their twitch page.
Please note that because Streamlabs does not have a public API, a Chromium process is launched to gather the information. This will use about 250 MiB of memory for a few seconds every hour. You can also include multiple instances of this on your bar to view the stream times of multiple twitch streamers.
![info-twitch-countdown](screenshots/1.png)
![info-twitch-live](screenshots/2.png)
## Dependencies
* `chromium`
* `jq`
* [cyrus-and/chrome-har-capturer](https://github.com/cyrus-and/chrome-har-capturer)
## Configuration
Get a Twitch Client ID:
* Go to [twitch.tv/console/apps/create](https://glass.twitch.tv/console/apps/create) and sign in
* Login, then go to `Apps` > `Register`
* Use any name and category, and set OAuth Redirect URL to `http://localhost`
* Click Manage on the application, and copy the Client ID from the end of the URL or from the box
If you want to be hide the seconds on the counter, you may comment the "showSeconds" line in the script. Please note that you may experience 10-20 seconds pauses every hour when the countdown updates.
## Module
```ini
[module/info-twitch-countdown]
type = custom/script
exec = ~/polybar-scripts/info-twitch-countdown.sh <streamer username>
tail = true
```

View File

@ -0,0 +1,68 @@
#!/bin/bash
streamer="$1" # You may change this to the streamer's username to override the command line argument.
filePath=""
clientId=
showSeconds=":%S" # Uncomment to hide seconds in countdown
function checkLive() {
while [[ $(curl -s https://api.twitch.tv/helix/streams?user_login="$streamer" -H "Client-ID: $clientId" | jq '.data[] | select(.type=="live")') ]]; do
echo "#1 LIVE"
sleep 10
done
}
function updateAuth() {
chromium --remote-debugging-port=9222 --headless >/dev/null 2>&1 & disown
sleep .1
chrome-har-capturer -f -c -g 7500 -o "$filePath/$streamer.har" https://twitch.tv/"$streamer" >/dev/null 2>&1
kill -1 "$(pgrep -f 'chromium --remote-debugging-port=9222 --headless')"
}
function checkReauth() {
if [[ ! -f "$filePath/$streamer.har" || "$(($(date +%s)-$(date +%s -r "$filePath/$streamer.har")))" -gt 3300 ]]; then
updateAuth
fi
}
function updateData() {
auth=$(jq -r '.["log"]["entries"][]["request"] | select(.url=="https://xt.streamlabs.com/api/v5/twitch-extensions/countdown/settings") | select(.method=="GET") | .["headers"][] | select(.name=="authorization") | .value' "$filePath/$streamer.har")
countdownData=$(curl -s https://xt.streamlabs.com/api/v5/twitch-extensions/countdown/settings -H "Authorization: $auth")
days=$(echo "$countdownData" | jq -r '.["enabled"] | keys[] as $k | "\($k), \(.[$k])" | select(endswith("true"))' | cut -d ',' -f1)
[[ -n "$1" ]] && days=$(echo "$days" | sed "/$1/d")
closestDay="8days"
for i in $days; do
dayUnixTime=$(date +%s --date="$i")
if [[ "$dayUnixTime" -lt "$(date +%s --date=$closestDay)" ]]; then
closestDay="$i"
fi
done
hour=$(echo "$countdownData" | jq -r ".[\"$closestDay\"][][\"HH\"]")
minute=$(echo "$countdownData" | jq -r ".[\"$closestDay\"][][\"mm\"]")
timeZone=$(echo "$countdownData" | jq '.["timezone"]')
streamTime=$(date +%s --date="TZ=$timeZone $closestDay $hour:$minute")
[[ "$(date +%s)" -gt "$streamTime" ]] && updateData "$closestDay"
}
function main() {
while [[ "$streamTime" -ge "$(date +%s)" ]]; do
daysUntil="$(((streamTime - $(date +%s))/86400)):"
[[ "$daysUntil" == "0:" ]] && daysUntil=
countdown="$(date -u --date @$((streamTime - "$(date +%s)")) +$daysUntil%H:%M"$showSeconds")"
echo "#2 $countdown"
[ $(($(date +%s) % 10)) -eq 0 ] && checkLive
checkReauth
sleep 1
done
checkLive
updateAuth
updateData
main
}
checkLive
updateAuth
updateData
main

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,20 @@
# Script: info-wifionice
This script shows some information about the current ICE train of Deutsche Bahn. It requests the data from the local information portal and was obviously hacked in a train.
![info-wifionice](screenshots/1.png)
## Dependencies
* You have to be logged in to the local SSID `WIFIonICE`.
## Module
```ini
[module/info-wifionice]
type = custom/script
exec = ~/polybar-scripts/info-wifionice.sh
interval = 10
```

View File

@ -0,0 +1,30 @@
#!/bin/sh
wifionice=$(curl -sf https://iceportal.de/api1/rs/status)
if [ "$(echo "$wifionice" | jq .connection)" = "true" ]; then
wifionice_speed=$(echo "$wifionice" | jq .speed)
if [ "$wifionice_speed" -ne 0 ]; then
wifionice_speed="$wifionice_speed km/h"
else
wifionice_speed=""
fi
station=$(curl -sf https://iceportal.de/api1/rs/tripInfo/trip | jq '[.[].stops[]? | select(.info.passed == false)][0]')
station_name=$(echo "$station" | jq -r '.station.name')
station_track=$(echo "$station" | jq -r '.track.actual')
station_arrival=$(echo "$station" | jq -r '.timetable.scheduledArrivalTime')
station_arrival=$(date --date="@$((station_arrival / 1000))" +%H:%M)
station_delay=$(echo "$station" | jq -r '.timetable.arrivalDelay')
if [ ! -z "$station_delay" ]; then
station_delay=" %{F#d60606}($station_delay)%{F-}"
else
station_delay=""
fi
echo "# $station_arrival$station_delay - $station_name, Gl. $station_track - $wifionice_speed"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,21 @@
# Script: info-wmname
This script prints the value of the window manager name property of the root window.
The BSPWM window manger, and maybe some more, has some problems with java scaling. To solve this you can [set the value of the window manager name property](https://wiki.archlinux.org/index.php/java#Impersonate_another_window_manager) to something different.
## Dependencies
* `wmname`
## Module
```ini
[module/info-wmname]
type = custom/script
exec = ~/polybar-scripts/info-wmname.sh
interval = 5
click-left = ~/polybar-scripts/info-wmname.sh --toggle
```

View File

@ -0,0 +1,15 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(wmname)" != "BSPWM" ]; then
wmname BSPWM
else
wmname LG3D
fi
;;
*)
wmname=$(wmname)
echo "# $wmname"
;;
esac

View File

@ -0,0 +1,24 @@
# Script: info-xampp
The Script prints the status of [XAMPP](https://www.apachefriends.org/de/index.html) services (Apache, MySQL, ProFTPD) if they are running.
![info-xampp](screenshots/1.png)
## Configuration
You may need to add `xampp` command to the `/etc/sudoers` NOPASSWD of your user:
```ini
user ALL=(ALL) NOPASSWD: /opt/lampp/xampp
```
## Module
```ini
[module/info-xampp]
type = custom/script
exec = ~/polybar-scripts/info-xampp.sh
interval = 10
```

View File

@ -0,0 +1,21 @@
#!/bin/sh
if sudo /opt/lampp/xampp status | grep -q "Apache is running."; then
status_apache="#11"
else
status_apache="#12"
fi
if sudo /opt/lampp/xampp status |grep -q "MySQL is running."; then
status_mysql="#21"
else
status_mysql="#22"
fi
if sudo /opt/lampp/xampp status | grep -q "ProFTPD is running."; then
status_ftp="#31"
else
status_ftp="#32"
fi
echo "$status_apache $status_mysql $status_ftp"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,13 @@
# Script: isactive-bluetooth
A script that shows if bluetooth is on or off.
## Module
```ini
[module/isactive-bluetooth]
type = custom/script
exec = ~/polybar-scripts/isactive-bluetooth.sh
interval = 10
```

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ "$(systemctl is-active bluetooth.service)" = "active" ]; then
echo "#1"
else
echo "#2"
fi

View File

@ -0,0 +1,16 @@
# Script: isrunning-claudius
A tiny module to report the state of claudius, the alternative filepicker for Discord.
Left click launches or closes claudius.
## Module
```ini
[module/isrunning-claudius]
type = custom/script
exec = ~/polybar-scripts/isrunning-claudius.sh
interval = 5
click-left = ~/polybar-scripts/isrunning-claudius --toggle
```

View File

@ -0,0 +1,18 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep claudius)" ]; then
pkill claudius
else
claudius &
fi
;;
*)
if [ "$(pgrep claudius)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -0,0 +1,14 @@
# Script: isrunning-compton
A simple script that allows you to toggle compton and shows if it is running.
## Module
```ini
[module/isrunning-compton]
type = custom/script
exec = ~/polybar-scripts/isrunning-compton.sh
interval = 5
click-left = ~/polybar-scripts/isrunning-compton.sh --toggle
```

View File

@ -0,0 +1,18 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep -x compton)" ]; then
pkill compton
else
compton -b --config ~/.config/compton/config
fi
;;
*)
if [ "$(pgrep -x compton)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -0,0 +1,14 @@
# Script: dropbox-isrunning
A script that shows if the dropbox client is running. You can also start and stop the client.
## Module
```ini
[module/dropbox-isrunning]
type = custom/script
exec = ~/polybar-scripts/dropbox-isrunning.sh
interval = 5
click-left = ~/polybar-scripts/dropbox-isrunning.sh --toggle
```

View File

@ -0,0 +1,18 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep dropbox)" ]; then
pkill -f dropbox
else
dropbox &
fi
;;
*)
if [ "$(pgrep dropbox)" ]; then
echo "#1"
else
echo "#2"
fi
;;
esac

View File

@ -0,0 +1,14 @@
# Script: isrunning-offlineimap
A script that shows if offlineimap is running. The scripts require you to have setup offlineimap yourself.
## Module
```ini
[module/offlineimap-isrunning]
type = custom/script
exec = ~/polybar-scripts/offlineimap-isrunning.sh
interval = 5
click-left = ~/polybar-scripts/offlineimap-isrunning.sh --toggle
```

View File

@ -0,0 +1,18 @@
#!/bin/sh
case "$1" in
--toggle)
if [ "$(pgrep offlineimap)" ]; then
pkill -f offlineimap
else
nohup offlineimap > /tmp/offlineimap.log &
fi
;;
*)
if [ "$(pgrep offlineimap)" ]; then
echo "#1 Online"
else
echo "#2 Offline"
fi
;;
esac

View File

@ -0,0 +1,18 @@
# Script: news-archlinux
A Python script that shows Arch Linux RSS news.
## Dependencies
* [python-feedparser](https://github.com/kurtmckee/feedparser//)
## Module
```ini
[module/news-archlinux]
type = custom/script
exec = ~/polybar-scripts/news-archlinux.py
interval = 600
```

View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import feedparser
from subprocess import call
import re
import textwrap
d = feedparser.parse("https://www.archlinux.org/feeds/news/")
for f in range(0, 1):
print(d.entries[f].title)
xy = d.entries[f].title

View File

@ -0,0 +1,23 @@
# Script: notification-chess
A small script that indicates whether you need to move.
![notification-chess](screenshots/1.png)
## Dependencies
* `curl`
* `jq`
* obviously a chess.com account
## Module
```ini
[module/notification-chess]
type = custom/script
exec = ~/polybar-scripts/notification-chess.sh
interval = 10
click-left = xdg-open https://www.chess.com/goto_ready_game & disown
```

View File

@ -0,0 +1,10 @@
#!/bin/sh
username=""
games=$(curl -sf "https://api.chess.com/pub/player/$username/games/to-move" | jq ".[] | length")
if [ "$games" -gt 0 ]; then
echo "#1 $games"
else
echo "#2"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

View File

@ -0,0 +1,24 @@
# Script: notification-github
A small script that shows your GitHub notifications.
## Dependencies
* `curl`
* `jq`
## Configuration
Generate a token at `GitHub Settings` > `Developer settings` > `Personal access tokens`.
## Module
```ini
[module/notification-github]
type = custom/script
exec = ~/polybar-scripts/notification-github.sh
interval = 60
```

Some files were not shown because too many files have changed in this diff Show More