mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 19:00:14 +00:00
continuing dev
This commit is contained in:
@ -1,50 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
|
||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
||||
in
|
||||
{
|
||||
|
||||
# Adapted from:
|
||||
# A rofi powered menu to execute brightness choices.
|
||||
|
||||
config.brightnessCommand = builtins.toString (
|
||||
pkgs.writeShellScript "brightness" ''
|
||||
|
||||
dimmer=""
|
||||
medium=""
|
||||
brighter=""
|
||||
|
||||
chosen=$(printf '%s;%s;%s\n' \
|
||||
"$dimmer" \
|
||||
"$medium" \
|
||||
"$brighter" \
|
||||
| ${rofi}/bin/rofi \
|
||||
-theme-str '@import "brightness.rasi"' \
|
||||
-hover-select \
|
||||
-me-select-entry ''' \
|
||||
-me-accept-entry MousePrimary \
|
||||
-dmenu \
|
||||
-sep ';' \
|
||||
-selected-row 1)
|
||||
|
||||
|
||||
case "$chosen" in
|
||||
"$dimmer")
|
||||
${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 25; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 25
|
||||
;;
|
||||
|
||||
"$medium")
|
||||
${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 75; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 75
|
||||
;;
|
||||
|
||||
"$brighter")
|
||||
${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 100; ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 100
|
||||
;;
|
||||
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
|
||||
''
|
||||
);
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
|
||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
||||
in
|
||||
{
|
||||
|
||||
# Adapted from:
|
||||
# https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/scripts/rofi-power
|
||||
# A rofi powered menu to execute power related action.
|
||||
|
||||
config.powerCommand = builtins.toString (
|
||||
pkgs.writeShellScript "powermenu" ''
|
||||
power_off=''
|
||||
reboot=''
|
||||
lock=''
|
||||
suspend=''
|
||||
log_out=''
|
||||
|
||||
chosen=$(printf '%s;%s;%s;%s;%s\n' \
|
||||
"$power_off" \
|
||||
"$reboot" \
|
||||
"$lock" \
|
||||
"$suspend" \
|
||||
"$log_out" \
|
||||
| ${rofi}/bin/rofi \
|
||||
-theme-str '@import "power.rasi"' \
|
||||
-hover-select \
|
||||
-me-select-entry "" \
|
||||
-me-accept-entry MousePrimary \
|
||||
-dmenu \
|
||||
-sep ';' \
|
||||
-selected-row 2)
|
||||
|
||||
confirm () {
|
||||
${builtins.readFile ./rofi-prompt.sh}
|
||||
}
|
||||
|
||||
case "$chosen" in
|
||||
"$power_off")
|
||||
confirm 'Shutdown?' && doas shutdown now
|
||||
;;
|
||||
|
||||
"$reboot")
|
||||
confirm 'Reboot?' && doas reboot
|
||||
;;
|
||||
|
||||
"$lock")
|
||||
${pkgs.betterlockscreen}/bin/betterlockscreen --lock --display 1 --blur 0.5 --span
|
||||
;;
|
||||
|
||||
"$suspend")
|
||||
systemctl suspend
|
||||
;;
|
||||
|
||||
"$log_out")
|
||||
confirm 'Logout?' && i3-msg exit
|
||||
;;
|
||||
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
''
|
||||
);
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Credit: https://gist.github.com/Nervengift/844a597104631c36513c
|
||||
|
||||
sink=$(
|
||||
ponymix -t sink list |
|
||||
awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' |
|
||||
rofi \
|
||||
-dmenu \
|
||||
-p 'pulseaudio sink:' \
|
||||
-width 100 \
|
||||
-hover-select \
|
||||
-me-select-entry '' \
|
||||
-me-accept-entry MousePrimary \
|
||||
-theme-str 'inputbar { enabled: false; }' |
|
||||
grep -Po '[0-9]+(?=:)'
|
||||
) &&
|
||||
ponymix set-default -d "$sink" &&
|
||||
for input in $(ponymix list -t sink-input | grep -Po '[0-9]+(?=:)'); do
|
||||
echo "$input -> $sink"
|
||||
ponymix -t sink-input -d "$input" move "$sink"
|
||||
done
|
@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Credit: https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/scripts/rofi-prompt
|
||||
|
||||
# Rofi powered menu to prompt a message and get a yes/no answer.
|
||||
# Uses: rofi
|
||||
|
||||
yes='Confirm'
|
||||
no='Cancel'
|
||||
query='Are you sure?'
|
||||
|
||||
while [ $# -ne 0 ]; do
|
||||
case "$1" in
|
||||
-y | --yes)
|
||||
[ -n "$2" ] && yes="$2" || yes=''
|
||||
shift
|
||||
;;
|
||||
|
||||
-n | --no)
|
||||
[ -n "$2" ] && no="$2" || no=''
|
||||
shift
|
||||
;;
|
||||
|
||||
-q | --query)
|
||||
[ -n "$2" ] && query="$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
chosen=$(printf '%s;%s\n' "$yes" "$no" |
|
||||
rofi -theme-str '@import "prompt.rasi"' \
|
||||
-hover-select \
|
||||
-me-select-entry "" \
|
||||
-me-accept-entry MousePrimary \
|
||||
-p "$query" \
|
||||
-dmenu \
|
||||
-sep ';' \
|
||||
-a 0 \
|
||||
-u 1 \
|
||||
-selected-row 1)
|
||||
|
||||
case "$chosen" in
|
||||
"$yes") return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
@ -1,6 +0,0 @@
|
||||
@import "common.rasi"
|
||||
|
||||
#window {
|
||||
width: 605px;
|
||||
height: 230px;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/**
|
||||
* Allows to change the settings of every menu simply by editing this file
|
||||
* https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/themes/shared/settings.rasi
|
||||
*/
|
||||
|
||||
* {
|
||||
/* General */
|
||||
font: "Hack Nerd Font 60";
|
||||
|
||||
/* option menus: i3-layout, music, power and screenshot
|
||||
*
|
||||
* Values bellow are 'no-padding' ones for a size 60 (@icon-font) font, played
|
||||
* around using this character: ■
|
||||
* We then add add 100 actual padding around the icons.
|
||||
* -12px 0px -19px -96px */
|
||||
option-element-padding: 1% 1% 1% 1%;
|
||||
option-5-window-padding: 4% 4%;
|
||||
option-5-listview-spacing: 15px;
|
||||
|
||||
prompt-text-font: "Hack Nerd Font 18";
|
||||
prompt-window-height: 300px;
|
||||
prompt-window-width: 627px;
|
||||
prompt-window-border: 2px;
|
||||
prompt-prompt-padding: 20px 30px;
|
||||
prompt-prompt-margin: 8px;
|
||||
prompt-listview-padding: 60px 114px 0px 114px;
|
||||
/* Values bellow are 'no-padding' ones for a size 18 (@prompt-text-font) font,
|
||||
* played around using this character: ■
|
||||
* We then add add 30 actual padding around the text.
|
||||
* -4px -1px -6px -28px */
|
||||
prompt-element-padding: 26px 29px 24px 2px;
|
||||
|
||||
vpn-textbox-prompt-colon-padding: @network-textbox-prompt-colon-padding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings used in every rofi option menu:
|
||||
*/
|
||||
#window {
|
||||
children: [ horibox ];
|
||||
}
|
||||
#horibox {
|
||||
children: [ listview ];
|
||||
}
|
||||
#listview {
|
||||
layout: horizontal;
|
||||
}
|
||||
element {
|
||||
padding: 40px 68px 43px 30px;
|
||||
}
|
||||
#window {
|
||||
padding: 20px;
|
||||
}
|
||||
#listview {
|
||||
spacing: 10px;
|
||||
lines: 5;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
#entry {
|
||||
placeholder: "Launch Program";
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
@import "common.rasi"
|
||||
|
||||
#window {
|
||||
width: 980px;
|
||||
height: 230px;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/**
|
||||
* This theme is intended for a 2 items option menu with a headerbar.
|
||||
* https://gitlab.com/vahnrr/rofi-menus/-/blob/b1f0e8a676eda5552e27ef631b0d43e660b23b8e/themes/prompt.rasi
|
||||
*/
|
||||
@import "common.rasi"
|
||||
* {
|
||||
font: @prompt-text-font;
|
||||
}
|
||||
#window {
|
||||
height: @prompt-window-height;
|
||||
width: @prompt-window-width;
|
||||
children: [ inputbar, horibox ];
|
||||
border: @prompt-window-border;
|
||||
}
|
||||
#inputbar {
|
||||
enabled: false;
|
||||
}
|
||||
#prompt {
|
||||
padding: @prompt-prompt-padding;
|
||||
margin: @prompt-prompt-margin;
|
||||
}
|
||||
#listview {
|
||||
padding: @prompt-listview-padding;
|
||||
spacing: @option-5-listview-spacing;
|
||||
lines: 2;
|
||||
}
|
||||
#element {
|
||||
font: @prompt-text-font;
|
||||
padding: @prompt-element-padding;
|
||||
}
|
Reference in New Issue
Block a user