This commit is contained in:
Varris 2023-08-30 21:23:45 +02:00
parent 5a60fdb534
commit 2748a440c9
17 changed files with 340 additions and 359 deletions

View File

@ -1,13 +1,12 @@
{ pkgs, ... }:
{
programs.steam.enable = true;
chaotic.steam.extraCompatPackages = with pkgs; [ luxtorpeda proton-ge-custom ];
programs = {
dconf.enable = true;
hyprland.enable = true;
fish.enable = true;
hyprland.enable = true;
kdeconnect.enable = true;
ssh.startAgent = true;
steam.enable = true;
};
chaotic.steam.extraCompatPackages = with pkgs; [ luxtorpeda proton-ge-custom ];
}

View File

@ -8,6 +8,7 @@ require("plugins.dressing")
require("plugins.lspconfig")
require("plugins.lualine")
require("plugins.smartsplits")
require("plugins.surround")
require("plugins.telescope")
require("plugins.treesitter")
require("plugins.trouble")

View File

@ -1,3 +1,4 @@
require("nvim-treesitter.configs").setup({
require("nvim-treesitter.configs").setup {
highlight = { enable = true },
})
indent = { enable = true },
}

View File

@ -8,7 +8,7 @@ vim.o.smartindent = true
vim.o.background = "dark"
vim.o.clipboard = "unnamedplus"
vim.o.mouse = ""
-- vim.o.mouse = ""
vim.o.termguicolors = true
vim.o.ignorecase = true
vim.o.smartcase = true

View File

@ -1,166 +0,0 @@
{ pkgs, ... }:
let
inherit (import ./scripts.nix { inherit pkgs; }) workspaces mpd-current-song get-volume;
in
{
eww-config = ''
;; ----------------------------- right monitor
(defwidget bar0 []
(centerbox
:class "bar"
:orientation "h"
(left_side0)
(center)
(right_side)
)
)
(defwidget left_side0 []
(box
:space-evenly false
:orientation "h"
:spacing 5
(box
:class "wswidget"
:spacing 0
(workspaces0)
)
(box
:class "window"
window0)
)
)
;; ----------------------------- left monitor
(defwidget bar1 []
(centerbox
:class "bar"
:orientation "h"
(left_side1)
(center)
(right_side)
)
)
(defwidget left_side1 []
(box
:space-evenly false
:orientation "h"
:spacing 5
(box
:class "wswidget"
:spacing 0
(workspaces1)
)
(box
:class "window"
window1)
)
)
;; -----------------------------
(defwidget center []
(box
:space-evenly false
:spacing 5
(eventbox
:onscroll "pamixer `echo {} | sed 's/up/\-i/\' | sed 's/down/\-d/'` 10"
(box
:space-evenly false
:class "volume"
volume))
(eventbox
:onclick "${pkgs.mpc-cli}/bin/mpc toggle"
(box
:class "mpd"
mpd))
)
)
(defwidget right_side []
(box
:space-evenly false
:spacing 5
:halign "end"
(box
:space-evenly false
:orientation "h"
:class "date"
date)
)
)
;; ---------------------------- workspace widget
(deflisten workspace0
"${workspaces}/bin/workspaces.sh 0")
(defwidget workspaces0 []
(literal :content workspace0))
(deflisten workspace1
"${workspaces}/bin/workspaces.sh 1")
(defwidget workspaces1 []
(literal :content workspace1))
;; ---------------------------- window widget
(deflisten window0 "${pkgs.eww-hyprland-activewindow}/bin/hyprland-activewindow `hyprctl monitors -j | jq -r \".[0].name\"`")
(deflisten window1 "${pkgs.eww-hyprland-activewindow}/bin/hyprland-activewindow `hyprctl monitors -j | jq -r \".[1].name\"`")
(defwidget title0 []
(label :text "''${window0}"))
(defwidget title1 []
(label :text "''${window1}"))
;; -----------------------------
(defpoll volume
:initial ""
:interval "0.1s"
"${get-volume}/bin/get_volume.sh")
(deflisten mpd
:initial ""
"${mpd-current-song}/bin/mpd_current_song.sh")
(defpoll date
:interval "1s"
"date '+%a %d, %B %H:%M'")
(defwindow bar0
:monitor 0
:windowtype "dock"
:geometry
(geometry :x "0%"
:y "0%"
:width "100%"
:height "32px"
:anchor "top center")
:exclusive true
(bar0))
(defwindow bar1
:monitor 1
:windowtype "dock"
:geometry
(geometry :x "0%"
:y "0%"
:width "100%"
:height "32px"
:anchor "top center")
:exclusive true
(bar1))
'';
}

View File

@ -0,0 +1,8 @@
@import "panel/eww.scss";
* {
all: unset;
font-family: "JetBrainsMono Nerd Font";
font-size: 12px;
};

View File

@ -0,0 +1 @@
(include "panel/eww.yuck")

View File

@ -0,0 +1,83 @@
$bg: rgba(40,40,40,0.8);
$fg: rgb(235,219,178);
$wsfg: rgb(235,219,178);
$wsbg: rgb(60,56,54);
$activewsbg: rgb(102,92,84);
$box-bg: rgb(80,73,69);
//Global Styles
.bar {
background-color: $bg;
color: $fg;
}
.window {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 0px 5px 10px;
}
.volume {
background-color: $box-bg;
border-radius: 10px 0px 0px 10px;
margin: 5px 0px 5px 0px;
padding: 0px 10px 0px 10px;
}
.mpd {
background-color: $box-bg;
border-radius: 0px 10px 10px 0px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.tray {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.date {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.wswidget {
background-color: $box-bg;
// border-radius: 10px;
margin: 5px 0px 5px 10px;
}
.w0, .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09, .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 {
background-color: $wsbg;
padding: 3px 10px;
}
.w01, .w011, .w04, .w044 {
background-color: $wsbg;
// border-radius: 10px 0px 0px 10px;
}
.w03, .w033, .w06, .w066 {
background-color: $wsbg;
// border-radius: 0px 10px 10px 0px;
}
/* Occupied */
.w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09 {
background-color: $wsbg;
}
/* Focused */
.w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 {
background-color: $activewsbg;
}

View File

@ -0,0 +1,153 @@
;; ----------------------------- right monitor
(defwidget bar0 []
(centerbox
:class "bar"
:orientation "h"
(left_side0)
(center)
(right_side)
))
(defwidget left_side0 []
(box
:space-evenly false
:orientation "h"
:spacing 5
(box
:class "wswidget"
:spacing 0
(workspaces0))
(box
:class { window0 != "" ? "window" : "" }
window0)
))
;; ----------------------------- left monitor
(defwidget bar1 []
(centerbox
:class "bar"
:orientation "h"
(left_side1)
(center)
(right_side)
))
(defwidget left_side1 []
(box
:space-evenly false
:orientation "h"
:spacing 5
(box
:class "wswidget"
:spacing 0
(workspaces1))
(box
:class { window1 != "" ? "window" : "" }
window1)
))
;; -----------------------------
(defwidget center []
(box
:space-evenly false
:spacing 5
(eventbox
:onscroll "pamixer `echo {} | sed 's/up/\-i/\' | sed 's/down/\-d/'` 10"
(box
:space-evenly false
:class "volume"
volume))
(eventbox
:onclick "mpc toggle"
(box
:class "mpd"
mpd))
)
)
(defwidget right_side []
(box
:space-evenly false
:spacing 5
:halign "end"
(box
:space-evenly false
:orientation "h"
:class "date"
date)
)
)
;; ---------------------------- workspace widget
(deflisten workspace0
"scripts/workspaces.sh 0")
(defwidget workspaces0 []
(literal :content workspace0))
(deflisten workspace1
"scripts/workspaces.sh 1")
(defwidget workspaces1 []
(literal :content workspace1))
;; ---------------------------- window widget
(deflisten window0 "hyprland-activewindow `hyprctl monitors -j | jq -r \".[0].name\"`")
(deflisten window1 "hyprland-activewindow `hyprctl monitors -j | jq -r \".[1].name\"`")
(defwidget title0 []
(label :text "''${window0}"))
(defwidget title1 []
(label :text "''${window1}"))
;; -----------------------------
(defpoll volume
:initial ""
:interval "0.5s"
"scripts/get-volume.sh")
(deflisten mpd
:initial ""
"scripts/mpd-current-song.sh")
(defpoll date
:interval "10s"
"date '+%a %d, %B %H:%M'")
(defwindow bar0
:monitor 0
:windowtype "dock"
:geometry
(geometry :x "0%"
:y "0%"
:width "100%"
:height "32px"
:anchor "top center")
:exclusive true
(bar0))
(defwindow bar1
:monitor 1
:windowtype "dock"
:geometry
(geometry :x "0%"
:y "0%"
:width "100%"
:height "32px"
:anchor "top center")
:exclusive true
(bar1))

View File

@ -0,0 +1,16 @@
#!/usr/bin/env cached-nix-shell
#! nix-shell -i bash -p pulsemixer
#
volume=$(pamixer --get-volume)
if [[ $volume -eq 0 ]]; then
echo "$volume%"
elif [[ $volume -lt 25 ]]; then
echo "$volume%"
elif [[ $volume -lt 50 ]]; then
echo "$volume%"
elif [[ $volume -lt 75 ]]; then
echo "󰕾 $volume%"
else
echo "$volume%"
fi

View File

@ -0,0 +1,20 @@
#!/usr/bin/env cached-nix-shell
#! nix-shell -i bash -p mpc-cli
currentsong=""
state=""
while true; do
state="$(mpc status %state%)"
current_song="$(mpc current)"
if [[ $state == "playing" ]]; then
echo "$current_song"
elif [[ $state == "paused" && $current_song ]]; then
echo "󰏤 $current_song"
else
echo " stopped"
fi
mpc idle player &> /dev/null
done

View File

@ -0,0 +1,43 @@
#!/usr/bin/env cached-nix-shell
#! nix-shell -i bash -p hyprland socat jq
workspaces() {
unset -v \
o1 o2 o3 o4 o5 o6 \
f1 f2 f3 f4 f5 f6
ows="$(hyprctl workspaces -j | jq '.[] | del(select(.id == -99)) | .id')"
for num in $ows; do
export o"$num"="$num"
done
# Get Focused workspace for current monitor ID
arg="$1"
num="$(hyprctl monitors -j | jq --argjson arg "$arg" '.[] | select(.id == $arg).activeWorkspace.id')"
export f"$num"="$num"
if [[ $arg -eq 0 ]]; then
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \
(button :onclick \"hyprctl dispatch workspace 1\" :class \"w0$o1$f1\" \"1\") \
(button :onclick \"hyprctl dispatch workspace 2\" :class \"w0$o2$f2\" \"2\") \
(button :onclick \"hyprctl dispatch workspace 3\" :class \"w0$o3$f3\" \"3\") \
)\
)"
elif [[ $arg -eq 1 ]]; then
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \
(button :onclick \"hyprctl dispatch workspace 4\" :class \"w0$o4$f4\" \"4\") \
(button :onclick \"hyprctl dispatch workspace 5\" :class \"w0$o5$f5\" \"5\") \
(button :onclick \"hyprctl dispatch workspace 6\" :class \"w0$o6$f6\" \"6\") \
)\
)"
fi
}
workspaces $1
socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r; do
workspaces $1
done

View File

@ -1,14 +1,10 @@
{ pkgs, ... }:
let
inherit (import ./config.nix { inherit pkgs; }) eww-config;
inherit (import ./stylesheet.nix) eww-stylesheet;
in
{
home.packages = [ pkgs.eww-wayland ];
xdg.configFile."eww/eww.yuck".text = "${eww-config}";
xdg.configFile."eww/eww.scss".text = "${eww-stylesheet}";
programs.eww = {
enable = true;
package = pkgs.eww-wayland;
configDir = ./config;
};
home.packages = [ pkgs.eww-hyprland-activewindow ];
}

View File

@ -1,80 +0,0 @@
{ pkgs, ... }:
{
workspaces = pkgs.writeShellScriptBin "workspaces.sh" ''
workspaces() {
unset -v \
o1 o2 o3 o4 o5 o6 \
f1 f2 f3 f4 f5 f6
ows="$(${pkgs.hyprland}/bin/hyprctl workspaces -j | ${pkgs.jq}/bin/jq '.[] | del(select(.id == -99)) | .id')"
for num in $ows; do
export o"$num"="$num"
done
# Get Focused workspace for current monitor ID
arg="$1"
num="$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq --argjson arg "$arg" '.[] | select(.id == $arg).activeWorkspace.id')"
export f"$num"="$num"
if [[ $arg -eq 0 ]]; then
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 1\" :class \"w0$o1$f1\" \"1\") \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 2\" :class \"w0$o2$f2\" \"2\") \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 3\" :class \"w0$o3$f3\" \"3\") \
)\
)"
elif [[ $arg -eq 1 ]]; then
echo "(eventbox :onscroll \"echo {} | sed -e 's/up/-1/g' -e 's/down/+1/g' | xargs hyprctl dispatch workspace\" \
(box :class \"workspace\" :orientation \"h\" :space-evenly \"false\" \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 4\" :class \"w0$o4$f4\" \"4\") \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 5\" :class \"w0$o5$f5\" \"5\") \
(button :onclick \"${pkgs.hyprland}/bin/hyprctl dispatch workspace 6\" :class \"w0$o6$f6\" \"6\") \
)\
)"
fi
}
workspaces $1
${pkgs.socat}/bin/socat -u UNIX-CONNECT:/tmp/hypr/"$HYPRLAND_INSTANCE_SIGNATURE"/.socket2.sock - | while read -r; do
workspaces $1
done
'';
mpd-current-song = pkgs.writeShellScriptBin "mpd_current_song.sh" ''
currentsong=""
state=""
while true; do
state=$(${pkgs.mpc-cli}/bin/mpc status %state%)
current_song=$(${pkgs.mpc-cli}/bin/mpc current)
if [[ $state == "playing" ]]; then
echo " $current_song"
elif [[ $state == "paused" && $current_song ]]; then
echo "󰏤 $current_song"
else
echo " stopped"
fi
${pkgs.mpc-cli}/bin/mpc idle player &> /dev/null
done
'';
get-volume = pkgs.writeShellScriptBin "get_volume.sh" ''
volume=$(${pkgs.pamixer}/bin/pamixer --get-volume)
if [[ $volume -eq 0 ]]; then
echo " $volume%"
elif [[ $volume -lt 25 ]]; then
echo " $volume%"
elif [[ $volume -lt 50 ]]; then
echo " $volume%"
elif [[ $volume -lt 75 ]]; then
echo "󰕾 $volume%"
else
echo " $volume%"
fi
'';
}

View File

@ -1,93 +0,0 @@
{
eww-stylesheet = ''
$bg: rgba(40,40,40,0.8);
$fg: rgb(235,219,178);
$wsfg: rgb(235,219,178);
$wsbg: rgb(60,56,54);
$activewsbg: rgb(102,92,84);
$box-bg: rgb(80,73,69);
* {
all: unset; //Unsets everything so you can style everything from scratch
font-family: "JetBrainsMono Nerd Font";
font-size: 12px;
}
//Global Styles
.bar {
background-color: $bg;
color: $fg;
}
.window {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 0px 5px 10px;
}
.volume {
background-color: $box-bg;
border-radius: 10px 0px 0px 10px;
margin: 5px 0px 5px 0px;
padding: 0px 10px 0px 10px;
}
.mpd {
background-color: $box-bg;
border-radius: 0px 10px 10px 0px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.tray {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.date {
background-color: $box-bg;
border-radius: 10px;
padding: 0px 10px 0px 10px;
margin: 5px 10px 5px 0px;
}
.wswidget {
background-color: $box-bg;
border-radius: 10px;
margin: 5px 0px 5px 10px;
}
.w0, .w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09, .w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 {
background-color: $wsbg;
padding: 3px 10px;
}
.w01, .w011, .w04, .w044 {
background-color: $wsbg;
border-radius: 10px 0px 0px 10px;
}
.w03, .w033, .w06, .w066 {
background-color: $wsbg;
border-radius: 0px 10px 10px 0px;
}
/* Occupied */
.w01, .w02, .w03, .w04, .w05, .w06, .w07, .w08, .w09 {
background-color: $wsbg;
}
/* Focused */
.w011, .w022, .w033, .w044, .w055, .w066, .w077, .w088, .w099 {
background-color: $activewsbg;
}
'';
}

View File

@ -139,13 +139,13 @@ in
exec-once = ${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp
exec-once = ${pkgs.blueman}/bin/blueman-applet
exec-once = ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator
# exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
exec-once = ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1
exec-once = ${pkgs.mullvad-vpn}/bin/mullvad-gui
exec-once = ${pkgs.ydotool}/bin/ydotoold
exec = ${pkgs.xorg.xrandr}/bin/xrandr --output ${rightMonitor.display} --primary
exec = ${wob-voldaemon}/bin/wob-volumeindicator.sh;
exec = ${pkgs.eww-wayland}/bin/eww kill; ${pkgs.eww-wayland}/bin/eww open-many bar0 bar1
exec = pkill eww; ${pkgs.eww-wayland}/bin/eww open-many bar0 bar1
exec = pkill swww; sleep 2 && ${pkgs.swww}/bin/swww init && ${pkgs.swww}/bin/swww img $(cat ~/.cache/swww/wallpaper.txt)
#Set cursor

View File

@ -76,7 +76,6 @@
RADV_PERFTEST = "gpl";
WINEDLLOVERRIDES = "winemenubuilder.exe=d";
XDG_SCREENSHOTS_DIR = "~/Screenshots";
# WLR_NO_HARDWARE_CURSORS = "1";
};
fonts.fontconfig.enable = true;