├── USING_NVIDIA ├── display_setup.sh ├── intel_xorg.conf ├── default ├── Xsetup ├── optimus.desktop └── daemon.conf ├── pictures ├── lspci.png └── lspci_2.png ├── nvidia-switch-ui ├── rofi ├── powermenu │ ├── styles │ │ ├── colors.rasi │ │ ├── berry.rasi │ │ ├── cocoa.rasi │ │ ├── faded.rasi │ │ ├── mask.rasi │ │ ├── blackout.rasi │ │ ├── bluish.rasi │ │ ├── gotham.rasi │ │ ├── nightly.rasi │ │ ├── nordic.rasi │ │ ├── blackout.rasi.save │ │ └── nordic_blackout.rasi │ ├── confirm.rasi │ ├── message.rasi │ ├── full_alt.rasi │ ├── full_rounded.rasi │ ├── full_square.rasi │ ├── column_alt.rasi │ ├── column_circle.rasi │ ├── column_rounded.rasi │ ├── column_square.rasi │ ├── row_alt.rasi │ ├── row_square.rasi │ ├── dock_circle.rasi │ ├── drop_circle.rasi │ ├── drop_square.rasi │ ├── row_circle.rasi │ ├── card_alt.rasi │ ├── dock_rounded.rasi │ ├── drop_rounded.rasi │ ├── row_rounded.rasi │ ├── card_square.rasi │ ├── card_rounded.rasi │ ├── dock_square.rasi │ ├── card_circle.rasi │ ├── dock_alt.rasi │ ├── drop_alt.rasi │ ├── full_circle.rasi.save │ └── full_circle.rasi └── nvidia_switch_ui.sh ├── display_setup_nvidia_only.sh ├── turn_off_gpu_at_boot.service ├── reset_xorg_conf.service ├── TODO.txt ├── nvidia_xorg.conf ├── open_nvidia_session.sh ├── load_nvidia_modules.sh ├── remove_nvidia_from_kernel.sh ├── bus_id ├── uninstaller.sh ├── gpu_switch.sh ├── nvidia_switch.sh ├── README.md ├── installer.sh └── LICENSE /USING_NVIDIA: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /display_setup.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /intel_xorg.conf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /default/Xsetup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /bin/bash /opt/nvidia-switch/display_setup.sh 3 | -------------------------------------------------------------------------------- /pictures/lspci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvidiaswitch/nvidia-switch/HEAD/pictures/lspci.png -------------------------------------------------------------------------------- /pictures/lspci_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvidiaswitch/nvidia-switch/HEAD/pictures/lspci_2.png -------------------------------------------------------------------------------- /nvidia-switch-ui/rofi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nvidiaswitch/nvidia-switch/HEAD/nvidia-switch-ui/rofi -------------------------------------------------------------------------------- /display_setup_nvidia_only.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xrandr --setprovideroutputsource modesetting NVIDIA-0 3 | xrandr --auto 4 | #xrandr --dpi 96 5 | #xrandr --output eDP-1-1 --primary 6 | -------------------------------------------------------------------------------- /default/optimus.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=Optimus 4 | Exec=/bin/bash /opt/nvidia-switch/display_setup.sh 5 | NoDisplay=true 6 | X-GNOME-Autostart-Phase=DisplayServer 7 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/colors.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * Change the colorscheme for every menu simply by editing this file... 3 | * 4 | * Available Color Schemes 5 | * 6 | * blu.sh berry nordic nightly gotham mask faded cocoa 7 | * 8 | */ 9 | 10 | @import "nordic_blackout.rasi" 11 | -------------------------------------------------------------------------------- /turn_off_gpu_at_boot.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Remove Nvidia GPU from kernel." 3 | 4 | [Service] 5 | Type=oneshot 6 | Environment="POWERSAVE=1" 7 | ExecStartPre=/bin/bash -c '/usr/local/bin/load_nvidia_modules.sh "unload"' 8 | ExecStart=/bin/bash -c '/usr/local/bin/gpu_switch.sh "off"' 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /reset_xorg_conf.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="Reset xorg.conf to default at boot." 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStartPre=/bin/bash -c 'echo "" > /opt/nvidia-switch/display_setup.sh' 7 | ExecStartPre=/bin/bash -c 'rm /etc/X11/xorg.conf' 8 | ExecStart=/bin/bash -c 'ln -s /opt/nvidia-switch/intel_xorg.conf /etc/X11/xorg.conf' 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/berry.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #280F28ff; 3 | background-alt: #2D142Cff; 4 | foreground: #ffffffA6; 5 | border: #EE4540ff; 6 | border-alt: #C92A42ff; 7 | selected: #510A3299; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/cocoa.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #3C3945FF; 3 | background-alt: #413E4Aff; 4 | foreground: #F7C7B2ff; 5 | border: #B38184ff; 6 | border-alt: #F3B69Eff; 7 | selected: #B381841a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/faded.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #57678CFF; 3 | background-alt: #5E6C91ff; 4 | foreground: #FFFCFFff; 5 | border: #FF83A7ff; 6 | border-alt: #F4BB6Cff; 7 | selected: #A0B5F44c; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/mask.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #3E4667ff; 3 | background-alt: #434C6Dff; 4 | foreground: #FAF7CCff; 5 | border: #CA8CA5ff; 6 | border-alt: #F0B2B3ff; 7 | selected: #EFD4B61a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/blackout.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #080808ff; 3 | background-alt: #171717ff; 4 | foreground: #FFFFFFff; 5 | border: #E9F6FEff; 6 | border-alt: #FFFFFFff; 7 | selected: #1e1e1eff; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/bluish.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #EFF0F1FF; 3 | background-alt: #E3E3E3FF; 4 | foreground: #000000A6; 5 | border: #000B83FF; 6 | border-alt: #3DAEE9FF; 7 | selected: #93CEE9FF; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/gotham.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #24334Aff; 3 | background-alt: #29384Fff; 4 | foreground: #FEFFF1ff; 5 | border: #3A6081ff; 6 | border-alt: #715979ff; 7 | selected: #C46C854C; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/nightly.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #25344Bff; 3 | background-alt: #2A3950ff; 4 | foreground: #FEFFF1ff; 5 | border: #A162F7ff; 6 | border-alt: #45E3FFff; 7 | selected: #6F88FE1a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/nordic.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #425775ff; 3 | background-alt: #475C7Bff; 4 | foreground: #ffffffcc; 5 | border: #FDBB6Dff; 6 | border-alt: #DA717Fff; 7 | selected: #685E79ff; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/blackout.rasi.save: -------------------------------------------------------------------------------- 1 | * { 2 | background: #080808ff; 3 | background-alt: #171717ff 4 | ; 5 | foreground: #FFFFFFff; 6 | border: #E9F6FEff; 7 | border-alt: #FFFFFFff; 8 | selected: #1e1e1eff; 9 | urgent: #DA4453FF; 10 | } 11 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/styles/nordic_blackout.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #1E242Dff; 3 | background-alt: #2E3440ff; 4 | foreground: #E9F6FEff; 5 | border: #E9F6FEff; 6 | border-alt: #E9F6FEff; 7 | selected: #3B4252ff; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /TODO.txt: -------------------------------------------------------------------------------- 1 | 1) Make an option to enable NVIDIA boot and not INTEL i.e. 2 | nvidia-switch's main purpose will be to disable nvidia in order to 3 | intel take its place 4 | 2) Make an ui that works in any distribuition 5 | 3) Generalize the idea for amd integrated graphics 6 | 4) it's possible to make it work with LXDM? The link 7 | https://wiki.gentoo.org/wiki/NVIDIA/Optimus#X_Display_Manager_.28XDM.29 seems not to work. 8 | Is this a bug? 9 | -------------------------------------------------------------------------------- /nvidia_xorg.conf: -------------------------------------------------------------------------------- 1 | Section "OutputClass" 2 | Identifier "intel" 3 | MatchDriver "i915" 4 | Driver "modesetting" 5 | EndSection 6 | 7 | Section "OutputClass" 8 | Identifier "nvidia" 9 | MatchDriver "nvidia-drm" 10 | Driver "nvidia" 11 | Option "AllowEmptyInitialConfiguration" 12 | Option "PrimaryGPU" "yes" 13 | ModulePath "/usr/lib/nvidia/xorg" 14 | ModulePath "/usr/lib/xorg/modules" 15 | EndSection 16 | -------------------------------------------------------------------------------- /open_nvidia_session.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | USING_NVIDIA="$(cat "/opt/nvidia-switch/USING_NVIDIA" 2> /dev/null)" 4 | 5 | case $USING_NVIDIA in 6 | 0) sudo /opt/nvidia-switch/load_nvidia_modules.sh "unload"; sudo /opt/nvidia-switch/gpu_switch.sh "off" ;; 7 | 1) export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib:/usr/lib/x86_64-linux-gnu/vdpau:${LD_LIBRARY_PATH}; export VK_ICD_FILENAMES=/etc/vulkan/icd.d/nvidia_icd.json ;; 8 | *) echo "Invalid option!" ;; 9 | esac 10 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/confirm.rasi: -------------------------------------------------------------------------------- 1 | /* Confirm Dialog */ 2 | 3 | @import "styles/colors.rasi" 4 | 5 | * { 6 | background-color: @background; 7 | text-color: @foreground; 8 | font: "FantasqueSansMono Nerd Font 16"; 9 | } 10 | 11 | window { 12 | width: 700px; 13 | padding: 50px; 14 | border: 1px; 15 | border-radius: 0px; 16 | border-color: @border; 17 | location: center; 18 | y-offset: -2em; 19 | } 20 | 21 | entry { 22 | expand: true; 23 | text-color: @border; 24 | } 25 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/message.rasi: -------------------------------------------------------------------------------- 1 | /* Message Dialog */ 2 | 3 | @import "styles/colors.rasi" 4 | 5 | * { 6 | background-color: @background; 7 | text-color: @foreground; 8 | font: "FantasqueSansMono Nerd Font 16"; 9 | } 10 | 11 | window { 12 | width: 360px; 13 | padding: 25px; 14 | border: 1px; 15 | border-radius: 0px; 16 | border-color: @border; 17 | location: center; 18 | y-offset: -2em; 19 | } 20 | 21 | entry { 22 | expand: true; 23 | text-color: @border; 24 | } 25 | -------------------------------------------------------------------------------- /load_nvidia_modules.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | MODULES_LOAD=(nvidia nvidia_uvm nvidia_modeset nvidia_drm) 4 | MODULES_UNLOAD=(nvidia_drm nvidia_modeset nvidia_uvm nvidia) 5 | 6 | function load_modules { 7 | for module in "${MODULES_LOAD[@]}" 8 | do 9 | #Loading modules 10 | sudo modprobe "${module}" 11 | done 12 | } 13 | 14 | function unload_modules { 15 | for module in "${MODULES_UNLOAD[@]}" 16 | do 17 | #Unloading modules 18 | sudo modprobe -r "${module}" 19 | done 20 | } 21 | 22 | 23 | if [[ "$1" == "load" ]] 24 | then 25 | load_modules 26 | 27 | elif [[ "$1" == "unload" ]] 28 | then 29 | unload_modules 30 | fi 31 | -------------------------------------------------------------------------------- /default/daemon.conf: -------------------------------------------------------------------------------- 1 | # GDM configuration storage 2 | # 3 | # See /usr/share/gdm/gdm.schemas for a list of available options. 4 | 5 | [daemon] 6 | # Uncomment the line below to force the login screen to use Xorg 7 | WaylandEnable=false 8 | 9 | # Enabling automatic login 10 | # AutomaticLoginEnable = true 11 | # AutomaticLogin = user1 12 | 13 | # Enabling timed login 14 | # TimedLoginEnable = true 15 | # TimedLogin = user1 16 | # TimedLoginDelay = 10 17 | 18 | [security] 19 | 20 | [xdmcp] 21 | 22 | [chooser] 23 | 24 | [debug] 25 | # Uncomment the line below to turn on debugging 26 | # More verbose logs 27 | # Additionally lets the X server dump core if it crashes 28 | #Enable=true 29 | 30 | -------------------------------------------------------------------------------- /remove_nvidia_from_kernel.sh: -------------------------------------------------------------------------------- 1 | 2 | # We set POWERSAVE=1 at boot. 3 | 4 | # When POWERSAVE=1, the NVIDIA GPU is turned off at boot time. Also, it will turn 5 | # the card on before attempting to load the modules and render graphics, and turn it 6 | # off after the X exits. In order to it work, CONTROLLER_BUS_ID and DEVICE_BUS_ID 7 | # must be set correctly. IDs can be found by inspecting the output of lshw, or even 8 | # better, lspci -tvv tree. 9 | 10 | echo "Fron now on, before new NVIDIA driver installations, the turn_off_gpu_at_boot.service must be turned off in systemd." 11 | sudo cp /opt/nvidia-switch/turn_off_gpu_at_boot.service /etc/systemd/system/turn_off_gpu_at_boot.service 12 | sudo systemctl enable turn_off_gpu_at_boot.service 13 | -------------------------------------------------------------------------------- /bus_id: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # When POWERSAVE=1, the NVIDIA GPU is turned off at boot time. Also, it will turn 4 | # the card on before attempting to load the modules and render graphics, and turn it 5 | # off after the X exits. In order to it work, CONTROLLER_BUS_ID and DEVICE_BUS_ID 6 | # must be set correctly. IDs can be found by inspecting the output of lshw, or even 7 | # better, lspci -tvv tree. 8 | 9 | # Bus ID of the PCI express controller direcly above NVIDIA in the PCI tree, 10 | # see lspci -tv 11 | CONTROLLER_BUS_ID=0000:00:01.0 12 | 13 | # Bus ID of the NVIDIA graphic card, use lspci | grep VGA 14 | DEVICE_BUS_ID=0000:01:00.0 15 | 16 | # Another NVIDIA device under the PCI express controller (CONTROLLER_BUS_ID) tree 17 | SUB_DEVICE_BUS_ID=0000:01:00.1 18 | 19 | -------------------------------------------------------------------------------- /nvidia-switch-ui/nvidia_switch_ui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Author : Aditya Shakya 4 | ## Mail : adi1090x@gmail.com 5 | ## Github : @adi1090x 6 | ## Twitter : @adi1090x 7 | 8 | # Available and non-preconfigured themes: 9 | # >> Created and tested on : rofi 1.6.0-1 10 | # 11 | # column_circle column_square column_rounded column_alt 12 | # card_circle card_square card_rounded card_alt 13 | # dock_circle dock_square dock_rounded dock_alt 14 | # drop_circle drop_square drop_rounded drop_alt 15 | # full_circle full_square full_rounded full_alt 16 | # row_circle row_square row_rounded row_alt 17 | 18 | # Good look tweaking themes the themes 19 | 20 | theme="row_square" 21 | dir="/opt/nvidia-switch/nvidia-switch-ui/powermenu" 22 | 23 | rofi_command="/opt/nvidia-switch/nvidia-switch-ui/rofi -theme $dir/$theme" 24 | 25 | # Options 26 | On="▶" 27 | Off="⏸" 28 | 29 | # Confirmation 30 | confirm_exit() { 31 | rofi -dmenu\ 32 | -i\ 33 | -no-fixed-num-lines\ 34 | -p "Do you want to close all applications and confirm?"\ 35 | -theme $dir/confirm.rasi 36 | } 37 | 38 | # Message 39 | msg() { 40 | rofi -theme "$dir/message.rasi" -e "Valid options: yes / y / no / n " 41 | } 42 | 43 | # Variable passed to rofi 44 | options="$On\n$Off" 45 | 46 | chosen="$(echo -e "$options" | $rofi_command -p "NVIDIA Switch" -dmenu)" 47 | 48 | ans="$(confirm_exit &)" 49 | ans="$(echo "$ans" | awk '{print tolower($0)}')" 50 | 51 | case $chosen in 52 | $On) 53 | if [[ $ans == "yes" || $ans == "y" ]]; then 54 | sudo nvidia-switch "1" 55 | elif [[ $ans == "no" || $ans == "n" ]]; then 56 | exit 0 57 | else 58 | msg 59 | fi 60 | ;; 61 | $Off) 62 | if [[ $ans == "yes" || $ans == "y" ]]; then 63 | sudo nvidia-switch "0" 64 | elif [[ $ans == "no" || $ans == "n" ]]; then 65 | exit 0 66 | else 67 | msg 68 | fi 69 | ;; 70 | esac 71 | -------------------------------------------------------------------------------- /uninstaller.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This scripts is based on the description of: 4 | # https://wiki.archlinux.org/title/NVIDIA_Optimus#Use_NVIDIA_graphics_only 5 | 6 | function uninstall_gdm() { \ 7 | 8 | sudo rm "/usr/share/gdm/greeter/autostart/optimus.desktop" 9 | sudo rm "/etc/xdg/autostart/optimus.desktop" 10 | 11 | if [[ -f "/etc/gdm3/daemon.conf" || -f "/etc/gdm/custom.conf" ]]; then 12 | 13 | if [[ -f "/etc/gdm3/daemon.conf" ]]; then 14 | sudo sed -i '/WaylandEnable/s/^/#/g' "/etc/gdm3/daemon.conf" 15 | fi 16 | 17 | if [[ -f "/etc/gdm/custom.conf" ]]; then 18 | sudo sed -i '/WaylandEnable/s/^/#/g' "/etc/gdm/custom.conf" 19 | fi 20 | fi 21 | 22 | } 23 | 24 | function uninstall_lightdm() { \ 25 | 26 | if [ -f "/etc/lightdm/lightdm.conf" ]; then 27 | sed -i ':a;N;$!ba; s/\[Seat:\*\]\ndisplay-setup-script=\/opt\/nvidia-switch\/display_setup.sh/\[Seat:\*\]/g' "/etc/lightdm/lightdm.conf" 28 | fi 29 | } 30 | 31 | function uninstall_sddm() { \ 32 | 33 | if [ -d "/usr/share/sddm/scripts" ]; then 34 | sudo rm "/opt/nvidia-switch/default/Xsetup" 35 | fi 36 | } 37 | 38 | DISPLAYMANAGER="$(cat /etc/X11/default-display-manager | awk -F"/" '{print $NF}')" 39 | 40 | if [[ "$DISPLAYMANAGER" == lightdm* ]]; then 41 | uninstall_lightdm 42 | elif [[ "$DISPLAYMANAGER" == sddm* ]]; then 43 | uninstall_sddm 44 | elif [[ "$DISPLAYMANAGER" == gdm* ]]; then 45 | uninstall_gdm 46 | fi 47 | 48 | sudo rm "/etc/X11/xorg.conf" 49 | sudo cp "/opt/nvidia-switch/intel_xorg.conf" "/etc/X11/xorg.conf" 50 | sudo systemctl disable turn_off_gpu_at_boot.service 51 | sudo systemctl disable reset_xorg_conf.service 52 | sudo rm "/usr/local/bin/nvidia-switch" 53 | sudo rm "/usr/local/bin/nvidia-switch-ui" 54 | sudo rm "/usr/local/sbin/nvidia-switch-ui" 55 | sudo rm "/usr/local/sbin/nvidia-switch" 56 | sudo rm "/etc/systemd/system/reset_xorg_conf.service" 57 | sudo rm "/etc/systemd/system/turn_off_gpu_at_boot.service" 58 | sudo rm "/etc/sudoers.d/nvidia_switch" 59 | sudo rm -r "/opt/nvidia-switch/" 60 | -------------------------------------------------------------------------------- /gpu_switch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # When POWERSAVE=1, the NVIDIA GPU is turned off at boot time. Also, it will turn 4 | # the card on before attempting to load the modules and render graphics, and turn it 5 | # off after the X exits. In order to it work, CONTROLLER_BUS_ID and DEVICE_BUS_ID 6 | # must be set correctly. IDs can be found by inspecting the output of lshw, or even 7 | # better, lspci -tvv tree. 8 | 9 | # Load bus Id's 10 | . /etc/nvidia-switch/bus_id 11 | 12 | function turn_off_gpu { 13 | # The ideia of the script is to remove the Nvidia from the Kernel only if the 14 | # The GPU is set to be removed at boot time, and only be removed at boot time. 15 | # Otherwise, powersave is prefered. Two reasons can be given. Fist, A GPU being 16 | # automatically removed can cause some issues with Nvidia drivers instalation. 17 | # That's the why the service turn_off_gpu_at_boot.service must be disabled for 18 | # new nvidia driver instalation. The second reason is that the system hangs if 19 | # the GPU is put off after its use. Hence, it can only be totally turned off at boot time. 20 | 21 | # TIP: If it the laptop is not plugged, after gaming, is better to reboot the laptop 22 | # to save battery, but you are not restricted to it; just better. 23 | 24 | if [[ "$POWERSAVE" == '1' ]]; then 25 | #Removing Nvidia bus from the kernel 26 | eval "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/remove <<<1" 27 | eval "sudo tee /sys/bus/pci/devices/${SUB_DEVICE_BUS_ID}/remove <<<1" 28 | else 29 | #Enabling powersave for the graphic card 30 | eval "sudo tee /sys/bus/pci/devices/${DEVICE_BUS_ID}/power/control << /opt/nvidia-switch/display_setup.sh' 39 | 40 | # The USING_NVIDIA file, is used to, in the next login, inform your X session laucher 41 | # (display manager, startx, xinit) to turn off your NVIDIA Graphics card. 42 | # It's only used by open_nvidia_session.sh script. 43 | 44 | bash -c 'echo "1" > "/opt/nvidia-switch/USING_NVIDIA"' 45 | } 46 | 47 | function turn_off { 48 | # Clean previous configurations 49 | sudo rm /etc/X11/xorg.conf 50 | # Configure Intel display 51 | sudo bash -c 'echo "" > /opt/nvidia-switch/display_setup.sh' 52 | 53 | # Use pre-configured intel xorg 54 | sudo ln -s /opt/nvidia-switch/intel_xorg.conf /etc/X11/xorg.conf 55 | 56 | # Inform dusplay manager you will not use nvidia so that you can unload 57 | # nvidia-modules and put your NVIDIA to rest a bit. 58 | sudo bash -c 'echo "0" > "/opt/nvidia-switch/USING_NVIDIA"' 59 | } 60 | 61 | 62 | if [[ "$1" == "1" ]]; then 63 | turn_on 64 | elif [[ "$1" == "0" ]]; then 65 | turn_off 66 | else 67 | echo 'Usage:' 68 | echo 'To use NVIDIA, type: sudo nvidia-switch "1"' 69 | echo 'To deactivate NVIDIA, type: sudo nvidia-switch "0"' 70 | exit 71 | fi 72 | 73 | # Restart your display manager. This is executed in order to the new configuration 74 | # done to be read. If it is not restarted, it's not guaranteed the script will work. 75 | # By implementation choices, this is done as soon this script is lauched. This way, 76 | # The user will not forget that he have turned on the graphics card; it's more intuitive. 77 | 78 | # gdm is quite bad in with this script. I suggest using lightdm or sddm. It's possible to use 79 | # lightdm, or sddm, with gnome or any other desktop environment. Just a metter of installing 80 | # the packages. 81 | 82 | sudo systemctl restart display-manager.service 83 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/full_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: true; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | } 29 | 30 | prompt { 31 | enabled: true; 32 | padding: 1% 1% 1% 0%; 33 | background-color: @background-alt; 34 | text-color: @foreground; 35 | } 36 | 37 | textbox-prompt-colon { 38 | expand: false; 39 | str: "System |"; 40 | background-color: @background-alt; 41 | text-color: @foreground; 42 | padding: 1% 0.5% 1% 0.5%; 43 | } 44 | 45 | inputbar { 46 | children: [ textbox-prompt-colon, prompt ]; 47 | background-color: @background-alt; 48 | text-color: @foreground; 49 | expand: false; 50 | border: 0% 0.2% 0.2% 0%; 51 | border-radius: 1%; 52 | border-color: @border; 53 | margin: 0% 59.3% 0% 0%; 54 | padding: 0.5%; 55 | position: center; 56 | } 57 | 58 | listview { 59 | background-color: @background; 60 | margin: 0% 0% 0% 0%; 61 | spacing: 3%; 62 | cycle: true; 63 | dynamic: true; 64 | layout: horizontal; 65 | } 66 | 67 | mainbox { 68 | background-color: @background; 69 | children: [ inputbar, listview ]; 70 | spacing: 5%; 71 | padding: 32.50% 0% 0% 13.25%; 72 | } 73 | 74 | element { 75 | background-color: @background-alt; 76 | text-color: @foreground; 77 | orientation: horizontal; 78 | border-radius: 5%; 79 | } 80 | 81 | element-text { 82 | font: "feather 64"; 83 | expand: true; 84 | horizontal-align: 0.5; 85 | vertical-align: 0.5; 86 | margin: 6.5% 4% 13.5% 4%; 87 | } 88 | 89 | element normal.urgent, 90 | element alternate.urgent { 91 | background-color: @urgent; 92 | text-color: @foreground; 93 | border-radius: 0.2%; 94 | } 95 | 96 | element normal.active, 97 | element alternate.active { 98 | background-color: @background-alt; 99 | text-color: @foreground; 100 | } 101 | 102 | element selected { 103 | background-color: @selected; 104 | text-color: @foreground; 105 | border: 0% 0.2% 0.2% 0%; 106 | border-radius: 5%; 107 | border-color: @border; 108 | } 109 | 110 | element selected.urgent { 111 | background-color: @urgent; 112 | text-color: @foreground; 113 | } 114 | 115 | element selected.active { 116 | background-color: @background-alt; 117 | color: @foreground; 118 | } 119 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/full_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: true; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | } 29 | 30 | prompt { 31 | enabled: true; 32 | padding: 1% 1% 1% 0%; 33 | background-color: @background-alt; 34 | text-color: @foreground; 35 | } 36 | 37 | textbox-prompt-colon { 38 | expand: false; 39 | str: "System |"; 40 | background-color: @background-alt; 41 | text-color: @foreground; 42 | padding: 1% 0.5% 1% 0.5%; 43 | } 44 | 45 | inputbar { 46 | children: [ textbox-prompt-colon, prompt ]; 47 | background-color: @background-alt; 48 | text-color: @foreground; 49 | expand: false; 50 | border: 0% 0% 0.2% 0.2%; 51 | border-radius: 15px; 52 | border-color: @border; 53 | margin: 0% 59.3% 0% 0%; 54 | padding: 0.5%; 55 | position: center; 56 | } 57 | 58 | listview { 59 | background-color: @background; 60 | margin: 0% 0% 0% 0%; 61 | spacing: 3%; 62 | cycle: true; 63 | dynamic: true; 64 | layout: horizontal; 65 | } 66 | 67 | mainbox { 68 | background-color: @background; 69 | children: [ inputbar, listview ]; 70 | spacing: 5%; 71 | padding: 32.50% 0% 0% 13.25%; 72 | } 73 | 74 | element { 75 | background-color: @background-alt; 76 | text-color: @foreground; 77 | orientation: horizontal; 78 | border-radius: 25px; 79 | } 80 | 81 | element-text { 82 | font: "feather 64"; 83 | expand: true; 84 | horizontal-align: 0.5; 85 | vertical-align: 0.5; 86 | margin: 6.5% 4% 13.5% 4%; 87 | } 88 | 89 | element normal.urgent, 90 | element alternate.urgent { 91 | background-color: @urgent; 92 | text-color: @foreground; 93 | border-radius: 0.2%; 94 | } 95 | 96 | element normal.active, 97 | element alternate.active { 98 | background-color: @background-alt; 99 | text-color: @foreground; 100 | } 101 | 102 | element selected { 103 | background-color: @selected; 104 | text-color: @foreground; 105 | border: 0% 0% 0.2% 0.2%; 106 | border-radius: 25px; 107 | border-color: @border; 108 | } 109 | 110 | element selected.urgent { 111 | background-color: @urgent; 112 | text-color: @foreground; 113 | } 114 | 115 | element selected.active { 116 | background-color: @background-alt; 117 | color: @foreground; 118 | } 119 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/full_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: true; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | } 29 | 30 | prompt { 31 | enabled: true; 32 | padding: 1% 1% 1% 0%; 33 | background-color: @background-alt; 34 | text-color: @foreground; 35 | } 36 | 37 | textbox-prompt-colon { 38 | expand: false; 39 | str: "System |"; 40 | background-color: @background-alt; 41 | text-color: @foreground; 42 | padding: 1% 0.5% 1% 0.5%; 43 | } 44 | 45 | inputbar { 46 | children: [ textbox-prompt-colon, prompt ]; 47 | background-color: @background-alt; 48 | text-color: @foreground; 49 | expand: false; 50 | border: 0% 0% 0.2% 0%; 51 | border-radius: 0% 0% 0% 0%; 52 | border-color: @border; 53 | margin: 0% 59.3% 0% 0%; 54 | padding: 0.5%; 55 | position: center; 56 | } 57 | 58 | listview { 59 | background-color: @background; 60 | margin: 0% 0% 0% 0%; 61 | spacing: 3%; 62 | cycle: true; 63 | dynamic: true; 64 | layout: horizontal; 65 | } 66 | 67 | mainbox { 68 | background-color: @background; 69 | children: [ inputbar, listview ]; 70 | spacing: 5%; 71 | padding: 32.50% 0% 0% 13.25%; 72 | } 73 | 74 | element { 75 | background-color: @background-alt; 76 | text-color: @foreground; 77 | orientation: horizontal; 78 | border-radius: 0%; 79 | } 80 | 81 | element-text { 82 | font: "feather 64"; 83 | expand: true; 84 | horizontal-align: 0.5; 85 | vertical-align: 0.5; 86 | margin: 6.5% 4% 13.5% 4%; 87 | } 88 | 89 | element normal.urgent, 90 | element alternate.urgent { 91 | background-color: @urgent; 92 | text-color: @foreground; 93 | border-radius: 0.2%; 94 | } 95 | 96 | element normal.active, 97 | element alternate.active { 98 | background-color: @background-alt; 99 | text-color: @foreground; 100 | } 101 | 102 | element selected { 103 | background-color: @selected; 104 | text-color: @foreground; 105 | border: 0% 0% 0.2% 0%; 106 | border-radius: 0%; 107 | border-color: @border; 108 | } 109 | 110 | element selected.urgent { 111 | background-color: @urgent; 112 | text-color: @foreground; 113 | } 114 | 115 | element selected.active { 116 | background-color: @background-alt; 117 | color: @foreground; 118 | } 119 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/column_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 100%; 29 | width: 12.25%; 30 | location: east; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System"; 45 | background-color: @border; 46 | text-color: @background; 47 | padding: 1% 1% 1% 2.2%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon ]; 52 | background-color: @border; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0% 0%; 56 | border-radius: 1.5%; 57 | border-color: @border; 58 | margin: 0% 0% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: vertical; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3%; 76 | padding: 4% 2% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: vertical; 83 | border-radius: 5%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 5% 0% 7.8% 0%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @border; 109 | text-color: @foreground; 110 | border: 0% 0% 0% 0%; 111 | border-radius: 5%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/column_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 100%; 29 | width: 12.25%; 30 | location: east; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System"; 45 | background-color: @border; 46 | text-color: @background; 47 | padding: 1% 1% 1% 2.2%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon ]; 52 | background-color: @border; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0% 0%; 56 | border-radius: 100%; 57 | border-color: @border; 58 | margin: 0% 0% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: vertical; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3%; 76 | padding: 4% 2% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: vertical; 83 | border-radius: 100%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 5% 0% 7.8% 0%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.2%; 111 | border-radius: 100%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/column_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 100%; 29 | width: 12.25%; 30 | location: east; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System"; 45 | background-color: @border; 46 | text-color: @background; 47 | padding: 1% 1% 1% 2.2%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon ]; 52 | background-color: @border; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0% 0%; 56 | border-radius: 15px; 57 | border-color: @border; 58 | margin: 0% 0% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: vertical; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3%; 76 | padding: 4% 2% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: vertical; 83 | border-radius: 25px; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 5% 0% 7.8% 0%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.2% 0% 0.2% 0%; 111 | border-radius: 25px; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/column_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 100%; 29 | width: 12.25%; 30 | location: east; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System"; 45 | background-color: @border; 46 | text-color: @background; 47 | padding: 1% 1% 1% 2.2%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon ]; 52 | background-color: @border; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0.2% 0%; 56 | border-radius: 0% 0% 0% 0%; 57 | border-color: @border; 58 | margin: 0% 0% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: vertical; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3%; 76 | padding: 4% 2% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: vertical; 83 | border-radius: 0%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 5% 0% 7.8% 0%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0.2% 0%; 111 | border-radius: 0%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/row_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.5% 0.3% 0.1%; 56 | border-radius: 1%; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 3%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.5% 0.3% 0.1%; 111 | border-radius: 3%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/row_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "TeX Gyre Bonum Math 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "NVIDIA |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0% 0.5%; 56 | border-radius: 0% 0% 0% 0%; 57 | border-color: @border; 58 | margin: 0% 49% 0% 20%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 20%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 0%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0% 0.5%; 111 | border-radius: 0%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/dock_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: south; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.1% 0.5% 0%; 56 | border-radius: 100%; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 100%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.8% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.1% 0.5% 0%; 111 | border-radius: 100%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/drop_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: north; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 7%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.1% 0.5% 0%; 56 | border-radius: 100%; 57 | border-color: @border; 58 | margin: 0% 33.25% 0% 20%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ listview, inputbar ]; 75 | spacing: 0%; 76 | padding: 5% 0% 5% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 100%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.1% 0.5% 0%; 111 | border-radius: 100%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/drop_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: north; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 7%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0.2% 0%; 56 | border-radius: 0% 0% 0% 0%; 57 | border-color: @border; 58 | margin: 0% 33.25% 0% 20%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ listview, inputbar ]; 75 | spacing: 0%; 76 | padding: 5% 0% 5% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 0%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0.2% 0%; 111 | border-radius: 0%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/row_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0.5% 0%; 56 | border-radius: 100%; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 100%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0.5% 0%; 111 | border-radius: 100%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/card_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 12"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0%; 28 | height: 28.5%; 29 | width: 50%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 0.5% 0.5% 0.5% 0%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0.2% 0.2%; 56 | border-radius: 1%; 57 | border-color: @border; 58 | margin: 0% 21.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 2%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3.5%; 76 | padding: 4% 0% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 4%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 4.7% 2.7% 7.5% 2.7%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0.2% 0.2%; 111 | border-radius: 4%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/dock_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: south; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0.2% 0% 0.2% 0%; 56 | border-radius: 16px; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 35px; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.8% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.2% 0% 0.2% 0%; 111 | border-radius: 35px; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/drop_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: north; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 7%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0.2% 0% 0.2% 0%; 56 | border-radius: 16px; 57 | border-color: @border; 58 | margin: 0% 33.25% 0% 20%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ listview, inputbar ]; 75 | spacing: 0%; 76 | padding: 5% 0% 5% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 35px; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.2% 0% 0.2% 0%; 111 | border-radius: 35px; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/row_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.3% 0% 0.3%; 56 | border-radius: 18px; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 50px; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.3% 0% 0.3%; 111 | border-radius: 50px; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/card_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 12"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 28.5%; 29 | width: 50%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 0.5% 0.5% 0.5% 0%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0% 0% 0.2%; 56 | border-radius: 0% 0% 0% 0%; 57 | border-color: @border; 58 | margin: 0% 21.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 2%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3.5%; 76 | padding: 4% 0% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 0%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 4.5% 2.7% 7.5% 2.7%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0% 0% 0.2%; 111 | border-radius: 0%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/card_rounded.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 12"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 28.5%; 29 | width: 50%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 0.5% 0.5% 0.5% 0%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0.2% 0% 0.2% 0%; 56 | border-radius: 12px; 57 | border-color: @border; 58 | margin: 0% 21.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 2%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3.5%; 76 | padding: 4% 0% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 25px; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 4.7% 2.7% 7.5% 2.7%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.2% 0% 0.2% 0%; 111 | border-radius: 25px; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/dock_square.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: south; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0.1% 0.1% 0.1% 0.5%; 56 | border-radius: 0% 0% 0% 0%; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 0%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.8% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0.1% 0.1% 0.1% 0.5%; 111 | border-radius: 0%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/card_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 12"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 28.5%; 29 | width: 50%; 30 | location: center; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 0.5% 0.5% 0.5% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 0.5% 0.5% 0.5% 0%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.2% 0.2% 0%; 56 | border-radius: 0% 100% 100% 100%; 57 | border-color: @border; 58 | margin: 0% 21.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 2%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 3.5%; 76 | padding: 4% 0% 0% 2%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 100%; 84 | } 85 | 86 | element-text { 87 | font: "feather 32"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 4.5% 2.7% 7.5% 2.7%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.2% 0.2% 0%; 111 | border-radius: 100%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/dock_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: south; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 0.5%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.1% 0.5% 0.5%; 56 | border-radius: 1% 2% 3% 4%; 57 | border-color: @border; 58 | margin: 0% 59.3% 0% 0%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ inputbar, listview ]; 75 | spacing: 5%; 76 | padding: 5% 0% 0% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 1% 2% 3% 4%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.8% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.1% 0.5% 0.5%; 111 | border-radius: 1% 2% 3% 4%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/drop_alt.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: false; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | height: 42%; 29 | width: 100%; 30 | location: north; 31 | x-offset: 0; 32 | y-offset: 0; 33 | } 34 | 35 | prompt { 36 | enabled: true; 37 | padding: 1% 1% 1% 0%; 38 | background-color: @background-alt; 39 | text-color: @foreground; 40 | } 41 | 42 | textbox-prompt-colon { 43 | expand: false; 44 | str: "System |"; 45 | background-color: @background-alt; 46 | text-color: @foreground; 47 | padding: 1% 0.5% 1% 7%; 48 | } 49 | 50 | inputbar { 51 | children: [ textbox-prompt-colon, prompt ]; 52 | background-color: @background-alt; 53 | text-color: @foreground; 54 | expand: false; 55 | border: 0% 0.1% 0.5% 0.5%; 56 | border-radius: 1% 2% 3% 4%; 57 | border-color: @border; 58 | margin: 0% 33.25% 0% 20%; 59 | padding: 0.5%; 60 | position: center; 61 | } 62 | 63 | listview { 64 | background-color: @background; 65 | margin: 0% 0% 0% 0%; 66 | spacing: 3%; 67 | cycle: true; 68 | dynamic: true; 69 | layout: horizontal; 70 | } 71 | 72 | mainbox { 73 | background-color: @background; 74 | children: [ listview, inputbar ]; 75 | spacing: 0%; 76 | padding: 5% 0% 5% 13.25%; 77 | } 78 | 79 | element { 80 | background-color: @background-alt; 81 | text-color: @foreground; 82 | orientation: horizontal; 83 | border-radius: 1% 2% 3% 4%; 84 | } 85 | 86 | element-text { 87 | font: "feather 64"; 88 | expand: true; 89 | horizontal-align: 0.5; 90 | vertical-align: 0.5; 91 | margin: 6.5% 4% 13.5% 4%; 92 | } 93 | 94 | element normal.urgent, 95 | element alternate.urgent { 96 | background-color: @urgent; 97 | text-color: @foreground; 98 | border-radius: 0.2%; 99 | } 100 | 101 | element normal.active, 102 | element alternate.active { 103 | background-color: @background-alt; 104 | text-color: @foreground; 105 | } 106 | 107 | element selected { 108 | background-color: @selected; 109 | text-color: @foreground; 110 | border: 0% 0.1% 0.5% 0.5%; 111 | border-radius: 1% 2% 3% 4%; 112 | border-color: @border; 113 | } 114 | 115 | element selected.urgent { 116 | background-color: @urgent; 117 | text-color: @foreground; 118 | } 119 | 120 | element selected.active { 121 | background-color: @background-alt; 122 | color: @foreground; 123 | } 124 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/full_circle.rasi.save: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: true; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | 29 | position: center; 30 | 31 | } 32 | 33 | prompt { 34 | enabled: true; 35 | padding: 1% 1% 1% 0%; 36 | background-color: @background-alt; 37 | text-color: @foreground; 38 | 39 | position: center; 40 | 41 | expand: true; 42 | 43 | } 44 | 45 | textbox-prompt-colon { 46 | expand: false; 47 | 48 | str: "NVIDIA System |"; 49 | 50 | background-color: @background-alt; 51 | text-color: @foreground; 52 | padding: 1% 0.5% 1% 0.5%; 53 | } 54 | 55 | inputbar { 56 | children: [ textbox-prompt-colon, prompt ]; 57 | background-color: @background-alt; 58 | text-color: @foreground; 59 | expand: false; 60 | border: 0% 0.2% 0% 0.2%; 61 | border-radius: 0% 100% 100% 0%; 62 | border-color: @border; 63 | margin: 0% 59.3% 0% 0%; 64 | padding: 0.5%; 65 | position: center; 66 | } 67 | 68 | listview { 69 | background-color: @background; 70 | margin: 0% 0% 0% 0%; 71 | spacing: 3%; 72 | cycle: true; 73 | dynamic: true; 74 | layout: 75 | horizontal; 76 | position: 77 | } 78 | 79 | mainbox { 80 | background-color: @background; 81 | children: [ inputbar, listview ]; 82 | spacing: 5%; 83 | padding: 32.50% 0% 0% 13.25%; 84 | 85 | position: center; 86 | } 87 | 88 | element { 89 | background-color: @background-alt; 90 | text-color: @foreground; 91 | orientation: horizontal; 92 | border-radius: 100%; 93 | } 94 | 95 | element-text { 96 | font: "feather 64"; 97 | expand: true; 98 | horizontal-align: 0.5; 99 | vertical-align: 0.5; 100 | margin: 6.5% 4% 13.5% 4%; 101 | } 102 | 103 | element normal.urgent, 104 | element alternate.urgent { 105 | background-color: @urgent; 106 | text-color: @foreground; 107 | border-radius: 0.2%; 108 | } 109 | 110 | element normal.active, 111 | element alternate.active { 112 | background-color: @background-alt; 113 | text-color: @foreground; 114 | } 115 | 116 | element selected { 117 | background-color: @selected; 118 | text-color: @foreground; 119 | border: 0% 0.2% 0% 0%; 120 | border-radius: 100%; 121 | border-color: @border; 122 | } 123 | 124 | element selected.urgent { 125 | background-color: @urgent; 126 | text-color: @foreground; 127 | } 128 | 129 | element selected.active { 130 | background-color: @background-alt; 131 | color: @foreground; 132 | } 133 | -------------------------------------------------------------------------------- /nvidia-switch-ui/powermenu/full_circle.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Author : Aditya Shakya 4 | * Mail : adi1090x@gmail.com 5 | * Github : @adi1090x 6 | * Twitter : @adi1090x 7 | * 8 | */ 9 | 10 | configuration { 11 | font: "FantasqueSansMono Nerd Font 14"; 12 | show-icons: false; 13 | icon-theme: "Papirus"; 14 | drun-display-format: "{name}"; 15 | disable-history: false; 16 | fullscreen: true; 17 | hide-scrollbar: true; 18 | sidebar-mode: false; 19 | } 20 | 21 | @import "styles/colors.rasi" 22 | 23 | window { 24 | transparency: "real"; 25 | background-color: @background; 26 | text-color: @foreground; 27 | border-radius: 0px; 28 | 29 | position: center; 30 | 31 | } 32 | 33 | prompt { 34 | enabled: true; 35 | padding: 1% 1% 1% 0%; 36 | background-color: @background-alt; 37 | text-color: @foreground; 38 | 39 | position: center; 40 | 41 | expand: true; 42 | 43 | } 44 | 45 | textbox-prompt-colon { 46 | expand: false; 47 | 48 | str: "NVIDIA System |"; 49 | 50 | background-color: @background-alt; 51 | text-color: @foreground; 52 | padding: 1% 0.5% 1% 0.5%; 53 | } 54 | 55 | inputbar { 56 | children: [ textbox-prompt-colon, prompt ]; 57 | background-color: @background-alt; 58 | text-color: @foreground; 59 | expand: false; 60 | border: 0% 0.2% 0% 0.2%; 61 | border-radius: 0% 100% 100% 0%; 62 | border-color: @border; 63 | margin: 0% 49% 0% 20%; 64 | padding: 0.5%; 65 | position: center; 66 | } 67 | 68 | listview { 69 | background-color: @background; 70 | margin: 0% 0% 0% 20%; 71 | spacing: 3%; 72 | cycle: true; 73 | dynamic: true; 74 | layout: horizontal; 75 | 76 | position: center; 77 | 78 | } 79 | 80 | mainbox { 81 | background-color: @background; 82 | children: [ inputbar, listview ]; 83 | spacing: 5%; 84 | padding: 32.50% 0% 0% 13.25%; 85 | 86 | position: center; 87 | } 88 | 89 | element { 90 | background-color: @background-alt; 91 | text-color: @foreground; 92 | orientation: horizontal; 93 | border-radius: 100%; 94 | } 95 | 96 | element-text { 97 | font: "feather 64"; 98 | expand: true; 99 | horizontal-align: 0.5; 100 | vertical-align: 0.5; 101 | margin: 6.5% 4% 13.5% 4%; 102 | } 103 | 104 | element normal.urgent, 105 | element alternate.urgent { 106 | background-color: @urgent; 107 | text-color: @foreground; 108 | border-radius: 0.2%; 109 | } 110 | 111 | element normal.active, 112 | element alternate.active { 113 | background-color: @background-alt; 114 | text-color: @foreground; 115 | } 116 | 117 | element selected { 118 | background-color: @selected; 119 | text-color: @foreground; 120 | border: 0% 0.2% 0% 0%; 121 | border-radius: 100%; 122 | border-color: @border; 123 | } 124 | 125 | element selected.urgent { 126 | background-color: @urgent; 127 | text-color: @foreground; 128 | } 129 | 130 | element selected.active { 131 | background-color: @background-alt; 132 | color: @foreground; 133 | } 134 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nvidia-switch 2 | 3 | NVIDIA switch is a tool that automates the shifts between your NVIDIA Graphics 4 | Card and your Intel without needing to reboot your computer or changing TTY. 5 | This script let all the X configurations to be done by your Display Manager, 6 | which improves security a bit and let the things more intuitive. Also, it has 7 | power management features similar to nvidia-xrun. 8 | 9 | 10 | # First, set up the Bus ID information 11 | 12 | In order to make power management features work properly, you need to make sure 13 | that Bus IDs in `bus_id` file are correctly set for both the 14 | NVIDIA graphic card and the PCI express controller that hosts it. You should be 15 | able to find both the ids in the `lspci -tv` and `lspci` output mesages 16 | as follows. 17 | 18 | First, open therminal and type 19 | 20 | lspci 21 | 22 | After, open the `bus_id` file inside the nvidia-switch directory. The `DEVICE_BUS_ID` 23 | variable in the `bus_id` file corresponds to the NVIDIA graphics 24 | card ID. The output of `lspci` must contain a lot of Bus IDs, but the ones that matters 25 | are the NVIDIA ones, and is displayed similarly as follows 26 | 27 | ![](https://github.com/nvidiaswitch/nvidia-switch/blob/main/pictures/lspci_2.png) 28 | 29 | This way the Bus ID must be `01:00.0`. The correct format must be put similarly to 30 | 31 | DEVICE_BUS_ID=0000:01:00.0 32 | 33 | Note that, in some cases, like in mine, it's possible to have two, or more, NVIDIA devices. 34 | In such cases, you can put the second NVIDIA device in the `SUB_DEVICE_BUS_ID`, and its format is similar 35 | to `DEVICE_BUS_ID` format, that is, 36 | 37 | SUB_DEVICE_BUS_ID=0000:01:00.1 38 | 39 | Now, we need to find the Bus ID of the PCI express controller that hosts your NVIDIA graphics 40 | card with the `lspci -tv`. For example, my `lspci -tv` outputs have the following snippet: 41 | 42 | ![](https://github.com/nvidiaswitch/nvidia-switch/blob/main/pictures/lspci.png) 43 | 44 | Note that, inside the squares I have the numbers `0000:00:01.0`. This is the NVIDIA 45 | Graphics card parent in the `lspci -tv` tree, and is the controller that hosts my NVIDIA 46 | device. Hence, the `CONTROLLER_BUS_ID` is given by 47 | 48 | CONTROLLER_BUS_ID=0000:00:01.0 49 | 50 | Also, under the same controller we have only two devices, the NVIDIA ones, which 51 | confirms that only two devices must be turned off, as the previous steps suggested. 52 | 53 | The Bus IDs are used by the systemd service to completely remove the card from the kernel device tree. 54 | This means that the NVIDIA devices won't even show in lspci output as soon as the laptop is 55 | turned on, and this will prevent the NVIDIA modules to be loaded, so that we can take advantage 56 | of the kernel power management features to keep the card switched off. On the other hand, as soon you need 57 | your NVIDIA, the graphic card is turned on, and the modulues will be loaded again, allowing 58 | the use of the full performance of the NVIDIA Graphics Card. 59 | 60 | > As a note, we only turn off the NVIDIA Graphics card at system startup. This is done to prevent 61 | the system locks after switching between video cards. 62 | 63 | The service can be enabled by running this command inside the nvidia-switch directory: 64 | 65 | sudo bash remove_nvidia_from_kernel.sh 66 | 67 | 68 | # Instalation 69 | 70 | After the Bus ID's is setted up correcly, just type on terminal 71 | 72 | echo "$(whoami)" | xargs sudo bash ./installer.sh 73 | 74 | If nothing comes wrong, a joke will be printed in your screen with no warnings. =) 75 | 76 | # Usage 77 | 78 | The nvidia-switch script is as simple as it seems. To let your NVIDIA render games, 79 | you just need to open the terminal and type: 80 | 81 | sudo nvidia-switch "1" 82 | 83 | To let our Intel graphics card to render simple programs, and let the power management 84 | tool to run, you just need to open the terminal and type: 85 | 86 | sudo nvidia-switch "0" 87 | 88 | > Note that using nvidia-switch closes all your applications in your session. 89 | > This is done because there is no way of starting a new X session using the display 90 | > manager without closing the current session. Hence, before using nvidia-switch, 91 | > please, close all your applications manually. 92 | 93 | 94 | # On the similarities with nvidia-xrun 95 | 96 | This scripts is havely based on [nvidia-xrun](https://github.com/Witko/nvidia-xrun/) ideas, 97 | but it has been organized in a way it was possible to execute the script without changing TTY. 98 | In summary, this script fixes https://github.com/Witko/nvidia-xrun/issues/4. As such, this 99 | script has no warranty, see https://github.com/Witko/nvidia-xrun/blob/master/LICENSE, and follows the 100 | same copyright. 101 | 102 | # Disclosure 103 | 104 | I won't spend much time on this repo. This repo was made for my personal use, but since 105 | I find this useful, I am sharing it with everyone. 106 | -------------------------------------------------------------------------------- /installer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This scripts is based on the description of: 4 | # https://wiki.archlinux.org/title/NVIDIA_Optimus#Use_NVIDIA_graphics_only 5 | 6 | function install_gdm() { \ 7 | 8 | sudo cp "/opt/nvidia-switch/default/optimus.desktop" "/usr/share/gdm/greeter/autostart/optimus.desktop" 9 | sudo cp "/opt/nvidia-switch/default/optimus.desktop" "/etc/xdg/autostart/optimus.desktop" 10 | 11 | if [[ -f "/etc/gdm3/daemon.conf" || -f "/etc/gdm/custom.conf" ]]; then 12 | 13 | if [[ -f "/etc/gdm3/daemon.conf" ]]; then 14 | sudo sed -i '/WaylandEnable/s/^#//g' "/etc/gdm3/daemon.conf" 15 | fi 16 | 17 | if [[ -f "/etc/gdm/custom.conf" ]]; then 18 | sudo sed -i '/WaylandEnable/s/^#//g' "/etc/gdm/custom.conf" 19 | fi 20 | else 21 | if [[ -d "/etc/gdm3" ]]; then 22 | sudo cp "/opt/nvidia-switch/default/daemon.conf" "/etc/gdm3/daemon.conf" 23 | fi 24 | 25 | if [[ -d "/etc/gdm" ]]; then 26 | sudo cp "/opt/nvidia-switch/default/daemon.conf" "/etc/gdm/custom.conf" 27 | fi 28 | 29 | if [[ ! -f "/etc/gdm3/daemon.conf" || ! -f "/etc/gdm/custom.conf" ]]; then 30 | echo "You seem not to have the gdm system config directory. Find where is it located in order to disable Wayland." 31 | fi 32 | fi 33 | 34 | } 35 | 36 | function install_lightdm() { \ 37 | 38 | if [ -f "/etc/lightdm/lightdm.conf" ]; then 39 | sed -i ':a;N;$!ba; s/\[Seat:\*\]/\[Seat:\*\]\ndisplay-setup-script=\/opt\/nvidia-switch\/display_setup.sh/2' "/etc/lightdm/lightdm.conf" 40 | awk '!a[$0]++' '/etc/lightdm/lightdm.conf' | sudo tee '/etc/lightdm/lightdm.conf' > /dev/null 41 | else 42 | echo "You seem not to have the lightdm system config file. Find where is it located and set display-setup-script=/opt/nvidia-switch/display_setup.sh." 43 | fi 44 | } 45 | 46 | function install_sddm() { \ 47 | 48 | if [ -d "/usr/share/sddm/scripts" ]; then 49 | sudo cp "/opt/nvidia-switch/default/Xsetup" "/usr/share/sddm/scripts" 50 | else 51 | echo "You seem not to have sddm config directory." 52 | fi 53 | } 54 | 55 | 56 | if [ $# -eq 0 ]; then 57 | echo 'Usage:' 58 | echo 'echo "$(whoami)" | xargs sudo bash ./installer.sh' 59 | exit 60 | fi 61 | 62 | if [ "$EUID" -ne 0 ]; then 63 | echo 'Usage:' 64 | echo 'echo "$(whoami)" | xargs sudo bash ./installer.sh' 65 | exit 66 | fi 67 | 68 | cd "$(dirname "$0")" 69 | 70 | # 'sudo whoami' does not work. Up to my knowledge, there is no reliable way of knowing 71 | # which user used sudo inside a script. Hence, the user name is expected as an argument of the 72 | # script. 73 | USER_WHO_SUDOED="$1" 74 | 75 | ################################################################################# 76 | # FOR SANITY CHECK, SEE IF THE USER TYPED THE AT LEAST A VALID USER. 77 | if ! getent passwd "$USER_WHO_SUDOED" > /dev/null 2>&1; then 78 | echo 'You seem to have given a wrong username, and manually.' 79 | echo "If you dont wan't to give a name manually, try:" 80 | echo 'echo "$(whoami)" | xargs sudo bash ./installer.sh' 81 | exit 82 | fi 83 | ################################################################################# 84 | 85 | # Copy archives 86 | if [ -d "/opt" ]; then 87 | if [ ! -d "/opt/nvidia-switch/" ]; then 88 | sudo mkdir "/opt/nvidia-switch/" 89 | fi 90 | else 91 | mkdir "/opt" 92 | mkdir "/opt/nvidia-switch/" 93 | fi 94 | 95 | find . -iname "*.sh" -exec bash -c 'chmod +x "$0"' {} + 96 | 97 | cp -r ./ "/opt/nvidia-switch/" 2>/dev/null 98 | 99 | # Make a Intel configuration equal to the already configured 100 | if [ -f "/etc/X11/xorg.conf" ]; then 101 | echo "Your xorg.conf config in Intel mode is now: " 102 | cat "/etc/X11/xorg.conf" | tee "/opt/nvidia-switch/intel_xorg.conf" 103 | fi 104 | 105 | if [ -d "/etc/X11/xorg.conf.d" ]; then 106 | if [ ! -z "$(ls -A /etc/X11/xorg.conf.d)" ]; then 107 | cat /etc/X11/xorg.conf.d/* | tee -a "/opt/nvidia-switch/intel_xorg.conf" 108 | fi 109 | fi 110 | 111 | if [ ! -d "/etc/nvidia-switch" ]; then 112 | sudo mkdir "/etc/nvidia-switch" 113 | fi 114 | 115 | if [ ! -f "/etc/nvidia-switch/bus_id" ]; then 116 | sudo cp "/opt/nvidia-switch/bus_id" "/etc/nvidia-switch" 117 | fi 118 | 119 | # Configure the display manager to be setted up for nvidia-switch 120 | DISPLAYMANAGER="$(cat /etc/X11/default-display-manager | awk -F"/" '{print $NF}')" 121 | 122 | if [[ "$DISPLAYMANAGER" == lightdm* ]]; then 123 | install_lightdm 124 | elif [[ "$DISPLAYMANAGER" == sddm* ]]; then 125 | install_sddm 126 | elif [[ "$DISPLAYMANAGER" == gdm* ]]; then 127 | install_gdm 128 | else 129 | echo "You seem to possess a display manager we don't know how to configure, if you have one." 130 | echo "If you don't have one, you might need to manually configure your display"\ 131 | " with the display_setup.sh script in the proper place." 132 | echo "Some options are to put the xrandr commands in xprofile, xsessionrc or in xinitrc files." 133 | echo "Regarding this script, we accepet any pull requests treating different uses of the display_setup.sh script." 134 | fi 135 | 136 | # Copy the archive to the bin and sbin directories 137 | cp "/opt/nvidia-switch/nvidia_switch.sh" "/usr/local/bin/nvidia-switch" 138 | cp "/opt/nvidia-switch/nvidia_switch.sh" "/usr/local/sbin/nvidia-switch" 139 | cp "/opt/nvidia-switch/nvidia-switch-ui/nvidia_switch_ui.sh" "/usr/local/bin/nvidia-switch-ui" 140 | cp "/opt/nvidia-switch/nvidia-switch-ui/nvidia_switch_ui.sh" "/usr/local/sbin/nvidia-switch-ui" 141 | 142 | # Give the archives execution permission: 143 | sudo chmod +x "/usr/local/sbin/nvidia-switch" 144 | sudo chmod +x "/usr/local/bin/nvidia-switch" 145 | sudo chmod +x "/usr/local/bin/nvidia-switch-ui" 146 | sudo chmod +x "/usr/local/sbin/nvidia-switch-ui" 147 | 148 | # Adding the script /opt/nvidia-switch/open_nvidia_session.sh to run at session startup. 149 | if [ -f "/etc/debian_version" ]; then 150 | if [ ! -f "/home/$USER_WHO_SUDOED/.xsessionrc" ]; then 151 | sudo touch "/home/$USER_WHO_SUDOED/.xsessionrc" 152 | sudo chown "$USER_WHO_SUDOED:$USER_WHO_SUDOED" "/home/$USER_WHO_SUDOED/.xsessionrc" 153 | fi 154 | 155 | if [ -z "$(grep 'sudo /opt/nvidia-switch/open_nvidia_session.sh &' "/home/$USER_WHO_SUDOED/.xsessionrc")" ]; then 156 | echo '/opt/nvidia-switch/open_nvidia_session.sh &' >> "/home/$USER_WHO_SUDOED/.xsessionrc" 157 | fi 158 | else 159 | echo "You are not using a Debian-based system." 160 | echo "You need to add the script /opt/nvidia-switch/open_nvidia_session.sh to run at startup of your user X session." 161 | fi 162 | 163 | # Make a simple systemd service to reset the xorg.conf at boot. This prevents black 164 | # and flickering screens after the laptop reboots with NVIDIA on. 165 | sudo cp "/opt/nvidia-switch/reset_xorg_conf.service" "/etc/systemd/system/" 166 | sudo systemctl enable reset_xorg_conf.service 167 | 168 | ##################################################################################### 169 | # WARNING: DO NOT MESS WITH THIS PORTION OF THE SCRIPT. ANY ERROR ADDED HERE CAN # 170 | # PREVENT YOU FROM USING SUDO!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # 171 | # WITHOUT A ROOT PASSWORD, IT WILL BE NEEDED TO USE BASH AS INIT SYSTEM TO FIX THE # 172 | # MESS DONE. A QUITE DELICATE SITUATION FOR NOVICES. # 173 | ##################################################################################### 174 | sudo touch "/etc/sudoers.d/nvidia_switch" 175 | sudo chmod +w "/etc/sudoers.d/nvidia_switch" 176 | 177 | sudo touch "/opt/nvidia-switch/tmp_nvidia_switch" 178 | sudo chmod +w "/opt/nvidia-switch/tmp_nvidia_switch" 179 | echo "$USER_WHO_SUDOED ALL=(ALL) NOPASSWD: /usr/local/bin/nvidia-switch, /usr/local/sbin/nvidia-switch, /opt/nvidia-switch/open_nvidia_session.sh, /opt/nvidia-switch/gpu_switch.sh, /opt/nvidia-switch/load_nvidia_modules.sh" | sudo tee '/opt/nvidia-switch/tmp_nvidia_switch' > /dev/null 180 | NEW_RULE="$(cat /opt/nvidia-switch/tmp_nvidia_switch)" 181 | 182 | #Checks if the user's rule already exist before modifying the additional sudoers file 183 | if [[ -z "$( grep "$NEW_RULE" /etc/sudoers.d/nvidia_switch )" ]]; then 184 | echo "$NEW_RULE" | sudo tee -a '/etc/sudoers.d/nvidia_switch' > /dev/null 185 | fi 186 | sudo chmod 0440 "/etc/sudoers.d/nvidia_switch" 187 | sudo rm "/opt/nvidia-switch/tmp_nvidia_switch" 188 | # END WARNING 189 | ################################################################################# 190 | 191 | echo "It has broken your laptop successfully. =P" 192 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | --------------------------------------------------------------------------------