switch to waybar and modify theme from opensuse

This commit is contained in:
Morgan McMillian 2022-02-17 08:08:27 -08:00
parent 2658b8602f
commit 0cc1f9f516
6 changed files with 285 additions and 10 deletions

View file

@ -19,8 +19,10 @@ set $term /home/thrrgilag/bin/term
# Note: pass the final command to swaymsg so that the resulting window can be opened # Note: pass the final command to swaymsg so that the resulting window can be opened
# on the original workspace that the command was run on. # on the original workspace that the command was run on.
#set $menu dmenu_path | dmenu | xargs swaymsg exec -- #set $menu dmenu_path | dmenu | xargs swaymsg exec --
set $menu dmenu_path | wofi --show drun --location=2 -i | xargs swaymsg exec -- #set $menu dmenu_path | wofi --show drun --location=2 -i | xargs swaymsg exec --
set $run dmenu_path | wofi --show run --location=2 -i | xargs swaymsg exec -- #set $run dmenu_path | wofi --show run --location=2 -i | xargs swaymsg exec --
set $menu wofi
set $run wofi-emoji
set $background /home/thrrgilag/.background set $background /home/thrrgilag/.background
set $background_lock /home/thrrgilag/.background_lock set $background_lock /home/thrrgilag/.background_lock
@ -225,23 +227,30 @@ bindsym --locked Pause exec playerctl play-pause
# #
# Read `man 5 sway-bar` for more information about this section. # Read `man 5 sway-bar` for more information about this section.
bar { bar {
position top #position top
#swaybar_command waybar swaybar_command waybar
# When the status_command prints a new line to stdout, swaybar updates. # When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time. # The default just shows the current date and time.
#status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done #status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
#status_command while date +'%Y-%m-%d %k:%M'; do sleep 1; done #status_command while date +'%Y-%m-%d %k:%M'; do sleep 1; done
# #
status_command while /home/thrrgilag/bin/statusbar; do sleep 1; done #status_command while /home/thrrgilag/bin/statusbar; do sleep 1; done
colors { #colors {
statusline #ffffff # statusline #ffffff
background #323232 # background #323232
inactive_workspace #32323200 #32323200 #5c5c5c # inactive_workspace #32323200 #32323200 #5c5c5c
} #}
} }
# modified openSUSE theme
default_border pixel 2
gaps inner 5
client.focused #6da741 #173f4f #73ba25
client.unfocused #00a489 #173f4f #35b9ab
client.focused_inactive #6da741 #00a489 #173f4f
# may be linked to ~/dotfiles/.config/sway/laptop # may be linked to ~/dotfiles/.config/sway/laptop
include ~/.config/sway/local include ~/.config/sway/local
include /etc/sway/config.d/* include /etc/sway/config.d/*

136
.config/waybar/config Normal file
View file

@ -0,0 +1,136 @@
{
"layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 30, // Waybar height (to be removed for auto height)
// "width": 1280, // Waybar width
// "gtk-layer-shell": "false",
// Choose the order of the modules
"modules-left": ["tray", "sway/workspaces", "sway/mode", "custom/spotify"],
"modules-center": ["sway/window"],
"modules-right": ["custom/scratchpad-indicator", "network", "cpu", "memory", "temperature", "battery", "pulseaudio", "clock#date", "custom/clock"],
"sway/mode": {
"format": " {}"
},
"sway/workspaces": {
"all-outputs": false,
"disable-scroll": true,
},
"sway/window": {
"max-length": 80,
"tooltip": false
},
"custom/layout": {
"tooltip": false,
"exec": "swaymsg -mrt subscribe '[\"input\"]' | jq -r --unbuffered \"select(.change == \\\"xkb_layout\\\") | .input | select(.type == \\\"keyboard\\\") | .xkb_active_layout_name | .[0:2]\""
},
"custom/zypper": {
"format": "{} ",
"interval": 3600,
"exec": "zypper lu | grep 'v |' | wc -l; echo 'packages to update'",
"exec-if": "exit 0",
"on-click": "exec alacritty -e sudo sh -c 'zypper ref; zypper dup; pkill -SIGRTMIN+8 waybar'",
"signal": 8
},
// Modules configuration
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{:%H:%M}",
"tooltip": false
},
"clock#date": {
"format": "{:%a %d %b w:%V}",
"tooltip": false
},
"custom/clock": {
"format": " {} ",
"exec": "date +'%Y-%m-%d %k:%M'"
},
"cpu": {
"format": "{usage}% ",
"tooltip": false
},
"memory": {
"format": "{}% "
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C {icon}",
"format": "{temperatureC}°C {icon}",
"format-icons": ["", "", ""]
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{icon}",
"format-charging": "",
"format-plugged": "",
"format-alt": "{capacity}% {time}",
"format-icons": ["", "", "", "", ""]
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "",
"format-ethernet": "",
"format-linked": "",
"format-disconnected": "⚠",
"format-alt": "{ifname} {essid} ({signalStrength}%)"
},
"pulseaudio": {
"format": "{icon}",
"format-alt": "{volume} {icon}",
"format-alt-click": "click-right",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"scroll-step": 10,
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pavucontrol",
"tooltip": false
},
"custom/scratchpad-indicator": {
"interval": 3,
"return-type": "json",
"exec": "swaymsg -t get_tree | jq --unbuffered --compact-output '(recurse(.nodes[]) | select(.name == \"__i3_scratch\") | .focus) as $scratch_ids | [.. | (.nodes? + .floating_nodes?) // empty | .[] | select(.id |IN($scratch_ids[]))] as $scratch_nodes | if ($scratch_nodes|length) > 0 then { text: \"\\($scratch_nodes | length)\", tooltip: $scratch_nodes | map(\"\\(.app_id // .window_properties.class) (\\(.id)): \\(.name)\") | join(\"\\n\") } else empty end'",
"format": "{} 🗗",
"on-click": "exec swaymsg 'scratchpad show'",
"on-click-right": "exec swaymsg 'move scratchpad'"
},
"custom/weather": {
"exec": "curl 'https://wttr.in/?format=1'",
"interval": 3600
},
"custom/spotify": {
"exec": "$HOME/.config/waybar/spotify.sh",
"interval": 1
}
}

21
.config/waybar/spotify.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/bash
MCLASS=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
MICON="🎵"
if [[ $MCLASS == "playing" ]]; then
MINFO=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
if [[ ${#MINFO} > 35 ]];
then
MINFO=$(echo $MINFO | cut -c1-35)"..."
fi
MTEXT=$MICON" "$MINFO" "
elif [[ $class == "paused" ]];
then
MTEXT=$MICON" (paused) "
elif [[ $class == "stopped" ]];
then
MTEXT=""
fi
printf "$MTEXT"

73
.config/waybar/style.css Normal file
View file

@ -0,0 +1,73 @@
* {
border: none;
border-radius: 0;
font-family: "FiraCode NF";
font-size: 16px;
box-shadow: none;
text-shadow: none;
transition-duration: 0s;
}
window#waybar {
color: rgba(53, 185, 171, 1);
background-color: rgba(23, 63, 79, 0.4);
border-bottom: 2px solid rgba(53, 185, 171, 0.4);
}
window#waybar.solo {
color: rgba(53, 185, 171, 1);
}
#workspaces {
margin: 0 5px;
}
#workspaces button {
padding: 0 5px;
color: rgba(53, 185, 171, 1);
}
#workspaces button.focused {
color: rgba(115, 186, 37, 1);
}
#workspaces button.visible {
color: rgba(115, 186, 37, 1);
}
#workspaces button.urgent {
color: rgba(33, 164, 223, 1);
}
#mode,
#battery,
#cpu,
#memory,
#network,
#pulseaudio,
#idle_inhibitor,
#temperature,
#custom-layout,
#backlight {
font-family: "Source Sans Pro";
font-size: 15px;
margin: 0px 6px 0px 10px;
/* min-width: 30px;*/
}
#clock {
margin: 0px 6px 0px 10px;
}
#battery.warning {
color: rgba(255, 210, 4, 1);
}
#battery.critical {
color: rgba(238, 46, 36, 1);
}
#battery.charging {
color: rgba(217, 216, 216, 1);
}

4
.config/wofi/config Normal file
View file

@ -0,0 +1,4 @@
width=800
height=400
insensitive=true
mode=drun,run

32
.config/wofi/style.css Normal file
View file

@ -0,0 +1,32 @@
/* https://cloudninja.pw/docs/wofi.html */
window {
border: 2px solid black;
background-color: rgba(23, 63, 79, 0.8);
}
#input {
color: rgba(115, 186, 37, 1);
border: 2px solid black;
background-color: rgba(53, 185, 171, 0.3);
font-size: 18px;
}
#outer-box {
margin: 10px;
}
#scroll {
margin: 5px 0px;
font-size: 16px;
color: #35b9ab;
}
#scroll label {
margin: 2px 0px;
}
#entry:selected {
color: rgba(115, 186, 37, 1);
background-color: rgba(53, 185, 171, 0.3);
}