New Setup 📦
This commit is contained in:
parent
d16174b447
commit
415dbd08a1
10194 changed files with 1368647 additions and 4 deletions
203
home/.config/waybar/config
Normal file
203
home/.config/waybar/config
Normal file
|
@ -0,0 +1,203 @@
|
|||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
|
||||
"modules-left": ["tray", "custom/launcher", "sway/workspaces", "sway/mode", "sway/window"],
|
||||
"modules-center": ["custom/stub", "custom/spotify", "custom/weather", "clock", "custom/vnc", "custom/stub"],
|
||||
"modules-right": ["custom/keyboard-layout", "backlight", "memory", "battery", "network", "pulseaudio", "custom/power"],
|
||||
|
||||
"sway/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"3": "3",
|
||||
"4": "4",
|
||||
"5": "5",
|
||||
"6": "6",
|
||||
"7": "7",
|
||||
"8": "8",
|
||||
"9": "9",
|
||||
"10": "10",
|
||||
}
|
||||
},
|
||||
|
||||
"sway/mode": {
|
||||
"format": "<span style=\"italic\">{}</span>"
|
||||
},
|
||||
|
||||
"sway/window": {
|
||||
"icon": false,
|
||||
"format": "{}"
|
||||
},
|
||||
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
}
|
||||
},
|
||||
|
||||
"tray": {
|
||||
"icon-size": 14,
|
||||
"spacing": 5
|
||||
},
|
||||
|
||||
"clock": {
|
||||
"tooltip-format": "{:%A %B %d %Y | %H:%M}",
|
||||
//"format": " {:%a %d %b %I:%M %p}", //12 hour format
|
||||
"format": " {:%a %d %b %H:%M}", //24 hour format
|
||||
"format-alt": " {:%d/%m/%Y %H:%M:%S}",
|
||||
//"timezones": [ "" ],
|
||||
//"max-length": 200
|
||||
"interval": 1
|
||||
},
|
||||
|
||||
"cpu": {
|
||||
"format": " {usage}%",
|
||||
"on-click": "alacritty -e htop"
|
||||
},
|
||||
|
||||
"memory": {
|
||||
"format": " {used:0.1f}GB",
|
||||
"on-click": "alacritty -e htop"
|
||||
},
|
||||
|
||||
"temperature": {
|
||||
// "thermal-zone": 2,
|
||||
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
|
||||
"critical-threshold": 80,
|
||||
// "format-critical": "{temperatureC}°C ",
|
||||
"format": "{temperatureC}°C "
|
||||
},
|
||||
|
||||
"backlight": {
|
||||
// "device": "acpi_video1",
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": ["", ""],
|
||||
"on-scroll-down": "brightnessctl -c backlight set 5%",
|
||||
"on-scroll-up": "brightnessctl -c backlight set +5%"
|
||||
},
|
||||
|
||||
"battery": {
|
||||
"states": {
|
||||
// "good": 95,
|
||||
"warning": 30,
|
||||
"critical": 15
|
||||
},
|
||||
"format": "{icon} {capacity}%",
|
||||
"format-icons": ["", "", "", "", ""]
|
||||
},
|
||||
|
||||
"network": {
|
||||
// "interface": "wlp2s0", // (Optional) To force the use of this interface
|
||||
"format": "⚠ Disabled",
|
||||
"format-wifi": " ",
|
||||
"format-ethernet": " {ifname}",
|
||||
"format-disconnected": "⚠ Disconnected",
|
||||
"on-click": "networkmanager_dmenu",
|
||||
"tooltip" : true,
|
||||
"tooltip-format" : "{ifname}\n{ipaddr}",
|
||||
"tooltip-format-wifi" : "{essid} {ifname}\n{ipaddr}\nstrength: {signalStrength}%"
|
||||
},
|
||||
|
||||
"pulseaudio": {
|
||||
"scroll-step": 5,
|
||||
"format": "{icon} {volume}%",
|
||||
"format-bluetooth": "{icon} {volume}%",
|
||||
"format-muted":"muted ",
|
||||
"format-icons": {
|
||||
"headphones": "",
|
||||
"handsfree": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", ""]
|
||||
},
|
||||
"on-click": "pavucontrol"
|
||||
},
|
||||
|
||||
"custom/stub" : {
|
||||
"format": " {} ",
|
||||
"exec": "echo \":\""
|
||||
},
|
||||
|
||||
"custom/spotify": {
|
||||
"exec": "/usr/bin/python3 ~/.config/waybar/scripts/mediaplayer.py --player spotify",
|
||||
"format": " {} ",
|
||||
"return-type": "json",
|
||||
"on-click": "playerctl play-pause",
|
||||
"on-scroll-up": "playerctl next",
|
||||
"on-scroll-down": "playerctl previous"
|
||||
},
|
||||
|
||||
"custom/launcher": {
|
||||
"format":"| {} ",
|
||||
"on-click": "exec nwggrid",
|
||||
"tooltip": false,
|
||||
"exec" : "echo $USER"
|
||||
},
|
||||
|
||||
"custom/weather": {
|
||||
"format": "{}",
|
||||
"tooltip": true,
|
||||
"interval": 3600,
|
||||
"exec": "$HOME/.config/waybar/scripts/waybar-wttr.py",
|
||||
"return-type": "json"
|
||||
},
|
||||
|
||||
"custom/pacman": {
|
||||
"format": " {}",
|
||||
"interval": 7200, // every two hours
|
||||
"exec": "checkupdates | wc -l", // # of updates
|
||||
"exec-if": "exit 0", // always run; consider advanced run conditions
|
||||
"on-click": "alacritty -e sudo pacman -Syu ; pkill -SIGRTMIN+8 waybar", // update system
|
||||
"signal": 8
|
||||
},
|
||||
|
||||
"custom/power": {
|
||||
"format":" ⏻ ",
|
||||
"on-click": "nwgbar",
|
||||
"tooltip": false,
|
||||
},
|
||||
|
||||
"custom/vnc": {
|
||||
"format": "🖥{}",
|
||||
"exec": "$HOME/.config/sway/scripts/vnc_server.sh",
|
||||
"on-click": "$HOME/.config/sway/scripts/vnc_server.sh $(cat /tmp/VNC_CHANGE_STATE_VAR)",
|
||||
|
||||
"return-type": "json",
|
||||
"tooltip" : true,
|
||||
"interval": "once",
|
||||
"signal": 5
|
||||
},
|
||||
|
||||
// to find keyboard identifier use "swaymsg -t get_inputs"
|
||||
"custom/keyboard-layout": {
|
||||
"format": " {}",
|
||||
"tooltip": false,
|
||||
"exec": "$HOME/.config/waybar/scripts/kblayout.sh"
|
||||
// "on-click": "swaymsg exec alacritty -e ~/.config/sway/scripts/keyhint.sh",
|
||||
// "exec": "$HOME/.config/waybar/scripts/kblayout.sh '1:1:AT_Translated_Set_2_keyboard'"
|
||||
// "exec": "$HOME/.config/waybar/scripts/kblayout.sh '6700:3620:SEM_USB_Keyboard'"
|
||||
},
|
||||
|
||||
"wlr/taskbar": {
|
||||
"format": "{icon}",
|
||||
"icon-size": 14,
|
||||
"icon-theme": "Numix-Circle",
|
||||
"tooltip-format": "{title}",
|
||||
"on-click": "activate",
|
||||
"on-click-middle": "close"
|
||||
},
|
||||
|
||||
"custom/arrowL0": {
|
||||
"format":""
|
||||
},
|
||||
|
||||
"custom/arrowR0": {
|
||||
"format":""
|
||||
},
|
||||
}
|
BIN
home/.config/waybar/scripts/KeyHints$Column.class
Normal file
BIN
home/.config/waybar/scripts/KeyHints$Column.class
Normal file
Binary file not shown.
BIN
home/.config/waybar/scripts/KeyHints.class
Normal file
BIN
home/.config/waybar/scripts/KeyHints.class
Normal file
Binary file not shown.
100
home/.config/waybar/scripts/KeyHints.java
Normal file
100
home/.config/waybar/scripts/KeyHints.java
Normal file
|
@ -0,0 +1,100 @@
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class KeyHints {
|
||||
private static final int STEP = 50;
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
args = new String[]{"/home/owpk/.config/sway/config.d/default"};
|
||||
if (args.length != 1) {
|
||||
System.err.println("pass path to sway keybind config as first arg");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
var lines = Files.lines(Paths.get(args[0]))
|
||||
.map(String::strip)
|
||||
.filter(x -> x.contains("$mod"))
|
||||
.map(x -> x.replaceAll("[ |\t]+", " ")
|
||||
.replaceAll("\"", "").substring(x.indexOf("$"))).collect(Collectors.toList());
|
||||
|
||||
var splittedSource = splitToSublist(lines.stream()
|
||||
.sorted(Comparator.comparing(x -> x.toLowerCase())).collect(Collectors.toList()));
|
||||
|
||||
var splittedListOfMap = splittedSource.stream()
|
||||
.map(x -> {
|
||||
var map = x.stream().map(s -> s.split(" ", 2))
|
||||
.collect(Collectors.toMap(x1 -> x1[0], x2 -> x2[1]));
|
||||
var tree = new TreeMap<String, String>(
|
||||
Comparator.comparing(c -> c, String.CASE_INSENSITIVE_ORDER));
|
||||
tree.putAll(map);
|
||||
return tree;
|
||||
}).map(x -> {
|
||||
var longestKey = getLongestStringFormat(
|
||||
streamToLongestWordLength(x.keySet().stream()));
|
||||
return x.entrySet().stream()
|
||||
.map(s -> (String.format(longestKey, s.getKey()) + s.getValue())
|
||||
.replaceAll(" ", "."))
|
||||
.collect(Collectors.toList());
|
||||
}).map(x -> new Column(x, streamToLongestWordLength(x.stream())))
|
||||
.collect(Collectors.toList());
|
||||
var sb = new StringBuilder();
|
||||
var longestColumn = splittedListOfMap.stream()
|
||||
.max(Comparator.comparing(x -> x.content.size()))
|
||||
.orElse(new Column()).content;
|
||||
|
||||
for (int i = 0; i < longestColumn.size(); i++) {
|
||||
for (Column currentColumn : splittedListOfMap) {
|
||||
String currentLine = "";
|
||||
if (i < currentColumn.content.size()) {
|
||||
currentLine = currentColumn.content.get(i);
|
||||
}
|
||||
sb.append(String.format(getLongestStringFormat(currentColumn.width) + " | ", currentLine));
|
||||
}
|
||||
sb.append("\n");
|
||||
}
|
||||
System.out.println(sb);
|
||||
}
|
||||
|
||||
private static class Column {
|
||||
List<String> content = new ArrayList<>();
|
||||
int width;
|
||||
|
||||
public Column() {
|
||||
}
|
||||
|
||||
public Column(List<String> content, int width) {
|
||||
this.content = content;
|
||||
this.width = width;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLongestStringFormat(int size) {
|
||||
return "%-" + size + "s";
|
||||
}
|
||||
|
||||
private static int streamToLongestWordLength(Stream<String> st) {
|
||||
return st.max(Comparator.comparing(String::length))
|
||||
.orElse("").length() + 2;
|
||||
}
|
||||
|
||||
private static List<List<String>> splitToSublist(List<String> baseList) {
|
||||
var list = new ArrayList<List<String>>();
|
||||
int start = 0;
|
||||
int step = Math.min(STEP, baseList.size());
|
||||
int end = step;
|
||||
while (start < end) {
|
||||
var sublist = baseList.subList(start, end);
|
||||
list.add(sublist);
|
||||
start = end + 1;
|
||||
step = Math.min(baseList.size() - end, step);
|
||||
end += step;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
Binary file not shown.
18
home/.config/waybar/scripts/kblayout.sh
Executable file
18
home/.config/waybar/scripts/kblayout.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
KEYBOARD=`swaymsg -r -t get_inputs | grep -i identifier | grep -i keyboard | tail -1| sed 's/"identifier": //; s/ //g; s/,//'`
|
||||
|
||||
if [[ $1 ]]
|
||||
then
|
||||
KEYBOARD="\"$1\""
|
||||
fi
|
||||
|
||||
swaymsg -r -t get_inputs | jq -r \
|
||||
"first(.[]|select(.identifier == $KEYBOARD and .type == \"keyboard\")) \
|
||||
| .xkb_active_layout_name"
|
||||
|
||||
swaymsg -mrt subscribe '["input"]' | jq -r --unbuffered \
|
||||
"select(.change == \"xkb_layout\")
|
||||
| .input
|
||||
| select(.identifier == $KEYBOARD and .type == \"keyboard\") \
|
||||
| .xkb_active_layout_name"
|
||||
|
4
home/.config/waybar/scripts/keyhint.sh
Normal file
4
home/.config/waybar/scripts/keyhint.sh
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
KH=$(java -cp $HOME/.config/waybar/scripts/ KeyHints $HOME/.config/sway/config.d/default)
|
||||
echo $KH
|
BIN
home/.config/waybar/scripts/keyhints
Executable file
BIN
home/.config/waybar/scripts/keyhints
Executable file
Binary file not shown.
3
home/.config/waybar/scripts/keyhints.build_artifacts.txt
Normal file
3
home/.config/waybar/scripts/keyhints.build_artifacts.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
[EXECUTABLE]
|
||||
keyhints
|
||||
|
131
home/.config/waybar/scripts/mediaplayer.py
Executable file
131
home/.config/waybar/scripts/mediaplayer.py
Executable file
|
@ -0,0 +1,131 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
import json
|
||||
gi.require_version('Playerctl', '2.0')
|
||||
from gi.repository import Playerctl, GLib
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def write_output(text, player):
|
||||
logger.info('Writing output')
|
||||
|
||||
output = {'text': text,
|
||||
'class': 'custom-' + player.props.player_name,
|
||||
'alt': player.props.player_name}
|
||||
|
||||
dump = json.dumps(output) + '\n'
|
||||
logger.info(':: Dumped info: ' + dump)
|
||||
|
||||
sys.stdout.write(dump)
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def on_play(player, status, manager):
|
||||
logger.info('Received new playback status')
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def on_metadata(player, metadata, manager):
|
||||
logger.info('Received new metadata')
|
||||
track_info = ''
|
||||
|
||||
if player.props.player_name == 'spotify' and \
|
||||
'mpris:trackid' in metadata.keys() and \
|
||||
':ad:' in player.props.metadata['mpris:trackid']:
|
||||
track_info = 'AD PLAYING'
|
||||
elif player.get_artist() != '' and player.get_title() != '':
|
||||
track_info = '{artist} - {title}' \
|
||||
.format(artist=player.get_artist().replace("&", "&"),
|
||||
title=player.get_title().replace("&", "&"))
|
||||
else:
|
||||
track_info = player.get_title()
|
||||
|
||||
if player.props.status != 'Playing' and track_info:
|
||||
track_info = ' ' + track_info
|
||||
write_output(track_info, player)
|
||||
|
||||
|
||||
def on_player_appeared(manager, player, selected_player=None):
|
||||
if player is not None and (selected_player is None or player.name == selected_player):
|
||||
init_player(manager, player)
|
||||
else:
|
||||
logger.debug("New player appeared, but it's not the selected player, skipping")
|
||||
|
||||
|
||||
def on_player_vanished(manager, player):
|
||||
logger.info('Player has vanished')
|
||||
sys.stdout.write('\n')
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
def init_player(manager, name):
|
||||
logger.debug('Initialize player: {player}'.format(player=name.name))
|
||||
player = Playerctl.Player.new_from_name(name)
|
||||
player.connect('playback-status', on_play, manager)
|
||||
player.connect('metadata', on_metadata, manager)
|
||||
manager.manage_player(player)
|
||||
on_metadata(player, player.props.metadata, manager)
|
||||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
logger.debug('Received signal to stop, exiting')
|
||||
sys.stdout.write('\n')
|
||||
sys.stdout.flush()
|
||||
# loop.quit()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
# Increase verbosity with every occurence of -v
|
||||
parser.add_argument('-v', '--verbose', action='count', default=0)
|
||||
|
||||
# Define for which player we're listening
|
||||
parser.add_argument('--player')
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
arguments = parse_arguments()
|
||||
|
||||
# Initialize logging
|
||||
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG,
|
||||
format='%(name)s %(levelname)s %(message)s')
|
||||
|
||||
# Logging is set by default to WARN and higher.
|
||||
# With every occurrence of -v it's lowered by one
|
||||
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
|
||||
|
||||
# Log the sent command line arguments
|
||||
logger.debug('Arguments received {}'.format(vars(arguments)))
|
||||
|
||||
manager = Playerctl.PlayerManager()
|
||||
loop = GLib.MainLoop()
|
||||
|
||||
manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player))
|
||||
manager.connect('player-vanished', on_player_vanished)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
|
||||
for player in manager.props.player_names:
|
||||
if arguments.player is not None and arguments.player != player.name:
|
||||
logger.debug('{player} is not the filtered player, skipping it'
|
||||
.format(player=player.name)
|
||||
)
|
||||
continue
|
||||
|
||||
init_player(manager, player)
|
||||
|
||||
loop.run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
11
home/.config/waybar/scripts/user_location.py
Executable file
11
home/.config/waybar/scripts/user_location.py
Executable file
|
@ -0,0 +1,11 @@
|
|||
import requests
|
||||
|
||||
|
||||
def get_location():
|
||||
response = requests.get(f'https://ipinfo.io').json()
|
||||
location_data = {
|
||||
"city": response.get("city"),
|
||||
"region": response.get("region"),
|
||||
"country": response.get("country")
|
||||
}
|
||||
return location_data
|
117
home/.config/waybar/scripts/waybar-wttr.py
Executable file
117
home/.config/waybar/scripts/waybar-wttr.py
Executable file
|
@ -0,0 +1,117 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import json
|
||||
import requests
|
||||
import user_location
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
WEATHER_CODES = {
|
||||
'113': '☀️',
|
||||
'116': '⛅️',
|
||||
'119': '☁️',
|
||||
'122': '☁️',
|
||||
'143': '🌫',
|
||||
'176': '🌦',
|
||||
'179': '🌧',
|
||||
'182': '🌧',
|
||||
'185': '🌧',
|
||||
'200': '⛈',
|
||||
'227': '🌨',
|
||||
'230': '❄️',
|
||||
'248': '🌫',
|
||||
'260': '🌫',
|
||||
'263': '🌦',
|
||||
'266': '🌦',
|
||||
'281': '🌧',
|
||||
'284': '🌧',
|
||||
'293': '🌦',
|
||||
'296': '🌦',
|
||||
'299': '🌧',
|
||||
'302': '🌧',
|
||||
'305': '🌧',
|
||||
'308': '🌧',
|
||||
'311': '🌧',
|
||||
'314': '🌧',
|
||||
'317': '🌧',
|
||||
'320': '🌨',
|
||||
'323': '🌨',
|
||||
'326': '🌨',
|
||||
'329': '❄️',
|
||||
'332': '❄️',
|
||||
'335': '❄️',
|
||||
'338': '❄️',
|
||||
'350': '🌧',
|
||||
'353': '🌦',
|
||||
'356': '🌧',
|
||||
'359': '🌧',
|
||||
'362': '🌧',
|
||||
'365': '🌧',
|
||||
'368': '🌨',
|
||||
'371': '❄️',
|
||||
'374': '🌧',
|
||||
'377': '🌧',
|
||||
'386': '⛈',
|
||||
'389': '🌩',
|
||||
'392': '⛈',
|
||||
'395': '❄️'
|
||||
}
|
||||
|
||||
data = {}
|
||||
|
||||
user_loc = user_location.get_location()
|
||||
weather = requests.get("https://wttr.in/?format=j1&location={}".format(user_loc)).json()
|
||||
|
||||
|
||||
def format_time(time):
|
||||
return time.replace("00", "").zfill(2)
|
||||
|
||||
|
||||
def format_temp(temp):
|
||||
return (hour['FeelsLikeC']+"°").ljust(3)
|
||||
|
||||
|
||||
def format_chances(hour):
|
||||
chances = {
|
||||
"chanceoffog": "Fog",
|
||||
"chanceoffrost": "Frost",
|
||||
"chanceofovercast": "Overcast",
|
||||
"chanceofrain": "Rain",
|
||||
"chanceofsnow": "Snow",
|
||||
"chanceofsunshine": "Sunshine",
|
||||
"chanceofthunder": "Thunder",
|
||||
"chanceofwindy": "Wind"
|
||||
}
|
||||
|
||||
conditions = []
|
||||
for event in chances.keys():
|
||||
if int(hour[event]) > 0:
|
||||
conditions.append(chances[event]+" "+hour[event]+"%")
|
||||
return ", ".join(conditions)
|
||||
|
||||
|
||||
data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
|
||||
"" + weather['current_condition'][0]['FeelsLikeC']+"°"
|
||||
|
||||
data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n"
|
||||
data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n"
|
||||
data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n"
|
||||
data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
|
||||
data['tooltip'] += f"Location: {weather['nearest_area'][0]['areaName'][0]['value']}\n"
|
||||
for i, day in enumerate(weather['weather']):
|
||||
data['tooltip'] += f"\n<b>"
|
||||
if i == 0:
|
||||
data['tooltip'] += "Today, "
|
||||
if i == 1:
|
||||
data['tooltip'] += "Tomorrow, "
|
||||
data['tooltip'] += f"{day['date']}</b>\n"
|
||||
data['tooltip'] += f"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° "
|
||||
data['tooltip'] += f"🌅 {day['astronomy'][0]['sunrise']} 🌇 {day['astronomy'][0]['sunset']}\n"
|
||||
for hour in day['hourly']:
|
||||
if i == 0:
|
||||
if int(format_time(hour['time'])) < datetime.now().hour-2:
|
||||
continue
|
||||
data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n"
|
||||
|
||||
|
||||
print(json.dumps(data))
|
293
home/.config/waybar/style.css
Normal file
293
home/.config/waybar/style.css
Normal file
|
@ -0,0 +1,293 @@
|
|||
@import '../colors.css';
|
||||
|
||||
|
||||
/* Reset all styles */
|
||||
* {
|
||||
color: @font;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 1 1;
|
||||
font-family:Hack;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.modules-center {
|
||||
background: @bg-light;
|
||||
border-radius: 4;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: alpha(@bg, 0.9);
|
||||
border-radius: 5;
|
||||
/* background-color: rgba(100, 100, 100, 0); */
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
margin-top: 8;
|
||||
padding: 2 2;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: rgba(43, 48, 59, 0.95);
|
||||
border: 1px solid rgba(100, 114, 125, 0.8);
|
||||
border-radius: 7px;
|
||||
border-color: shade(alpha(@borders, 0.9), 2.25);
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: @font;
|
||||
min-height: 0;
|
||||
border-color: shade(alpha(@borders, 0.9), 2.25);
|
||||
padding: 0 7px;
|
||||
margin: 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
border-color: @accent;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background: @aur1;
|
||||
color: @font;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#mode {
|
||||
color: @font;
|
||||
}
|
||||
|
||||
#clock, #custom-power, #battery, #cpu, #memory, #idle_inhibitor, #temperature, #custom-keyboard-layout, #backlight, #network, #pulseaudio, #mode, #custom-pacman {
|
||||
margin-right: 2px;
|
||||
margin-left: 2px;
|
||||
|
||||
background-color: @bg-light;
|
||||
border-radius: 4px;
|
||||
|
||||
padding-left:10px;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding-left: 5px;
|
||||
margin-right: 20px;
|
||||
border-style: hidden;
|
||||
color: @font;
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
border-radius: 4 0 0 4;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: @aur1;
|
||||
background-color: @font;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background: @aur1;
|
||||
color: @font;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#battery.warning:not(.charging) {
|
||||
background: #f53c3c;
|
||||
color: white;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#custom-launcher{
|
||||
background-color: @accent;
|
||||
border-style: hidden;
|
||||
color: @bg-light;
|
||||
font-size: 13px;
|
||||
/* border-radius: 0 4 4 0; */
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: @accent;
|
||||
color: @bg;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
#custom-arrowL0,#custom-arrowR0 {
|
||||
background-color: @bg;
|
||||
/* color: shade(alpha(@borders, 1.0), 2.25); */
|
||||
color: @accent;
|
||||
}
|
||||
|
||||
#mode {
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: @aur1;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: @aur1;
|
||||
}
|
||||
|
||||
#network.disabled {
|
||||
color: @aur1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------
|
||||
*
|
||||
* GAPS
|
||||
*
|
||||
* --------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
* {
|
||||
color: @font;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 0 0;
|
||||
font-family:Hack;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background-color: rgba(100, 100, 100, 0);
|
||||
/* background: shade(alpha(@borders, 0.9), 2.25); */
|
||||
}
|
||||
|
||||
.modules-left,.modules-right,.modules-center {
|
||||
background: alpha(@bg, 0.8);
|
||||
margin-top: 25;
|
||||
margin-left: 25;
|
||||
margin-right: 25;
|
||||
border-radius: 6;
|
||||
padding: 7;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
color: @font;
|
||||
min-height: 0;
|
||||
border-color: shade(alpha(@borders, 0.9), 2.25);
|
||||
padding: 0 7px;
|
||||
margin: 0;
|
||||
border-bottom: 2px solid transparent;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
border-color: #8db0AE;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background: @aur1;
|
||||
color: @font;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#mode {
|
||||
color: @font;
|
||||
}
|
||||
|
||||
#clock, #battery, #cpu, #memory, #idle_inhibitor, #temperature, #custom-keyboard-layout, #backlight, #network, #pulseaudio, #mode, #window, #custom-pacman {
|
||||
margin-right: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Module styles
|
||||
* -------------------------------------------------------------------------- */
|
||||
@keyframes blink {
|
||||
to {
|
||||
color: @aur1;
|
||||
background-color: @font;
|
||||
}
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background: @aur1;
|
||||
color: @font;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
#custom-launcher,#custom-power{
|
||||
font-size: 13px;
|
||||
border-style: hidden;
|
||||
background-color: @accent;
|
||||
font-size: 13px;
|
||||
color: @bg;
|
||||
}
|
||||
|
||||
#custom-power {
|
||||
border-radius: 3;
|
||||
}
|
||||
|
||||
#tray {
|
||||
background-color: @accent;
|
||||
color: #2e3440;
|
||||
padding: 0 5px;
|
||||
border-radius: 3 0 0 3;
|
||||
}
|
||||
|
||||
#custom-arrowL0,#custom-arrowR0 {
|
||||
background-color: @bg;
|
||||
color: @accent;
|
||||
}
|
||||
|
||||
#window{
|
||||
border-style: hidden;
|
||||
}
|
||||
|
||||
#mode{
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
color: @aur1;
|
||||
}
|
||||
|
||||
#temperature.critical {
|
||||
color: @aur1;
|
||||
}
|
||||
|
||||
#network.disabled {
|
||||
color: @aur1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue