i3-gaps, polybar
This commit is contained in:
41
.Xresources
Normal file
41
.Xresources
Normal file
@ -0,0 +1,41 @@
|
||||
xterm*Background:black
|
||||
xterm*Foreground:white
|
||||
xterm*cursorColor:green
|
||||
!xterm*pointerShape:arrow
|
||||
!xterm*pointerColor:blue
|
||||
xterm*VT100.geometry:80x32
|
||||
xterm*faceName:Terminus:style=Regular:size=9
|
||||
!xterm*font:-*-terminus-medium-*-*-*-14-*-*-*-*-*-*-*
|
||||
!xterm*faceName:Inconsolata:style=Regular:size=11
|
||||
!xterm*font:-*-dina-medium-r-*-*-16-*-*-*-*-*-*-*
|
||||
!xterm*renderFont:false
|
||||
xterm*dynamicColors:true
|
||||
xterm*utf8:2
|
||||
xterm*eightBitInput:true
|
||||
xterm*saveLines:4096
|
||||
xterm*scrollKey:true
|
||||
xterm*scrollTtyOutput:false
|
||||
xterm*scrollBar:true
|
||||
xterm*rightScrollBar:true
|
||||
xterm*jumpScroll:true
|
||||
xterm*multiScroll:true
|
||||
xterm*toolBar:false
|
||||
xterm*locale:true
|
||||
xterm*termName:xterm-256color
|
||||
xterm*metaSendsEscape:true
|
||||
|
||||
urxvt*font:-xos4-terminus-*-*-*-*-12-*-*-*-*-*-*-*
|
||||
!urxvt*depth: 32
|
||||
!urxvt*background: rgba:0000/0000/0200/c800
|
||||
!urxvt*transparent: false
|
||||
|
||||
!URxvt.depth: 32
|
||||
!URxvt.background: [95]#000000
|
||||
!!urxvt*shading: 60
|
||||
|
||||
URxvt*inheritPixmap: true
|
||||
1URxvt*transparent: true
|
||||
! URxvt*shading: 0 to 99 darkens, 101 to 200 lightens
|
||||
URxvt*shading: 20
|
||||
|
||||
urxvt*saveLines:8192
|
184
.config/i3/config
Normal file
184
.config/i3/config
Normal file
@ -0,0 +1,184 @@
|
||||
# i3 config file (v4)
|
||||
|
||||
set $mod Mod4
|
||||
set $TERMINAL urxvt
|
||||
|
||||
# Font for window titles. Will also be used by the bar unless a different font
|
||||
# is used in the bar {} block below.
|
||||
font pango:Jetbrains Mono 10
|
||||
# font pango:Terminus 10
|
||||
# font Terminus
|
||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||
floating_modifier $mod
|
||||
|
||||
# start a terminal
|
||||
bindsym $mod+Return exec "$TERMINAL &"
|
||||
bindsym $mod+Shift+Return exec "$TERMINAL --role=floating &"
|
||||
|
||||
# kill focused window
|
||||
bindsym $mod+Shift+q kill
|
||||
|
||||
# start dmenu (a program launcher)
|
||||
bindsym $mod+d exec --no-startup-id rofi -show drun
|
||||
bindsym $mod+i exec --no-startup-id rofi -show window
|
||||
|
||||
# move focused window
|
||||
bindsym $mod+j move left
|
||||
bindsym $mod+k move down
|
||||
bindsym $mod+l move up
|
||||
bindsym $mod+semicolon move right
|
||||
|
||||
# alternatively, you can use the cursor keys:
|
||||
bindsym $mod+Left move left
|
||||
bindsym $mod+Down move down
|
||||
bindsym $mod+Up move up
|
||||
bindsym $mod+Right move right
|
||||
|
||||
# split in horizontal orientation
|
||||
bindsym $mod+h split h
|
||||
|
||||
# split in vertical orientation
|
||||
bindsym $mod+v split v
|
||||
|
||||
# enter fullscreen mode for the focused container
|
||||
bindsym $mod+f fullscreen toggle
|
||||
|
||||
# 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
|
||||
|
||||
# Define names for default workspaces for which we configure key bindings later on.
|
||||
# We use variables to avoid repeating the names in multiple places.
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
bindsym $mod+1 workspace $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
|
||||
|
||||
# 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
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||
bindsym $mod+Shift+r restart
|
||||
# exit i3 (logs you out of your X session)
|
||||
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'Exit i3 and end your X session?' -b 'Yes' '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
|
||||
|
||||
bindsym j resize shrink width 10 px or 10 ppt
|
||||
bindsym k resize grow height 10 px or 10 ppt
|
||||
bindsym l resize shrink height 10 px or 10 ppt
|
||||
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||
|
||||
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
|
||||
|
||||
bindsym Shift+j resize shrink width 1 px or 1 ppt
|
||||
bindsym Shift+k resize grow height 1 px or 1 ppt
|
||||
bindsym Shift+l resize shrink height 1 px or 1 ppt
|
||||
bindsym Shift+semicolon resize grow width 1 px or 1 ppt
|
||||
|
||||
bindsym Shift+Left resize shrink width 1 px or 1 ppt
|
||||
bindsym Shift+Down resize grow height 1 px or 1 ppt
|
||||
bindsym Shift+Up resize shrink height 1 px or 1 ppt
|
||||
bindsym Shift+Right resize grow width 1 px or 1 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"
|
||||
|
||||
# custom shit
|
||||
|
||||
# startup
|
||||
exec_always --no-startup-id $HOME/.config/polybar/launch.sh
|
||||
#exec_always --no-startup-id /$HOME/.config/polybar/i3wmthemer_bar_launch.sh
|
||||
|
||||
exec --no-startup-id i3-msg 'exec $TERMINAL; workspace 2; exec firefox;'
|
||||
exec --no-startup-id feh --bg-scale ~/Wallpapers/seneca.jpg
|
||||
exec --no-startup-id xrandr --output HDMI1 --right-of eDP1
|
||||
|
||||
exec telegram-desktop
|
||||
# exec cantata
|
||||
|
||||
exec --no-startup-id sleep 4; i3-msg '[class="Mattermost"] move scratchpad; [class="Telegram"] move scratchpad'
|
||||
|
||||
# gaps
|
||||
gaps inner 10
|
||||
|
||||
# settings
|
||||
hide_edge_borders both
|
||||
for_window [class="^.*"] title_format "%title [%class]"
|
||||
for_window [class="^.*"] border pixel 0
|
||||
for_window [class="Telegram"] gaps outer 0
|
||||
for_window [class="Mattermost"] gaps outer 0
|
||||
for_window [window_role="floating"] floating enable
|
||||
for_window [class="QSyncthingTray"] floating enable
|
||||
for_window [class="Thunderbird" window_type="normal"] floating enable, resize set 1024 768
|
||||
for_window [class="Gnome-calculator"] floating enable
|
||||
for_window [class="Blueberry.py"] floating enable
|
||||
for_window [class="Pavucontrol"] floating enable
|
||||
|
||||
# keybinds
|
||||
bindsym Mod1+Tab workspace back_and_forth
|
||||
bindsym $mod+Tab focus right
|
||||
bindsym $mod+Ctrl+Tab focus left
|
||||
bindsym Print exec "~/bin/screenshot.sh"
|
||||
bindsym $mod+Print exec "owo -s --fullscreen --no-cursor"
|
||||
|
||||
bindsym $mod+minus [class="Telegram"] scratchpad show
|
||||
bindsym $mod+p [class="Mattermost"] scratchpad show
|
||||
|
||||
# audio binds
|
||||
bindsym XF86AudioMicMute exec --no-startup-id pulseaudio-ctl mute-input
|
||||
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume alsa_output.pci-0000_00_1f.3.analog-stereo +10% && pactl set-sink-mute 1 0
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume alsa_output.pci-0000_00_1f.3.analog-stereo -10% && pactl set-sink-mute 1 0
|
||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute alsa_output.pci-0000_00_1f.3.analog-stereo toggle
|
||||
|
||||
# backlight binds
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id ~/bin/brightness.sh down
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id ~/bin/brightness.sh up
|
||||
|
314
.config/polybar/backup/config
Normal file
314
.config/polybar/backup/config
Normal file
@ -0,0 +1,314 @@
|
||||
[colors]
|
||||
background = #aa222222
|
||||
#background-alt = #aa444444
|
||||
foreground = #dfdfdf
|
||||
foreground-alt = #555555
|
||||
primary = #7596ff
|
||||
secondary = #e60053
|
||||
alert = #bd2c40
|
||||
|
||||
[settings]
|
||||
screenchange-reload = false
|
||||
format-background = ${colors.background}
|
||||
format-foreground = ${colors.foreground}
|
||||
|
||||
[bar/mybar]
|
||||
monitor =
|
||||
fixed-center = true
|
||||
width = 100%
|
||||
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
height = 35
|
||||
line-size = 1
|
||||
|
||||
padding = 2.5
|
||||
module-margin = 2.5
|
||||
|
||||
font-0 = IBM Plex Sans Bold:size=8;0
|
||||
font-1 = FontAwesome5Free:style=Solid:pixelsize=8;0
|
||||
font-2 = FontAwesome5Brands:style=Solid:pixelsize=8;0
|
||||
|
||||
modules-left = i3 bspwm xwindow
|
||||
modules-center = date
|
||||
modules-right = my-apps backlight updates-arch-combined mpd pulseaudio wlan filesystem memory cpu battery temperature
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 0
|
||||
|
||||
cursor-click = pointer
|
||||
|
||||
|
||||
[module/my-apps]
|
||||
type = custom/menu
|
||||
|
||||
; If true, <label-toggle> will be to the left of the menu items (default).
|
||||
; If false, it will be on the right of all the items.
|
||||
expand-right = false
|
||||
|
||||
; "menu-LEVEL-N" has the same properties as "label-NAME" with
|
||||
; the additional "exec" property
|
||||
;
|
||||
; Available exec commands:
|
||||
; menu-open-LEVEL
|
||||
; menu-close
|
||||
; Other commands will be executed using "/usr/bin/env sh -c $COMMAND"
|
||||
|
||||
menu-0-0 = Browsers
|
||||
menu-0-0-exec = menu-open-1
|
||||
|
||||
menu-1-0 = Firefox
|
||||
menu-1-0-exec = firefox &
|
||||
menu-1-1 = Chromium
|
||||
menu-1-1-exec = chromium &
|
||||
|
||||
|
||||
[module/i3]
|
||||
type = internal/i3
|
||||
format = <label-state> <label-mode>
|
||||
wrapping-scroll = false
|
||||
|
||||
label-mode-padding = 2
|
||||
label-mode-foreground = #000
|
||||
label-mode-background = ${colors.primary}
|
||||
|
||||
; focused = Active workspace on focused monitor
|
||||
label-focused = %icon%
|
||||
label-focused-background = ${colors.background-alt}
|
||||
label-focused-overline = ${colors.primary}
|
||||
label-focused-padding = 2
|
||||
|
||||
; unfocused = Inactive workspace on any monitor
|
||||
label-unfocused = %icon%
|
||||
label-unfocused-padding = 2
|
||||
|
||||
; visible = Active workspace on unfocused monitor
|
||||
label-visible = %icon%
|
||||
label-visible-background = ${self.label-focused-background}
|
||||
label-visible-overline = ${self.label-focused-overline}
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
|
||||
; urgent = Workspace with urgency hint set
|
||||
label-urgent = %icon%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 2
|
||||
|
||||
ws-icon-0 = 1;
|
||||
ws-icon-1 = 2;
|
||||
ws-icon-2 = 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
|
||||
|
||||
[module/bspwm]
|
||||
type = internal/bspwm
|
||||
format = <label-state> <label-mode>
|
||||
wrapping-scroll = false
|
||||
fuzzy-match = true
|
||||
|
||||
ws-icon-0 = term;
|
||||
ws-icon-1 = web;
|
||||
ws-icon-2 = chat;
|
||||
ws-icon-3 = irc;
|
||||
|
||||
label-mode-padding = 2
|
||||
label-mode-foreground = #000
|
||||
label-mode-background = ${colors.primary}
|
||||
|
||||
; focused = Active workspace on focused monitor
|
||||
label-focused = %index%
|
||||
label-focused-background = ${colors.background-alt}
|
||||
label-focused-overline = ${colors.primary}
|
||||
label-focused-padding = 2
|
||||
|
||||
; unfocused = Inactive workspace on any monitor
|
||||
label-unfocused = %index%
|
||||
label-unfocused-padding = 2
|
||||
|
||||
; visible = Active workspace on unfocused monitor
|
||||
label-visible = %index%
|
||||
label-visible-background = ${self.label-focused-background}
|
||||
label-visible-overline = ${self.label-focused-overline}
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
|
||||
; urgent = Workspace with urgency hint set
|
||||
label-urgent = %index%
|
||||
label-urgent-background = ${colors.alert}
|
||||
label-urgent-padding = 2
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
label = %title%
|
||||
label-maxlen = 100
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
mount-0 = /
|
||||
interval = 30
|
||||
|
||||
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
|
||||
label-unmounted-foreground = ${colors.foreground-alt}
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 1
|
||||
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
|
||||
label = "RAM: %percentage_used%%"
|
||||
|
||||
[module/backlight]
|
||||
type = internal/xbacklight
|
||||
|
||||
; XRandR output to get get values from
|
||||
; Default: the monitor defined for the running bar
|
||||
output = eDP1
|
||||
|
||||
; Create scroll handlers used to set the backlight value
|
||||
; Default: true
|
||||
enable-scroll = false
|
||||
|
||||
[module/cpu]
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
|
||||
label = "CPU:%percentage:2%%"
|
||||
|
||||
[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 = 100
|
||||
label-song-ellipsis = true
|
||||
|
||||
|
||||
[module/wlan]
|
||||
type = internal/network
|
||||
interface = wlp2s0
|
||||
interval = 3.0
|
||||
|
||||
format-prefix = " "
|
||||
format-connected = <label-connected>
|
||||
label-connected = "%signal%% %essid%"
|
||||
|
||||
format-disconnected =
|
||||
;format-disconnected = <label-disconnected>
|
||||
;format-disconnected-overline = ${self.format-connected-overline}
|
||||
;label-disconnected = %ifname% disconnected
|
||||
;label-disconnected-foreground = ${colors.foreground-alt}
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-muted-prefix = " "
|
||||
format-muted-prefix-foreground = ${colors.foreground-alt}
|
||||
|
||||
format-volume-prefix = " "
|
||||
format-volume-prefix-foregroud = ${colors.foreground-alt}
|
||||
|
||||
format-volume = <label-volume> <bar-volume>
|
||||
label-volume = VOL %percentage%%
|
||||
label-volume-foreground = ${root.foreground}
|
||||
|
||||
label-muted = muted
|
||||
label-muted-foreground = #666
|
||||
|
||||
bar-volume-width = 8
|
||||
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}
|
||||
format-overline = ${colors.primary}
|
||||
|
||||
[module/battery]
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
adapter = AC
|
||||
full-at = 99
|
||||
|
||||
format-charging-prefix = " "
|
||||
format-charging-prefix-foreground = ${colors.foreground-alt}
|
||||
format-charging = <label-charging>
|
||||
|
||||
label-charging = "BAT: %percentage%%"
|
||||
|
||||
format-discharging-prefix = " "
|
||||
format-discharging-prefix-foreground = ${colors.foreground-alt}
|
||||
format-discharging = <label-discharging>
|
||||
|
||||
label-discharging = "BAT: %percentage%%"
|
||||
|
||||
format-full-prefix = " "
|
||||
format-full-prefix-foreground = ${colors.foreground-alt}
|
||||
|
||||
[module/temperature]
|
||||
type = internal/temperature
|
||||
thermal-zone = 0
|
||||
warn-temperature = 60
|
||||
|
||||
format = <label>
|
||||
format-warn = <label-warn>
|
||||
format-prefix = " "
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
format-warn-overline = #FF0000
|
||||
format-warn-prefix = " "
|
||||
format-warn-prefix-foreground = ${colors.foreground-alt}
|
||||
|
||||
label = "TMP: %temperature-c%"
|
||||
label-warn = "!TMP: %temperature-c%"
|
||||
label-warn-foreground = ${colors.secondary}
|
||||
|
||||
[module/player-mpris-tail]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/player-mpris-tail.py -f '{icon} {artist} - {title}'
|
||||
tail = true
|
||||
label = %output%
|
||||
format-overline = ${colors.primary}
|
||||
|
||||
[module/updates-arch-combined]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/update-checker.sh
|
||||
interval = 600
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 1.0
|
||||
date = %Y-%m-%d%
|
||||
time = %H:%M
|
||||
date-alt = %A, %d %B %Y
|
||||
time-alt = %H:%M:%S
|
||||
; Available tokens:
|
||||
; %date%
|
||||
; %time%
|
||||
; Default: %date%
|
||||
label = %date% %time%
|
||||
label-font = 6
|
||||
label-foreground = #F26722
|
||||
; vim:ft=dosini
|
||||
|
5
.config/polybar/backup/launch.sh
Executable file
5
.config/polybar/backup/launch.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
killall -q polybar
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
polybar mybar
|
||||
|
620
.config/polybar/config
Normal file
620
.config/polybar/config
Normal file
@ -0,0 +1,620 @@
|
||||
;==========================================================
|
||||
;
|
||||
;
|
||||
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
|
||||
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
|
||||
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
|
||||
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
|
||||
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
|
||||
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
||||
;
|
||||
;
|
||||
; To learn more about how to configure Polybar
|
||||
; go to https://github.com/jaagr/polybar
|
||||
;
|
||||
; The README contains alot of information
|
||||
;
|
||||
;==========================================================
|
||||
|
||||
; read colors from pywal
|
||||
[colors]
|
||||
background = ${xrdb:color0:#222}
|
||||
foreground = ${xrdb:color7:#222}
|
||||
foreground-alt = ${xrdb:color6:#222}
|
||||
background-alt = $(xrdb:color5:#222}
|
||||
primary = ${xrdb:color1:#222}
|
||||
secondary = ${xrdb:color2:#222}
|
||||
alert = ${xrdb:color3:#222}
|
||||
c8 = ${xrdb:color8:#222}
|
||||
c9 = ${xrdb:color9:#222}
|
||||
c10 = ${xrdb:color10:#222}
|
||||
c11 = ${xrdb:color11:#222}
|
||||
c12 = ${xrdb:color12:#222}
|
||||
c13 = ${xrdb:color13:#222}
|
||||
c14 = ${xrdb:color14:#222}
|
||||
|
||||
[bar/example]
|
||||
;monitor = ${env:MONITOR:HDMI-1}
|
||||
width = 100%
|
||||
height = 20
|
||||
;override-redirect=true
|
||||
offset-x = 0
|
||||
offset-y = 3
|
||||
;wm-restack=i3
|
||||
radius = 0.0
|
||||
fixed-center = false
|
||||
;separator=
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.background}
|
||||
|
||||
line-size = 3
|
||||
line-color = ${colors.c9}
|
||||
|
||||
border-size = 5
|
||||
border-color = ${colors.background}
|
||||
;#00000000
|
||||
|
||||
padding-left = 0
|
||||
padding-right = 0
|
||||
|
||||
module-margin-left = 0
|
||||
module-margin-right = 0
|
||||
|
||||
font-0 = RobotoMono Nerd Font:antialias=true:pixelsize=10;1
|
||||
font-1 = RobotoMono Nerd Font:antialias=true:size=6;2
|
||||
font-2 = RobotoMono Nerd Font:antialias=false:size=14;2
|
||||
modules-left = s7 s4 i3 s5 xwindow
|
||||
modules-center =
|
||||
modules-right = s4 cpu s1 memory s1 temperature s1 date s5 powermenu s6
|
||||
|
||||
;tray-position = right
|
||||
;tray-padding = 0
|
||||
;tray-background = #0063ff
|
||||
|
||||
;wm-restack = bspwm
|
||||
wm-restack = i3
|
||||
;override-redirect = true
|
||||
|
||||
;scroll-up = bspwm-desknext
|
||||
;scroll-down = bspwm-deskprev
|
||||
|
||||
;scroll-up = i3wm-wsnext
|
||||
;scroll-down = i3wm-wsprev
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
[bar/bottom]
|
||||
;monitor = ${env:MONITOR:HDMI-1}
|
||||
width = 100%
|
||||
height = 20
|
||||
;override-redirect=true
|
||||
offset-x = 0
|
||||
offset-y = 3
|
||||
;wm-restack=i3
|
||||
radius = 0.0
|
||||
fixed-center = false
|
||||
;separator=
|
||||
background = ${colors.background}
|
||||
; #00000000
|
||||
;${colors.background}
|
||||
foreground = ${colors.background}
|
||||
bottom=true
|
||||
line-size = 0
|
||||
line-color = #f00
|
||||
|
||||
border-size = 5
|
||||
border-color = ${colors.background}
|
||||
;#00000000
|
||||
|
||||
padding-left = 0
|
||||
padding-right = 0
|
||||
|
||||
module-margin-left = 0
|
||||
module-margin-right = 0
|
||||
|
||||
font-0 = RobotoMono Nerd Font :antialias=true:pixelsize=10;1
|
||||
font-1 = RobotoMono Nerd Font:antialias=true:size=4;2
|
||||
font-2 = RobotoMono Nerd Font:antialias=false:size=14;2
|
||||
font-3 - RobotoMono Nerd Font:antialias=true:size=18;0
|
||||
; siji
|
||||
modules-left = s4 battery s3 s4 wlan s3 s4 mpd s3
|
||||
modules-center =
|
||||
; pulseaudio
|
||||
modules-right = s4 spotify s1 pulseaudio
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 0
|
||||
tray-background = ${colors.background}
|
||||
|
||||
;wm-restack = bspwm
|
||||
wm-restack = i3
|
||||
;override-redirect = true
|
||||
|
||||
;scroll-up = bspwm-desknext
|
||||
;scroll-down = bspwm-deskprev
|
||||
|
||||
;scroll-up = i3wm-wsnext
|
||||
;scroll-down = i3wm-wsprev
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
||||
|
||||
|
||||
|
||||
[module/xwindow]
|
||||
type = internal/xwindow
|
||||
background = ${bar/example.background}
|
||||
format-foreground = ${colors.foreground}
|
||||
label = %title:0:90:...%
|
||||
|
||||
[module/xkeyboard]
|
||||
type = internal/xkeyboard
|
||||
blacklist-0 = num lock
|
||||
|
||||
format-prefix = "Key:"
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
format-prefix-underline = ${colors.secondary}
|
||||
|
||||
label-layout = %layout%
|
||||
label-layout-underline = ${colors.secondary}
|
||||
|
||||
label-indicator-padding = 2
|
||||
label-indicator-margin = 1
|
||||
label-indicator-background = ${colors.secondary}
|
||||
label-indicator-underline = ${colors.secondary}
|
||||
|
||||
[module/s1]
|
||||
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
;#00000000
|
||||
content-foreground = ${colors.primary}
|
||||
|
||||
[module/s2]
|
||||
|
||||
type = custom/text
|
||||
content = "%{T3}"
|
||||
content-background=${bar/example.background}
|
||||
content-foreground=${colors.primary}
|
||||
|
||||
[module/s3]
|
||||
type=custom/text
|
||||
content="%{T3}%{T-}"
|
||||
content-background=${bar/example.background}
|
||||
content-foreground=${colors.primary}
|
||||
|
||||
[module/s4]
|
||||
type=custom/text
|
||||
content="%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${colors.primary}
|
||||
|
||||
[module/s5]
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${colors.primary}
|
||||
|
||||
[module/s6]
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${bar/example.border-color}
|
||||
|
||||
|
||||
[module/s7]
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${bar/example.border-color}
|
||||
|
||||
|
||||
[module/s8]
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${bar/example.border-color}
|
||||
|
||||
|
||||
[module/s9]
|
||||
type = custom/text
|
||||
content = "%{T3}%{T-}"
|
||||
content-background = ${bar/example.background}
|
||||
content-foreground = ${bar/example.border-color}
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
interval = 25
|
||||
|
||||
mount-0 = /
|
||||
|
||||
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 =false
|
||||
;format-background = ${colors.background}
|
||||
|
||||
label-mode-padding = 0
|
||||
label-mode-foreground = ${colors.foreground}
|
||||
;#000
|
||||
label-mode-background = ${colors.secondary}
|
||||
|
||||
; focused = Active workspace on focused monitor
|
||||
label-focused =
|
||||
;%icon%
|
||||
label-focused-background = ${colors.primary}
|
||||
;${module/bspwm.label-focused-background}
|
||||
label-focused-underline = #00000000
|
||||
;${module/bspwm.label-focused-underline}
|
||||
label-focused-padding = ${module/bspwm.label-focused-padding}
|
||||
;label-focused-format = ${colors.foreground}
|
||||
label-focused-foreground= ${colors.background}
|
||||
; unfocused = Inactive workspace on any monitor
|
||||
label-unfocused =
|
||||
;%icon%
|
||||
label-unfocused-padding = ${module/bspwm.label-occupied-padding}
|
||||
label-unfocused-background = ${colors.primary}
|
||||
|
||||
ws-icon-0 = 1;
|
||||
ws-icon-1 = 2;
|
||||
;ws-icon-2 = 3;3
|
||||
;ws-icon-3 = 4;4
|
||||
;ws-icon-4 = 5;5
|
||||
|
||||
label-visible-background = ${self.label-focused-background}
|
||||
label-visible-underline = ${self.label-focused-underline}
|
||||
label-visible-padding = ${self.label-focused-padding}
|
||||
|
||||
; urgent = Workspace with urgency hint set
|
||||
label-urgent = %index%
|
||||
label-urgent-background = ${module/bspwm.label-urgent-background}
|
||||
label-urgent-padding = ${module/bspwm.label-urgent-padding}
|
||||
|
||||
; Separator in between workspaces
|
||||
label-separator =
|
||||
|
||||
|
||||
[module/mpd]
|
||||
type = internal/mpd
|
||||
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
|
||||
|
||||
icon-prev = a
|
||||
icon-stop = b
|
||||
icon-play = c
|
||||
icon-pause = d
|
||||
icon-next = e
|
||||
|
||||
label-song-maxlen = 25
|
||||
label-song-ellipsis = true
|
||||
|
||||
[module/xbacklight]
|
||||
type = internal/xbacklight
|
||||
|
||||
format = <label> <bar>
|
||||
label =" ﯦ "
|
||||
label-foreground=${colors.background}
|
||||
|
||||
label-padding =1
|
||||
;fbe6
|
||||
format-background = ${colors.primary}
|
||||
|
||||
bar-width = 10
|
||||
bar-indicator =
|
||||
bar-indicator-foreground = ${colors.foreground}
|
||||
;#fff
|
||||
bar-indicator-font = 2
|
||||
bar-fill = ""
|
||||
bar-fill-font = 2
|
||||
bar-fill-foreground = ${colors.background}
|
||||
bar-fill-padding-left = 1
|
||||
;#9f78e1
|
||||
|
||||
bar-empty = ""
|
||||
bar-empty-font = 2
|
||||
bar-empty-foreground = ${colors.foreground}
|
||||
bar-empty-padding-right = 1
|
||||
|
||||
[module/backlight-acpi]
|
||||
inherit = module/xbacklight
|
||||
type = internal/backlight
|
||||
card = intel_backlight
|
||||
|
||||
[module/cpu]
|
||||
format=<label>
|
||||
|
||||
label-padding =1
|
||||
type = internal/cpu
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-background = ${colors.primary}
|
||||
format-prefix-foreground = ${colors.background}
|
||||
;format-underline = ${colors.primary}
|
||||
;; note that this is how to make underline go away
|
||||
;#f90000
|
||||
label = %percentage-sum%
|
||||
|
||||
[module/spotify]
|
||||
|
||||
type = custom/script
|
||||
interval = 3
|
||||
format-prefix="%{T1}%{T-} "
|
||||
format <label>
|
||||
format-background = ${colors.primary}
|
||||
exec = python /home/paramah/.config/polybar/polybar-spotify/spotify_status.py -f '{song} by {artist}'
|
||||
|
||||
[module/memory]
|
||||
type = internal/memory
|
||||
interval = 2
|
||||
format-prefix = " "
|
||||
format-background = ${colors.primary}
|
||||
format-prefix-foreground = ${colors.background}
|
||||
;format-underline = ${colors.primary}
|
||||
;;
|
||||
|
||||
label-padding =1
|
||||
;#4bffdc
|
||||
label = %gb_free%
|
||||
|
||||
[module/wlan]
|
||||
type = internal/network
|
||||
interface = wlp6s0
|
||||
interval = 0.5
|
||||
|
||||
format-connected-prefix="直| "
|
||||
format-connected = <label-connected>
|
||||
format-connected-underline = #9f78e1
|
||||
label-connected = %essid%
|
||||
;label-connected = %local_ip%|%essid%| %upspeed% %downspeed%
|
||||
format-connected-background=${colors.primary}
|
||||
|
||||
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.background}
|
||||
|
||||
[module/eth]
|
||||
type = internal/network
|
||||
interface = wlp59s0
|
||||
interval = 3.0
|
||||
|
||||
format-connected-underline = #55aa55
|
||||
format-connected-prefix = " "
|
||||
format-connected-prefix-foreground = ${colors.primary}
|
||||
label-connected = %local_ip%
|
||||
|
||||
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 =
|
||||
date-alt = " %Y-%m-%d"
|
||||
|
||||
time = %H:%M
|
||||
time-alt = %H:%M:%S
|
||||
|
||||
format-background = ${colors.primary}
|
||||
format-prefix =" "
|
||||
format-prefix-foreground = ${colors.background}
|
||||
;format-underline = ${colors.primary}
|
||||
;#0a6cf5
|
||||
|
||||
label = %date% %time%
|
||||
label-padding = 1
|
||||
|
||||
[module/pulseaudio]
|
||||
type = internal/pulseaudio
|
||||
|
||||
format-volume = <label-volume> <bar-volume>
|
||||
label-volume = 墳 %percentage%%
|
||||
label-volume-foreground = ${colors.background}
|
||||
format-volume-background = ${colors.primary}
|
||||
|
||||
label-muted ="婢 %{T2}%{T-}"
|
||||
label-muted-foreground = ${colors.background}
|
||||
format-muted-background = ${colors.primary}
|
||||
|
||||
bar-volume-width = 21
|
||||
bar-volume-foreground-0 = ${colors.background}
|
||||
;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}
|
||||
|
||||
[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]
|
||||
prefix="BAT"
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
adapter = AC
|
||||
full-at = 98
|
||||
format-charging = <animation-charging> <label-charging>
|
||||
;format-charging-underline = ${colors.primary}
|
||||
;#ffb52a
|
||||
|
||||
format-charging-background = ${colors.primary}
|
||||
format-discharging = <ramp-capacity> <label-discharging>
|
||||
;format-discharging-underline = ${self.format-charging-underline}
|
||||
format-discharging-background = ${colors.primary}
|
||||
|
||||
format-full-prefix = " : "
|
||||
format-full-prefix-foreground = ${colors.background}
|
||||
format-full-background = ${colors.background}
|
||||
;format-full-underline = ${self.format-charging-underline}
|
||||
label-charging-passing =1
|
||||
label-discharging-padding =1
|
||||
|
||||
ramp-capacity-0 =" "
|
||||
ramp-capacity-1 = " "
|
||||
ramp-capacity-2 = " "
|
||||
ramp-capacity-padding = 1
|
||||
;ramp-capacity-0 =
|
||||
;ramp-capacity-1 =
|
||||
;ramp-capacity-2 =
|
||||
ramp-capacity-foreground = ${colors.background}
|
||||
|
||||
animation-charging-0 =
|
||||
animation-charging-1 =
|
||||
animation-charging-2 =
|
||||
animation-charging-foreground = ${colors.foreground-alt}
|
||||
animation-charging-framerate = 750
|
||||
|
||||
animation-discharging-0 =
|
||||
animation-discharging-1 =
|
||||
animation-discharging-2 =
|
||||
animation-discharging-foreground = ${colors.foreground-alt}
|
||||
animation-discharging-framerate = 750
|
||||
|
||||
[module/temperature]
|
||||
type = internal/temperature
|
||||
thermal-zone = 0
|
||||
warn-temperature = 50
|
||||
|
||||
format = <ramp> <label>
|
||||
;format-underline = ${colors.primary}
|
||||
;#f50a4d
|
||||
format-background = ${colors.primary}
|
||||
|
||||
label-padding =1
|
||||
label-warn-padding = 1
|
||||
format-warn = <ramp> <label-warn>
|
||||
;format-warn-underline = ${self.format-underline}
|
||||
format-warn-background= ${colors.primary}
|
||||
hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input
|
||||
label = %temperature-c%
|
||||
label-warn = %temperature-c%
|
||||
label-warn-foreground = ${colors.background}
|
||||
|
||||
ramp-0 = " "
|
||||
ramp-1 = " "
|
||||
ramp-2 =" "
|
||||
|
||||
ramp-foreground = ${colors.background}
|
||||
|
||||
[module/powermenu]
|
||||
type = custom/menu
|
||||
|
||||
expand-right = true
|
||||
|
||||
format-spacing = 1
|
||||
|
||||
label-open =" "
|
||||
label-open-foreground = ${bar/example.background}
|
||||
label-close = x
|
||||
label-close-foreground = ${bar/example.background}
|
||||
label-separator = |
|
||||
label-separator-foreground = ${colors.foreground-alt}
|
||||
label-open-background= ${bar/example.background}
|
||||
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 = sudo reboot
|
||||
|
||||
menu-2-0 = power off
|
||||
menu-2-0-exec = sudo 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
|
||||
pseudo-transparency = true
|
||||
|
||||
[global/wm]
|
||||
margin-top = 0
|
||||
margin-bottom = 0
|
||||
|
||||
; vim:ft=dosini
|
||||
|
6
.config/polybar/launch.sh
Executable file
6
.config/polybar/launch.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
killall -q polybar
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
polybar example &
|
||||
polybar bottom &
|
||||
|
28
.config/polybar/polybar-gmail/auth.py
Executable file
28
.config/polybar/polybar-gmail/auth.py
Executable file
@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import httplib2
|
||||
import webbrowser
|
||||
from oauth2client import client, file
|
||||
|
||||
SCOPE = 'https://www.googleapis.com/auth/gmail.readonly'
|
||||
REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'
|
||||
DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
CLIENT_SECRETS_PATH = os.path.join(DIR, 'client_secrets.json')
|
||||
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
|
||||
storage = file.Storage(CREDENTIALS_PATH)
|
||||
|
||||
if pathlib.Path(CREDENTIALS_PATH).is_file():
|
||||
credentials = storage.get()
|
||||
credentials.refresh(httplib2.Http())
|
||||
print('Credentials successfully refreshed')
|
||||
else:
|
||||
flow = client.flow_from_clientsecrets(CLIENT_SECRETS_PATH, scope=SCOPE,
|
||||
redirect_uri=REDIRECT_URI)
|
||||
auth_uri = flow.step1_get_authorize_url()
|
||||
webbrowser.open(auth_uri)
|
||||
auth_code = input('Enter the auth code: ')
|
||||
credentials = flow.step2_exchange(auth_code)
|
||||
storage.put(credentials)
|
||||
print('Credentials successfully created')
|
58
.config/polybar/polybar-gmail/launch.py
Executable file
58
.config/polybar/polybar-gmail/launch.py
Executable file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import subprocess
|
||||
import time
|
||||
import argparse
|
||||
from apiclient import discovery, errors
|
||||
from oauth2client import client, file
|
||||
from httplib2 import ServerNotFoundError
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-p', '--prefix', default='\uf0e0')
|
||||
parser.add_argument('-c', '--color', default='#e06c75')
|
||||
parser.add_argument('-ns', '--nosound', action='store_true')
|
||||
args = parser.parse_args()
|
||||
|
||||
DIR = os.path.dirname(os.path.realpath(__file__))
|
||||
CREDENTIALS_PATH = os.path.join(DIR, 'credentials.json')
|
||||
|
||||
unread_prefix = '%{F' + args.color + '}' + args.prefix + ' %{F-}'
|
||||
error_prefix = '%{F' + args.color + '}\uf06a %{F-}'
|
||||
count_was = 0
|
||||
|
||||
def print_count(count, is_odd=False):
|
||||
tilde = '~' if is_odd else ''
|
||||
output = ''
|
||||
if count > 0:
|
||||
output = unread_prefix + tilde + str(count)
|
||||
else:
|
||||
output = (args.prefix + ' ' + tilde).strip()
|
||||
print(output, flush=True)
|
||||
|
||||
def update_count(count_was):
|
||||
gmail = discovery.build('gmail', 'v1', credentials=file.Storage(CREDENTIALS_PATH).get())
|
||||
labels = gmail.users().labels().get(userId='me', id='INBOX').execute()
|
||||
count = labels['messagesUnread']
|
||||
print_count(count)
|
||||
if not args.nosound and count_was < count and count > 0:
|
||||
subprocess.run(['canberra-gtk-play', '-i', 'message'])
|
||||
return count
|
||||
|
||||
print_count(0, True)
|
||||
|
||||
while True:
|
||||
try:
|
||||
if pathlib.Path(CREDENTIALS_PATH).is_file():
|
||||
count_was = update_count(count_was)
|
||||
time.sleep(10)
|
||||
else:
|
||||
print(error_prefix + 'credentials not found', flush=True)
|
||||
time.sleep(2)
|
||||
except (errors.HttpError, ServerNotFoundError, OSError) as error:
|
||||
print_count(count_was, True)
|
||||
time.sleep(5)
|
||||
except client.AccessTokenRefreshError:
|
||||
print(error_prefix + 'revoked/expired credentials', flush=True)
|
||||
time.sleep(5)
|
BIN
.config/polybar/polybar-gmail/preview.png
Normal file
BIN
.config/polybar/polybar-gmail/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 B |
56
.config/polybar/polybar-gmail/readme.md
Normal file
56
.config/polybar/polybar-gmail/readme.md
Normal file
@ -0,0 +1,56 @@
|
||||
# Polybar Gmail
|
||||
|
||||
A [Polybar](https://github.com/jaagr/polybar) module to show unread messages from Gmail.
|
||||
|
||||

|
||||
|
||||
## Dependencies
|
||||
|
||||
```sh
|
||||
sudo pip install --upgrade oauth2client google-api-python-client
|
||||
```
|
||||
|
||||
**Font Awesome** - for email badge
|
||||
|
||||
**canberra-gtk-play** - for new email sound
|
||||
|
||||
You can change the badge or turn off sound, for more info see [script arguments](#script-arguments)
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
cd ~/.config/polybar
|
||||
curl -LO https://github.com/vyachkonovalov/polybar-gmail/archive/master.tar.gz
|
||||
tar zxf master.tar.gz && rm master.tar.gz
|
||||
mv polybar-gmail-master gmail
|
||||
```
|
||||
|
||||
and obtain/refresh credentials
|
||||
|
||||
```sh
|
||||
~/.config/polybar/gmail/auth.py
|
||||
```
|
||||
|
||||
### Module
|
||||
|
||||
```ini
|
||||
[module/gmail]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/gmail/launch.py
|
||||
tail = true
|
||||
click-left = xdg-open https://mail.google.com
|
||||
```
|
||||
|
||||
## Script arguments
|
||||
|
||||
`-p` or `--prefix` - to change email badge, default:
|
||||
|
||||
`-c` or `--color` - to change new email badge color, default: #e06c75
|
||||
|
||||
`-ns` or `--nosound` - turn off new email sound
|
||||
|
||||
### Example
|
||||
|
||||
```sh
|
||||
launch.py --prefix '📧' --color '#be5046' --nosound
|
||||
```
|
50
.config/polybar/polybar-network-traffic/network-traffic.sh
Executable file
50
.config/polybar/polybar-network-traffic/network-traffic.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
print_bytes() {
|
||||
#if [ "$1" -eq 0 ] || [ "$1" -lt 100 ]; then
|
||||
# bytes="0 kB/s"
|
||||
#elif [ "$1" -lt 1000 ]; then
|
||||
# bytes="0$(echo "scale=1;$1/1000" | bc -l ) kB/s"
|
||||
if [ "$1" -eq 0 ] || [ "$1" -lt 1000 ]; then
|
||||
bytes="0 kB/s"
|
||||
elif [ "$1" -lt 1000000 ]; then
|
||||
bytes="$(echo "scale=0;$1/1000" | bc -l ) kB/s"
|
||||
else
|
||||
bytes="$(echo "scale=1;$1/1000000" | bc -l ) MB/s"
|
||||
fi
|
||||
|
||||
echo "$bytes"
|
||||
}
|
||||
|
||||
INTERVAL=10
|
||||
INTERFACES="wlp6s0"
|
||||
|
||||
declare -A bytes
|
||||
|
||||
for interface in $INTERFACES; do
|
||||
bytes[past_rx_$interface]="$(cat /sys/class/net/"$interface"/statistics/rx_bytes)"
|
||||
bytes[past_tx_$interface]="$(cat /sys/class/net/"$interface"/statistics/tx_bytes)"
|
||||
done
|
||||
|
||||
while true; do
|
||||
down=0
|
||||
up=0
|
||||
|
||||
for interface in $INTERFACES; do
|
||||
bytes[now_rx_$interface]="$(cat /sys/class/net/"$interface"/statistics/rx_bytes)"
|
||||
bytes[now_tx_$interface]="$(cat /sys/class/net/"$interface"/statistics/tx_bytes)"
|
||||
|
||||
bytes_down=$((((${bytes[now_rx_$interface]} - ${bytes[past_rx_$interface]})) / INTERVAL))
|
||||
bytes_up=$((((${bytes[now_tx_$interface]} - ${bytes[past_tx_$interface]})) / INTERVAL))
|
||||
|
||||
down=$(((( "$down" + "$bytes_down" ))))
|
||||
up=$(((( "$up" + "$bytes_up" ))))
|
||||
|
||||
bytes[past_rx_$interface]=${bytes[now_rx_$interface]}
|
||||
bytes[past_tx_$interface]=${bytes[now_tx_$interface]}
|
||||
done
|
||||
|
||||
echo " $(print_bytes $down) 祝 $(print_bytes $up)"
|
||||
|
||||
sleep $INTERVAL
|
||||
done
|
20
.config/polybar/polybar-network-update/updates-arch-combined.sh
Executable file
20
.config/polybar/polybar-network-update/updates-arch-combined.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
|
||||
updates_arch=0
|
||||
fi
|
||||
|
||||
if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
|
||||
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
|
||||
# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
|
||||
updates_aur=0
|
||||
fi
|
||||
|
||||
updates=$(("$updates_arch" + "$updates_aur"))
|
||||
|
||||
if [ "$updates" -gt 0 ]; then
|
||||
echo " Updates: $updates"
|
||||
else
|
||||
echo " No Updates"
|
||||
fi
|
21
.config/polybar/polybar-spotify/LICENSE
Normal file
21
.config/polybar/polybar-spotify/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Jesse van Rhijn
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
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 OR COPYRIGHT HOLDERS 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.
|
70
.config/polybar/polybar-spotify/README.md
Normal file
70
.config/polybar/polybar-spotify/README.md
Normal file
@ -0,0 +1,70 @@
|
||||
# polybar-spotify
|
||||
|
||||
This is a module that shows the current song playing and its primary artist on Spotify, with a Spotify-green underline, for people that don't want to set up mpd. If Spotify is not active, nothing is shown. If the song name is longer than `trunclen` characers (default 25), it is truncated and `...` is appended. If the song is truncated and contains a single opening parenthesis, the closing paranethsis is appended as well.
|
||||
|
||||
### Dependencies
|
||||
- Python (2.x or 3.x)
|
||||
- Python `dbus` module
|
||||
|
||||
[](https://i.imgur.com/kEluTSq.png)
|
||||
|
||||
### Settings
|
||||
``` ini
|
||||
[module/spotify]
|
||||
type = custom/script
|
||||
interval = 1
|
||||
format-prefix = " "
|
||||
format = <label>
|
||||
exec = python /path/to/spotify/script -f '{artist}: {song}'
|
||||
format-underline = #1db954
|
||||
```
|
||||
|
||||
#### Custom arguments
|
||||
|
||||
##### Truncate
|
||||
|
||||
The argument "-t" is optional and sets the `trunlen`. It specifies the maximum length of the song name, so that it gets truncated when the specified length is exceeded. Defaults to 25.
|
||||
|
||||
Override example:
|
||||
|
||||
``` ini
|
||||
exec = python /path/to/spotify/script -t 42
|
||||
```
|
||||
|
||||
##### Format
|
||||
|
||||
The argument "-f" is optional and sets the format. You can specify how to display the song and the artist's name, as well as where (or whether) to print the play-pause indicator.
|
||||
|
||||
Override example:
|
||||
|
||||
``` ini
|
||||
exec = python /path/to/spotify/script -f '{play_pause} {song} - {artist}'
|
||||
```
|
||||
|
||||
This would output "Lone Digger - Caravan Palace" in your polybar, instead of what is shown in the screenshot.
|
||||
|
||||
##### Status indicator
|
||||
|
||||
The argument "-p" is optional, and sets which unicode symbols to use for the status indicator. These should be given as a comma-separated string, with the play indicator as the first value and the pause indicator as the second.
|
||||
|
||||
Override example:
|
||||
|
||||
``` ini
|
||||
exec = python /path/to/spotify/script -p '[playing],[paused]'
|
||||
```
|
||||
|
||||
##### Fonts
|
||||
|
||||
The argument "--font" is optional, and allow to specify which font from your Polybar config to use to display the main label.
|
||||
|
||||
Override example:
|
||||
```ini
|
||||
exec = python /path/to/spotify/script --font=1
|
||||
```
|
||||
|
||||
The argument "--playpause-font" is optional, and allow to specify which font from your Polybar config to use to display the "play/pause" indicator.
|
||||
|
||||
Override example:
|
||||
``` ini
|
||||
exec = python /path/to/spotify/script -p '[playing],[paused]' --playpause-font=2
|
||||
```
|
122
.config/polybar/polybar-spotify/spotify_status.py
Normal file
122
.config/polybar/polybar-spotify/spotify_status.py
Normal file
@ -0,0 +1,122 @@
|
||||
#!/bin/python
|
||||
|
||||
import sys
|
||||
import dbus
|
||||
import argparse
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-t',
|
||||
'--trunclen',
|
||||
type=int,
|
||||
metavar='trunclen'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-f',
|
||||
'--format',
|
||||
type=str,
|
||||
metavar='custom format',
|
||||
dest='custom_format'
|
||||
)
|
||||
parser.add_argument(
|
||||
'-p',
|
||||
'--playpause',
|
||||
type=str,
|
||||
metavar='play-pause indicator',
|
||||
dest='play_pause'
|
||||
)
|
||||
parser.add_argument(
|
||||
'--font',
|
||||
type=str,
|
||||
metavar='the index of the font to use for the main label',
|
||||
dest='font'
|
||||
)
|
||||
parser.add_argument(
|
||||
'--playpause-font',
|
||||
type=str,
|
||||
metavar='the index of the font to use to display the playpause indicator',
|
||||
dest='play_pause_font'
|
||||
)
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
def fix_string(string):
|
||||
# corrects encoding for the python version used
|
||||
if sys.version_info.major == 3:
|
||||
return string
|
||||
else:
|
||||
return string.encode('utf-8')
|
||||
|
||||
# Default parameters
|
||||
output = fix_string(u'{play_pause} {artist}: {song}')
|
||||
trunclen = 25
|
||||
play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused
|
||||
|
||||
label_with_font = '%{{T{font}}}{label}%{{T-}}'
|
||||
font = args.font
|
||||
play_pause_font = args.play_pause_font
|
||||
|
||||
# parameters can be overwritten by args
|
||||
if args.trunclen is not None:
|
||||
trunclen = args.trunclen
|
||||
if args.custom_format is not None:
|
||||
output = args.custom_format
|
||||
if args.play_pause is not None:
|
||||
play_pause = args.play_pause
|
||||
|
||||
try:
|
||||
session_bus = dbus.SessionBus()
|
||||
spotify_bus = session_bus.get_object(
|
||||
'org.mpris.MediaPlayer2.spotify',
|
||||
'/org/mpris/MediaPlayer2'
|
||||
)
|
||||
|
||||
spotify_properties = dbus.Interface(
|
||||
spotify_bus,
|
||||
'org.freedesktop.DBus.Properties'
|
||||
)
|
||||
|
||||
metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata')
|
||||
status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus')
|
||||
|
||||
# Handle play/pause label
|
||||
|
||||
play_pause = play_pause.split(',')
|
||||
|
||||
if status == 'Playing':
|
||||
play_pause = play_pause[0]
|
||||
elif status == 'Paused':
|
||||
play_pause = play_pause[1]
|
||||
else:
|
||||
play_pause = str()
|
||||
|
||||
if play_pause_font:
|
||||
play_pause = label_with_font.format(font=play_pause_font, label=play_pause)
|
||||
|
||||
# Handle main label
|
||||
|
||||
artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else ''
|
||||
song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else ''
|
||||
|
||||
if not artist and not song:
|
||||
print('')
|
||||
else:
|
||||
if len(song) > trunclen:
|
||||
song = song[0:trunclen]
|
||||
song += '...'
|
||||
if ('(' in song) and (')' not in song):
|
||||
song += ')'
|
||||
|
||||
if font:
|
||||
artist = label_with_font.format(font=font, label=artist)
|
||||
song = label_with_font.format(font=font, label=song)
|
||||
|
||||
print(output.format(artist=artist, song=song, play_pause=play_pause))
|
||||
|
||||
except Exception as e:
|
||||
if isinstance(e, dbus.exceptions.DBusException):
|
||||
print('')
|
||||
else:
|
||||
print(e)
|
59
.config/polybar/polybar-weather/openweathermap-detailed.sh
Executable file
59
.config/polybar/polybar-weather/openweathermap-detailed.sh
Executable file
@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_icon() {
|
||||
case $1 in
|
||||
01d) icon="";;
|
||||
01n) icon="";;
|
||||
02d) icon="";;
|
||||
02n) icon="";;
|
||||
03*) icon="";;
|
||||
04*) icon="";;
|
||||
09d) icon="";;
|
||||
09n) icon="";;
|
||||
10d) icon="";;
|
||||
10n) icon="";;
|
||||
11d) icon="";;
|
||||
11n) icon="";;
|
||||
13d) icon="";;
|
||||
13n) icon="";;
|
||||
50d) icon="";;
|
||||
50n) icon="";;
|
||||
*) icon="";
|
||||
esac
|
||||
|
||||
echo $icon
|
||||
}
|
||||
|
||||
KEY="3692c013ad7b21a0bc6805462f11350f"
|
||||
CITY="Katowice, PL"
|
||||
UNITS="metric"
|
||||
SYMBOL="°"
|
||||
|
||||
API="https://api.openweathermap.org/data/2.5"
|
||||
|
||||
if [ -n "$CITY" ]; then
|
||||
if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
|
||||
CITY_PARAM="id=$CITY"
|
||||
else
|
||||
CITY_PARAM="q=$CITY"
|
||||
fi
|
||||
|
||||
weather=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
|
||||
else
|
||||
location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
|
||||
|
||||
if [ -n "$location" ]; then
|
||||
location_lat="$(echo "$location" | jq '.location.lat')"
|
||||
location_lon="$(echo "$location" | jq '.location.lng')"
|
||||
|
||||
weather=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$weather" ]; then
|
||||
weather_desc=$(echo "$weather" | jq -r ".weather[0].description")
|
||||
weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1)
|
||||
weather_icon=$(echo "$weather" | jq -r ".weather[0].icon")
|
||||
|
||||
echo "$(get_icon "$weather_icon")" "$weather_desc", "$weather_temp$SYMBOL"
|
||||
fi
|
11
.config/rofi/config
Normal file
11
.config/rofi/config
Normal file
@ -0,0 +1,11 @@
|
||||
# general
|
||||
rofi.modi: window,drun
|
||||
|
||||
# matching
|
||||
rofi.matching: glob
|
||||
|
||||
# layout
|
||||
rofi.width: 35
|
||||
rofi.location: 0
|
||||
rofi.theme: /usr/share/rofi/themes/Arc-Dark.rasi
|
||||
|
23
.git-commit-template.txt
Normal file
23
.git-commit-template.txt
Normal file
@ -0,0 +1,23 @@
|
||||
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
|
||||
# |<---- Using a Maximum Of 50 Characters ---->|
|
||||
|
||||
# Explain why this change is being made
|
||||
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
|
||||
|
||||
# Provide links or keys to any relevant tickets, articles or other resources
|
||||
# Example: Github issue #23
|
||||
|
||||
# --- COMMIT END ---
|
||||
# Typy commitów
|
||||
# feat (nowa funkcja)
|
||||
# fix (poprawka)
|
||||
# refactor (refactoring kodu)
|
||||
# style (formatting stylu kodu, bez zmian funkcjonalnych)
|
||||
# docs (zmiany w dokumentacji)
|
||||
# test (testowy commit, bez wpływu na produkcję)
|
||||
#
|
||||
#
|
||||
#
|
||||
# Integracja z TAIGA
|
||||
# ------------------------------------------------------------------
|
||||
# TG-{REF} (REF to id US/ISSUE/etc w Taiga)
|
54
.gitconfig
54
.gitconfig
@ -1,7 +1,7 @@
|
||||
[user]
|
||||
email = aleksander@cynarski.pl
|
||||
name = Aleksander Cynarski
|
||||
signingkey = C4340BA42B9C173A
|
||||
signingkey = C4340BA42B9C173A
|
||||
[push]
|
||||
default = matching
|
||||
[merge]
|
||||
@ -14,6 +14,30 @@
|
||||
tree = "forest --pretty=format:\"%C(red)%h %C(magenta)(%ar) %C(blue)%an %C(reset)%s\" --style=15 --reverse"
|
||||
d = difftool
|
||||
open = !vim `git-open.sh`
|
||||
; slim log
|
||||
lg = log --graph --pretty=slim --abbrev-commit --date=relative
|
||||
; lg date: sorted by date and with absolute dates
|
||||
lgd = log --graph --pretty=slim --abbrev-commit --date=local --date-order
|
||||
; lg upstream: also show upstream branch
|
||||
lgu = !git lg $( git rev-parse --symbolic @{u} ) HEAD
|
||||
; lg date, upstream
|
||||
lgdu = !git lgd $( git rev-parse --symbolic @{u} ) HEAD
|
||||
; lg me: my commits from all branches, by date
|
||||
lgme = !git lgd --author=\"$( git config --get user.name )\" --all
|
||||
|
||||
; grep with some context (and a header)
|
||||
hgrep = grep --heading -B3 -A3
|
||||
|
||||
; diff by word
|
||||
diffword = diff --word-diff --word-diff-regex='\\w+|[^[:space:]]'
|
||||
; diff by character
|
||||
diffchar = diff --word-diff --word-diff-regex='.'
|
||||
|
||||
; checkout files with only whitespace changes
|
||||
whitespacecheckout = "!git status --porcelain | grep '^.M' | cut -b4- | while read file ; do if test -z "$( git diff -w "$file" )"; then git checkout -- "$file" ; fi; done"
|
||||
|
||||
; rebase not-yet-pushed commits
|
||||
rebaselocal = "!REMOTE=$( git rev-parse --abbrev-ref HEAD@{u} ) ; if [ -n "$REMOTE" ]; then git rebase -i $REMOTE ; else echo "ERROR: Unable to determine remote branch" ; fi"
|
||||
[diff]
|
||||
tool = vimdiff
|
||||
[difftool]
|
||||
@ -21,4 +45,30 @@
|
||||
[core]
|
||||
excludesfile = ~/.gitignore
|
||||
quotepath = false
|
||||
editor = vim
|
||||
editor = vim
|
||||
pager = diff-so-fancy | less --tabs=4 -RFX
|
||||
[pretty]
|
||||
slim = "%C(red)%h%C(yellow)%d%C(reset) %s %C(green)(%cd) %C(bold blue)<%an>%C(reset)"
|
||||
[filter "lfs"]
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
[commit]
|
||||
template = /home/paramah/tools/dotfiles/.git-commit-template.txt
|
||||
[sequence]
|
||||
editor = interactive-rebase-tool
|
||||
[color]
|
||||
ui = true
|
||||
[color "diff-highlight"]
|
||||
oldNormal = red bold
|
||||
oldHighlight = red bold 52
|
||||
newNormal = green bold
|
||||
newHighlight = green bold 22
|
||||
[color "diff"]
|
||||
meta = 11
|
||||
frag = magenta bold
|
||||
commit = yellow bold
|
||||
old = red bold
|
||||
new = green bold
|
||||
whitespace = red reverse
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -13,3 +13,7 @@ tags
|
||||
tags.*
|
||||
.vscode
|
||||
.exports
|
||||
nbproject
|
||||
.idea
|
||||
docker/etc/php/
|
||||
.jira
|
||||
|
64
.zshrc
64
.zshrc
@ -24,15 +24,22 @@ export PATH="/home/paramah/.gem/ruby/2.4.0/bin:$PATH"
|
||||
export PATH="/home/paramah/.gem/ruby/2.3.0/bin:$PATH"
|
||||
export PATH="/home/paramah/.gem/ruby/2.5.0/bin:$PATH"
|
||||
export PATH="/home/paramah/.local/bin:$PATH"
|
||||
export PATH=$PATH:$HOME/.SpaceVim/bin
|
||||
export PATH=$PATH:$HOME/.captain/bin
|
||||
|
||||
#Home bin (last always!)
|
||||
export PATH="/home/paramah/go/bin:$PATH"
|
||||
export PATH="/home/paramah/bin:$PATH"
|
||||
|
||||
#symfony
|
||||
export PATH="$HOME/.symfony/bin:$PATH"
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH=$HOME/.oh-my-zsh
|
||||
ZSH_THEME="powerlevel9k/powerlevel9k"
|
||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs_joined)
|
||||
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs_joined virtualenv nodeenv)
|
||||
|
||||
export CHROME_BIN=/usr/bin/chromium
|
||||
|
||||
source /usr/bin/virtualenvwrapper.sh
|
||||
|
||||
@ -44,6 +51,9 @@ plugins=(
|
||||
systemd
|
||||
themes
|
||||
git
|
||||
fzf
|
||||
git-flow-completion
|
||||
go
|
||||
)
|
||||
|
||||
|
||||
@ -52,10 +62,11 @@ source ~/.zplug/init.zsh
|
||||
|
||||
zplug 'ytet5uy4/fzf-widgets'
|
||||
zplug 'zsh-users/zaw'
|
||||
#zplug 'voronkovich/project.plugin.zsh'
|
||||
|
||||
|
||||
# Map widgets to key
|
||||
bindkey '^ge' fzf-select-widget
|
||||
bindkey '^ge' fzf-select-widget
|
||||
bindkey '^@.' fzf-edit-dotfiles
|
||||
bindkey '^@c' fzf-change-directory
|
||||
bindkey '^@n' fzf-change-named-directory
|
||||
@ -95,6 +106,8 @@ else
|
||||
export EDITOR='nvim'
|
||||
fi
|
||||
|
||||
export DISABLE_AUTO_TITLE='true'
|
||||
|
||||
TMPDIR=/home/paramah/.tmp/
|
||||
|
||||
eval "$(jira --completion-script-zsh)"
|
||||
@ -133,24 +146,65 @@ export goinside;
|
||||
##########################################################################################
|
||||
|
||||
|
||||
alias l="tmuxp load -d"
|
||||
alias l="tmuxp load -y "
|
||||
alias dc="docker-compose"
|
||||
alias d="docker"
|
||||
alias t="tmux"
|
||||
alias b="buku --suggest"
|
||||
alias j="jrnl"
|
||||
alias g="git"
|
||||
alias wh="curl wttr.in/Gliwice"
|
||||
|
||||
alias drestart="sudo systemctl restart docker"
|
||||
alias dstop="sudo systemctl stop docker"
|
||||
alias dstart="sudo systemctl start docker"
|
||||
alias ls="exa"
|
||||
#alias ls="exa"
|
||||
alias yaycc="yay -Sc"
|
||||
alias frp="frpc -c ~/frpc.ini"
|
||||
|
||||
alias mleft="xrandr --output HDMI1 --rotation left"
|
||||
alias mnormal="xrandr --output HDMI1 --rotation normal"
|
||||
|
||||
alias l="sudo systemctl restart docker && tmux kill-server"
|
||||
|
||||
alias crl="dbus-send --session --dest=org.Cinnamon.LookingGlass --type=method_call /org/Cinnamon/LookingGlass org.Cinnamon.LookingGlass.ReloadExtension string:'EXTENSION_UUID' string:'APPLET'"
|
||||
|
||||
# alias cat="bat"
|
||||
alias ping='~/bin/prettyping --nolegend'
|
||||
#alias ping='~/bin/prettyping --nolegend'
|
||||
|
||||
alias sourcec="docker run --publish 7080:7080 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph --volume /var/run/docker.sock:/var/run/docker.sock sourcegraph/server:2.11.2"
|
||||
|
||||
alias hadolint="docker run --rm -i hadolint/hadolint"
|
||||
|
||||
|
||||
telegram-desktop () { # launch telegram and send it to scratchpad
|
||||
(/usr/bin/telegram-desktop &)
|
||||
sleep 2
|
||||
i3-msg '[class="Telegram"] move scratchpad'
|
||||
}
|
||||
|
||||
telegram-desktop () { # launch telegram and send it to scratchpad
|
||||
(/usr/bin/mattermost-desktop &)
|
||||
sleep 2
|
||||
i3-msg '[class="Mattermost"] move scratchpad'
|
||||
}
|
||||
|
||||
theme () {
|
||||
(wal -qi $WALLPAPER)
|
||||
(feh --bg-scale $WALLPAPER)
|
||||
}
|
||||
|
||||
autoload -U +X bashcompinit && bashcompinit
|
||||
complete -o nospace -C /usr/bin/vault vault
|
||||
|
||||
#wal -i ~/Wallpapers/5sense1.jpg
|
||||
#wal -i ~/Wallpapers/steampunk_1.jpg
|
||||
#wal -i ~/Wallpapers/steampunk_5.jpg
|
||||
#wal -i ~/Wallpapers/rail.jpg
|
||||
#wal -i ~/Wallpapers/forrest_new.jpg
|
||||
#wal -i ~/Wallpapers/cyberpunk_city.jpg
|
||||
#xrdb ~/.Xresources
|
||||
#sudo sh -c 'echo -n "elantech" > /sys/bus/serio/devices/serio1/protocol'
|
||||
source <(hcloud completion zsh)
|
||||
#eval "$(starship init zsh)"
|
||||
#neofetch
|
||||
|
@ -10,7 +10,8 @@ W końcu zebrałem w jedno repo wszystkie potrzebne mi konfiguracje oprogramowan
|
||||
- [zsh][zsh] - zarąbisty shell, fish niestety nie potrafił sobie poradzić z kompatybilnością z SH
|
||||
- [taskwarrior][taskwarrior] - zarządzanie czasem i zadaniami
|
||||
- [eg][eg] - help systemowy z własną konfiguracją i możliwością rozbudowy o własne komendy/opisy
|
||||
|
||||
- [i3-gaps][i3-gaps] - mały i szybki WM
|
||||
- [polybar][polybar] - bardzo fajny i prosty w konfiguracji status bar dla [i3-gaps][i3-gaps]
|
||||
|
||||
## Dodatkowe oprogramowanie
|
||||
|
||||
@ -55,4 +56,5 @@ Przydatne nrzędzie do tworzenia kopii zapasowych na różnych serwerach/dyskach
|
||||
[borg]: https://www.borgbackup.org/ "BorgBackup"
|
||||
[borg-zsh-completion]: https://github.com/mrkmg/borgbackup-zsh-completion "Borg zsh"
|
||||
[termtrack]: https://github.com/trehn/termtrack "TermTrack"
|
||||
|
||||
[i3-gaps]: https://github.com/Airblader/i3 "i3-gaps"
|
||||
[polybar]: https://github.com/polybar/polybar "polybar"
|
||||
|
3
bin/fan_auto
Executable file
3
bin/fan_auto
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
sudo echo level auto > /proc/acpi/ibm/fan
|
4
bin/fan_full
Executable file
4
bin/fan_full
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo level disengaged > /proc/acpi/ibm/fan
|
||||
|
287
bin/gitea
Executable file
287
bin/gitea
Executable file
@ -0,0 +1,287 @@
|
||||
#!/usr/bin/env bash
|
||||
# ---
|
||||
# This file is automatically generated from gitea.md - DO NOT EDIT
|
||||
# ---
|
||||
|
||||
# MIT License
|
||||
#
|
||||
# Copyright (c) 2017 PJ Eby
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
||||
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
||||
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
||||
# is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# 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 OR
|
||||
# COPYRIGHT HOLDERS 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.
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
realpath.location(){ realpath.follow "$1"; realpath.absolute "$REPLY" ".."; }
|
||||
realpath.resolved(){ realpath.follow "$1"; realpath.absolute "$REPLY"; }
|
||||
realpath.dirname() { if [[ $1 =~ /+[^/]+/*$ ]]; then REPLY="${1%${BASH_REMATCH[0]}}"; REPLY=${REPLY:-/}; else REPLY=.; fi }
|
||||
realpath.basename(){ if [[ $1 =~ /*([^/]+)/*$ ]]; then REPLY="${BASH_REMATCH[1]}"; else REPLY=/; fi }
|
||||
|
||||
realpath.follow() {
|
||||
local target
|
||||
while [[ -L "$1" ]] && target=$(readlink -- "$1"); do
|
||||
realpath.dirname "$1"
|
||||
# Resolve relative to symlink's directory
|
||||
[[ $REPLY != . && $target != /* ]] && REPLY=$REPLY/$target || REPLY=$target
|
||||
# Break out if we found a symlink loop
|
||||
for target; do [[ $REPLY == "$target" ]] && break 2; done
|
||||
# Add to the loop-detect list and tail-recurse
|
||||
set -- "$REPLY" "$@"
|
||||
done
|
||||
REPLY="$1"
|
||||
}
|
||||
|
||||
realpath.absolute() {
|
||||
REPLY=$PWD; local eg=extglob; ! shopt -q $eg || eg=; ${eg:+shopt -s $eg}
|
||||
while (($#)); do case $1 in
|
||||
/*) REPLY=/; set -- "${1##+(/)}" "${@:2}" ;;
|
||||
*/*) set -- "${1%%/*}" "${1##${1%%/*}+(/)}" "${@:2}" ;;
|
||||
''|.) shift ;;
|
||||
..) realpath.dirname "$REPLY"; shift ;;
|
||||
*) REPLY="${REPLY%/}/$1"; shift ;;
|
||||
esac; done; ${eg:+shopt -u $eg}
|
||||
}
|
||||
|
||||
realpath.canonical() {
|
||||
realpath.follow "$1"; set -- "$REPLY" # $1 is now resolved
|
||||
realpath.basename "$1"; set -- "$1" "$REPLY" # $2 = basename $1
|
||||
realpath.dirname "$1"
|
||||
[[ $REPLY != "$1" ]] && realpath.canonical "$REPLY"; # recurse unless root
|
||||
realpath.absolute "$REPLY" "$2"; # combine canon parent w/basename
|
||||
}
|
||||
|
||||
realpath.relative() {
|
||||
local target=""
|
||||
realpath.absolute "$1"; set -- "$REPLY" "${@:2}"; realpath.absolute "${2-$PWD}" X
|
||||
while realpath.dirname "$REPLY"; [[ "$1" != "$REPLY" && "$1" == "${1#${REPLY%/}/}" ]]; do
|
||||
target=../$target
|
||||
done
|
||||
[[ $1 == "$REPLY" ]] && REPLY=${target%/} || REPLY="$target${1#${REPLY%/}/}"
|
||||
REPLY=${REPLY:-.}
|
||||
}
|
||||
# For documentation, see https://github.com/bashup/loco
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
fn_exists() { declare -F -- "$1"; } >/dev/null
|
||||
fn_copy() { REPLY="$(declare -f "$1")"; eval "$2 ${REPLY#$1}"; }
|
||||
findup() { walkup "${1:-$PWD}" reply_if_exists "${@:2}"; }
|
||||
|
||||
reply_if_exists() {
|
||||
local pat dir=$1 IFS= ; shift
|
||||
for pat; do
|
||||
for REPLY in ${dir%/}/$pat; do [[ -f "$REPLY" ]] && return 0; done
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
walkup() {
|
||||
realpath.absolute "$1"
|
||||
until set -- "$REPLY" "${@:2}"; "$2" "$1" "${@:3}"; do
|
||||
[[ "$1" != "/" ]] || return 1; realpath.dirname "$1"
|
||||
done
|
||||
}
|
||||
|
||||
_loco_usage() { loco_error "Usage: $LOCO_COMMAND command args..."; }
|
||||
_loco_error() { echo "$@" >&2; exit 64; }
|
||||
_loco_cmd() { REPLY="$LOCO_NAME.$1"; }
|
||||
_loco_exec() { loco_error "Unrecognized command: $1"; }
|
||||
_loco_exists() { type -t "$1"; } >/dev/null
|
||||
|
||||
_loco_do() {
|
||||
[[ "${1-}" ]] || loco_usage # No command given, exit w/usage
|
||||
REPLY=""; loco_cmd "$1"; local cmd="$REPLY"
|
||||
[[ "$cmd" ]] || loco_usage # Unrecognized command, exit w/usage
|
||||
|
||||
if loco_exists "$cmd"; then
|
||||
# Command, alias, function, or builtin exists
|
||||
shift; "$cmd" "$@"
|
||||
else
|
||||
# Invoke the default command interpreter
|
||||
loco_exec "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
_loco_findproject() {
|
||||
# shellcheck disable=SC2015 # plain var assign can't be false
|
||||
findup "$LOCO_PWD" "${LOCO_FILE[@]}" && LOCO_PROJECT=$REPLY ||
|
||||
loco_error "Can't find $LOCO_FILE here";
|
||||
}
|
||||
_loco_preconfig() { true; }
|
||||
_loco_postconfig() { true; }
|
||||
_loco_findroot() { realpath.dirname "$LOCO_PROJECT"; LOCO_ROOT=$REPLY; }
|
||||
_loco_loadproject() { cd "$LOCO_ROOT"; $LOCO_LOAD "$1"; }
|
||||
_loco_site_config() { source "$1"; }
|
||||
_loco_user_config() { source "$1"; }
|
||||
|
||||
|
||||
# Find our configuration, exposing relevant paths and defaults
|
||||
|
||||
# shellcheck disable=SC2034 # some vars are only used by extending scripts
|
||||
_loco_config() {
|
||||
LOCO_ARGS=("$@")
|
||||
loco_preconfig "$@"
|
||||
${LOCO_COMMAND:+:} realpath.basename "$LOCO_SCRIPT"; LOCO_COMMAND="${LOCO_COMMAND-$REPLY}"
|
||||
LOCO_NAME="${LOCO_NAME-${LOCO_COMMAND}}"
|
||||
LOCO_PWD="${LOCO_PWD-$PWD}"
|
||||
|
||||
LOCO_SITE_CONFIG="${LOCO_SITE_CONFIG-/etc/$LOCO_NAME/config}"
|
||||
[ -f "$LOCO_SITE_CONFIG" ] && loco_site_config "$LOCO_SITE_CONFIG"
|
||||
LOCO_RC="${LOCO_RC-.${LOCO_NAME}rc}"
|
||||
LOCO_USER_CONFIG="${LOCO_USER_CONFIG-$HOME/$LOCO_RC}"
|
||||
[ -f "$LOCO_USER_CONFIG" ] && loco_user_config "$LOCO_USER_CONFIG"
|
||||
|
||||
[[ ${LOCO_FILE-} ]] || LOCO_FILE=(".$LOCO_NAME")
|
||||
LOCO_LOAD="${LOCO_LOAD-source}"
|
||||
loco_postconfig "$@"
|
||||
}
|
||||
|
||||
_loco_main() {
|
||||
loco_config "$@"
|
||||
fn_exists "$LOCO_NAME" || eval "$LOCO_NAME() { loco_do \"\$@\"; }"
|
||||
${LOCO_PROJECT:+:} loco_findproject "$@"
|
||||
${LOCO_ROOT:+:} loco_findroot "$@"
|
||||
loco_loadproject "$LOCO_PROJECT"
|
||||
loco_do "$@"
|
||||
}
|
||||
|
||||
# Initialize default function implementations
|
||||
for f in $(compgen -A function _loco_); do
|
||||
fn_exists "${f#_}" || fn_copy "$f" "${f#_}"
|
||||
done
|
||||
|
||||
# Clear all LOCO_* variables before beginning
|
||||
for lv in ${!LOCO_@}; do unset "$lv"; done
|
||||
|
||||
LOCO_SCRIPT=$0
|
||||
GITEA_CREATE=()
|
||||
gitea.--with() {
|
||||
local GITEA_CREATE=(${GITEA_CREATE[@]+"${GITEA_CREATE[@]}"} "${@:1:2}")
|
||||
gitea "${@:3}"
|
||||
}
|
||||
gitea.--description() { gitea --with description "$1" "${@:2}"; }
|
||||
gitea.--desc() { gitea --description "$@"; }
|
||||
gitea.-d() { gitea --description "$@"; }
|
||||
gitea.--public() { gitea --with private= false "$@"; }
|
||||
gitea.-p() { gitea --public "$@"; }
|
||||
gitea.--private() { gitea --with private= true "$@"; }
|
||||
gitea.-P() { gitea --private "$@"; }
|
||||
gitea.--repo() {
|
||||
split_repo "$1"; local PROJECT_ORG="${REPLY[1]}" PROJECT_NAME="${REPLY[2]}"; gitea "${@:2}"
|
||||
}
|
||||
gitea.-r() { gitea --repo "$@"; }
|
||||
gitea.--tag() { local PROJECT_TAG="$1"; gitea "${@:2}" ; }
|
||||
gitea.-t() { gitea --tag "$@"; }
|
||||
gitea.exists() { split_repo "$1" && auth api 200 404 "repos/$REPLY" ; }
|
||||
gitea.delete() { split_repo "$1" && auth api 204 "" "/repos/$REPLY" -X DELETE; }
|
||||
gitea.deploy-key() {
|
||||
split_repo "$1"
|
||||
jmap title "$2" key "$3" read_only= "${4-true}" | json auth api 201 "" /repos/$REPLY/keys
|
||||
}
|
||||
gitea.new() {
|
||||
split_repo "$1"; local org="${REPLY[1]}" repo="${REPLY[2]}"
|
||||
if [[ $org == "$GITEA_USER" ]]; then org=user; else org="org/$org"; fi
|
||||
jmap name "$repo" ${GITEA_CREATE[@]+"${GITEA_CREATE[@]}"} "${@:2}" |
|
||||
json api "200|201" "" "$org/repos?token=$GITEA_API_TOKEN"
|
||||
[[ ! "${GITEA_DEPLOY_KEY-}" ]] ||
|
||||
gitea deploy-key "$1" "${GITEA_DEPLOY_KEY_TITLE:-default}" \
|
||||
"$GITEA_DEPLOY_KEY" "${GITEA_DEPLOY_READONLY:-true}"
|
||||
}
|
||||
gitea.vendor-merge() { :; }
|
||||
|
||||
branch-exists() { git rev-parse --verify "$1" &>/dev/null; }
|
||||
|
||||
gitea.vendor() {
|
||||
[[ ! -d .git ]] || loco_error ".git repo must not exist here";
|
||||
[[ -n "${PROJECT_ORG-}" ]] || PROJECT_ORG=$GITEA_USER
|
||||
[[ -n "${PROJECT_NAME-}" ]] || loco_error "PROJECT_NAME not set"
|
||||
|
||||
local GITEA_GIT_URL=${GITEA_GIT_URL-$GITEA_URL}
|
||||
[[ $GITEA_GIT_URL == *: ]] || GITEA_GIT_URL="${GITEA_GIT_URL%/}/";
|
||||
local GIT_REPO="$GITEA_GIT_URL$PROJECT_ORG/$PROJECT_NAME.git"
|
||||
|
||||
if gitea exists "$PROJECT_ORG/$PROJECT_NAME"; then
|
||||
[[ -n "${PROJECT_TAG-}" ]] || loco_error "PROJECT_TAG not set"
|
||||
local MESSAGE="Vendor update to $PROJECT_TAG"
|
||||
git clone --bare -b vendor "$GIT_REPO" .git ||
|
||||
git clone --bare "$GIT_REPO" .git # handle missing-branch case
|
||||
else
|
||||
local MESSAGE="Initial import"
|
||||
gitea new "$PROJECT_ORG/$PROJECT_NAME" "$@"
|
||||
git clone --bare "$GIT_REPO" .git
|
||||
fi
|
||||
|
||||
git config --local --bool core.bare false
|
||||
git config --local user.name "${GITEA_VENDOR_NAME:-Vendor}"
|
||||
git config --local user.email "${GITEA_VENDOR_EMAIL:-vendor@example.com}"
|
||||
|
||||
git add .; git commit -m "$MESSAGE" # commit to master or vendor
|
||||
branch-exists vendor || git checkout -b vendor # split off vendor branch if needed
|
||||
git push --all
|
||||
|
||||
[[ -z "${PROJECT_TAG-}" ]] || { git tag "vendor-$PROJECT_TAG"; git push --tags; }
|
||||
|
||||
git checkout master
|
||||
gitea vendor-merge
|
||||
}
|
||||
split_repo() {
|
||||
[[ "$1" == */* ]] || set -- "$GITEA_USER/$1";
|
||||
REPLY=("$1" "${1%/*}" "${1##*/}")
|
||||
}
|
||||
jmap() {
|
||||
local filter='{}' opts=(-n) arg=1
|
||||
while (($#)); do
|
||||
if [[ $1 == *= ]]; then
|
||||
filter+=" | .$1 $2"
|
||||
else
|
||||
filter+=" | .$1=\$__$arg"
|
||||
opts+=(--arg "__$arg" "$2")
|
||||
((arg++))
|
||||
fi
|
||||
shift 2
|
||||
done
|
||||
jq "${opts[@]}" "$filter"
|
||||
}
|
||||
json() { "$@" -X POST -H "Content-Type: application/json" -d @-; }
|
||||
auth() { "$@" -H "Authorization: token $GITEA_API_TOKEN"; }
|
||||
api() {
|
||||
if ! shopt -q extglob; then
|
||||
# extglob is needed for pattern matching
|
||||
local r=0; shopt -s extglob; api "$@" || r=$?; shopt -u extglob; return $r
|
||||
fi
|
||||
read-curl --silent --write-out '%{http_code}' --output /dev/null "${@:4}" "${GITEA_URL%/}/api/v1/${3#/}"
|
||||
local true="@($1)" false="@($2)"
|
||||
# shellcheck disable=2053 # glob matching is what we want!
|
||||
if [[ $REPLY == $true ]]; then return 0; elif [[ $2 && $REPLY == $false ]]; then return 1
|
||||
else case $REPLY in
|
||||
000) fail "Invalid server response: check GITEA_URL" 78 ;; # EX_PROTOCOL
|
||||
401) fail "Unauthorized: check GITEA_USER and GITEA_API_TOKEN" 77 ;; # EX_NOPERM
|
||||
404) fail "Server returned 404 Not Found" 69 ;; # EX_UNAVAILABLE
|
||||
*) fail "Failure: HTTP code $REPLY (expected $1${2:+ or $2})" 70 ;; # EX_SOFTWARE
|
||||
esac
|
||||
fi
|
||||
}
|
||||
read-curl() { REPLY=$(curl "$@"); }
|
||||
fail() { echo "$1" >&2; return "${2-64}"; }
|
||||
loco_preconfig() {
|
||||
LOCO_SCRIPT=$BASH_SOURCE
|
||||
LOCO_SITE_CONFIG=/etc/gitea-cli/gitearc
|
||||
LOCO_USER_CONFIG=$HOME/.config/gitearc
|
||||
LOCO_NAME=gitea
|
||||
LOCO_FILE=(.gitearc)
|
||||
PROJECT_NAME="${PROJECT_NAME-$(basename "$PWD")}"
|
||||
}
|
||||
loco_findproject() {
|
||||
findup "$LOCO_PWD" "${LOCO_FILE[@]}" && LOCO_PROJECT=$REPLY || LOCO_PROJECT=/dev/null
|
||||
}
|
||||
loco_findroot() { LOCO_ROOT=$LOCO_PWD; }
|
||||
if [[ $0 == "${BASH_SOURCE-}" ]]; then loco_main "$@"; fi
|
3
bin/i3lock.sh
Executable file
3
bin/i3lock.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
xset dpms force off && i3lock -d -i ~/Wallpapers/nebula_!.png
|
||||
|
4
bin/make_drone_secrets
Executable file
4
bin/make_drone_secrets
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
args=("$@")
|
||||
cat ${args[0]} |awk -F\= '{system(" drone secret add --repository='${args[1]}' --name="$1 " --data="$2)}'
|
8
bin/resolv.sh
Executable file
8
bin/resolv.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat > /etc/resolv.conf <<EOF
|
||||
# ParaConsul
|
||||
|
||||
nameserver 127.0.0.1
|
||||
|
||||
EOF
|
12
jira.d/config.yml
Executable file
12
jira.d/config.yml
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
echo "endpoint: https://jazzypro.atlassian.net"
|
||||
echo "user: aleksander.cynarski@jazzy.pro"
|
||||
echo "authentication-method: api-token"
|
||||
|
||||
|
||||
if [ -f ${PWD}/.jira ]; then
|
||||
PROJECT=`cat ${PWD}/.jira`
|
||||
echo "project: $PROJECT"
|
||||
fi
|
||||
|
||||
cat ~/.jira.d/custom
|
5
jira.d/custom
Normal file
5
jira.d/custom
Normal file
@ -0,0 +1,5 @@
|
||||
custom-commands:
|
||||
- name: mine
|
||||
help: display issues assigned to me
|
||||
script: |-
|
||||
{{jira}} list --query "resolution = unresolved and assignee=currentuser() ORDER BY created"
|
2
jira.d/templates/custom
Normal file
2
jira.d/templates/custom
Normal file
@ -0,0 +1,2 @@
|
||||
{{ range .issues }} {{ .key | append ":" | printf "%-12s"}} {{ .fields.summary }} {{ if .fields.assignee }} ^^^@{{ .fields.assignee.key }}{{end}}
|
||||
{{ end }}
|
@ -1,5 +1,5 @@
|
||||
source ~/.vim/common.vim
|
||||
set shell=/bin/bash
|
||||
set shell=/bin/zsh
|
||||
set hidden
|
||||
|
||||
|
||||
@ -49,6 +49,9 @@ Plug 'wincent/ferret'
|
||||
Plug 'moll/vim-bbye'
|
||||
|
||||
Plug 'shime/vim-livedown'
|
||||
Plug 'kjwon15/vim-transparent'
|
||||
|
||||
Plug 'mzlogin/vim-markdown-toc'
|
||||
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
|
||||
@ -129,7 +132,9 @@ Plug 'fatih/vim-go'
|
||||
|
||||
" DevOps Syntax
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
Plug 'chr4/nginx.vim'
|
||||
" Plug 'chr4/nginx.vim'
|
||||
|
||||
Plug 'ekalinin/Dockerfile.vim'
|
||||
|
||||
call plug#end()
|
||||
"
|
||||
@ -176,6 +181,8 @@ filetype plugin indent on
|
||||
|
||||
"autocmd VimEnter * colorscheme farout
|
||||
autocmd VimEnter * colorscheme fahrenheit
|
||||
set bg=light
|
||||
hi Normal guibg=NONE ctermbg=NONE
|
||||
"autocmd VimEnter *
|
||||
|
||||
|
||||
@ -339,7 +346,26 @@ nnoremap <unique> <Leader>sg :call PhpCreateSettersAndGetters()<CR>
|
||||
"nnoremap <unique> <Leader>da :call PhpDocAll()<CR>
|
||||
nnoremap <unique> <Leader>da :call pdv#DocumentWithSnip()<CR><Paste>
|
||||
|
||||
|
||||
let g:vdebug_options = {
|
||||
\ 'port' : 9009,
|
||||
\ 'timeout' : 20,
|
||||
\ 'server' : '',
|
||||
\ 'on_close' : 'stop',
|
||||
\ 'break_on_open' : 1,
|
||||
\ 'ide_key' : '',
|
||||
\ 'debug_window_level' : 0,
|
||||
\ 'debug_file_level' : 0,
|
||||
\ 'debug_file' : '',
|
||||
\ 'path_maps' : {},
|
||||
\ 'watch_window_style' : 'expanded',
|
||||
\ 'marker_default' : '⬦',
|
||||
\ 'marker_closed_tree' : '▸',
|
||||
\ 'marker_open_tree' : '▾',
|
||||
\ 'sign_breakpoint' : '▷',
|
||||
\ 'sign_current' : '▶',
|
||||
\ 'continuous_mode' : 1
|
||||
\}
|
||||
<
|
||||
|
||||
" Extract expression (normal mode)
|
||||
|
||||
|
Reference in New Issue
Block a user