403Webshell
Server IP : 164.138.27.172  /  Your IP : 216.73.216.143
Web Server : nginx/1.27.4
System : Linux cookingdream 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : www-adm ( 1001)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/powerline/renderers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/powerline/renderers/i3bar.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)

import json

from powerline.renderer import Renderer


class I3barRenderer(Renderer):
	'''I3bar Segment Renderer.

	Currently works only for i3bgbar (i3 bar with custom patches).
	'''

	@staticmethod
	def hlstyle(*args, **kwargs):
		# We don’t need to explicitly reset attributes, so skip those calls
		return ''

	def hl(self, contents, fg=None, bg=None, attrs=None, **kwargs):
		segment = {
			'full_text': contents,
			'separator': False,
			'separator_block_width': 0,  # no separators
		}

		if fg is not None:
			if fg is not False and fg[1] is not False:
				segment['color'] = '#{0:06x}'.format(fg[1])
		if bg is not None:
			if bg is not False and bg[1] is not False:
				segment['background'] = '#{0:06x}'.format(bg[1])
		return json.dumps(segment) + ','


renderer = I3barRenderer

Youez - 2016 - github.com/yon3zu
LinuXploit