radio: files: Add river and waybar configurations

impermanence
Luis Guilherme Coelho 2024-03-10 13:06:27 -03:00
parent e7dbe3df9d
commit 727d21b917
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
3 changed files with 565 additions and 0 deletions

View File

@ -0,0 +1,200 @@
#!/bin/sh
# Set up keyboard layout
riverctl keyboard-layout\
-options grp:menu_switch,parens:swap_brackets,caps:swapescape \
us,br
# close the focused view
riverctl map normal Super q close
# spawn $TERMINAL
riverctl map normal Super Return spawn foot
# spawn $EDITOR
riverctl map normal Super e spawn "foot -e $EDITOR"
# audio
# status bar
riverctl spawn waybar
# browser
riverctl map normal Super B spawn $BROWSER
# notifications
riverctl spawn fnott
# go to last tag
riverctl map normal Super Escape focus-previous-tags
# application launcher
riverctl map normal Super Semicolon spawn fuzzel
# wallpaper
riverctl spawn "swaybg -i ~/media/pictures/wallpapers/wall.png"
# grab videos from clipboard
riverctl map normal Super V spawn "wl-paste | xargs vid"
riverctl map normal Super+Shift V spawn "wl-paste | xargs vd"
# screenshot
riverctl map normal Printscreen \
spawn "grim ~/media/pictures/screenshots/$(date +'%Y-%m-%d--%H-%M-%S.png')"
# lock screen
riverctl map normal Super+Shift S \
spawn "swaylock -k -i ~/media/pictures/wallpapers/lockscreen"
# toggle monocle layout
riverctl map normal Super M send-layout-cmd rivercarro "main-location monocle"
riverctl map normal Super T send-layout-cmd rivercarro "main-location left"
# Super+J and Super+K to focus the next/previous view in the layout stack
riverctl map normal Super Tab focus-view next
riverctl map normal Super+Shift Tab focus-view previous
# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous
# view in the layout stack
riverctl map normal Super+Shift J swap next
riverctl map normal Super+Shift K swap previous
# Super+Period and Super+Comma to focus the next/previous output
riverctl map normal Super Period focus-output next
riverctl map normal Super Comma focus-output previous
# Super+Shift+{Period,Comma} to send the focused view to the next/previous output
riverctl map normal Super+Shift Period send-to-output next
riverctl map normal Super+Shift Comma send-to-output previous
# Super+Return to bump the focused view to the top of the layout stack
#riverctl map normal Super Return zoom
# Super+H and Super+L to decrease/increase the main ratio of rivercarro(1)
riverctl map normal Super H send-layout-cmd rivercarro "main-ratio -0.05"
riverctl map normal Super L send-layout-cmd rivercarro "main-ratio +0.05"
# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivercarro(1)
riverctl map normal Super+Shift H send-layout-cmd rivercarro "main-count +1"
riverctl map normal Super+Shift L send-layout-cmd rivercarro "main-count -1"
# Super+Alt+{H,J,K,L} to move views
riverctl map -repeat normal Super+Shift H move left 10
riverctl map -repeat normal Super+Shift J move down 10
riverctl map -repeat normal Super+Shift K move up 10
riverctl map -repeat normal Super+Shift L move right 10
# Super+Alt+Control+{H,J,K,L} to snap views to screen edges
riverctl map normal Super+Alt+Control H snap left
riverctl map normal Super+Alt+Control J snap down
riverctl map normal Super+Alt+Control K snap up
riverctl map normal Super+Alt+Control L snap right
# Super+Alt+Shift+{H,J,K,L} to resize views
riverctl map -repeat normal Super+Alt H resize horizontal -10
riverctl map -repeat normal Super+Alt J resize vertical 10
riverctl map -repeat normal Super+Alt K resize vertical -10
riverctl map -repeat normal Super+Alt L resize horizontal 10
# Super + Left Mouse Button to move views
riverctl map-pointer normal Super BTN_LEFT move-view
# Super + Right Mouse Button to resize views
riverctl map-pointer normal Super BTN_RIGHT resize-view
# Super + Middle Mouse Button to toggle float
riverctl map-pointer normal Super BTN_MIDDLE toggle-float
for i in $(seq 1 9)
do
tags=$((1 << ($i - 1)))
# Super+[1-9] to focus tag [0-8]
riverctl map normal Super $i set-focused-tags $tags
# Super+Shift+[1-9] to tag focused view with tag [0-8]
riverctl map normal Super+Shift $i set-view-tags $tags
# Super+Control+[1-9] to toggle focus of tag [0-8]
riverctl map normal Super+Control $i toggle-focused-tags $tags
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
done
# Super+0 to focus all tags
# Super+Shift+0 to tag focused view with all tags
all_tags=$(((1 << 32) - 1))
riverctl map normal Super 0 set-focused-tags $all_tags
riverctl map normal Super+Shift 0 set-view-tags $all_tags
# Super+Space to toggle float
riverctl map normal Super Space toggle-float
# Super+F to toggle fullscreen
riverctl map normal Super F toggle-fullscreen
# Declare a passthrough mode. This mode has only a single mapping to return to
# normal mode. This makes it useful for testing a nested wayland compositor
riverctl declare-mode passthrough
# Super+F11 to enter passthrough mode
riverctl map normal Super F11 enter-mode passthrough
# Super+F11 to return to normal mode
riverctl map passthrough Super F11 enter-mode normal
# Various media key mapping examples for both normal and locked mode which do
# not have a modifier
for mode in normal locked
do
# Eject the optical drive (well if you still have one that is)
riverctl map $mode None XF86Eject spawn 'eject -T'
# # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer)
# riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer --allow-boost -i 5'
# riverctl map $mode Shift XF86AudioRaiseVolume spawn 'pamixer --allow-boost -i 10'
# riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer --allow-boost -d 5'
# riverctl map $mode Shift XF86AudioLowerVolume spawn 'pamixer --allow-boost -d 10'
# riverctl map $mode None XF86AudioMute spawn 'pamixer -t'
# riverctl map $mode None XF86AudioMicMute spawn 'pamixer -t --source 4'
# one day pipewire wil work...
riverctl map $mode None XF86AudioRaiseVolume spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 5%+'
riverctl map $mode Shift XF86AudioRaiseVolume spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 10%+'
riverctl map $mode None XF86AudioLowerVolume spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 5%-'
riverctl map $mode Shift XF86AudioLowerVolume spawn 'wpctl set-volume -l 2.0 @DEFAULT_AUDIO_SINK@ 10%-'
riverctl map $mode None XF86AudioMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'
riverctl map $mode None XF86AudioMicMute spawn 'wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle'
# control mpv playlist listening on socket /tmp/mpv-socket
riverctl map $mode Super XF86AudioLowerVolume spawn "echo '{ \"command\": [\"keypress\", \"<\"] }' | socat - /tmp/mpv-socket"
riverctl map $mode Super XF86AudioRaiseVolume spawn "echo '{ \"command\": [\"keypress\", \">\"] }' | socat - /tmp/mpv-socket"
riverctl map $mode Super XF86AudioMute spawn "echo '{ \"command\": [\"keypress\", \"p\"] }' | socat - /tmp/mpv-socket"
riverctl map $mode Super A spawn "echo '{ \"command\": [\"keypress\", \"N\"] }' | socat - /tmp/mpv-socket"
# Control screen backlight brightness with light (https://github.com/haikarainen/light)
riverctl map $mode None XF86MonBrightnessUp spawn 'brightnessctl set +5%'
riverctl map $mode Shift XF86MonBrightnessUp spawn 'brightnessctl set +10%'
riverctl map $mode None XF86MonBrightnessDown spawn 'brightnessctl set 5%-'
riverctl map $mode Shift XF86MonBrightnessDown spawn 'brightnessctl set 10%-'
done
# Set background and border color
riverctl border-color-focused 0x8581e0
riverctl border-color-unfocused 0x313131
riverctl border-width 1
# Set keyboard repeat rate
riverctl set-repeat 50 300
# Make all views with an app-id that starts with "float" and title "foo" start floating.
riverctl rule-add -title 'Telegram Desktop' float
# Make all views with app-id "bar" and any title use client-side decorations
riverctl rule-add -app-id "bar" csd
# Set the default layout generator to be rivercarro and start it.
# River will send the process group of the init executable SIGTERM on exit.
riverctl default-layout rivercarro
rivercarro -inner-gaps 10 -outer-gaps 10 -no-smart-gaps &

View File

@ -0,0 +1,122 @@
{
// "layer": "bottom", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right)
"spacing": 0, // Gaps between modules (4px)
// Choose the order of the modules
"modules-left": ["river/tags", "river/window"],
"modules-right": ["custom/arrow1", "custom/net-up-icon", "network#up",
"custom/net-down-icon", "network#down",
"custom/arrow2", "custom/mem-icon", "memory",
"custom/arrow1", "custom/cpu-icon", "cpu",
"custom/arrow2", "custom/temp-icon", "temperature",
"custom/arrow1", "custom/wireplumber-icon", "wireplumber",
"custom/arrow2", "custom/bat-icon", "battery",
"custom/arrow1", "clock",
"custom/arrow2", "tray"],
// Modules configuration
"river/tags": {
"tag-labels": ["α", "β", "γ", "δ", "ε", "ζ", "η"]
},
"river/window": {
"format": "ICON {}",
"max-length": 75,
"tooltip": false
},
"tray": {
"spacing": 10,
"tooltip": false
},
"clock": {
"format": "{:%r}",
"interval": 1,
"tooltip-format": "<tt><big>{calendar}</big></tt>",
"format-alt": "{:%Y-%m-%d}"
},
"cpu": {
"format": "{usage}%",
"tooltip": false
},
"custom/cpu-icon": {
"format": " ",
"tooltip": false
},
"memory": {
"format": "{used}Gb",
"tooltip": false
},
"custom/mem-icon": {
"format": " ",
"tooltip": false
},
"temperature": {
"format": "{temperatureC}°C",
"tooltip": false
},
"custom/temp-icon": {
"format": " ",
"tooltip": false
},
"battery": {
"states": {
"full": 100,
"good": 95,
"critical": 20
},
"tooltip": false,
"format": "{capacity}%",
},
"custom/bat-icon": {
"format": " ",
"tooltip": false
},
"network#down": {
"format-wifi": "{bandwidthDownBytes}",
"tooltip": false,
},
"custom/net-down-icon": {
"format": " ",
"tooltip": false
},
"network#up": {
"format-wifi": "{bandwidthUpBytes}",
"tooltip": false,
},
"custom/net-up-icon": {
"format": " ",
"tooltip": false
},
"wireplumber": {
"format": "{volume}%",
"tooltip": false
},
"custom/wireplumber-icon": {
"format": " ",
"tooltip": false
},
"keyboard-state": {
"capslock": true,
"format": "{name} {icon}",
"format-icons": {
"locked": "",
"unlocked": ""
}
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"custom/arrow1": {
"format": "",
"tooltip": false
},
"custom/arrow2": {
"format": "",
"tooltip": false
},
}

View File

@ -0,0 +1,243 @@
/* Colors (anemofilia) */
@define-color black #1A1A1A;
@define-color blue #8581E0;
@define-color gray #313131;
@define-color white #DDDDDD;
@define-color mode @black;
@define-color normal-bg @black;
@define-color normal-fg @white;
@define-color focused-bg @gray;
@define-color focused-fg @blue;
@define-color sound @gray;
@define-color network @black;
@define-color memory @gray;
@define-color cpu @black;
@define-color temp @gray;
@define-color layout @black;
@define-color battery @gray;
@define-color date @black;
@define-color time @black;
* {
border: none;
border-radius: 0;
font-family: Meslo LG M DZ, JuliaMono, Noto;
font-size: 12px;
min-height: 0;
margin: 0;
padding: 0;
box-shadow: none;
text-shadow: none;
icon-shadow: none;
}
window#waybar {
background: @normal-bg;
color: @white;
}
tooltip {
background: rgba(43, 48, 59, 0.8);
border: 1px solid rgba(100, 114, 125, 0.8);
}
tooltip label {
color: white;
}
#tags button {
color: @gray;
background: transparent;
padding-left: 4px;
padding-right: 4px;
padding-top: 1px;
padding-bottom: 1px;
min-height: 0;
min-width: 0;
}
#tags button:not(.focused):not(.occupied) {
border-top: 2px solid transparent;
color: @normal-fg;
background: @normal-bg;
}
#tags button:not(.occupied).focused {
border-top: 2px solid transparent;
color: @focused-fg;
background: @focused-bg;
}
#tags button:not(.focused).occupied {
border-top: 2px solid @normal-fg;
color: @normal-fg;
background: @normal-bg;
}
#tags button.occupied.focused {
border-top: 2px solid @focused-fg;
color: @focused-fg;
background: @focused-bg;
}
#tags button:hover {
box-shadow: inherit;
text-shadow: inherit;
background: @black;
color: @white;
}
#window {
margin-left: 3px;
margin-right: 3px;
background: @normal-bg;
}
#pulseaudio,#wireplumber,#network,#cpu,#memory,#backlight,#battery,#clock, #custom-arrow1, #custom-arrow2 {
padding-left: 5px;
}
#wireplumber {
background: @focused-bg;
}
#wireplumber.muted {
background: @focused-bg;
}
#pulseaudio {
background: @focused-bg;
}
#pulseaudio.muted {
background: @focused-bg;
}
#network.wifi {
background: @focused-bg;
}
#network.disconnected {
background: @focused-bg;
}
#cpu {
background: @focused-bg;
}
#temperature {
background: @normal-bg;
}
#memory {
background: @normal-bg;
}
#battery.full {
background: @normal-bg;
}
#battery.good {
background: @normal-bg;
}
#battery.critical {
background: @normal-bg;
}
#clock {
background: @focused-bg;
}
#tray {
background: @normal-bg;
}
@keyframes blink {
to {
background-color: #ffffff;
color: black;
}
}
#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;
}
tooltip {
font-family: Meslo LG M DZ, JuliaMono, Noto;
font-size: 11px;
background-color: @black;
text-shadow: none;
}
tooltip * {
font-family: Meslo LG M DZ, JuliaMono, Noto;
font-size: 11px;
background-color: @black;
text-shadow: none;
}
#custom-arrow1 {
font-size: 13pt;
color: @focused-bg;
background: @normal-bg;
}
#custom-arrow2 {
font-size: 13pt;
color: @normal-bg;
background: @focused-bg;
}
/* #taskbar */
#taskbar button {
color: @normal-fg;
background: @normal-bg;
}
#taskbar button.active {
color: @focused-fg;
background: @normal-bg;
}
/* #taskbar button.minimized
#taskbar button.maximized
#taskbar button.fullscreen
#taskbar.empty */
#custom-net-up-icon {
background: @focused-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/net_up.png");
}
#custom-net-down-icon {
background: @focused-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/net_down.png");
}
#custom-mem-icon {
background: @normal-bg;
background-color: @normal-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/mem.png");
}
#custom-bat-icon {
background: @normal-bg;
background-color: @normal-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/battery_100.png");
}
#custom-cpu-icon {
background: @focused-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/cpu.png");
}
#custom-temp-icon {
background: @normal-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/temp.png");
}
#custom-wireplumber-icon {
background: @focused-bg;
background-image: url("/home/radio/areas/code/scm/zero/home-environments/radio/files/.config/awesome/icons/vol_low.png");
}