My Linux dotfiles
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(river): update bindings and init script

Fix layout shortcut formatting, simplify the init script, and adjust window rules.

+16 -31
+1 -7
river/init
··· 1 1 #!/bin/sh 2 2 3 - compile() { 4 - notify-send -t 1000 "Compiling config..." 5 - cargo build --release 6 - notify-send -t 1000 "Compiled!" 7 - } 8 - 9 3 cd "$(dirname "$0")" || exit 1 10 - [ "$1" == "compile" ] && compile 4 + cargo build --release 11 5 exec "./target/release/river-config"
-3
river/src/autostart.rs
··· 1 1 use crate::riverctl::spawn; 2 2 use anyhow::Result; 3 - use std::env; 4 3 use std::fs; 5 4 use std::path::Path; 6 5 7 6 pub fn run() -> Result<()> { 8 7 let lockfile = "/tmp/river-autostart.lock"; 9 - 10 - env::set_current_dir(env::home_dir().expect("wtf is home directory?"))?; 11 8 12 9 if !Path::new(lockfile).exists() { 13 10 fs::File::create(lockfile)?;
+1 -4
river/src/binds.rs
··· 111 111 112 112 // System 113 113 bind!(MOD, "B", "spawn", "pkill -USR1 waybar"); 114 - bind!(MOD, "R", "spawn", &format!("sh -c '{}/init compile'", cfg)); 114 + bind!(MOD, "R", "spawn", &format!("{}/init", cfg)); 115 115 116 116 // Voxtype 117 117 bind!(MOD, "V", "spawn", "voxtype record start"); ··· 128 128 // Notifications 129 129 bind!(mod_shift, "D", "spawn", "makoctl dismiss"); 130 130 bind!(mod_shift, "R", "spawn", "makoctl restore"); 131 - 132 - // Open dolphin in the ~/Shared/ folder 133 - bind!(MOD, "T", "spawn", "dolphin ~/Shared"); 134 131 135 132 // Media Controls 136 133 let media_keys = [
+12 -12
river/src/layout.rs
··· 8 8 riverctl(&["default-layout", "wideriver"])?; 9 9 10 10 // Ignore error if pkill fails (e.g. process not found) 11 - _ = run_cmd("pkill wideriver"); 11 + let _ = run_cmd("pkill wideriver"); 12 12 13 13 let focused_color = colors.get_hex("color10"); 14 14 let unfocused_color = colors.get_hex("color0"); ··· 40 40 41 41 // Layout binds 42 42 let cmds = [ 43 - ("up", "--layout monocle"), 44 - ("down", "--layout wide"), 45 - ("left", "--layout left"), 46 - ("right", "--layout right"), 47 - ("M", "--layout-toggle"), 48 - ("L", "--ratio +0.025"), 49 - ("H", "--ratio -0.025"), 50 - ("E", "--stack even"), 51 - ("W", "--stack dwindle"), 52 - ("I", "--stack diminish"), 43 + (format!("{}+up", MOD), "--layout monocle"), 44 + (format!("{}+down", MOD), "--layout wide"), 45 + (format!("{}+left", MOD), "--layout left"), 46 + (format!("{}+right", MOD), "--layout right"), 47 + (format!("{}+M", MOD), "--layout-toggle"), 48 + (format!("{}+L", MOD), "--ratio +0.025"), 49 + (format!("{}+H", MOD), "--ratio -0.025"), 50 + (format!("{}+E", MOD), "--stack even"), 51 + (format!("{}+W", MOD), "--stack dwindle"), 52 + (format!("{}+I", MOD), "--stack diminish"), 53 53 ]; 54 54 55 55 for (combo, arg) in cmds { 56 - riverctl(&["map", "normal", MOD, combo, "send-layout-cmd", "wideriver", arg])?; 56 + riverctl(&["map", "normal", &combo, "send-layout-cmd", "wideriver", arg])?; 57 57 } 58 58 59 59 Ok(())
+1 -1
river/src/main.rs
··· 11 11 use wal::WalColors; 12 12 13 13 fn main() -> Result<()> { 14 + autostart::run()?; 14 15 input::run()?; 15 16 rules::run()?; 16 17 binds::run()?; 17 18 layout::run(&load_pywal_colors())?; 18 - autostart::run()?; 19 19 20 20 Ok(()) 21 21 }
+1 -4
river/src/rules.rs
··· 2 2 use anyhow::Result; 3 3 4 4 pub fn run() -> Result<()> { 5 - riverctl(&["rule-add", "-app-id", "zen-beta", "tags", "1"])?; 6 - riverctl(&["rule-add", "-app-id", "zen-beta", "csd"])?; 7 - riverctl(&["rule-add", "-app-id", "Spotify", "tags", &(1 << 4).to_string()])?; 8 - riverctl(&["rule-add", "-app-id", "vesktop", "tags", &(1 << 3).to_string()])?; 5 + riverctl(&["rule-add", "-app-id", "zen", "tags", "1"])?; 9 6 Ok(()) 10 7 }