Add pinnacle to default config dir, fix windows on udev

This commit is contained in:
Ottatop 2023-08-14 21:01:00 -05:00
parent 73d1916403
commit 3623df002b
2 changed files with 12 additions and 4 deletions

View file

@ -59,7 +59,7 @@ impl<B: Backend> State<B> {
state.focused_tags().next().cloned().map(|tag| tag.layout())
}) else { return };
let (windows_on_foc_tags, windows_not_on_foc_tags): (Vec<_>, _) =
let (windows_on_foc_tags, mut windows_not_on_foc_tags): (Vec<_>, _) =
output.with_state(|state| {
let focused_tags = state.focused_tags().collect::<Vec<_>>();
self.windows.iter().cloned().partition(|win| {
@ -67,6 +67,8 @@ impl<B: Backend> State<B> {
})
});
windows_not_on_foc_tags.retain(|win| win.output(self) == Some(output.clone()));
let tiled_windows = windows_on_foc_tags
.iter()
.filter(|win| {

View file

@ -351,9 +351,15 @@ impl<B: Backend> State<B> {
fn start_config() -> Result<(), Box<dyn std::error::Error>> {
let config_dir = {
let config_dir = std::env::var("PINNACLE_CONFIG_DIR")
.or_else(|_| std::env::var("XDG_CONFIG_HOME"))
.unwrap_or("~/.config".to_string());
let config_dir = std::env::var("PINNACLE_CONFIG_DIR").unwrap_or_else(|_| {
let default_config_dir =
std::env::var("XDG_CONFIG_HOME").unwrap_or("~/.config".to_string());
PathBuf::from(default_config_dir)
.join("pinnacle")
.to_string_lossy()
.to_string()
});
PathBuf::from(shellexpand::tilde(&config_dir).to_string())
};