15 files changed,
1356 insertions(+),
0 deletions(-)
Author:
Smirnov Olexandr
ss2316544@gmail.com
Committed at:
2020-09-27 21:55:01 +0300
Parent:
68604c9
jump to
A
config/i3/config
··· 1 +############# General ############# 2 +# Bind $MOD(super) key 3 +set $mod Mod4 4 +# Font 5 +font monospace 10 6 +font pango:hack 10 7 +# Disable window title 8 +default_border pixel 9 + 10 +############ Autostart ############ 11 +exec --no-startup-id exec picom -b 12 +exec --no-startup-id exec feh --bg-scale ~/Imager/wallpaper.png 13 +exec --no-startup-id exec setxkbmap "us,ru,ua" ",winkeys" "grp:alt_shift_toggle" 14 +exec --no-startup-id exec org.telegram.desktop 15 +exec --no-startup-id exec discord 16 + 17 +############ Key bindings ######### 18 +# Terminal 19 +bindsym $mod+Return exec kitty 20 +#bindsym $mod+Return exec konsole 21 + 22 +# Kill focus window 23 +bindsym $mod+q kill 24 +bindsym Mod1+F4 kill 25 + 26 +# Program/Exit louncher 27 +bindsym $mod+space exec "rofi -show drun -show-icons -font 'hack 12' -show cobi -disable-history" 28 +bindsym $mod+Escape exec "rofi -show power-menu -show-icons -font 'hack 12' -width 30 -lines 6 -disable-history -modi power-menu:~/.config/rofi/rofi-power-menu" 29 +# Restart i3wm 30 +bindsym $mod+Shift+r restart 31 + 32 +# Load program 33 +bindsym $mod+F1 exec dolphin 34 +bindsym $mod+F2 exec chromium 35 +bindsym $mod+b exec firefox 36 +bindsym $mod+F3 exec spotify 37 +bindsym $mod+F4 exec subl 38 +bindsym $mod+F5 exec notable 39 + 40 +# Floating window 41 +floating_modifier $mod 42 +bindsym $mod+Shift+space floating toggle 43 +bindsym $mod+Shift+f focus mode_toggle 44 + 45 +# Fullscreen mode 46 +bindsym $mod+f fullscreen toggle 47 +bindsym $mod+F11 fullscreen toggle 48 + 49 +# Splits 50 +bindsym $mod+h split h 51 +bindsym $mod+v split v 52 + 53 +# Focus the parent container 54 +bindsym $mod+a focus parent 55 + 56 +# Change container layout(stacked, tabbed, toggle split) 57 +bindsym $mod+s layout stacking 58 +bindsym $mod+w layout tabbed 59 +bindsym $mod+e layout toggle split 60 + 61 +# Scratchpad 62 +bindsym $mod+Shift+grave move scratchpad 63 +bindsym $mod+grave scratchpad show 64 + 65 +######### Window preferens ######## 66 +assign [class="(?i)konsole|kitty"] $ws1 67 +assign [class="(?i)chromium|firefox"] $ws2 68 +assign [class="(?i)subl|code|atom|typora|prepros"] $ws3 69 +assign [class="(?i)dolphin"] $ws4 70 +assign [class="(?i)telegram|discord"] $ws6 71 +assign [title="Notable|Simplenote"] $ws7 72 +assign [title="KeePassXC"] $ws8 73 +for_window [class="Spotify"] move to workspace $ws10 74 + 75 +##### Change containet focus ###### 76 +# Vim like keys container 77 +bindsym $mod+j focus left 78 +bindsym $mod+k focus down 79 +bindsym $mod+l focus up 80 +bindsym $mod+semicolon focus right 81 + 82 +# Alternatively cursor keys 83 +bindsym $mod+Left focus left 84 +bindsym $mod+Down focus down 85 +bindsym $mod+Up focus up 86 +bindsym $mod+Right focus right 87 + 88 +##### Move focused container ###### 89 +# Vim like keys 90 +bindsym $mod+Shift+j move left 91 +bindsym $mod+Shift+k move down 92 +bindsym $mod+Shift+l move up 93 +bindsym $mod+Shift+colon move right 94 + 95 +# Alternatively cursor keys 96 +bindsym $mod+Shift+Left move left 97 +bindsym $mod+Shift+Down move down 98 +bindsym $mod+Shift+Up move up 99 +bindsym $mod+Shift+Right move right 100 + 101 +############ Workspaces ########### 102 +set $ws1 "1" 103 +set $ws2 "2" 104 +set $ws3 "3" 105 +set $ws4 "4" 106 +set $ws5 "5" 107 +set $ws6 "6" 108 +set $ws7 "7" 109 +set $ws8 "8" 110 +set $ws9 "9" 111 +set $ws10 "10" 112 + 113 +# Switch workspace 114 +bindsym $mod+1 workspace $ws1 115 +bindsym $mod+2 workspace $ws2 116 +bindsym $mod+3 workspace $ws3 117 +bindsym $mod+4 workspace $ws4 118 +bindsym $mod+5 workspace $ws5 119 +bindsym $mod+6 workspace $ws6 120 +bindsym $mod+7 workspace $ws7 121 +bindsym $mod+8 workspace $ws8 122 +bindsym $mod+9 workspace $ws9 123 +bindsym $mod+0 workspace $ws10 124 + 125 +# Move focused container to workspace 126 +bindsym $mod+Shift+1 move container to workspace $ws1 127 +bindsym $mod+Shift+2 move container to workspace $ws2 128 +bindsym $mod+Shift+3 move container to workspace $ws3 129 +bindsym $mod+Shift+4 move container to workspace $ws4 130 +bindsym $mod+Shift+5 move container to workspace $ws5 131 +bindsym $mod+Shift+6 move container to workspace $ws6 132 +bindsym $mod+Shift+7 move container to workspace $ws7 133 +bindsym $mod+Shift+8 move container to workspace $ws8 134 +bindsym $mod+Shift+9 move container to workspace $ws9 135 +bindsym $mod+Shift+0 move container to workspace $ws10 136 + 137 +########### Resize mode ########### 138 +mode "resize" { 139 + bindsym j resize shrink width 10 px or 10 ppt 140 + bindsym k resize grow height 10 px or 10 ppt 141 + bindsym l resize shrink height 10 px or 10 ppt 142 + bindsym semicolon resize grow width 10 px or 10 ppt 143 + 144 + # same bindings, but for the arrow keys 145 + bindsym Left resize shrink width 10 px or 10 ppt 146 + bindsym Down resize grow height 10 px or 10 ppt 147 + bindsym Up resize shrink height 10 px or 10 ppt 148 + bindsym Right resize grow width 10 px or 10 ppt 149 + 150 + # back to normal: Enter or Escape or $mod+r 151 + bindsym Return mode "default" 152 + bindsym Escape mode "default" 153 + bindsym $mod+r mode "default" 154 +} 155 +bindsym $mod+r mode "resize" 156 + 157 +############### Bar ############### 158 +exec_always --no-startup-id $HOME/.config/polybar/launch.sh 159 +#bar { 160 +# status_command i3status 161 +# position top 162 +#} 163 + 164 +############## Colors ############# 165 +# class border backgr. text indicator child_border 166 +client.focused #268bd2 #268bd2 #ffffff #268bd2 #268bd2 167 +client.focused_inactive #000000 #000000 #ffffff #000000 #000000 168 +client.unfocused #000000 #000000 #888888 #000000 #000000 169 +client.urgent #000000 #000000 #ffffff #000000 #000000 170 +client.placeholder #000000 #000000 #ffffff #000000 #000000 171 +client.background #ffffff
A
config/kitty/kitty.conf
··· 1 +#: MOD 2 +kitty_mod ctrl+shift 3 +clear_all_shortcuts no 4 + 5 + 6 + 7 +#: Font 8 +font_family Jetbrains Mono 9 +bold_font auto 10 +italic_font auto 11 +bold_italic_font auto 12 + 13 +font_size 12.0 14 + 15 +adjust_line_height 0 16 +adjust_column_width 0 17 + 18 +disable_ligatures never 19 +font_features none 20 +box_drawing_scale 0.001, 1, 1.5, 2 21 + 22 + 23 + 24 +#: Cursor 25 +cursor #dfdfdf 26 +cursor_text_color #7d7d7d 27 + 28 +#cursor_shape block 29 +cursor_shape beam 30 + 31 +cursor_beam_thickness 1.5 32 +cursor_underline_thickness 2.0 33 + 34 +cursor_blink_interval 0 35 +cursor_stop_blinking_after 15.0 36 + 37 + 38 + 39 +#: Bell 40 +enable_audio_bell no 41 +visual_bell_duration 0.0 42 +window_alert_on_bell no 43 +command_on_bell none 44 +bell_on_tab no 45 + 46 + 47 + 48 +#: Scrollback (History) 49 +scrollback_lines 500 50 +scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER 51 +scrollback_pager_history_size 0 52 +wheel_scroll_multiplier 5.0 53 +touch_scroll_multiplier 1.0 54 + 55 + 56 + 57 +#: Mouse 58 +mouse_hide_wait 2.5 59 + 60 +url_color #4ecdc4 61 +url_style curly 62 + 63 +open_url_modifiers kitty_mod 64 +open_url_with default 65 +url_prefixes http https file ftp 66 +copy_on_select yes 67 +strip_trailing_spaces never 68 +rectangle_select_modifiers ctrl+alt 69 +terminal_select_modifiers shift 70 +select_by_word_characters :@-./_~?&=%+# 71 +click_interval -1.0 72 +focus_follows_mouse yes 73 +pointer_shape_when_grabbed arrow 74 + 75 + 76 + 77 +#: Perfomance 78 +repaint_delay 10 79 +input_delay 3 80 +sync_to_monitor yes 81 +command_on_bell none 82 + 83 + 84 + 85 +#: Window 86 +remember_window_size yes 87 +initial_window_width 640 88 +initial_window_height 480 89 +enabled_layouts * 90 + 91 +window_resize_step_cells 2 92 +window_resize_step_lines 2 93 +window_border_width 1.0 94 +draw_minimal_borders no 95 +window_margin_width 0.0 96 +single_window_margin_width -1000.0 97 +window_padding_width 0.0 98 + 99 +placement_strategy center 100 +active_border_color #073642 101 +inactive_border_color #292f36 102 +bell_border_color #ff5a00 103 +inactive_text_alpha 1.0 104 +hide_window_decorations no 105 +resize_debounce_time 0.1 106 +resize_draw_strategy static 107 +resize_in_steps no 108 + 109 + 110 + 111 +#: Tabs 112 +tab_bar_edge bottom 113 +tab_bar_margin_width 0.0 114 +tab_bar_style powerline 115 +tab_bar_min_tabs 2 116 +tab_switch_strategy previous 117 +tab_fade 0.25 0.5 0.75 1 118 +tab_separator " ┇" 119 +tab_title_template "{title}" 120 +active_tab_title_template none 121 + 122 +active_tab_foreground #dfdfdf 123 +active_tab_background #073642 124 +active_tab_font_style bold-italic 125 +inactive_tab_foreground #dfdfdf 126 +inactive_tab_background #292f36 127 +inactive_tab_font_style normal 128 + 129 +tab_bar_background none 130 + 131 + 132 + 133 +#: Theming 134 +foreground #dfdfdf 135 +background_opacity 0.87 136 +background_image none 137 +background_image_layout tiled 138 +background_image_linear no 139 +dynamic_background_opacity no 140 +background_tint 0.0 141 +dim_opacity 0.75 142 +selection_foreground #edebd7 143 +selection_background #073642 144 + 145 + 146 + 147 +#: Keyboard Shortcuts 148 +#: #: Clipboard 149 +map ctrl+shift+c copy_to_clipboard 150 +map ctrl+shift+v paste_from_clipboard 151 +map shift+insert paste_from_selection 152 +map kitty_mod+o pass_selection_to_program 153 + 154 +#: #: Scroll 155 +map kitty_mod+up scroll_line_up 156 +map kitty_mod+k scroll_line_up 157 +map kitty_mod+down scroll_line_down 158 +map kitty_mod+j scroll_line_down 159 +map kitty_mod+page_up scroll_page_up 160 +map kitty_mod+page_down scroll_page_down 161 +map kitty_mod+home scroll_home 162 +map kitty_mod+end scroll_end 163 +map kitty_mod+h show_scrollback 164 + 165 +#: #: Window 166 +map kitty_mod+F9 new_os_window 167 +map kitty_mod+enter new_window 168 +map kitty_mod+x close_window 169 +map kitty_mod+] next_window 170 +map kitty_mod+[ previous_window 171 +map kitty_mod+f move_window_forward 172 +map kitty_mod+b move_window_backward 173 +map kitty_mod+` move_window_to_top 174 +map kitty_mod+r start_resizing_window 175 + 176 +#: #: Tab 177 +map kitty_mod+l next_tab 178 +map kitty_mod+h previous_tab 179 +map kitty_mod+t new_tab 180 +map kitty_mod+q close_tab 181 +map kitty_mod+. set_tab_title 182 +map kitty_mod+1 first_window 183 +map kitty_mod+2 second_window 184 +map kitty_mod+3 third_window 185 +map kitty_mod+4 fourth_window 186 +map kitty_mod+5 fifth_window 187 +map kitty_mod+6 sixth_window 188 +map kitty_mod+7 seventh_window 189 +map kitty_mod+8 eighth_window 190 +map kitty_mod+9 ninth_window 191 +map kitty_mod+0 tenth_window 192 + 193 +#: #: Layouts 194 +map kitty_mod+l next_layout 195 + 196 +#: #: Font Size 197 +map kitty_mod+equal change_font_size all +2.0 198 +map kitty_mod+minus change_font_size all -2.0 199 +map kitty_mod+backspace change_font_size all 0 200 + 201 +#:#: Other 202 +map f11 toggle_fullscreen 203 +map kitty_mod+f10 toggle_maximized 204 +map kitty_mod+u kitten unicode_input 205 +map kitty_mod+f2 edit_config_file 206 +map kitty_mod+escape kitty_shell window 207 + 208 +map kitty_mod+delete clear_terminal reset active 209 + 210 +selection_background #073642 211 +selection_foreground #edebd7 212 +foreground #d2dae2 213 +background #1e272e 214 +cursorColor #d2dae2 215 + 216 +color0 #1e272e 217 +color8 #485460 218 + 219 +color1 #ff3f34 220 +color9 #ff5e57 221 + 222 +color2 #05c46b 223 +color10 #0be881 224 + 225 +color3 #ffa801 226 +color11 #ffc048 227 + 228 +color4 #3c40c6 229 +color12 #575fcf 230 + 231 +color5 #f53b57 232 +color13 #ef5777 233 + 234 +color6 #0fbcf9 235 +color14 #4bcffa 236 + 237 +color7 #808e9b 238 +color15 #d2dae2
A
config/polybar/config
··· 1 +[settings] 2 +pseudo-transparency = true 3 + 4 +[colors] 5 +background = #002B36 6 +background-alt = #073642 7 +foreground = #dfdfdf 8 +foreground-alt = #fdf6e3 9 +primary = #268bd2 10 +secondary = #218DC8 11 +alert = #268bd2 12 +;alert = #dc322f 13 + 14 +############################################################################################################ 15 +[bar/example] 16 +#monitor = ${env:MONITOR:HDMI-1} 17 +width = 100% 18 +height = 26 19 +fixed-center = true 20 +locale = en_US.UTF-8 21 + 22 +background = ${colors.background} 23 +foreground = ${colors.foreground} 24 + 25 +line-size = 1 26 +line-color = #f00 27 + 28 +padding-left = 0 29 +padding-right = 0 30 +module-margin-left = 1 31 +module-margin-right = 1 32 + 33 +; Fonts 34 +font-0 = Iosevka Nerd Font:style=Medium:size=8;3 35 +font-1 = FontAwesome5Free:style=Solid:size=7.5;2.5 36 +font-2 = Weather Icons:size=7;2 37 +font-3 = FontAwesome5Brands:style=Solid:size=7.5;2.5 38 + 39 +############################################################################################################ 40 +; Modules position 41 +modules-left = i3 sp2 openweathermap-simple updates-pacman 42 +;modules-center = title 43 +modules-center = spotify 44 +modules-right = pulseaudio xkeyboard powermenu sp2 calendar 45 +tray-position = right 46 +tray-padding = 2 47 +tray-detached = false 48 + 49 +############################################################################################################ 50 +# INCLUDE MODULES 51 +############################################################################################################ 52 +[module/filesystem] 53 +type = internal/fs 54 +interval = 25 55 +mount-0 = / 56 +mount-1 = /home 57 + 58 +label-mounted = %{F#c38611} %mountpoint%: %percentage_used%% 59 +label-unmounted = %mountpoint% not mounted 60 +label-unmounted-foreground = ${colors.foreground-alt} 61 + 62 +############################################################################################################ 63 +[settings] 64 +screenchange-reload = true 65 + 66 +############################################################################################################ 67 +; Used for top and bottom aligned bars 68 +[global/wm] 69 +margin-top = 5 70 +margin-bottom = 5 71 +cursor-click = pointer 72 +cursor-scroll = ns-resize 73 +wm-restack = i3 74 + 75 +############################################################################################################ 76 +; i3wm workspace indicator 77 +[module/i3] 78 +type = internal/i3 79 +format = <label-state><label-mode> 80 +index-sort = true 81 +wrapping-scroll = false 82 +label-mode-padding = 1 83 +label-mode-foreground = #000 84 +label-mode-background = ${colors.primary} 85 +label-focused = %icon% 86 +label-focused-background = 002873C0 87 +label-focused-foreground = ${colors.foreground} 88 +label-focused-padding = 1 89 +label-focused-underline = 018BFF 90 +#label-focused-overline = ${colors.primary} 91 + 92 +label-unfocused = %icon% 93 +label-unfocused-background = 00255498 94 +label-unfocused-foreground = ${colors.foreground} 95 +label-unfocused-padding = 1 96 +#label-unfocused-underline = 255498 97 +#label-unfocused-overline = ${colors.background} 98 + 99 +label-urgent = %icon% 100 +label-urgent-background = ${colors.alert} 101 +label-urgent-foreground = ${colors.foreground} 102 +label-urgent-padding = 1 103 +label-urgent-underline = ${colors.alert} 104 +#label-urgent-overline = ${colors.background} 105 + 106 +label-visible = %icon% 107 +label-visible-background = ${colors.background} 108 +label-visible-foreground = ${colors.foreground} 109 +label-visible-padding = 1 110 +label-visible-underline = ${colors.background} 111 +#label-visible-overline = ${colors.background} 112 + 113 +ws-icon-0 = "1;1 " 114 +ws-icon-1 = "2;2 " 115 +ws-icon-2 = "3;3 " 116 +ws-icon-3 = "4;4 " 117 +ws-icon-4 = "5;5 " 118 +ws-icon-5 = "6;6 " 119 +ws-icon-6 = "7;7 " 120 +ws-icon-7 = 8;8 121 +ws-icon-8 = "9;9 " 122 +ws-icon-9 = "10;10 " 123 +;label-separator = | 124 + 125 +############################################################################################################ 126 +# PulseAudio- https://github.com/polybar/polybar/wiki/Module:-pulseaudio 127 +[module/pulseaudio] 128 +type = internal/pulseaudio 129 +format-volume = %{F#61a8ff}<ramp-volume><label-volume> 130 +label-volume = %{F#61a8ff} %percentage%% 131 +label-volume-foreground = ${root.foreground} 132 +label-muted = 133 +label-muted-foreground = #e8793e 134 + 135 +ramp-volume-0 = 136 +ramp-volume-1 = 137 +ramp-volume-2 = 138 +ramp-volume-3 = 139 +ramp-volume-4 = 140 + 141 +############################################################################################################ 142 +; CPU Loads - https://github.com/polybar/polybar/wiki/Module:-cpu 143 +[module/cpu] 144 +type = internal/cpu 145 +interval = 2 146 +format-prefix = " " 147 +format-prefix-foreground = ${colors.foreground-alt} 148 +label = %{F#1ecb0b} CPU %percentage%% 149 + 150 + 151 +############################################################################################################ 152 +# Memmory(RAM) - https://github.com/polybar/polybar/wiki/Module:-memory 153 +[module/memory] 154 +type = internal/memory 155 +interval = 2 156 +format-prefix = " " 157 +#format-prefix-foreground = ${colors.foreground-alt} 158 +#format-overline = #61C07C 159 +#format-underline = #61C07C 160 +label = %{F#8d61ff} MEM %percentage_used%% 161 + 162 +############################################################################################################ 163 +; Weather 164 +[module/openweathermap-simple] 165 +type = custom/script 166 +exec = ~/.config/polybar/scripts/openweathermap-simple.sh 167 +interval = 60 168 +label-font = 3 169 + 170 +############################################################################################################ 171 +; Sporify inkator - https://github.com/Jvanrhijn/polybar-spotify 172 +[module/spotify] 173 +type = custom/script 174 +interval = 1 175 +format-prefix = " " 176 +format = <label> 177 +exec = python ~/.config/polybar/scripts/spotify_status.py -f '{artist} - {song}' 178 +line-size 179 +format-underline = #1db954 180 + 181 +############################################################################################################ 182 +; Updates cheacker (pacman) 183 +[module/updates-pacman] 184 +type = custom/script 185 +exec = ~/.config/polybar/scripts/updates-pacman.sh 186 +interval = 600 187 + 188 +############################################################################################################ 189 +; Keyboard layout - https://github.com/polybar/polybar/wiki/Module:-xkeyboard 190 +[module/xkeyboard] 191 +type = internal/xkeyboard 192 +blacklist-0 = num lock 193 +label-NAME-maxlen = 10 194 +format-prefix = "" 195 +label-layout = %layout% 196 + 197 +label-indicator-padding = 2 198 +label-indicator-margin = 1 199 +label-indicator-background = 2B7DBC 200 +label-indicator-overline = 2B7DBC 201 +label-indicator-underline = 2B7DBC 202 + 203 +############################################################################################################ 204 +; Battery - https://github.com/polybar/polybar/wiki/Module:-battery 205 +[module/battery-combined-tlp] 206 +type = custom/script 207 +exec = ~/.config/polybar/scripts/battery-combined-tlp.sh 208 +interval = 10 209 + 210 +############################################################################################################ 211 +; Separator 212 +[module/sp2] 213 +type = custom/text 214 +content = "┇" 215 +; content-foreground = #93A1A1 216 + 217 +############################################################################################################ 218 +; Calendar 219 +[module/calendar] 220 +type = custom/script 221 +exec = ~/.config/polybar/scripts/popup-calendar.sh 222 +interval = 5 223 +click-left = ~/.config/polybar/scripts/popup-calendar.sh --popup & 224 + 225 +############################################################################################################ 226 +# Date & time - https://github.com/polybar/polybar/wiki/Module:-date 227 +[module/date] 228 +type = internal/date 229 +interval = 1 230 +dqate = 231 +time =%{F#E0D9FF} %H:%M:%S 232 +date-alt =%{F#E0D9FF} %a %e %B %Y 233 +time-alt = %H:%M 234 +format-prefix = 235 +label = %date% %time% 236 + 237 +############################################################################################################ 238 +; Focus window name - https://github.com/polybar/polybar/wiki/Module:-xwindow 239 +[module/title] 240 +type = internal/xwindow 241 +label = %{F#f0f0f0}%title:0:50:...% 242 +label-empty = Empty 243 +label-empty-foreground = #707880 244 +label-maxlen = 30 245 +label-padding = 0
A
config/polybar/launch.sh
··· 1 +#!/bin/bash 2 +killall -q polybar 3 +while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done 4 +polybar example &
A
config/polybar/scripts/btc
··· 1 +#!/usr/bin/python 2 +# -*- coding: utf-8 -*- 3 + 4 +import json,sys,urllib.request,time 5 + 6 +if len(sys.argv) != 3: 7 + print("Usage: btc usd,eur,btc nok") 8 + sys.exit() 9 + 10 +currencies = sys.argv[1] 11 +basecurrency = sys.argv[2] 12 + 13 +currencyurl = "http://freecurrencyrates.com/api/action.php?do=cvals&iso=" + currencies.replace(',','') + "&f=" + basecurrency + "&v=1&s=cbr" 14 +f = urllib.request.urlopen(currencyurl) 15 +obj = json.loads(f.read()) 16 +res=""; 17 +for c in currencies.split(','): 18 + res += c.upper() + ":{:,.2f}".format(1/obj[c.upper()]).replace(',',' ') 19 + 20 +# some unicode currency code replacement (optional) 21 +res = res.replace("USD", " $") 22 +res = res.replace("EUR", " €") 23 +res = res.replace("BTC", " ") 24 + 25 +print(res);
A
config/polybar/scripts/openweathermap-simple.sh
··· 1 +#!/bin/sh 2 +API="https://api.openweathermap.org/data/2.5" 3 +KEY="34e5d198afe8fb0303e3c3c37774d2ca" 4 +CITY="Horodnytsya, UA" 5 +UNITS="metric" 6 +SYMBOL="°С" 7 + 8 +get_icon() { 9 + case $1 in 10 + # Icons for weather-icons 11 + 01d) icon="";; 12 + 01n) icon="";; 13 + 02d) icon="";; 14 + 02n) icon="";; 15 + 03*) icon="";; 16 + 04*) icon="";; 17 + 09d) icon="";; 18 + 09n) icon="";; 19 + 10d) icon="";; 20 + 10n) icon="";; 21 + 11d) icon="";; 22 + 11n) icon="";; 23 + 13d) icon="";; 24 + 13n) icon="";; 25 + 50d) icon="";; 26 + 50n) icon="";; 27 + *) icon=""; 28 + esac 29 + 30 + echo $icon 31 +} 32 + 33 +if [ -n "$CITY" ]; then 34 + if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then 35 + CITY_PARAM="id=$CITY" 36 + else 37 + CITY_PARAM="q=$CITY" 38 + fi 39 + 40 + weather=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS") 41 +else 42 + location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue) 43 + 44 + if [ -n "$location" ]; then 45 + location_lat="$(echo "$location" | jq '.location.lat')" 46 + location_lon="$(echo "$location" | jq '.location.lng')" 47 + 48 + weather=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS") 49 + fi 50 +fi 51 + 52 +if [ -n "$weather" ]; then 53 + weather_temp=$(echo "$weather" | jq ".main.temp" | cut -d "." -f 1) 54 + weather_icon=$(echo "$weather" | jq -r ".weather[0].icon") 55 + 56 + echo "$(get_icon "$weather_icon")" "$weather_temp$SYMBOL" 57 +fi
A
config/polybar/scripts/popup-calendar.sh
··· 1 +#!/bin/sh 2 + 3 +BAR_HEIGHT=22 # polybar height 4 +BORDER_SIZE=1 # border size from your wm settings 5 +YAD_WIDTH=222 # 222 is minimum possible value 6 +YAD_HEIGHT=193 # 193 is minimum possible value 7 +DATE="$(date +"%a %d %H:%M")" 8 + 9 +case "$1" in 10 +--popup) 11 + if [ "$(xdotool getwindowfocus getwindowname)" = "yad-calendar" ]; then 12 + exit 0 13 + fi 14 + 15 + eval "$(xdotool getmouselocation --shell)" 16 + eval "$(xdotool getdisplaygeometry --shell)" 17 + 18 + # X 19 + if [ "$((X + YAD_WIDTH / 2 + BORDER_SIZE))" -gt "$WIDTH" ]; then #Right side 20 + : $((pos_x = WIDTH - YAD_WIDTH - BORDER_SIZE)) 21 + elif [ "$((X - YAD_WIDTH / 2 - BORDER_SIZE))" -lt 0 ]; then #Left side 22 + : $((pos_x = BORDER_SIZE)) 23 + else #Center 24 + : $((pos_x = X - YAD_WIDTH / 2)) 25 + fi 26 + 27 + # Y 28 + if [ "$Y" -gt "$((HEIGHT / 2))" ]; then #Bottom 29 + : $((pos_y = HEIGHT - YAD_HEIGHT - BAR_HEIGHT - BORDER_SIZE)) 30 + else #Top 31 + : $((pos_y = BAR_HEIGHT + BORDER_SIZE)) 32 + fi 33 + 34 + yad --calendar --undecorated --fixed --close-on-unfocus --no-buttons \ 35 + --width="$YAD_WIDTH" --height="$YAD_HEIGHT" --posx="$pos_x" --posy="$pos_y" \ 36 + --title="yad-calendar" --borders=0 >/dev/null & 37 + ;; 38 +*) 39 + echo "$DATE" 40 + ;; 41 +esac
A
config/polybar/scripts/redshift.sh
··· 1 +#!/bin/sh 2 + 3 +if [ "$(pgrep -x redshift)" ]; then 4 + temp=$(redshift -p 2> /dev/null | grep temp | cut -d ":" -f 2 | tr -dc "[:digit:]") 5 + 6 + if [ -z "$temp" ]; then 7 + echo "%{F#65737E} #" 8 + elif [ "$temp" -ge 5000 ]; then 9 + echo "%{F#8FA1B3} #" 10 + elif [ "$temp" -ge 4000 ]; then 11 + echo "%{F#EBCB8B} #" 12 + else 13 + echo "%{F#D08770} #" 14 + fi 15 +fi
A
config/polybar/scripts/spotify_status.py
··· 1 +#!/usr/bin/env python 2 +import sys 3 +import dbus 4 +import argparse 5 + 6 +parser = argparse.ArgumentParser() 7 +parser.add_argument( 8 + '-t', 9 + '--trunclen', 10 + type=int, 11 + metavar='trunclen' 12 +) 13 +parser.add_argument( 14 + '-f', 15 + '--format', 16 + type=str, 17 + metavar='custom format', 18 + dest='custom_format' 19 +) 20 +parser.add_argument( 21 + '-p', 22 + '--playpause', 23 + type=str, 24 + metavar='play-pause indicator', 25 + dest='play_pause' 26 +) 27 +parser.add_argument( 28 + '--font', 29 + type=str, 30 + metavar='the index of the font to use for the main label', 31 + dest='font' 32 +) 33 +parser.add_argument( 34 + '--playpause-font', 35 + type=str, 36 + metavar='the index of the font to use to display the playpause indicator', 37 + dest='play_pause_font' 38 +) 39 +parser.add_argument( 40 + '-q', 41 + '--quiet', 42 + action='store_true', 43 + help="if set, don't show any output when the current song is paused", 44 + dest='quiet', 45 +) 46 + 47 +args = parser.parse_args() 48 + 49 + 50 +def fix_string(string): 51 + # corrects encoding for the python version used 52 + if sys.version_info.major == 3: 53 + return string 54 + else: 55 + return string.encode('utf-8') 56 + 57 + 58 +def truncate(name, trunclen): 59 + if len(name) > trunclen: 60 + name = name[:trunclen] 61 + name += '...' 62 + if ('(' in name) and (')' not in name): 63 + name += ')' 64 + return name 65 + 66 + 67 + 68 +# Default parameters 69 +output = fix_string(u'{play_pause} {artist}: {song}') 70 +trunclen = 35 71 +play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused 72 + 73 +label_with_font = '%{{T{font}}}{label}%{{T-}}' 74 +font = args.font 75 +play_pause_font = args.play_pause_font 76 + 77 +quiet = args.quiet 78 + 79 +# parameters can be overwritten by args 80 +if args.trunclen is not None: 81 + trunclen = args.trunclen 82 +if args.custom_format is not None: 83 + output = args.custom_format 84 +if args.play_pause is not None: 85 + play_pause = args.play_pause 86 + 87 +try: 88 + session_bus = dbus.SessionBus() 89 + spotify_bus = session_bus.get_object( 90 + 'org.mpris.MediaPlayer2.spotify', 91 + '/org/mpris/MediaPlayer2' 92 + ) 93 + 94 + spotify_properties = dbus.Interface( 95 + spotify_bus, 96 + 'org.freedesktop.DBus.Properties' 97 + ) 98 + 99 + metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata') 100 + status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus') 101 + 102 + # Handle play/pause label 103 + 104 + play_pause = play_pause.split(',') 105 + 106 + if status == 'Playing': 107 + play_pause = play_pause[0] 108 + elif status == 'Paused': 109 + play_pause = play_pause[1] 110 + else: 111 + play_pause = str() 112 + 113 + if play_pause_font: 114 + play_pause = label_with_font.format(font=play_pause_font, label=play_pause) 115 + 116 + # Handle main label 117 + 118 + artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else '' 119 + song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else '' 120 + album = fix_string(metadata['xesam:album']) if metadata['xesam:album'] else '' 121 + 122 + if (quiet and status == 'Paused') or (not artist and not song and not album): 123 + print('') 124 + else: 125 + if font: 126 + artist = label_with_font.format(font=font, label=artist) 127 + song = label_with_font.format(font=font, label=song) 128 + album = label_with_font.format(font=font, label=album) 129 + 130 + # Add 4 to trunclen to account for status symbol, spaces, and other padding characters 131 + print(truncate(output.format(artist=artist, 132 + song=song, 133 + play_pause=play_pause, 134 + album=album), trunclen + 4)) 135 + 136 +except Exception as e: 137 + if isinstance(e, dbus.exceptions.DBusException): 138 + print('') 139 + else: 140 + print(e)
A
config/polybar/scripts/updates-pacman.sh
··· 1 +#!/bin/sh 2 +if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then 3 + updates_arch=0 4 +fi 5 + 6 +if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then 7 + updates_aur=0 8 +fi 9 + 10 +updates=$(("$updates_arch" + "$updates_aur")) 11 + 12 +if [ "$updates" -gt 0 ]; then 13 + echo "# $updates" 14 +else 15 + echo "" 16 +fi
A
config/rofi/solarized.rasi
··· 1 +* { 2 + selected-normal-foreground: rgba ( 129, 147, 150, 100 % ); 3 + foreground: rgba ( 129, 147, 150, 100 % ); 4 + normal-foreground: @foreground; 5 + alternate-normal-background: rgba ( 0, 43, 55, 100 % ); 6 + red: rgba ( 220, 50, 47, 100 % ); 7 + selected-urgent-foreground: rgba ( 218, 66, 129, 100 % ); 8 + blue: rgba ( 38, 139, 210, 100 % ); 9 + urgent-foreground: rgba ( 218, 66, 129, 100 % ); 10 + alternate-urgent-background: rgba ( 0, 43, 55, 100 % ); 11 + active-foreground: rgba ( 0, 142, 212, 100 % ); 12 + lightbg: rgba ( 238, 232, 213, 100 % ); 13 + selected-active-foreground: rgba ( 0, 142, 212, 100 % ); 14 + alternate-active-background: rgba ( 0, 43, 55, 100 % ); 15 + background: rgba ( 0, 43, 55, 100 % ); 16 + bordercolor: rgba ( 0, 43, 55, 100 % ); 17 + alternate-normal-foreground: @foreground; 18 + normal-background: rgba ( 0, 43, 55, 100 % ); 19 + lightfg: rgba ( 88, 104, 117, 100 % ); 20 + selected-normal-background: rgba ( 0, 54, 66, 100 % ); 21 + border-color: @foreground; 22 + spacing: 2; 23 + separatorcolor: rgba ( 0, 54, 66, 100 % ); 24 + urgent-background: rgba ( 0, 43, 55, 100 % ); 25 + selected-urgent-background: rgba ( 0, 54, 66, 100 % ); 26 + alternate-urgent-foreground: @urgent-foreground; 27 + background-color: rgba ( 0, 0, 0, 0 % ); 28 + alternate-active-foreground: @active-foreground; 29 + active-background: rgba ( 0, 43, 55, 100 % ); 30 + selected-active-background: rgba ( 0, 54, 66, 100 % ); 31 +} 32 +#window { 33 + background-color: @background; 34 + border: 1; 35 + padding: 5; 36 +} 37 +#mainbox { 38 + border: 0; 39 + padding: 0; 40 +} 41 +#message { 42 + border: 1px dash 0px 0px ; 43 + border-color: @separatorcolor; 44 + padding: 1px ; 45 +} 46 +#textbox { 47 + text-color: @foreground; 48 +} 49 +#listview { 50 + fixed-height: 0; 51 + border: 2px dash 0px 0px ; 52 + border-color: @separatorcolor; 53 + spacing: 2px ; 54 + scrollbar: true; 55 + padding: 2px 0px 0px ; 56 +} 57 +#element { 58 + border: 0; 59 + padding: 1px ; 60 +} 61 +#element.normal.normal { 62 + background-color: @normal-background; 63 + text-color: @normal-foreground; 64 +} 65 +#element.normal.urgent { 66 + background-color: @urgent-background; 67 + text-color: @urgent-foreground; 68 +} 69 +#element.normal.active { 70 + background-color: @active-background; 71 + text-color: @active-foreground; 72 +} 73 +#element.selected.normal { 74 + background-color: @selected-normal-background; 75 + text-color: @selected-normal-foreground; 76 +} 77 +#element.selected.urgent { 78 + background-color: @selected-urgent-background; 79 + text-color: @selected-urgent-foreground; 80 +} 81 +#element.selected.active { 82 + background-color: @selected-active-background; 83 + text-color: @selected-active-foreground; 84 +} 85 +#element.alternate.normal { 86 + background-color: @alternate-normal-background; 87 + text-color: @alternate-normal-foreground; 88 +} 89 +#element.alternate.urgent { 90 + background-color: @alternate-urgent-background; 91 + text-color: @alternate-urgent-foreground; 92 +} 93 +#element.alternate.active { 94 + background-color: @alternate-active-background; 95 + text-color: @alternate-active-foreground; 96 +} 97 +#scrollbar { 98 + width: 4px ; 99 + border: 0; 100 + handle-width: 8px ; 101 + padding: 0; 102 +} 103 +#mode-switcher { 104 + border: 2px dash 0px 0px ; 105 + border-color: @separatorcolor; 106 +} 107 +#button.selected { 108 + background-color: @selected-normal-background; 109 + text-color: @selected-normal-foreground; 110 +} 111 +#inputbar { 112 + spacing: 0; 113 + text-color: @normal-foreground; 114 + padding: 1px ; 115 +} 116 +#case-indicator { 117 + spacing: 0; 118 + text-color: @normal-foreground; 119 +} 120 +#entry { 121 + spacing: 0; 122 + text-color: @normal-foreground; 123 +} 124 +#prompt { 125 + spacing: 0; 126 + text-color: @normal-foreground; 127 +} 128 +#inputbar { 129 + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; 130 +} 131 +#textbox-prompt-colon { 132 + expand: false; 133 + str: ":"; 134 + margin: 0px 0.3em 0em 0em ; 135 + text-color: @normal-foreground; 136 +}