Advertisement
Guest User

Untitled

a guest
May 4th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.58 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. from i3pystatus import Status
  5. from i3pystatus.calendar import google as google_cal
  6. from i3pystatus.weather import weathercom
  7.  
  8. status = Status(logfile='$HOME/tmp/i3pystatus.log')
  9.  
  10.  
  11. # ИСПОЛЬЗУЕМЫЕ ЦВЕТА
  12.  
  13. ## MONOCHROME
  14. colors_bg = ['#352A3D', '#24323d', '#223642', '#2C5630', '#39703E', '#643a37', '#503745', '#472933', '#473333', '#84312E']
  15. colors_fnt = ['#BFC2C0', '#BFC2C0', '#BFC2C0', '#BFC2C0', '#BFC2C0', '#BFC2C0', '#BFC2C0', '#BFC2C0']
  16.  
  17. # РАСКЛАДКА
  18. status.register("xkblayout",
  19.     #hints = {"markup": "pango", "separator": False},
  20.     #format = "<span background ='" + colors_bg[8] + "' color = '#002B36'></span> {symbol}",
  21.     format=" {symbol}",
  22.     layouts = ["us", "ru"],)
  23.  
  24. # ЧАСЫ
  25. status.register("clock",
  26.     hints = {"markup": "pango", "separator": False, "border_right": 0, "border_left":0,},
  27.     format = "<span background ='" + colors_bg[0] + "' color = '#002B36'></span>" + " %a %-d %b %X",
  28.     color = colors_fnt[0],
  29.     interval = 1,
  30.     on_leftclick = "gnome-calendar",
  31.     )
  32.  
  33. # ИНДИКАТОР КЛАВИШ УПРАВЛЕНИЯ
  34. status.register("keyboard_locks",
  35.     hints = {"markup": "pango", "separator": False, "separator_block_width": 0, "border_right": 0, "border_left":0,},
  36.     format = "<span background ='" + colors_bg[1] + "' color = '" + colors_bg[0] + "'></span\
  37.              ><span background = '" + colors_bg[0] + "'>{caps} {num}</span>",
  38.     )
  39.  
  40. # PULSEAUDIO
  41. status.register("pulseaudio",
  42.     hints= {"markup": "pango", "separator": False, "separator_block_width": 0, "border_right": 0, "border_left":0,},
  43.     format = "<span background='" + colors_bg[2] + "' color='" + colors_bg[1] + "'></span\
  44.             ><span background='" + colors_bg[1] + "' > {volume}% </span>",
  45.     format_muted = "<span background='" + colors_bg[2] + "' color='" + colors_bg[1] + "'></span\
  46.             ><span background='" + colors_bg[1] + "' > [muted] </span>",
  47.     step = 2,
  48.     )
  49.  
  50. # BACKLIGHT
  51. status.register("backlight",
  52.     interval = 5,
  53.     color = colors_fnt[3],
  54.      hints= {"markup": "pango","separator": False,"separator_block_width": 0},
  55.     format = "<span background='" + colors_bg[3] + "' color='" + colors_bg[2] + "'></span\
  56.             ><span background='" + colors_bg[2] + "'> {percentage:.0f}% </span>",
  57.     on_upscroll = "light -A 1",
  58.     on_downscroll = "light -U 1",
  59.     )
  60.  
  61. # БАТАРЕЯ
  62. status.register("battery",
  63.     battery_ident = "BAT1",
  64.     interval = 3,
  65.     hints = {"markup": "pango","separator": False,"separator_block_width": 0},
  66.     format = "<span background='" + colors_bg[4] + "' color='" + colors_bg[3] + "'></span\
  67.             ><span background='" + colors_bg[3] + "'>{status} {percentage:.0f}%</span>",    
  68.     alert = True,
  69.     alert_percentage = 30,
  70.     color = colors_fnt[4],
  71.     full_color = "#f2edcd",
  72.     charging_color = "#ece6b6",
  73.     critical_color = "#e5d18d",
  74.     status = {
  75.         "DIS": " ",
  76.         "CHR": " ",
  77.         "FULL": " ",
  78.     },
  79.   )
  80.  
  81. # ТЕМПЕРАТУРА
  82. status.register("temp",
  83.     hints= {"markup": "pango","separator": False,"separator_block_width": 0},
  84.     format = "<span background='" + colors_bg[5] + "' color='" + colors_bg[4] + "'></span\
  85.             ><span background='" + colors_bg[4] + "'> {temp}°</span>",
  86.     color = colors_fnt[5],
  87.     alert_color = "#FFEF00",
  88.     alert_temp = 60,
  89.   )
  90.  
  91. # CPU
  92. status.register("cpu_usage",
  93.     color = colors_fnt[6],
  94.     hints = {"markup": "pango", "separator": False, "separator_block_width": 0},
  95.     on_leftclick = "terminology -e 'top -u tevildo'",
  96.     format = "<span background='" + colors_bg[7] + "' color='" + colors_bg[5] + "'></span\
  97.             ><span background='" + colors_bg[5] + "' > {usage}%</span>",
  98.     )
  99.  
  100. # SPOTIFY
  101. # Индикатор музыкальных проигрывателей. Подхватывает активный
  102. status.register("spotify",
  103.     hints = {"markup": "pango", "separator": False, "separator_block_width": 0},
  104.     format = "<span color='" + colors_bg[8] + "'></span\
  105.     ><span background='" + colors_bg[7] + "' >[{artist}/{album}/]{title}{status}</span>",
  106.     format_no_player = "<span color='" + colors_bg[8] + "'></span\
  107.     ><span background='" + colors_bg[7] + "' >♬ [no player]</span>",
  108.     on_middleclick=["stop"],
  109.     on_doubleleftclick="terminology -e 'ncmpcpp'",
  110.     on_doublerightclick="sonata",
  111.     status={
  112.         "pause": "  ",
  113.         "play": "  ",
  114.         "stop": "  ",
  115.         },
  116.     )
  117.  
  118. # # ПОГОДА
  119. # status.register('weather',
  120. #     #hints = {"markup": "pango", "separator": False, "separator_block_width": 0},
  121. #     #format = "{condition} {current_temp}{temp_unit}{icon}[ Hi: {high_temp}] Lo: {low_temp}",
  122. #     format = "weath:{condition}{current_temp}{temp_unit}{feelslike}{icon}",
  123. #     #format = "<span color='" + colors_bg[7] + "'></span\
  124. #     #><span background='" + colors_bg[7] + "' >{condition} {current_temp}{temp_unit}{icon}[ Hi: {high_temp}] Lo: {low_temp}</span>",
  125. #     colorize = True,
  126. #     backend = weathercom.Weathercom(
  127. #         location_code = "RSXX0091:1:RS",
  128. #         units = "metric",
  129. #         update_error="!",
  130. #     ),
  131. # )
  132.  
  133. # status.register(
  134. #     'weather',
  135. #     format='{condition} {current_temp}{temp_unit}[ {icon}][ Hi: {high_temp}][ Lo: {low_temp}][ {update_error}]',
  136. #     interval=60,
  137. #     colorize=True,
  138. #     hints={'markup': 'pango'},
  139. #     backend=weathercom.Weathercom(
  140. #         location_code='94107:4:US',
  141. #         units='imperial',
  142. #         update_error='<span color="#ff0000">!</span>',
  143. #     ),
  144. # )
  145.  
  146.  
  147. status.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement