1254 lines
81 KiB
HTML
1254 lines
81 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
<head>
|
|
<!-- 2020-01-11 sam. 21:59 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Polybar Configuration</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Dehaeze Thomas" />
|
|
<style type="text/css">
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
.title { text-align: center;
|
|
margin-bottom: .2em; }
|
|
.subtitle { text-align: center;
|
|
font-size: medium;
|
|
font-weight: bold;
|
|
margin-top:0; }
|
|
.todo { font-family: monospace; color: red; }
|
|
.done { font-family: monospace; color: green; }
|
|
.priority { font-family: monospace; color: orange; }
|
|
.tag { background-color: #eee; font-family: monospace;
|
|
padding: 2px; font-size: 80%; font-weight: normal; }
|
|
.timestamp { color: #bebebe; }
|
|
.timestamp-kwd { color: #5f9ea0; }
|
|
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
|
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
|
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
|
.underline { text-decoration: underline; }
|
|
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
|
p.verse { margin-left: 3%; }
|
|
pre {
|
|
border: 1px solid #ccc;
|
|
box-shadow: 3px 3px 3px #eee;
|
|
padding: 8pt;
|
|
font-family: monospace;
|
|
overflow: auto;
|
|
margin: 1.2em;
|
|
}
|
|
pre.src {
|
|
position: relative;
|
|
overflow: visible;
|
|
padding-top: 1.2em;
|
|
}
|
|
pre.src:before {
|
|
display: none;
|
|
position: absolute;
|
|
background-color: white;
|
|
top: -10px;
|
|
right: 10px;
|
|
padding: 3px;
|
|
border: 1px solid black;
|
|
}
|
|
pre.src:hover:before { display: inline;}
|
|
/* Languages per Org manual */
|
|
pre.src-asymptote:before { content: 'Asymptote'; }
|
|
pre.src-awk:before { content: 'Awk'; }
|
|
pre.src-C:before { content: 'C'; }
|
|
/* pre.src-C++ doesn't work in CSS */
|
|
pre.src-clojure:before { content: 'Clojure'; }
|
|
pre.src-css:before { content: 'CSS'; }
|
|
pre.src-D:before { content: 'D'; }
|
|
pre.src-ditaa:before { content: 'ditaa'; }
|
|
pre.src-dot:before { content: 'Graphviz'; }
|
|
pre.src-calc:before { content: 'Emacs Calc'; }
|
|
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
|
pre.src-fortran:before { content: 'Fortran'; }
|
|
pre.src-gnuplot:before { content: 'gnuplot'; }
|
|
pre.src-haskell:before { content: 'Haskell'; }
|
|
pre.src-hledger:before { content: 'hledger'; }
|
|
pre.src-java:before { content: 'Java'; }
|
|
pre.src-js:before { content: 'Javascript'; }
|
|
pre.src-latex:before { content: 'LaTeX'; }
|
|
pre.src-ledger:before { content: 'Ledger'; }
|
|
pre.src-lisp:before { content: 'Lisp'; }
|
|
pre.src-lilypond:before { content: 'Lilypond'; }
|
|
pre.src-lua:before { content: 'Lua'; }
|
|
pre.src-matlab:before { content: 'MATLAB'; }
|
|
pre.src-mscgen:before { content: 'Mscgen'; }
|
|
pre.src-ocaml:before { content: 'Objective Caml'; }
|
|
pre.src-octave:before { content: 'Octave'; }
|
|
pre.src-org:before { content: 'Org mode'; }
|
|
pre.src-oz:before { content: 'OZ'; }
|
|
pre.src-plantuml:before { content: 'Plantuml'; }
|
|
pre.src-processing:before { content: 'Processing.js'; }
|
|
pre.src-python:before { content: 'Python'; }
|
|
pre.src-R:before { content: 'R'; }
|
|
pre.src-ruby:before { content: 'Ruby'; }
|
|
pre.src-sass:before { content: 'Sass'; }
|
|
pre.src-scheme:before { content: 'Scheme'; }
|
|
pre.src-screen:before { content: 'Gnu Screen'; }
|
|
pre.src-sed:before { content: 'Sed'; }
|
|
pre.src-sh:before { content: 'shell'; }
|
|
pre.src-sql:before { content: 'SQL'; }
|
|
pre.src-sqlite:before { content: 'SQLite'; }
|
|
/* additional languages in org.el's org-babel-load-languages alist */
|
|
pre.src-forth:before { content: 'Forth'; }
|
|
pre.src-io:before { content: 'IO'; }
|
|
pre.src-J:before { content: 'J'; }
|
|
pre.src-makefile:before { content: 'Makefile'; }
|
|
pre.src-maxima:before { content: 'Maxima'; }
|
|
pre.src-perl:before { content: 'Perl'; }
|
|
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
|
pre.src-scala:before { content: 'Scala'; }
|
|
pre.src-shell:before { content: 'Shell Script'; }
|
|
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
|
/* additional language identifiers per "defun org-babel-execute"
|
|
in ob-*.el */
|
|
pre.src-cpp:before { content: 'C++'; }
|
|
pre.src-abc:before { content: 'ABC'; }
|
|
pre.src-coq:before { content: 'Coq'; }
|
|
pre.src-groovy:before { content: 'Groovy'; }
|
|
/* additional language identifiers from org-babel-shell-names in
|
|
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
|
the execution function name together. */
|
|
pre.src-bash:before { content: 'bash'; }
|
|
pre.src-csh:before { content: 'csh'; }
|
|
pre.src-ash:before { content: 'ash'; }
|
|
pre.src-dash:before { content: 'dash'; }
|
|
pre.src-ksh:before { content: 'ksh'; }
|
|
pre.src-mksh:before { content: 'mksh'; }
|
|
pre.src-posh:before { content: 'posh'; }
|
|
/* Additional Emacs modes also supported by the LaTeX listings package */
|
|
pre.src-ada:before { content: 'Ada'; }
|
|
pre.src-asm:before { content: 'Assembler'; }
|
|
pre.src-caml:before { content: 'Caml'; }
|
|
pre.src-delphi:before { content: 'Delphi'; }
|
|
pre.src-html:before { content: 'HTML'; }
|
|
pre.src-idl:before { content: 'IDL'; }
|
|
pre.src-mercury:before { content: 'Mercury'; }
|
|
pre.src-metapost:before { content: 'MetaPost'; }
|
|
pre.src-modula-2:before { content: 'Modula-2'; }
|
|
pre.src-pascal:before { content: 'Pascal'; }
|
|
pre.src-ps:before { content: 'PostScript'; }
|
|
pre.src-prolog:before { content: 'Prolog'; }
|
|
pre.src-simula:before { content: 'Simula'; }
|
|
pre.src-tcl:before { content: 'tcl'; }
|
|
pre.src-tex:before { content: 'TeX'; }
|
|
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
|
pre.src-verilog:before { content: 'Verilog'; }
|
|
pre.src-vhdl:before { content: 'VHDL'; }
|
|
pre.src-xml:before { content: 'XML'; }
|
|
pre.src-nxml:before { content: 'XML'; }
|
|
/* add a generic configuration mode; LaTeX export needs an additional
|
|
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
|
pre.src-conf:before { content: 'Configuration File'; }
|
|
|
|
table { border-collapse:collapse; }
|
|
caption.t-above { caption-side: top; }
|
|
caption.t-bottom { caption-side: bottom; }
|
|
td, th { vertical-align:top; }
|
|
th.org-right { text-align: center; }
|
|
th.org-left { text-align: center; }
|
|
th.org-center { text-align: center; }
|
|
td.org-right { text-align: right; }
|
|
td.org-left { text-align: left; }
|
|
td.org-center { text-align: center; }
|
|
dt { font-weight: bold; }
|
|
.footpara { display: inline; }
|
|
.footdef { margin-bottom: 1em; }
|
|
.figure { padding: 1em; }
|
|
.figure p { text-align: center; }
|
|
.equation-container {
|
|
display: table;
|
|
text-align: center;
|
|
width: 100%;
|
|
}
|
|
.equation {
|
|
vertical-align: middle;
|
|
}
|
|
.equation-label {
|
|
display: table-cell;
|
|
text-align: right;
|
|
vertical-align: middle;
|
|
}
|
|
.inlinetask {
|
|
padding: 10px;
|
|
border: 2px solid gray;
|
|
margin: 10px;
|
|
background: #ffffcc;
|
|
}
|
|
#org-div-home-and-up
|
|
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
|
textarea { overflow-x: auto; }
|
|
.linenr { font-size: smaller }
|
|
.code-highlighted { background-color: #ffff00; }
|
|
.org-info-js_info-navigation { border-style: none; }
|
|
#org-info-js_console-label
|
|
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
|
.org-info-js_search-highlight
|
|
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
|
.org-svg { width: 90%; }
|
|
/*]]>*/-->
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
|
|
<link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
|
|
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
|
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
|
|
<script type="text/javascript" src="../js/readtheorg.js"></script>
|
|
<script type="text/javascript">
|
|
/*
|
|
@licstart The following is the entire license notice for the
|
|
JavaScript code in this tag.
|
|
|
|
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
that code without the copy of the GNU GPL normally required by
|
|
section 4, provided you include this license notice and a URL
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
for the JavaScript code in this tag.
|
|
*/
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
function CodeHighlightOn(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(null != target) {
|
|
elem.cacheClassElem = elem.className;
|
|
elem.cacheClassTarget = target.className;
|
|
target.className = "code-highlighted";
|
|
elem.className = "code-highlighted";
|
|
}
|
|
}
|
|
function CodeHighlightOff(elem, id)
|
|
{
|
|
var target = document.getElementById(id);
|
|
if(elem.cacheClassElem)
|
|
elem.className = elem.cacheClassElem;
|
|
if(elem.cacheClassTarget)
|
|
target.className = elem.cacheClassTarget;
|
|
}
|
|
/*]]>*///-->
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="org-div-home-and-up">
|
|
<a accesskey="h" href="./index.html"> UP </a>
|
|
|
|
|
<a accesskey="H" href="./index.html"> HOME </a>
|
|
</div><div id="content">
|
|
<h1 class="title">Polybar Configuration</h1>
|
|
<div id="table-of-contents">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents">
|
|
<ul>
|
|
<li><a href="#orge45175a">Colors</a></li>
|
|
<li><a href="#orgc8fe72e">VM</a></li>
|
|
<li><a href="#org821ed7b">Top Bar</a></li>
|
|
<li><a href="#orgb4f58e5">Show Windows Title</a></li>
|
|
<li><a href="#org00bf733">I3 - Information about workspaces and active one</a></li>
|
|
<li><a href="#orgf6d52fa">BSPWM</a></li>
|
|
<li><a href="#org937d151">Music using MPD</a></li>
|
|
<li><a href="#orgd7ff37b">Backlight level</a></li>
|
|
<li><a href="#orgbb0a618">CPU Usage</a></li>
|
|
<li><a href="#orgf6c3b32">Date</a></li>
|
|
<li><a href="#orgd1c922e">Sound Volume</a></li>
|
|
<li><a href="#orgfdbbed3">Battery</a></li>
|
|
<li><a href="#orgc01c036">Temperature</a></li>
|
|
<li><a href="#org1e00bc3">Unread Mails</a>
|
|
<ul>
|
|
<li><a href="#org2c713a7">Unread Mail Scripts</a></li>
|
|
<li><a href="#orgd0fb5fc">Open Mails</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org8bc0735">Redshift</a>
|
|
<ul>
|
|
<li><a href="#org0e1685e">Redshift Scripts</a></li>
|
|
<li><a href="#org5f3dbe0">Toggle Redshift</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org10f4424">NordVPN</a>
|
|
<ul>
|
|
<li><a href="#org1858160">Nordvpn Status script</a></li>
|
|
<li><a href="#orgfb45dca">Nordvpn Toggle</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orga78a541">Dunst</a>
|
|
<ul>
|
|
<li><a href="#org05dbfd7">Dunst Status script</a></li>
|
|
<li><a href="#org8b69076">Dunst Toggle</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org47fb977">Lock Screen</a>
|
|
<ul>
|
|
<li><a href="#orgba19d9f">Lock screen Status script</a></li>
|
|
<li><a href="#org8891736">Toggle Automatic Lock Screen</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#orge9a7da7">Weather</a>
|
|
<ul>
|
|
<li><a href="#orgeba3af9">Script to retrieve the weather</a></li>
|
|
<li><a href="#org4aa4897"><span class="todo TODO">TODO</span> Open Weather Webpage</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org7b140fd">Network</a></li>
|
|
<li><a href="#org726272d">Screenshot</a></li>
|
|
<li><a href="#orgc30611d">Scripts</a>
|
|
<ul>
|
|
<li><a href="#orgfa1b0fe">Launch</a></li>
|
|
<li><a href="#org56bb827">Toggle</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge45175a" class="outline-2">
|
|
<h2 id="orge45175a">Colors</h2>
|
|
<div class="outline-text-2" id="text-orge45175a">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">colors</span>]
|
|
<span class="org-variable-name">base00</span> = ${xrdb:color0:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base01</span> = ${xrdb:color10:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base02</span> = ${xrdb:color11:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base03</span> = ${xrdb:color8:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base04</span> = ${xrdb:color12:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base05</span> = ${xrdb:color7:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base06</span> = ${xrdb:color13:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base07</span> = ${xrdb:color15:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base08</span> = ${xrdb:color1:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base09</span> = ${xrdb:color9:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0A</span> = ${xrdb:color3:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0B</span> = ${xrdb:color2:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0C</span> = ${xrdb:color6:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0D</span> = ${xrdb:color4:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0E</span> = ${xrdb:color5:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
<span class="org-variable-name">base0F</span> = ${xrdb:color14:<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
|
|
; based on http://chriskempson.com/projects/base16/
|
|
<span class="org-variable-name">background</span> = ${colors.base00}
|
|
<span class="org-variable-name">background-light</span> = ${colors.base01}
|
|
<span class="org-variable-name">background-selection</span> = ${colors.base02}
|
|
<span class="org-variable-name">comments</span> = ${colors.base03}
|
|
<span class="org-variable-name">foreground-dark</span> = ${colors.base04}
|
|
<span class="org-variable-name">foreground</span> = ${colors.base05}
|
|
<span class="org-variable-name">foreground-light</span> = ${colors.base06}
|
|
<span class="org-variable-name">foreground-light-bis</span> = ${colors.base07}
|
|
<span class="org-variable-name">red</span> = ${colors.base08}
|
|
<span class="org-variable-name">orange</span> = ${colors.base09}
|
|
<span class="org-variable-name">brown</span> = ${colors.base0A}
|
|
<span class="org-variable-name">green</span> = ${colors.base0B}
|
|
<span class="org-variable-name">turquoise</span> = ${colors.base0C}
|
|
<span class="org-variable-name">blue</span> = ${colors.base0D}
|
|
<span class="org-variable-name">purple</span> = ${colors.base0E}
|
|
<span class="org-variable-name">magenta</span> = ${colors.base0F}
|
|
<span class="org-variable-name">black</span> = ${<span class="org-comment-delimiter">#</span><span class="org-comment">000000}</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc8fe72e" class="outline-2">
|
|
<h2 id="orgc8fe72e">VM</h2>
|
|
<div class="outline-text-2" id="text-orgc8fe72e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">global/wm</span>]
|
|
<span class="org-variable-name">margin-top</span> = <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-variable-name">margin-bottom</span> = <span class="org-highlight-numbers-number">0</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org821ed7b" class="outline-2">
|
|
<h2 id="org821ed7b">Top Bar</h2>
|
|
<div class="outline-text-2" id="text-org821ed7b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">bar/top</span>]
|
|
<span class="org-variable-name">enable-ipc</span> = true
|
|
<span class="org-variable-name">override-redirect</span> = false
|
|
<span class="org-variable-name">bottom</span> = false
|
|
<span class="org-variable-name">fixed-center</span> = false
|
|
|
|
<span class="org-variable-name">width</span> = 100%
|
|
<span class="org-variable-name">height</span> = <span class="org-highlight-numbers-number">27</span>
|
|
<span class="org-variable-name">radius</span> = <span class="org-highlight-numbers-number">0.0</span>
|
|
|
|
<span class="org-variable-name">background</span> = ${colors.background}
|
|
<span class="org-variable-name">foreground</span> = ${colors.foreground}
|
|
|
|
<span class="org-variable-name">line-size</span> = <span class="org-highlight-numbers-number">2</span>
|
|
|
|
<span class="org-variable-name">border-size</span> = <span class="org-highlight-numbers-number">0</span>
|
|
|
|
<span class="org-variable-name">padding-left</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">padding-right</span> = <span class="org-highlight-numbers-number">16</span>
|
|
|
|
<span class="org-variable-name">module-margin-left</span> = <span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-variable-name">module-margin-right</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-variable-name">font-0</span> = Hack Nerd Font:style=Medium,Regular:pixelsize=<span class="org-highlight-numbers-number">10</span>;<span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-variable-name">font-1</span> = unifont:fontformat=truetype:size=<span class="org-highlight-numbers-number">8</span>:antialias=false;<span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-variable-name">font-2</span> = Weather Icons:size=<span class="org-highlight-numbers-number">10</span>;<span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-variable-name">modules-left</span> = i3 bspwm xwindow
|
|
<span class="org-variable-name">modules-center</span> =
|
|
<span class="org-variable-name">modules-right</span> = pulseaudio xbacklightredshift nordvpn lockscreen dunst unread_mail cpu battery temperature date
|
|
|
|
<span class="org-variable-name">wm-restack</span> = bspwm
|
|
|
|
<span class="org-variable-name">tray-position</span> = right
|
|
<span class="org-variable-name">tray-detached</span> = true
|
|
<span class="org-variable-name">tray-padding</span> = <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-variable-name">tray-background</span> = ${colors.background}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb4f58e5" class="outline-2">
|
|
<h2 id="orgb4f58e5">Show Windows Title</h2>
|
|
<div class="outline-text-2" id="text-orgb4f58e5">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/xwindow</span>]
|
|
<span class="org-variable-name">type</span> = internal/xwindow
|
|
<span class="org-variable-name">label</span> = %title:<span class="org-highlight-numbers-number">0</span>:<span class="org-highlight-numbers-number">30</span>:...%
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org00bf733" class="outline-2">
|
|
<h2 id="org00bf733">I3 - Information about workspaces and active one</h2>
|
|
<div class="outline-text-2" id="text-org00bf733">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/i3</span>]
|
|
<span class="org-variable-name">type</span> = internal/i3
|
|
|
|
<span class="org-variable-name">enable-scroll</span> = false
|
|
<span class="org-variable-name">wrapping-scroll</span> = false
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf"><span class="org-variable-name">format</span> = <label-state> <label-mode>
|
|
<span class="org-variable-name">index-sort</span> = true
|
|
</pre>
|
|
</div>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf"><span class="org-variable-name">label-mode-foreground</span> = ${colors.background}
|
|
<span class="org-variable-name">label-mode-background</span> = ${colors.foreground}
|
|
<span class="org-variable-name">label-mode-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">focused = Active workspace on focused monitor</span>
|
|
<span class="org-variable-name">label-focused</span> = %icon% %index%
|
|
<span class="org-variable-name">label-focused-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">label-focused-background</span> = ${colors.background}
|
|
<span class="org-variable-name">label-focused-underline</span> = ${colors.turquoise}
|
|
<span class="org-variable-name">label-focused-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">unfocused = Inactive workspace on any monitor</span>
|
|
<span class="org-variable-name">label-unfocused</span> = %icon% %index%
|
|
<span class="org-variable-name">label-unfocused-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">label-unfocused-background</span> = ${colors.background}
|
|
<span class="org-variable-name">label-unfocused-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">label-unfocused-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">visible = Active workspace on unfocused monitor</span>
|
|
<span class="org-variable-name">label-visible</span> = %icon% %index%
|
|
<span class="org-variable-name">label-visible-background</span> = ${colors.background}
|
|
<span class="org-variable-name">label-visible-underline</span> = ${colors.turquoise}
|
|
<span class="org-variable-name">label-visible-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">urgent = Workspace with urgency hint set</span>
|
|
<span class="org-variable-name">label-urgent</span> = %icon% %index%
|
|
<span class="org-variable-name">label-urgent-background</span> = ${colors.red}
|
|
<span class="org-variable-name">label-urgent-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf6d52fa" class="outline-2">
|
|
<h2 id="orgf6d52fa">BSPWM</h2>
|
|
<div class="outline-text-2" id="text-orgf6d52fa">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/bspwm</span>]
|
|
<span class="org-variable-name">type</span> = internal/bspwm
|
|
|
|
<span class="org-variable-name">pin-workspaces</span> = true
|
|
<span class="org-variable-name">enable-click</span> = true
|
|
<span class="org-variable-name">enable-scroll</span> = false
|
|
|
|
; Use fuzzy (partial) matching on labels when assigning
|
|
; icons to workspaces
|
|
; Example: code;♚ will apply the icon to all workspaces
|
|
; containing <span class="org-string">'code'</span> in the label
|
|
<span class="org-variable-name">fuzzy-match</span> = false
|
|
|
|
|
|
<span class="org-variable-name">ws-icon-0</span> = code;
|
|
<span class="org-variable-name">ws-icon-1</span> = web;
|
|
<span class="org-variable-name">ws-icon-2</span> = mail;
|
|
<span class="org-variable-name">ws-icon-3</span> = misc;
|
|
<span class="org-variable-name">ws-icon-4</span> = figs;ﬧ
|
|
<span class="org-variable-name">ws-icon-default</span> =
|
|
|
|
<span class="org-variable-name">label-focused</span> = %icon%
|
|
<span class="org-variable-name">label-focused-foreground</span> = ${colors.background}
|
|
<span class="org-variable-name">label-focused-background</span> = ${colors.turquoise}
|
|
<span class="org-variable-name">label-focused-underline</span>= ${colors.turquoise}
|
|
<span class="org-variable-name">label-focused-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-variable-name">label-occupied</span> = %icon%
|
|
<span class="org-variable-name">label-occupied-underline</span> = ${colors.foreground}
|
|
<span class="org-variable-name">label-occupied-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-variable-name">label-urgent</span> = %icon%
|
|
<span class="org-variable-name">label-urgent-background</span> = ${colors.red}
|
|
<span class="org-variable-name">label-urgent-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-variable-name">label-empty</span> = %icon%
|
|
<span class="org-variable-name">label-empty-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">label-empty-padding</span> = <span class="org-highlight-numbers-number">1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org937d151" class="outline-2">
|
|
<h2 id="org937d151">Music using MPD</h2>
|
|
<div class="outline-text-2" id="text-org937d151">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/mpd</span>]
|
|
<span class="org-variable-name">type</span> = internal/mpd
|
|
<span class="org-variable-name">format-online</span> = <icon-prev> <toggle> <icon-next> %{A1:termite -e <span class="org-string">"ncmpcpp"</span> &:}<label-song>%{A}
|
|
|
|
<span class="org-variable-name">format-online-spacing</span> = <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-variable-name">format-online-padding</span> = <span class="org-highlight-numbers-number">0</span>
|
|
|
|
<span class="org-variable-name">label-offline</span> = mpd is offline
|
|
<span class="org-variable-name">format-offline</span> = <label-offline>
|
|
<span class="org-variable-name">format-offline-foreground</span> = <span class="org-comment-delimiter">#</span><span class="org-comment">777</span>
|
|
|
|
<span class="org-variable-name">label-song</span> = %artist% - %title%
|
|
<span class="org-variable-name">label-song-maxlen</span> = <span class="org-highlight-numbers-number">30</span>
|
|
<span class="org-variable-name">label-song-ellipsis</span> = true
|
|
|
|
<span class="org-variable-name">icon-prev</span> = 寧
|
|
<span class="org-variable-name">icon-stop</span> = 栗
|
|
<span class="org-variable-name">icon-play</span> = 契
|
|
<span class="org-variable-name">icon-pause</span> = 
|
|
<span class="org-variable-name">icon-next</span> = 嶺
|
|
<span class="org-variable-name">icon-random</span> = 咽
|
|
<span class="org-variable-name">icon-repeat</span> = 凌
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Used to display the state of random/repeat/repeatone/single</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Only applies if <icon-[random|repeat|repeatone|single]> is used</span>
|
|
<span class="org-variable-name">toggle-on-foreground</span> = ${colors.foreground-light}
|
|
<span class="org-variable-name">toggle-off-foreground</span> = ${colors.comments}
|
|
|
|
<span class="org-variable-name">bar-progress-width</span> = <span class="org-highlight-numbers-number">15</span>
|
|
<span class="org-variable-name">bar-progress-indicator</span> = |
|
|
<span class="org-variable-name">bar-progress-fill</span> = ─
|
|
<span class="org-variable-name">bar-progress-empty</span> = ─
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd7ff37b" class="outline-2">
|
|
<h2 id="orgd7ff37b">Backlight level</h2>
|
|
<div class="outline-text-2" id="text-orgd7ff37b">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/xbacklight</span>]
|
|
<span class="org-variable-name">type</span> = internal/xbacklight
|
|
|
|
<span class="org-variable-name">format</span> = <ramp>
|
|
<span class="org-variable-name">ramp-0</span> = 
|
|
<span class="org-variable-name">ramp-1</span> = 
|
|
<span class="org-variable-name">ramp-2</span> = 
|
|
<span class="org-variable-name">ramp-3</span> = 
|
|
<span class="org-variable-name">ramp-4</span> = 
|
|
<span class="org-variable-name">ramp-5</span> = 
|
|
<span class="org-variable-name">ramp-6</span> = 
|
|
<span class="org-variable-name">ramp-7</span> = 
|
|
<span class="org-variable-name">ramp-8</span> = 
|
|
<span class="org-variable-name">ramp-9</span> = 
|
|
<span class="org-variable-name">ramp-10</span> = 
|
|
<span class="org-variable-name">ramp-11</span> = 
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgbb0a618" class="outline-2">
|
|
<h2 id="orgbb0a618">CPU Usage</h2>
|
|
<div class="outline-text-2" id="text-orgbb0a618">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/cpu</span>]
|
|
<span class="org-variable-name">type</span> = internal/cpu
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
|
|
|
|
<span class="org-variable-name">format-prefix-foreground</span> = ${colors.foreground}
|
|
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
|
|
<span class="org-variable-name">label</span> = %{A1:termite -e <span class="org-string">"htop"</span> &:} ﬙ %percentage:2%% %{A}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgf6c3b32" class="outline-2">
|
|
<h2 id="orgf6c3b32">Date</h2>
|
|
<div class="outline-text-2" id="text-orgf6c3b32">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/date</span>]
|
|
<span class="org-variable-name">type</span> = internal/date
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">1</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Open google calendar on left right</span>
|
|
<span class="org-variable-name">date</span> = %{A1:termite -e <span class="org-string">"ikhal"</span> &:} %d-%m%{A}
|
|
<span class="org-variable-name">date-alt</span> = <span class="org-string">"%{A1:termite -e \"ikhal\" &:} %d-%m-%Y%{A}"</span>
|
|
|
|
<span class="org-variable-name">time</span> =  %H:%M
|
|
<span class="org-variable-name">time-alt</span> =  %H:%M:%S
|
|
|
|
<span class="org-variable-name">label</span> = %date% %time%
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd1c922e" class="outline-2">
|
|
<h2 id="orgd1c922e">Sound Volume</h2>
|
|
<div class="outline-text-2" id="text-orgd1c922e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/pulseaudio</span>]
|
|
<span class="org-variable-name">type</span> = internal/pulseaudio
|
|
|
|
<span class="org-variable-name">sink</span> = alsa_output.pci-0000_00_1f.3.analog-stereo
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Open pavucontrol on left right</span>
|
|
<span class="org-variable-name">format-volume</span> =%{A1:pavucontrol &:}<label-volume> <bar-volume>%{A}
|
|
|
|
<span class="org-variable-name">label-volume</span> = %percentage%%
|
|
<span class="org-variable-name">label-volume-foreground</span> = ${root.foreground}
|
|
|
|
<span class="org-variable-name">label-muted</span> = ﱝ muted
|
|
|
|
<span class="org-variable-name">bar-volume-width</span> = <span class="org-highlight-numbers-number">10</span>
|
|
<span class="org-variable-name">bar-volume-foreground-0</span> = ${colors.green}
|
|
<span class="org-variable-name">bar-volume-foreground-1</span> = ${colors.green}
|
|
<span class="org-variable-name">bar-volume-foreground-2</span> = ${colors.blue}
|
|
<span class="org-variable-name">bar-volume-foreground-3</span> = ${colors.blue}
|
|
<span class="org-variable-name">bar-volume-foreground-4</span> = ${colors.red}
|
|
<span class="org-variable-name">bar-volume-foreground-5</span> = ${colors.red}
|
|
<span class="org-variable-name">bar-volume-foreground-6</span> = ${colors.red}
|
|
<span class="org-variable-name">bar-volume-gradient</span> = false
|
|
<span class="org-variable-name">bar-volume-indicator</span> = |
|
|
<span class="org-variable-name">bar-volume-indicator-font</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">bar-volume-fill</span> = ─
|
|
<span class="org-variable-name">bar-volume-fill-font</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">bar-volume-empty</span> = ─
|
|
<span class="org-variable-name">bar-volume-empty-font</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">bar-volume-empty-foreground</span> = ${colors.foreground}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfdbbed3" class="outline-2">
|
|
<h2 id="orgfdbbed3">Battery</h2>
|
|
<div class="outline-text-2" id="text-orgfdbbed3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/battery</span>]
|
|
<span class="org-variable-name">type</span> = internal/battery
|
|
|
|
<span class="org-variable-name">battery</span> = BAT0
|
|
<span class="org-variable-name">adapter</span> = ADP1
|
|
<span class="org-variable-name">full-at</span> = <span class="org-highlight-numbers-number">95</span>
|
|
|
|
<span class="org-variable-name">format-charging</span> = %{A1:xfce4-power-manager-settings &:}<ramp-capacity> <label-charging>%{A}
|
|
<span class="org-variable-name">format-charging-underline</span> = ${colors.blue}
|
|
|
|
<span class="org-variable-name">format-discharging</span> = %{A1:xfce4-power-manager-settings &:}<ramp-capacity> <label-discharging>%{A}
|
|
<span class="org-variable-name">format-discharging-underline</span> = ${colors.red}
|
|
|
|
<span class="org-variable-name">format-full-prefix</span> = %{A1:xfce4-power-manager-settings &:} %{A}
|
|
<span class="org-variable-name">format-full-prefix-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">format-full-underline</span> = ${colors.background}
|
|
|
|
<span class="org-variable-name">ramp-capacity-0</span> = 
|
|
<span class="org-variable-name">ramp-capacity-1</span> = 
|
|
<span class="org-variable-name">ramp-capacity-2</span> = 
|
|
<span class="org-variable-name">ramp-capacity-3</span> = 
|
|
<span class="org-variable-name">ramp-capacity-4</span> = 
|
|
<span class="org-variable-name">ramp-capacity-foreground</span> = ${colors.foreground}
|
|
|
|
<span class="org-variable-name">animation-charging-0</span> = 
|
|
<span class="org-variable-name">animation-charging-1</span> = 
|
|
<span class="org-variable-name">animation-charging-2</span> = 
|
|
<span class="org-variable-name">animation-charging-3</span> = 
|
|
<span class="org-variable-name">animation-charging-4</span> = 
|
|
<span class="org-variable-name">animation-charging-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">animation-charging-framerate</span> = <span class="org-highlight-numbers-number">750</span>
|
|
|
|
<span class="org-variable-name">animation-discharging-0</span> = 
|
|
<span class="org-variable-name">animation-discharging-1</span> = 
|
|
<span class="org-variable-name">animation-discharging-2</span> = 
|
|
<span class="org-variable-name">animation-discharging-3</span> = 
|
|
<span class="org-variable-name">animation-discharging-4</span> = 
|
|
<span class="org-variable-name">animation-discharging-foreground</span> = ${colors.foreground}
|
|
<span class="org-variable-name">animation-discharging-framerate</span> = <span class="org-highlight-numbers-number">750</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc01c036" class="outline-2">
|
|
<h2 id="orgc01c036">Temperature</h2>
|
|
<div class="outline-text-2" id="text-orgc01c036">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/temperature</span>]
|
|
<span class="org-variable-name">type</span> = internal/temperature
|
|
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">5</span>
|
|
<span class="org-variable-name">thermal-zone</span> = <span class="org-highlight-numbers-number">0</span>
|
|
<span class="org-variable-name">warn-temperature</span> = <span class="org-highlight-numbers-number">70</span>
|
|
;; Temperature off one cpu core
|
|
<span class="org-variable-name">hwmon-path</span> = /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input
|
|
|
|
<span class="org-variable-name">format</span> = %{A1:termite -e <span class="org-string">"watch sensors"</span> &:}<ramp> <label>%{A}
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">format-warn</span> = <ramp> <label-warn>
|
|
<span class="org-variable-name">format-warn-underline</span> = ${colors.red}
|
|
|
|
<span class="org-variable-name">label</span> = %temperature-c%
|
|
<span class="org-variable-name">label-warn</span> = %temperature-c%
|
|
<span class="org-variable-name">label-warn-foreground</span> = ${colors.red}
|
|
|
|
<span class="org-variable-name">ramp-0</span> = 
|
|
<span class="org-variable-name">ramp-1</span> = 
|
|
<span class="org-variable-name">ramp-2</span> = 
|
|
<span class="org-variable-name">ramp-3</span> = 
|
|
<span class="org-variable-name">ramp-4</span> = 
|
|
<span class="org-variable-name">ramp-foreground</span> = ${colors.foreground}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1e00bc3" class="outline-2">
|
|
<h2 id="org1e00bc3">Unread Mails</h2>
|
|
<div class="outline-text-2" id="text-org1e00bc3">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/unread_mail</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">label-font</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/mail-open.sh
|
|
<span class="org-variable-name">format</span> = <label>
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/mail-status.sh
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">1</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org2c713a7" class="outline-3">
|
|
<h3 id="org2c713a7">Unread Mail Scripts</h3>
|
|
<div class="outline-text-3" id="text-org2c713a7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-variable-name">mails</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">du</span> -a ~/.mail/*/Inbox/new/* <span class="org-highlight-numbers-number">2</span>>/dev/null | sed -n <span class="org-string">'$='</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-rainbow-delimiters-depth-2">[</span> -z <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">mails</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}%{F-}"</span>
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgd0fb5fc" class="outline-3">
|
|
<h3 id="orgd0fb5fc">Open Mails</h3>
|
|
<div class="outline-text-3" id="text-orgd0fb5fc">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash">termite -e <span class="org-string">"tmux -L neomutt attach"</span> &
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8bc0735" class="outline-2">
|
|
<h2 id="org8bc0735">Redshift</h2>
|
|
<div class="outline-text-2" id="text-org8bc0735">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/redshift</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">label-font</span> = <span class="org-highlight-numbers-number">2</span>
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/redshift-toggle.sh
|
|
<span class="org-variable-name">format</span> = <label>
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/redshift-status.sh
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org0e1685e" class="outline-3">
|
|
<h3 id="org0e1685e">Redshift Scripts</h3>
|
|
<div class="outline-text-3" id="text-org0e1685e">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"redshift"</span> >/dev/null; <span class="org-keyword">then</span>
|
|
<span class="org-type">echo</span> <span class="org-string">"望"</span>;
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-type">echo</span> <span class="org-string">"盛"</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5f3dbe0" class="outline-3">
|
|
<h3 id="org5f3dbe0">Toggle Redshift</h3>
|
|
<div class="outline-text-3" id="text-org5f3dbe0">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"redshift"</span> >/dev/null; <span class="org-keyword">then</span>
|
|
killall redshift;
|
|
<span class="org-keyword">else</span>
|
|
nohup redshift > /dev/null <span class="org-highlight-numbers-number">2</span>>&<span class="org-highlight-numbers-number">1</span> &
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org10f4424" class="outline-2">
|
|
<h2 id="org10f4424">NordVPN</h2>
|
|
<div class="outline-text-2" id="text-org10f4424">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/nordvpn</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/nordvpn-toggle.sh
|
|
<span class="org-variable-name">format</span> = <label>
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/nordvpn-status.sh
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org1858160" class="outline-3">
|
|
<h3 id="org1858160">Nordvpn Status script</h3>
|
|
<div class="outline-text-3" id="text-org1858160">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-variable-name">vpnstatus</span>=<span class="org-sh-quoted-exec">`nordvpn status`</span>;
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-rainbow-delimiters-depth-2">[</span> $<span class="org-rainbow-delimiters-depth-3">{</span><span class="org-variable-name">vpnstatus</span><span class="org-rainbow-delimiters-depth-3">}</span> == *<span class="org-string">"Connected"</span>* <span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">country=`nordvpn status | sed '/Country/!d ; s/Country: //'`</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-type"><span class="org-comment">echo</span></span><span class="org-comment"> "%{F#859900}%{F-} $country";</span>
|
|
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}%{F-}"</span>;
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgfb45dca" class="outline-3">
|
|
<h3 id="orgfb45dca">Nordvpn Toggle</h3>
|
|
<div class="outline-text-3" id="text-orgfb45dca">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span><span class="org-rainbow-delimiters-depth-2">[</span> $<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-sh-quoted-exec">nordvpn</span> status<span class="org-rainbow-delimiters-depth-3">)</span> == *<span class="org-string">"Connected"</span>* <span class="org-rainbow-delimiters-depth-2">]</span><span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
nordvpn disconnect && dunstify --replace=<span class="org-highlight-numbers-number">23198</span> <span class="org-string">"VPN"</span> <span class="org-string">"Disconnected"</span>;
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-variable-name">country</span>=<span class="org-sh-quoted-exec">`</span><span class="org-type"><span class="org-sh-quoted-exec">cat</span></span><span class="org-sh-quoted-exec"> ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`</span>;
|
|
dunstify --replace=<span class="org-highlight-numbers-number">23198</span> <span class="org-string">"VPN"</span> <span class="org-string">"Connecting to </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">country</span></span><span class="org-string">..."</span>;
|
|
nordvpn connect $<span class="org-variable-name">country</span> && dunstify --replace=<span class="org-highlight-numbers-number">23198</span> <span class="org-string">"VPN"</span> <span class="org-string">"Connected to </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">country</span></span><span class="org-string">"</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orga78a541" class="outline-2">
|
|
<h2 id="orga78a541">Dunst</h2>
|
|
<div class="outline-text-2" id="text-orga78a541">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/dunst</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/dunst-toggle.sh
|
|
<span class="org-variable-name">format</span> = <label>
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/dunst-status.sh
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org05dbfd7" class="outline-3">
|
|
<h3 id="org05dbfd7">Dunst Status script</h3>
|
|
<div class="outline-text-3" id="text-org05dbfd7">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-variable-name">tmpfile</span>=<span class="org-string">"/tmp/dunststatus"</span>;
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -f $<span class="org-variable-name">tmpfile</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-keyword">if</span> <span class="org-type">grep</span> -q <span class="org-string">"on"</span> $<span class="org-variable-name">tmpfile</span>; <span class="org-keyword">then</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">elif</span> <span class="org-type">grep</span> -q <span class="org-string">"off"</span> $<span class="org-variable-name">tmpfile</span>; <span class="org-keyword">then</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">fi</span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8b69076" class="outline-3">
|
|
<h3 id="org8b69076">Dunst Toggle</h3>
|
|
<div class="outline-text-3" id="text-org8b69076">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-variable-name">tmpfile</span>=<span class="org-string">"/tmp/dunststatus"</span>;
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -f $<span class="org-variable-name">tmpfile</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-keyword">if</span> <span class="org-type">grep</span> -q <span class="org-string">"on"</span> $<span class="org-variable-name">tmpfile</span>; <span class="org-keyword">then</span>
|
|
killall -SIGUSR1 dunst && <span class="org-type">echo</span> <span class="org-string">"off"</span> > $<span class="org-variable-name">tmpfile</span>;
|
|
<span class="org-keyword">elif</span> <span class="org-type">grep</span> -q <span class="org-string">"off"</span> $<span class="org-variable-name">tmpfile</span>; <span class="org-keyword">then</span>
|
|
killall -SIGUSR2 dunst && <span class="org-type">echo</span> <span class="org-string">"on"</span> > $<span class="org-variable-name">tmpfile</span>;
|
|
dunstify --replace=<span class="org-highlight-numbers-number">16549</span> <span class="org-string">"Dunst"</span> <span class="org-string">"Activated"</span>;
|
|
<span class="org-keyword">fi</span>
|
|
<span class="org-keyword">else</span>
|
|
killall -SIGUSR1 dunst && <span class="org-type">echo</span> <span class="org-string">"off"</span> > $<span class="org-variable-name">tmpfile</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org47fb977" class="outline-2">
|
|
<h2 id="org47fb977">Lock Screen</h2>
|
|
<div class="outline-text-2" id="text-org47fb977">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/lockscreen</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">format-underline</span> = ${colors.background}
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/lockscreen-toggle.sh
|
|
<span class="org-variable-name">click-right</span> = ~/scripts/lockscreen.sh
|
|
<span class="org-variable-name">format</span> = <label>
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/lockscreen-status.sh
|
|
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgba19d9f" class="outline-3">
|
|
<h3 id="orgba19d9f">Lock screen Status script</h3>
|
|
<div class="outline-text-3" id="text-orgba19d9f">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"xautolock"</span> >/dev/null
|
|
<span class="org-keyword">then</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-type">echo</span> <span class="org-string">""</span>;
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8891736" class="outline-3">
|
|
<h3 id="org8891736">Toggle Automatic Lock Screen</h3>
|
|
<div class="outline-text-3" id="text-org8891736">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"xautolock"</span> >/dev/null
|
|
<span class="org-keyword">then</span>
|
|
<span class="org-type">pkill</span> xautolock;
|
|
dunstify --replace=<span class="org-highlight-numbers-number">13602</span> <span class="org-string">'Lock Screen'</span> <span class="org-string">'Desactivated'</span>
|
|
<span class="org-keyword">else</span>
|
|
xautolock -locker <span class="org-string">"~/scripts/lockscreen.sh"</span> -detectsleep -time <span class="org-highlight-numbers-number">30</span> -notify <span class="org-highlight-numbers-number">60</span> -notifier <span class="org-string">"dunstify --replace=31846 -u critical -t 10000 -- 'Locking Screen' '60 seconds'"</span> &
|
|
dunstify --replace=<span class="org-highlight-numbers-number">13602</span> <span class="org-string">'Lock Screen'</span> <span class="org-string">'Activated'</span>
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge9a7da7" class="outline-2">
|
|
<h2 id="orge9a7da7">Weather</h2>
|
|
<div class="outline-text-2" id="text-orge9a7da7">
|
|
<p>
|
|
<a href="https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured">https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured</a>
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/weather</span>]
|
|
<span class="org-variable-name">type</span> = custom/script
|
|
|
|
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/weather-status.sh
|
|
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/weather-open.sh
|
|
|
|
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">600</span>
|
|
<span class="org-variable-name">label-font</span> = <span class="org-highlight-numbers-number">3</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgeba3af9" class="outline-3">
|
|
<h3 id="orgeba3af9">Script to retrieve the weather</h3>
|
|
<div class="outline-text-3" id="text-orgeba3af9">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-function-name">get_icon</span><span class="org-rainbow-delimiters-depth-1">()</span> <span class="org-rainbow-delimiters-depth-1">{</span>
|
|
<span class="org-keyword">case</span> $<span class="org-highlight-numbers-number">1</span><span class="org-keyword"> in</span>
|
|
01d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
01n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
02d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
02n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
03*) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
04*) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
09d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
09n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
10d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
10n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
11d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
11n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
13d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
13n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
50d) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
50n) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;;
|
|
*) <span class="org-variable-name">icon</span>=<span class="org-string">""</span>;
|
|
<span class="org-keyword">esac</span>
|
|
|
|
<span class="org-type">echo</span> $<span class="org-variable-name">icon</span>
|
|
<span class="org-rainbow-delimiters-depth-1">}</span>
|
|
|
|
<span class="org-function-name">get_duration</span><span class="org-rainbow-delimiters-depth-1">()</span> <span class="org-rainbow-delimiters-depth-1">{</span>
|
|
|
|
<span class="org-variable-name">osname</span>=$<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-sh-quoted-exec">uname</span> -s<span class="org-rainbow-delimiters-depth-2">)</span>
|
|
|
|
<span class="org-keyword">case</span> $<span class="org-variable-name">osname</span><span class="org-keyword"> in</span>
|
|
*BSD) <span class="org-type">date</span> -r <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span> -u +%H:%M;;
|
|
*) <span class="org-type">date</span> --date=<span class="org-string">"@</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span> -u +%H:%M;;
|
|
<span class="org-keyword">esac</span>
|
|
|
|
<span class="org-rainbow-delimiters-depth-1">}</span>
|
|
|
|
<span class="org-variable-name">KEY</span>=<span class="org-string">"a705adc4ce0e271801051b9460ecb1cd"</span>
|
|
<span class="org-variable-name">CITY</span>=<span class="org-string">""</span>
|
|
<span class="org-variable-name">UNITS</span>=<span class="org-string">"metric"</span>
|
|
<span class="org-variable-name">SYMBOL</span>=<span class="org-string">"°"</span>
|
|
|
|
<span class="org-variable-name">API</span>=<span class="org-string">"https://api.openweathermap.org/data/2.5"</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY</span></span><span class="org-string">"</span> -eq <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span> <span class="org-highlight-numbers-number">2</span>>/dev/null; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">CITY_PARAM</span>=<span class="org-string">"id=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY</span></span><span class="org-string">"</span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-variable-name">CITY_PARAM</span>=<span class="org-string">"q=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY</span></span><span class="org-string">"</span>
|
|
<span class="org-keyword">fi</span>
|
|
|
|
<span class="org-variable-name">current</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">curl</span> -sf <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">API</span></span><span class="org-string">/weather?appid=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">KEY</span></span><span class="org-string">&</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY_PARAM</span></span><span class="org-string">&units=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">UNITS</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">forecast</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">curl</span> -sf <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">API</span></span><span class="org-string">/forecast?appid=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">KEY</span></span><span class="org-string">&</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">CITY_PARAM</span></span><span class="org-string">&units=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">UNITS</span></span><span class="org-string">&cnt=1"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-variable-name">location</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">curl</span> -sf https://location.services.mozilla.com/v1/geolocate?<span class="org-variable-name">key</span>=geoclue<span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">location</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">location_lat</span>=<span class="org-string">"</span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">echo</span><span class="org-string"><span class="org-sh-quoted-exec"> "</span></span><span class="org-string"><span class="org-constant"><span class="org-sh-quoted-exec">$</span></span></span><span class="org-string"><span class="org-variable-name"><span class="org-sh-quoted-exec">location</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">" | jq '.location.lat')</span></span><span class="org-string">"</span>
|
|
<span class="org-variable-name">location_lon</span>=<span class="org-string">"</span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">echo</span><span class="org-string"><span class="org-sh-quoted-exec"> "</span></span><span class="org-string"><span class="org-constant"><span class="org-sh-quoted-exec">$</span></span></span><span class="org-string"><span class="org-variable-name"><span class="org-sh-quoted-exec">location</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">" | jq '.location.lng')</span></span><span class="org-string">"</span>
|
|
|
|
<span class="org-variable-name">current</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">curl</span> -sf <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">API</span></span><span class="org-string">/weather?appid=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">KEY</span></span><span class="org-string">&lat=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">location_lat</span></span><span class="org-string">&lon=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">location_lon</span></span><span class="org-string">&units=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">UNITS</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">forecast</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">curl</span> -sf <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">API</span></span><span class="org-string">/forecast?appid=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">KEY</span></span><span class="org-string">&lat=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">location_lat</span></span><span class="org-string">&lon=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">location_lon</span></span><span class="org-string">&units=</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">UNITS</span></span><span class="org-string">&cnt=1"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-keyword">fi</span>
|
|
<span class="org-keyword">fi</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span> && <span class="org-rainbow-delimiters-depth-1">[</span> -n <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">current_temp</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current</span></span><span class="org-string">"</span> | jq <span class="org-string">".main.temp"</span> | cut -d <span class="org-string">"."</span> -f <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">current_icon</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current</span></span><span class="org-string">"</span> | jq -r <span class="org-string">".weather[0].icon"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-variable-name">forecast_temp</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast</span></span><span class="org-string">"</span> | jq <span class="org-string">".list[].main.temp"</span> | cut -d <span class="org-string">"."</span> -f <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">forecast_icon</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast</span></span><span class="org-string">"</span> | jq -r <span class="org-string">".list[].weather[0].icon"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current_temp</span></span><span class="org-string">"</span> -gt <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast_temp</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">trend</span>=<span class="org-string">""</span> <span class="org-comment-delimiter">#</span><span class="org-comment"></span>
|
|
<span class="org-keyword">elif</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast_temp</span></span><span class="org-string">"</span> -gt <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current_temp</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">trend</span>=<span class="org-string">""</span> <span class="org-comment-delimiter">#</span><span class="org-comment"></span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-variable-name">trend</span>=<span class="org-string">""</span> <span class="org-comment-delimiter">#</span><span class="org-comment"></span>
|
|
<span class="org-keyword">fi</span>
|
|
|
|
|
|
<span class="org-variable-name">sun_rise</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current</span></span><span class="org-string">"</span> | jq <span class="org-string">".sys.sunrise"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">sun_set</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current</span></span><span class="org-string">"</span> | jq <span class="org-string">".sys.sunset"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
<span class="org-variable-name">now</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">date</span> +%s<span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">sun_rise</span></span><span class="org-string">"</span> -gt <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">now</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">daytime</span>=<span class="org-string">" </span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">get_duration</span><span class="org-string"><span class="org-sh-quoted-exec"> "$((sun_rise-now)</span></span><span class="org-string">)")"</span>
|
|
<span class="org-keyword">elif</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">sun_set</span></span><span class="org-string">"</span> -gt <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">now</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
<span class="org-variable-name">daytime</span>=<span class="org-string">" </span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">get_duration</span><span class="org-string"><span class="org-sh-quoted-exec"> "$((sun_set-now)</span></span><span class="org-string">)")"</span>
|
|
<span class="org-keyword">else</span>
|
|
<span class="org-variable-name">daytime</span>=<span class="org-string">" </span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">get_duration</span><span class="org-string"><span class="org-sh-quoted-exec"> "$((sun_rise-now)</span></span><span class="org-string">)")"</span>
|
|
<span class="org-keyword">fi</span>
|
|
|
|
<span class="org-type">echo</span> <span class="org-string">"</span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">get_icon</span><span class="org-string"><span class="org-sh-quoted-exec"> "</span></span><span class="org-string"><span class="org-constant"><span class="org-sh-quoted-exec">$</span></span></span><span class="org-string"><span class="org-variable-name"><span class="org-sh-quoted-exec">current_icon</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">")</span></span><span class="org-string"> </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">current_temp</span></span><span class="org-string">$SYMBOL </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">trend</span></span><span class="org-string"> </span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">get_icon</span><span class="org-string"><span class="org-sh-quoted-exec"> "</span></span><span class="org-string"><span class="org-constant"><span class="org-sh-quoted-exec">$</span></span></span><span class="org-string"><span class="org-variable-name"><span class="org-sh-quoted-exec">forecast_icon</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">")</span></span><span class="org-string"> </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">forecast_temp</span></span><span class="org-string">$SYMBOL </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">daytime</span></span><span class="org-string">"</span>
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org4aa4897" class="outline-3">
|
|
<h3 id="org4aa4897"><span class="todo TODO">TODO</span> Open Weather Webpage</h3>
|
|
<div class="outline-text-3" id="text-org4aa4897">
|
|
<ul class="org-ul">
|
|
<li class="off"><code>[ ]</code> Find a way to open a web page with detailed forecast with the current location</li>
|
|
</ul>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-comment-delimiter"># </span><span class="org-comment">location=$(</span><span class="org-sh-quoted-exec">curl</span><span class="org-comment"> -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">if [ -n "$location" ]; then</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">location_lat="$(</span><span class="org-sh-quoted-exec">echo</span><span class="org-comment"> "$location" | jq '.location.lat')"</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">location_lon="$(</span><span class="org-sh-quoted-exec">echo</span><span class="org-comment"> "$location" | jq '.location.lng')"</span>
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">else</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">fi</span>
|
|
$<span class="org-variable-name">BROWSER</span> https://www.yahoo.com/news/weather/france/grenoble/grenoble-593720
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org7b140fd" class="outline-2">
|
|
<h2 id="org7b140fd">Network</h2>
|
|
<div class="outline-text-2" id="text-org7b140fd">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/wired-network</span>]
|
|
<span class="org-variable-name">type</span> = internal/network
|
|
<span class="org-variable-name">interface</span> = enp0s20f0u9u4
|
|
|
|
<span class="org-variable-name">label-connected</span> = %local_ip%
|
|
<span class="org-variable-name">label-connected-foreground</span> = ${colors.foreground}
|
|
|
|
<span class="org-variable-name">format-connected-prefix</span> = <span class="org-string">" "</span>
|
|
<span class="org-variable-name">format-connected</span> = <label-connected>
|
|
|
|
<span class="org-variable-name">label-disconnected</span> = <span class="org-string">""</span>
|
|
<span class="org-variable-name">label-disconnected-foreground</span> = ${colors.comments}
|
|
|
|
<span class="org-variable-name">format-disconnected</span> = <label-disconnected>
|
|
|
|
[<span class="org-type">module/wireless-network</span>]
|
|
<span class="org-variable-name">type</span> = internal/network
|
|
<span class="org-variable-name">interface</span> = wlp2s0
|
|
|
|
<span class="org-variable-name">label-connected</span> = %essid%
|
|
<span class="org-variable-name">label-connected-foreground</span> = ${colors.foreground}
|
|
|
|
<span class="org-variable-name">format-connected-prefix</span> = <span class="org-string">" "</span>
|
|
<span class="org-variable-name">format-connected</span> = <label-connected>
|
|
|
|
<span class="org-variable-name">label-disconnected</span> = <span class="org-string">""</span>
|
|
<span class="org-variable-name">label-disconnected-foreground</span> = ${colors.comments}
|
|
|
|
<span class="org-variable-name">format-disconnected</span> = <label-disconnected>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org726272d" class="outline-2">
|
|
<h2 id="org726272d">Screenshot</h2>
|
|
<div class="outline-text-2" id="text-org726272d">
|
|
<div class="org-src-container">
|
|
<pre class="src src-conf">[<span class="org-type">module/screenshot</span>]
|
|
<span class="org-variable-name">type</span> = custom/text
|
|
<span class="org-variable-name">content</span> = <span class="org-string">""</span>
|
|
<span class="org-variable-name">click-left</span> = ~/bin/screenshot
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgc30611d" class="outline-2">
|
|
<h2 id="orgc30611d">Scripts</h2>
|
|
<div class="outline-text-2" id="text-orgc30611d">
|
|
</div>
|
|
<div id="outline-container-orgfa1b0fe" class="outline-3">
|
|
<h3 id="orgfa1b0fe">Launch</h3>
|
|
<div class="outline-text-3" id="text-orgfa1b0fe">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-comment-delimiter"># </span><span class="org-comment">Terminate already running bar instances</span>
|
|
killall -q polybar
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Wait until the processes have been shut down</span>
|
|
<span class="org-keyword">while</span> <span class="org-type">pgrep</span> -u $<span class="org-variable-name">UID</span> -x polybar >/dev/null; <span class="org-keyword">do</span> <span class="org-type">sleep</span> <span class="org-highlight-numbers-number">1</span>; <span class="org-keyword">done</span>
|
|
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">Launch Polybar, using default config location ~/.config/polybar/config</span>
|
|
polybar top &
|
|
<span class="org-comment-delimiter"># </span><span class="org-comment">polybar bottom &</span>
|
|
|
|
<span class="org-type">echo</span> <span class="org-string">"Polybar launched..."</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org56bb827" class="outline-3">
|
|
<h3 id="org56bb827">Toggle</h3>
|
|
<div class="outline-text-3" id="text-org56bb827">
|
|
<div class="org-src-container">
|
|
<pre class="src src-bash"><span class="org-comment-delimiter"># </span><span class="org-comment">Usage : toggle.sh top</span>
|
|
|
|
<span class="org-variable-name">pid</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">pgrep</span> -f <span class="org-string">"polybar </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span><span class="org-rainbow-delimiters-depth-1">)</span>
|
|
|
|
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</span> <span class="org-negation-char">!</span> -z <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">pid</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
|
|
polybar-msg -p $<span class="org-variable-name">pid</span> cmd toggle >/dev/null <span class="org-highlight-numbers-number">2</span>>&<span class="org-highlight-numbers-number">1</span>
|
|
<span class="org-keyword">fi</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Dehaeze Thomas</p>
|
|
<p class="date">Created: 2020-01-11 sam. 21:59</p>
|
|
</div>
|
|
</body>
|
|
</html>
|