literate-dotfiles/docs/polybar.html

1172 lines
72 KiB
HTML
Raw Normal View History

2020-01-11 22:04:45 +01:00
<?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-11-03 16:27:09 +01:00
<!-- 2020-11-03 mar. 16:26 -->
2020-01-11 22:04:45 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Polybar Configuration</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
2020-01-11 22:22:46 +01:00
<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>
2020-01-11 22:04:45 +01:00
</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>
2020-04-05 11:30:26 +02:00
<li><a href="#org61e09e9">Refresh Mail Scripts</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#orgd0fb5fc">Open Mails</a></li>
</ul>
</li>
2020-04-05 11:30:26 +02:00
<li><a href="#orgbf8122f">Unread News</a>
<ul>
<li><a href="#orgc9bda50">Unread News Scripts</a></li>
<li><a href="#org5fbaf38">Refresh News Scripts</a></li>
<li><a href="#org3459140">Open Newsboat</a></li>
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#org87f3575">Calendar</a>
<ul>
<li><a href="#org7058c70">Calendar Status Scripts</a></li>
<li><a href="#orgb67d0d9">Open Calendar</a></li>
</ul>
</li>
2020-01-11 22:04:45 +01:00
<li><a href="#org8bc0735">Redshift</a>
<ul>
2020-04-05 11:30:26 +02:00
<li><a href="#orgc95d065">Redshift - Status</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#org5f3dbe0">Toggle Redshift</a></li>
</ul>
</li>
<li><a href="#org10f4424">NordVPN</a>
<ul>
2020-03-22 23:04:07 +01:00
<li><a href="#org1858160">Nordvpn Status script</a></li>
2020-01-11 22:04:45 +01:00
<li><a href="#orgfb45dca">Nordvpn Toggle</a></li>
</ul>
</li>
2020-03-01 22:51:16 +01:00
<li><a href="#org3734bc8">Packages</a>
<ul>
<li><a href="#org9b8a9c8">Packages Status script</a></li>
2020-04-05 11:30:26 +02:00
<li><a href="#orgb8c1426">Refresh New Packages script</a></li>
2020-03-01 22:51:16 +01:00
<li><a href="#orgb3e71da">Packages Update</a></li>
</ul>
</li>
2020-01-11 22:04:45 +01:00
<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="#org7b140fd">Network</a></li>
2020-04-05 11:30:26 +02:00
<li><a href="#org8c39876">Wireguard</a>
<ul>
<li><a href="#org5fe71f8">Wireguard Connection Status</a></li>
<li><a href="#orgad2cf0d">Toggle Wireguard Connection</a></li>
</ul>
</li>
2020-05-26 08:40:15 +02:00
<li><a href="#org1abb101">Microphone loopback</a>
<ul>
<li><a href="#orgd343aa5">Loopback Status</a></li>
<li><a href="#org417e5fc">Toggle Loopback</a></li>
</ul>
</li>
2020-01-11 22:04:45 +01:00
<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">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">colors</span>]
<span class="org-variable-name">bg</span> = ${xrdb:background}
<span class="org-variable-name">red</span> = ${xrdb:color1}
<span class="org-variable-name">green</span> = ${xrdb:color2}
<span class="org-variable-name">yellow</span> = ${xrdb:color3}
<span class="org-variable-name">blue</span> = ${xrdb:color4}
<span class="org-variable-name">purple</span> = ${xrdb:color5}
<span class="org-variable-name">aqua</span> = ${xrdb:color6}
<span class="org-variable-name">gray</span> = ${colors.color7}
<span class="org-variable-name">darkgray</span> = ${colors.color8}
<span class="org-variable-name">darkred</span> = ${xrdb:color9}
<span class="org-variable-name">darkgreen</span> = ${xrdb:color10}
<span class="org-variable-name">darkyellow</span> = ${xrdb:color11}
<span class="org-variable-name">darkblue</span> = ${xrdb:color12}
<span class="org-variable-name">darkpurple</span> = ${xrdb:color13}
<span class="org-variable-name">darkaqua</span> = ${xrdb:color14}
<span class="org-variable-name">fg</span> = ${xrdb:foreground}
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">background</span> = ${colors.bg}
<span class="org-variable-name">foreground</span> = ${colors.fg}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">line-size</span> = <span class="org-highlight-numbers-number">2</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">border-size</span> = <span class="org-highlight-numbers-number">0</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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">12</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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 wired-network wireless-network wireguard nordvpn loopback redshift lockscreen dunst packages unread_news unread_mail calendar temperature battery date
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">wm-restack</span> = i3
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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.bg}
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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>:...%
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/i3</span>]
<span class="org-variable-name">type</span> = internal/i3
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">enable-scroll</span> = false
<span class="org-variable-name">wrapping-scroll</span> = false
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf"><span class="org-variable-name">format</span> = &lt;label-state&gt; &lt;label-mode&gt;
<span class="org-variable-name">index-sort</span> = true
2020-01-11 22:04:45 +01:00
</pre>
</div>
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf"><span class="org-variable-name">label-mode-foreground</span> = ${colors.bg}
<span class="org-variable-name">label-mode-background</span> = ${colors.fg}
<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.fg}
<span class="org-variable-name">label-focused-background</span> = ${colors.bg}
<span class="org-variable-name">label-focused-underline</span> = ${colors.aqua}
<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.fg}
<span class="org-variable-name">label-unfocused-background</span> = ${colors.bg}
<span class="org-variable-name">label-unfocused-underline</span> = ${colors.bg}
<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.bg}
<span class="org-variable-name">label-visible-underline</span> = ${colors.aqua}
<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>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/bspwm</span>]
<span class="org-variable-name">type</span> = internal/bspwm
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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
2020-01-11 22:04:45 +01:00
; Use fuzzy (partial) matching on labels when assigning
; icons to workspaces
2020-11-03 16:27:09 +01:00
; Example: code;&#9818; 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;&#63083;
<span class="org-variable-name">ws-icon-1</span> = web;&#62057;
<span class="org-variable-name">ws-icon-2</span> = mail;&#63215;
<span class="org-variable-name">ws-icon-3</span> = misc;&#58879;
<span class="org-variable-name">ws-icon-4</span> = figs;&#64295;
<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.bg}
<span class="org-variable-name">label-focused-background</span> = ${colors.aqua}
<span class="org-variable-name">label-focused-underline</span>= ${colors.aqua}
<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.fg}
<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.fg}
<span class="org-variable-name">label-empty-padding</span> = <span class="org-highlight-numbers-number">1</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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> = &lt;icon-prev&gt; &lt;toggle&gt; &lt;icon-next&gt; %{A1:$TERMINAL -e <span class="org-string">"ncmpcpp"</span> &amp;:}&lt;label-song&gt;%{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> = &lt;label-offline&gt;
<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> = &#63914;
<span class="org-variable-name">icon-stop</span> = &#63962;
<span class="org-variable-name">icon-play</span> = &#63753;
<span class="org-variable-name">icon-pause</span> = &#63715;
<span class="org-variable-name">icon-next</span> = &#63915;
<span class="org-variable-name">icon-random</span> = &#63902;
<span class="org-variable-name">icon-repeat</span> = &#63829;
<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 &lt;icon-[random|repeat|repeatone|single]&gt; is used</span>
<span class="org-variable-name">toggle-on-foreground</span> = ${colors.fg}
<span class="org-variable-name">toggle-off-foreground</span> = ${colors.gray}
<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> = &#9472;
<span class="org-variable-name">bar-progress-empty</span> = &#9472;
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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> = &lt;ramp&gt;
<span class="org-variable-name">ramp-0</span> = &#58312;
<span class="org-variable-name">ramp-1</span> = &#58313;
<span class="org-variable-name">ramp-2</span> = &#58314;
<span class="org-variable-name">ramp-3</span> = &#58315;
<span class="org-variable-name">ramp-4</span> = &#58316;
<span class="org-variable-name">ramp-5</span> = &#58317;
<span class="org-variable-name">ramp-6</span> = &#58319;
<span class="org-variable-name">ramp-7</span> = &#58320;
<span class="org-variable-name">ramp-8</span> = &#58321;
<span class="org-variable-name">ramp-9</span> = &#58322;
<span class="org-variable-name">ramp-10</span> = &#58323;
<span class="org-variable-name">ramp-11</span> = &#58324;
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-prefix-foreground</span> = ${colors.fg}
<span class="org-variable-name">format-underline</span> = ${colors.bg}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label</span> = %{A1:$TERMINAL -e <span class="org-string">"htop"</span> &amp;:}&#64281; %percentage:2%%%{A}
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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:$TERMINAL -e <span class="org-string">"ikhal"</span> &amp;:}&#62549; %d-%m%{A}
<span class="org-variable-name">date-alt</span> = <span class="org-string">"%{A1:$TERMINAL -e \"ikhal\" &amp;:}&#62549; %d-%m-%Y%{A}"</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">time</span> = &#58251; %H:%M
<span class="org-variable-name">time-alt</span> = &#58251; %H:%M:%S
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label</span> = %date% %time%
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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 &amp;:}&lt;label-volume&gt; &lt;bar-volume&gt;%{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> = &#64605; 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> = &#9472;
<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> = &#9472;
<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.fg}
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/battery</span>]
<span class="org-variable-name">type</span> = internal/battery
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">battery</span> = BAT0
<span class="org-variable-name">adapter</span> = AC
<span class="org-variable-name">full-at</span> = <span class="org-highlight-numbers-number">95</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-charging</span> = %{A1:xfce4-power-manager-settings &amp;:}&lt;ramp-capacity&gt; &lt;label-charging&gt;%{A}
<span class="org-variable-name">format-charging-underline</span> = ${colors.blue}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-discharging</span> = %{A1:xfce4-power-manager-settings &amp;:}&lt;ramp-capacity&gt; &lt;label-discharging&gt;%{A}
<span class="org-variable-name">format-discharging-underline</span> = ${colors.red}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label-full</span> = %{A1:xfce4-power-manager-settings &amp;:}&#62016; %{A}
<span class="org-variable-name">format-full-underline</span> = ${colors.bg}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">ramp-capacity-0</span> = &#62020;
<span class="org-variable-name">ramp-capacity-1</span> = &#62019;
<span class="org-variable-name">ramp-capacity-2</span> = &#62018;
<span class="org-variable-name">ramp-capacity-3</span> = &#62017;
<span class="org-variable-name">ramp-capacity-4</span> = &#62016;
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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">2</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>
<span class="org-variable-name">hwmon-path</span> = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input
<span class="org-variable-name">units</span> = false
<span class="org-variable-name">format</span> = %{A1:$TERMINAL --class=<span class="org-string">"Floating"</span> -e <span class="org-string">"watch sensors"</span> &amp;:}&lt;ramp&gt; &lt;label&gt;%{A}
<span class="org-variable-name">format-warn</span> = &lt;ramp&gt; &lt;label-warn&gt;
<span class="org-variable-name">label</span> = %temperature-c%&#176;C
<span class="org-variable-name">label-warn</span> = %temperature-c%&#176;C
<span class="org-variable-name">label-warn-foreground</span> = ${colors.fg}
<span class="org-variable-name">format-warn-underline</span> = ${colors.red}
<span class="org-variable-name">ramp-0</span> = &#62155;
<span class="org-variable-name">ramp-1</span> = &#62154;
<span class="org-variable-name">ramp-2</span> = &#62153;
<span class="org-variable-name">ramp-3</span> = &#62152;
<span class="org-variable-name">ramp-4</span> = &#62151;
<span class="org-variable-name">ramp-foreground</span> = ${colors.fg}
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/mail-open.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">click-right</span> = ~/.config/polybar/scripts/mail-refresh.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<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">2</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">mail_nb</span>=<span class="org-sh-quoted-exec">`du -a ~/.mail/*/Inbox/new/* 2&gt;/dev/null | wc -l`</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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">mail_nb</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</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">"&#63215;"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}&#63215; </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">mail_nb</span></span><span class="org-string">%{F-}"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-04-05 11:30:26 +02:00
<div id="outline-container-org61e09e9" class="outline-3">
<h3 id="org61e09e9">Refresh Mail Scripts</h3>
<div class="outline-text-3" id="text-org61e09e9">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">dunstify --replace=<span class="org-highlight-numbers-number">98465</span> <span class="org-string">"Mails &#62511;"</span> <span class="org-string">"Syncing..."</span>;
checkmail -q &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-variable-name">mail_nb</span>=<span class="org-sh-quoted-exec">`du -a ~/.mail/*/Inbox/new/* 2&gt;/dev/null | wc -l`</span> &amp;&amp; <span class="org-sh-escaped-newline">\</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">mail_nb</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
dunstify --replace=<span class="org-highlight-numbers-number">98465</span> <span class="org-string">"Mails &#62511;"</span> <span class="org-string">"No new mail"</span>;
<span class="org-keyword">fi</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
<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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">$<span class="org-variable-name">TERMINAL</span> -e <span class="org-string">"tmux new-session -A -s neomutt neomutt"</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
2020-04-05 11:30:26 +02:00
<div id="outline-container-orgbf8122f" class="outline-2">
<h2 id="orgbf8122f">Unread News</h2>
<div class="outline-text-2" id="text-orgbf8122f">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/unread_news</span>]
<span class="org-variable-name">type</span> = custom/script
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/news-open.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">click-right</span> = ~/.config/polybar/scripts/news-refresh.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/news-status.sh
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">60</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
<div id="outline-container-orgc9bda50" class="outline-3">
<h3 id="orgc9bda50">Unread News Scripts</h3>
<div class="outline-text-3" id="text-orgc9bda50">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"> <span class="org-variable-name">news_nb</span>=<span class="org-sh-quoted-exec">`newsboat -x print-unread 2&gt;/dev/null | cut -d " " -f1`</span>
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</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">news_nb</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</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">news_nb</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</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">"&#61930;"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}&#61930; </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">news_nb</span></span><span class="org-string">%{F-}"</span>;
<span class="org-keyword">fi</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org5fbaf38" class="outline-3">
<h3 id="org5fbaf38">Refresh News Scripts</h3>
<div class="outline-text-3" id="text-org5fbaf38">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">dunstify --replace=<span class="org-highlight-numbers-number">38492</span> <span class="org-string">"Newsboat &#61763;"</span> <span class="org-string">"Reloading..."</span>;
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"newsboat"</span> &gt;/dev/null; <span class="org-keyword">then</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">If newsboat is already running, try to refresh in the tmux session</span>
2020-04-05 11:30:26 +02:00
tmux send-keys -t newsboat R
2020-11-03 16:27:09 +01:00
<span class="org-keyword">else</span>
2020-04-05 11:30:26 +02:00
newsboat -x reload &amp;&amp; /
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">news_nb</span>=<span class="org-sh-quoted-exec">`newsboat -x print-unread | cut -d " " -f1`</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">38492</span> <span class="org-string">"Newsboat &#61763;"</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">news_nb</span></span><span class="org-string"> Unread News"</span>;
<span class="org-keyword">fi</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-org3459140" class="outline-3">
<h3 id="org3459140">Open Newsboat</h3>
<div class="outline-text-3" id="text-org3459140">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">$<span class="org-variable-name">TERMINAL</span> -e <span class="org-string">"tmux new-session -A -s newsboat newsboat"</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org87f3575" class="outline-2">
<h2 id="org87f3575">Calendar</h2>
<div class="outline-text-2" id="text-org87f3575">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/calendar</span>]
<span class="org-variable-name">type</span> = custom/script
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/calendar-open.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/calendar-status.sh
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">5</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
<div id="outline-container-org7058c70" class="outline-3">
<h3 id="org7058c70">Calendar Status Scripts</h3>
<div class="outline-text-3" id="text-org7058c70">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">next_events</span>=<span class="org-sh-quoted-exec">$</span><span class="org-sh-quoted-exec"><span class="org-rainbow-delimiters-depth-1">(</span></span><span class="org-sh-quoted-exec">khal list </span><span class="org-string"><span class="org-sh-quoted-exec">"$(</span></span><span class="org-sh-quoted-exec">date</span><span class="org-string"><span class="org-sh-quoted-exec"> +"%H:%M")</span></span><span class="org-string">"</span> 23:59 --format <span class="org-string">"{start-time} - {title}"</span> -df <span class="org-string">'SKIPME'</span> | <span class="org-type">grep</span> -v <span class="org-string">'SKIPME'</span> | <span class="org-type">grep</span> -v <span class="org-string">'No events'</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">cal_icon</span>=<span class="org-string">"&#62549;"</span>
<span class="org-variable-name">cal_nb</span>=<span class="org-string">""</span>
<span class="org-variable-name">cal_desc</span>=<span class="org-string">""</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">next_events</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">events_number</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">next_events</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">" | wc -l)</span></span><span class="org-string">"</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">events_number</span></span><span class="org-string">"</span> -gt <span class="org-string">"1"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-variable-name">cal_nb</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">events_number</span></span><span class="org-string">)"</span>
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">next_timed_events</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">next_events</span></span><span class="org-string">"</span> | sed -e <span class="org-string">'/^[^0-9]/d'</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">[</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">next_timed_events</span></span><span class="org-string">"</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">Only full day events</span>
<span class="org-variable-name">cal_desc</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">next_events</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">" | sed -e '/^[0-9]/d;s/^ - //' | head -n 1 | cut -c 1-15)</span></span><span class="org-string">"</span>
<span class="org-keyword">else</span>
<span class="org-variable-name">cal_desc</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">next_timed_events</span></span></span><span class="org-string"><span class="org-sh-quoted-exec">" | head -n 1 | cut -c 1-20)</span></span><span class="org-string">"</span>
<span class="org-keyword">fi</span>
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-type">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">{cal_icon}</span></span><span class="org-string">${cal_nb}</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">{cal_desc}</span></span><span class="org-string">"</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgb67d0d9" class="outline-3">
<h3 id="orgb67d0d9">Open Calendar</h3>
<div class="outline-text-3" id="text-orgb67d0d9">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">$<span class="org-variable-name">TERMINAL</span> --class=<span class="org-string">"Floating"</span> -e <span class="org-string">"khal interactive"</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
<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">
2020-11-03 16:27:09 +01:00
<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">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/redshift-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
2020-04-05 11:30:26 +02:00
<div id="outline-container-orgc95d065" class="outline-3">
<h3 id="orgc95d065">Redshift - Status</h3>
<div class="outline-text-3" id="text-orgc95d065">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"redshift"</span> &gt;/dev/null; <span class="org-keyword">then</span>
<span class="org-type">echo</span> <span class="org-string">"&#64147;"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"&#64167;"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"redshift"</span> &gt;/dev/null; <span class="org-keyword">then</span>
killall redshift &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">36492</span> <span class="org-string">"Redshift &#64147;"</span> <span class="org-string">"Turned off"</span>;
<span class="org-keyword">else</span>
nohup redshift &gt; /dev/null <span class="org-highlight-numbers-number">2</span>&gt;&amp;<span class="org-highlight-numbers-number">1</span> &amp;
dunstify --replace=<span class="org-highlight-numbers-number">36492</span> <span class="org-string">"Redshift &#64147;"</span> <span class="org-string">"Starting..."</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/nordvpn-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<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>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
<div id="outline-container-org1858160" class="outline-3">
2020-03-22 23:04:07 +01:00
<h3 id="org1858160">Nordvpn Status script</h3>
2020-01-11 22:04:45 +01:00
<div class="outline-text-3" id="text-org1858160">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">tmpfile</span>=<span class="org-string">"/tmp/vpnstatus"</span>;
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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> &amp;&amp; <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">"%{F#859900}&#63022;%{F-}"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"&#63022;"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">tmpfile</span>=<span class="org-string">"/tmp/vpnstatus"</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> &amp;&amp; <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>
nordvpn disconnect &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">23198</span> <span class="org-string">"VPN"</span> <span class="org-string">"Disconnected"</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-type">echo</span> <span class="org-string">"off"</span> &gt; $<span class="org-variable-name">tmpfile</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"> ~/.local/data/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> &amp;&amp; <span class="org-sh-escaped-newline">\</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> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-type">echo</span> <span class="org-string">"on"</span> &gt; $<span class="org-variable-name">tmpfile</span>;
<span class="org-keyword">fi</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org3734bc8" class="outline-2">
<h2 id="org3734bc8">Packages</h2>
<div class="outline-text-2" id="text-org3734bc8">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/packages</span>]
<span class="org-variable-name">type</span> = custom/script
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/packages-update.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">click-right</span> = ~/.config/polybar/scripts/packages-refresh.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/packages-status.sh
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">600</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
<div id="outline-container-org9b8a9c8" class="outline-3">
<h3 id="org9b8a9c8">Packages Status script</h3>
<div class="outline-text-3" id="text-org9b8a9c8">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">yay -Sy &gt; /dev/null <span class="org-highlight-numbers-number">2</span>&gt;&amp;<span class="org-highlight-numbers-number">1</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-variable-name">package_nb</span>=<span class="org-sh-quoted-exec">`yay -Qu 2&gt; /dev/null | wc -l`</span> || <span class="org-sh-escaped-newline">\</span>
<span class="org-variable-name">package_nb</span>=<span class="org-highlight-numbers-number">0</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">package_nb</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</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">"&#62211;"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}&#62211; </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">package_nb</span></span><span class="org-string">%{F-}"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
2020-04-05 11:30:26 +02:00
<div id="outline-container-orgb8c1426" class="outline-3">
<h3 id="orgb8c1426">Refresh New Packages script</h3>
<div class="outline-text-3" id="text-orgb8c1426">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">dunstify --replace=<span class="org-highlight-numbers-number">64654</span> <span class="org-string">'Packages &#62211;'</span> <span class="org-string">"Refreshing..."</span>
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
yay -Sy &gt; /dev/null <span class="org-highlight-numbers-number">2</span>&gt;&amp;<span class="org-highlight-numbers-number">1</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-variable-name">package_nb</span>=<span class="org-sh-quoted-exec">`yay -Qu 2&gt; /dev/null | wc -l`</span>;
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<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">package_nb</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
dunstify --replace=<span class="org-highlight-numbers-number">64654</span> <span class="org-string">'Packages &#62211;'</span> <span class="org-string">"No upgrade available"</span>
<span class="org-keyword">else</span>
dunstify --replace=<span class="org-highlight-numbers-number">64654</span> <span class="org-string">'Packages &#62211;'</span> <span class="org-string">"</span><span class="org-string"><span class="org-sh-quoted-exec">$(</span></span><span class="org-sh-quoted-exec">package_nb</span><span class="org-string"><span class="org-sh-quoted-exec">)</span></span><span class="org-string"> upgrade(s) available"</span>
<span class="org-keyword">fi</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
2020-03-01 22:51:16 +01:00
<div id="outline-container-orgb3e71da" class="outline-3">
<h3 id="orgb3e71da">Packages Update</h3>
<div class="outline-text-3" id="text-orgb3e71da">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash">$<span class="org-variable-name">TERMINAL</span> -e <span class="org-string">"yay"</span>
2020-03-01 22:51:16 +01:00
</pre>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/dunst-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<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>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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">"&#61683;"</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">"&#61942;"</span>;
<span class="org-keyword">fi</span>
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"&#61683;"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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> &amp;&amp; <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 &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-type">echo</span> <span class="org-string">"on"</span> &gt; $<span class="org-variable-name">tmpfile</span>;
dunstify --replace=<span class="org-highlight-numbers-number">16549</span> <span class="org-string">"Notifications &#61683;"</span> <span class="org-string">"Activated"</span>;
<span class="org-keyword">else</span>
dunstify --replace=<span class="org-highlight-numbers-number">16549</span> <span class="org-string">"Notifications &#61683;"</span> <span class="org-string">"Deactivated"</span>;
<span class="org-type">sleep</span> <span class="org-highlight-numbers-number">1</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
killall -SIGUSR1 dunst &amp;&amp; <span class="org-sh-escaped-newline">\</span>
<span class="org-type">echo</span> <span class="org-string">"off"</span> &gt; $<span class="org-variable-name">tmpfile</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/lockscreen</span>]
<span class="org-variable-name">type</span> = custom/script
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/lockscreen-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">click-right</span> = ~/.local/bin/lockscreen &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/lockscreen-status.sh
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"xautolock"</span> &gt;/dev/null
<span class="org-keyword">then</span>
<span class="org-type">echo</span> <span class="org-string">"&#61475;"</span>;
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"&#61596;"</span>;
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-keyword">if</span> <span class="org-type">pgrep</span> -x <span class="org-string">"xautolock"</span> &gt;/dev/null ; <span class="org-keyword">then</span>
<span class="org-type">pkill</span> xautolock &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">13602</span> <span class="org-string">'Lock Screen &#61475;'</span> <span class="org-string">'Desactivated'</span>
<span class="org-keyword">else</span>
xautolock -locker <span class="org-string">"~/.local/bin/lockscreen"</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> &amp;
dunstify --replace=<span class="org-highlight-numbers-number">13602</span> <span class="org-string">'Lock Screen &#61475;'</span> <span class="org-string">'Activated'</span>
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<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> = enp0s20f0u6u4
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label-connected</span> = &#63231; %local_ip%
<span class="org-variable-name">label-connected-foreground</span> = ${colors.fg}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label-disconnected</span> = &#63231;
<span class="org-variable-name">label-disconnected-foreground</span> = <span class="org-comment-delimiter">#</span><span class="org-comment">777</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
2020-01-11 22:04:45 +01:00
2020-05-26 08:40:15 +02:00
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<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
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-connected</span> = &lt;label-connected&gt;
<span class="org-variable-name">format-disconnected</span> = &lt;label-disconnected&gt;
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label-connected</span> = &#64168; %essid%
<span class="org-variable-name">label-connected-foreground</span> = ${colors.fg}
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">label-disconnected</span> = &#64169;
<span class="org-variable-name">label-disconnected-foreground</span> = <span class="org-comment-delimiter">#</span><span class="org-comment">777</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
2020-04-05 11:30:26 +02:00
<div id="outline-container-org8c39876" class="outline-2">
<h2 id="org8c39876">Wireguard</h2>
<div class="outline-text-2" id="text-org8c39876">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/wireguard</span>]
<span class="org-variable-name">type</span> = custom/script
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/wireguard-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/wireguard-status.sh
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
<div id="outline-container-org5fe71f8" class="outline-3">
<h3 id="org5fe71f8">Wireguard Connection Status</h3>
<div class="outline-text-3" id="text-org5fe71f8">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">config</span>=<span class="org-string">"homelab"</span>
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">connection</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">sudo</span> wg show <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">config</span></span><span class="org-string">"</span> <span class="org-highlight-numbers-number">2</span>&gt;/dev/null | head -n <span class="org-highlight-numbers-number">1</span> | awk <span class="org-string">'{print $NF }'</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<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">connection</span></span><span class="org-string">"</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">config</span></span><span class="org-string">"</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">"%{F#859900}&#63511;%{F-}"</span>
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"&#63512;"</span>
<span class="org-keyword">fi</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
</div>
<div id="outline-container-orgad2cf0d" class="outline-3">
<h3 id="orgad2cf0d">Toggle Wireguard Connection</h3>
<div class="outline-text-3" id="text-orgad2cf0d">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">config</span>=<span class="org-string">"homelab"</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">connection</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">sudo</span> wg show <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">config</span></span><span class="org-string">"</span> <span class="org-highlight-numbers-number">2</span>&gt;/dev/null | head -n <span class="org-highlight-numbers-number">1</span> | awk <span class="org-string">'{print $NF }'</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">connection</span></span><span class="org-string">"</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">config</span></span><span class="org-string">"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
<span class="org-type">sudo</span> wg-quick down <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">config</span></span><span class="org-string">"</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">83244</span> <span class="org-string">"Wireguard"</span> <span class="org-string">"Disconnected from </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">config</span></span><span class="org-string">"</span>
<span class="org-keyword">else</span>
<span class="org-type">sudo</span> wg-quick up <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">config</span></span><span class="org-string">"</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">83244</span> <span class="org-string">"Wireguard"</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">config</span></span><span class="org-string">"</span>
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org1abb101" class="outline-2">
<h2 id="org1abb101">Microphone loopback</h2>
<div class="outline-text-2" id="text-org1abb101">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-conf">[<span class="org-type">module/loopback</span>]
<span class="org-variable-name">type</span> = custom/script
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">format-underline</span> = ${colors.bg}
<span class="org-variable-name">click-left</span> = ~/.config/polybar/scripts/loopback-toggle.sh &gt;/dev/null 2&gt;%1 &amp;
<span class="org-variable-name">format</span> = &lt;label&gt;
<span class="org-variable-name">exec</span> = ~/.config/polybar/scripts/loopback-status.sh
2020-04-05 11:30:26 +02:00
2020-11-03 16:27:09 +01:00
<span class="org-variable-name">interval</span> = <span class="org-highlight-numbers-number">2</span>
2020-04-05 11:30:26 +02:00
</pre>
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-orgd343aa5" class="outline-3">
<h3 id="orgd343aa5">Loopback Status</h3>
<div class="outline-text-3" id="text-orgd343aa5">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">loopback</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">pactl</span> list <span class="org-highlight-numbers-number">2</span>&gt;/dev/null | <span class="org-type">grep</span> module-loopback | wc -l<span class="org-rainbow-delimiters-depth-1">)</span>
2020-05-26 08:40:15 +02:00
2020-11-03 16:27:09 +01:00
<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">loopback</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</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">"&#61744;"</span>
<span class="org-keyword">else</span>
<span class="org-type">echo</span> <span class="org-string">"%{F#859900}&#61744;%{F-}"</span>
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
2020-04-05 11:30:26 +02:00
</div>
</div>
2020-05-26 08:40:15 +02:00
<div id="outline-container-org417e5fc" class="outline-3">
<h3 id="org417e5fc">Toggle Loopback</h3>
<div class="outline-text-3" id="text-org417e5fc">
<div class="org-src-container">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-variable-name">loopback</span>=$<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-sh-quoted-exec">pactl</span> list <span class="org-highlight-numbers-number">2</span>&gt;/dev/null | <span class="org-type">grep</span> module-loopback | wc -l<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">loopback</span></span><span class="org-string">"</span> -eq <span class="org-string">"0"</span> <span class="org-rainbow-delimiters-depth-1">]</span>; <span class="org-keyword">then</span>
pactl load-module module-loopback <span class="org-variable-name">latency_msec</span>=<span class="org-highlight-numbers-number">1</span> &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">82244</span> <span class="org-string">"Loopback"</span> <span class="org-string">"Enabled"</span>
<span class="org-keyword">else</span>
pactl unload-module module-loopback &amp;&amp; <span class="org-sh-escaped-newline">\</span>
dunstify --replace=<span class="org-highlight-numbers-number">82244</span> <span class="org-string">"Loopback"</span> <span class="org-string">"Disabled"</span>
<span class="org-keyword">fi</span>
2020-05-26 08:40:15 +02:00
</pre>
</div>
</div>
</div>
</div>
2020-01-11 22:04:45 +01:00
<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">
2020-11-03 16:27:09 +01:00
<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">"&#62975;"</span>
<span class="org-variable-name">click-left</span> = ~/.local/bin/screenshot &gt;/dev/null 2&gt;%1 &amp;
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-comment-delimiter"># </span><span class="org-comment">Terminate already running bar instances</span>
2020-01-11 22:04:45 +01:00
killall -q polybar
2020-11-03 16:27:09 +01:00
<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 &gt;/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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-comment-delimiter"># </span><span class="org-comment">Launch Polybar, using default config location ~/.config/polybar/config</span>
polybar top &gt;&gt;/tmp/polybar.log <span class="org-highlight-numbers-number">2</span>&gt;&amp;<span class="org-highlight-numbers-number">1</span> &amp;
<span class="org-comment-delimiter"># </span><span class="org-comment">polybar bottom &amp;</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<span class="org-type">echo</span> <span class="org-string">"Polybar launched..."</span>
2020-01-11 22:04:45 +01:00
</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">
2020-11-03 16:27:09 +01:00
<pre class="src src-bash"><span class="org-comment-delimiter"># </span><span class="org-comment">Usage : toggle.sh top</span>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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>
2020-01-11 22:04:45 +01:00
2020-11-03 16:27:09 +01:00
<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 &gt;/dev/null <span class="org-highlight-numbers-number">2</span>&gt;&amp;<span class="org-highlight-numbers-number">1</span>
<span class="org-keyword">fi</span>
2020-01-11 22:04:45 +01:00
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2020-11-03 16:27:09 +01:00
<p class="date">Created: 2020-11-03 mar. 16:26</p>
2020-01-11 22:04:45 +01:00
</div>
</body>
</html>